Magellan Linux

Annotation of /trunk/extras/python3/python3-3.6.5-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30853 - (hide annotations) (download)
Thu Apr 26 09:27:08 2018 UTC (6 years ago) by niro
File size: 4937 byte(s)
-rediffed lib64 patch
1 niro 30852 # $Id$
2    
3     PNAME="python3"
4     PVER="3.6.5"
5     PBUILD="r1"
6    
7     PCAT="dev-lang"
8    
9     DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
10     HOMEPAGE="http://www.python.org/"
11    
12     DEPEND_x86_64=">= sys-apps/multiarch-wrapper-1"
13     SPECIAL_VARS="DEPEND_x86_64"
14    
15     DEPEND="$(marchdepend)
16     >= virtual/glibc
17     >= sys-libs/ncurses-6.0
18     >= sys-libs/zlib-1.2
19     >= dev-libs/expat-2
20     >= dev-libs/openssl-1.1
21     >= sys-libs/readline-7.0
22     >= dev-db/db-6.2
23     >= dev-db/sqlite-3.9
24     >= app-arch/bzip2-1.0.6
25     >= dev-libs/libffi-3.2"
26    
27     # util-linux for linux32/64
28     SDEPEND=">= virtual/sed
29     >= sys-apps/util-linux-2.29.2"
30    
31     SRCFILE="Python-${PVER/.0}.tar.xz"
32     SRCDIR="${BUILDDIR}/Python-${PVER/.0}"
33    
34     # disabled modules (needs the disable_modules patch)
35     export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die
36    
37     # force usage of our CFLAGS
38     export OPT="${CFLAGS}"
39    
40     # optimized ABIFLAGS is set to m = malloc in our builds
41     export PYTHON_ABIFLAGS="m"
42    
43     sminclude multilib mtools mbuild
44     msetfeature "!check"
45    
46     # uses PYVER and sometimes PVER; so keep both
47     SRC_URI=(
48     http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE}
49     http://www.python.org/ftp/python/${PVER}/${SRCFILE}
50     mirror://python/${SRCFILE}
51     mirror://python/python-3.3.2-disable_modules_and_ssl.patch
52     mirror://python/python-2.5.0-mimetypes-apache.patch
53 niro 30853 mirror://python/python-3.6.5-lib64.patch
54 niro 30852 )
55    
56     # sed line: on 2 digits add an zero: 2.6 -> 2.6.0
57     #UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'"
58     #UP2DATE="updatecmd -listonly https://www.python.org/downloads/ | grep '/releases/[0-9]' | sed 's:.*/releases/\(.*\)/:\1:' | upsort_pipe"
59     UP2DATE="updatecmd ${HOMEPAGE}/download/ | grep -- '-3\.' | highesttarball xz"
60    
61     src_prepare()
62     {
63     munpack ${SRCFILE} || die
64    
65     mpatch python-3.3.2-disable_modules_and_ssl.patch || die
66     mpatch python-2.5.0-mimetypes-apache.patch || die
67    
68 niro 30853 only-m64 mpatch python-3.6.5-lib64.patch || die
69 niro 30852
70     # ensure to use system-wide copies of expat, zlib and libffi
71     # rather than copies shipped in the tarball
72     all-abis 'rm -r Modules/expat || die'
73     all-abis 'rm -r Modules/zlib || die'
74     all-abis 'rm -r Modules/_ctypes/{darwin,libffi}* || die'
75     }
76    
77     src_compile()
78     {
79     mconfigure \
80     --enable-shared \
81     --enable-ipv6 \
82     --infodir=/usr/share/info \
83     --mandir=/usr/share/man \
84     --with-threads \
85     --with-computed-gotos \
86     --with-system-expat \
87     --with-system-ffi \
88     || die
89    
90     mmake || die
91     }
92    
93     src_install()
94     {
95     # install some missing directories
96     minstalldir /usr || die
97    
98     mmake DESTDIR=${BINDIR} altinstall || die
99    
100     all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die
101     all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die
102    
103     # remove hardcoded CFLAGS from default Makefile
104     all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu/Makefile || die
105    
106     if [[ $(mlibdir) != lib ]]
107     then
108     # move config header
109     all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig-$(mabi).h || die
110    
111     # install a stub header
112     cat > ${BINDIR}/usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig.h << "EOF"
113     /* pyconfig.h - Stub Header */
114     #ifndef __STUB__PYCONFIG_H__
115     #define __STUB__PYCONFIG_H__
116    
117     #if defined(__x86_64__) || \
118     defined(__sparc64__) || \
119     defined(__arch64__) || \
120     defined(__powerpc64__) || \
121     defined (__s390x__)
122     # include "pyconfig-m64.h"
123     #else
124     # include "pyconfig-m32.h"
125     #endif
126    
127     #endif /* __STUB__PYCONFIG_H__ */
128     EOF
129     # install the multiarch-wrapper
130     for exec in python${PVER%.*} python${PVER%.*}${PYTHON_ABIFLAGS}
131     do
132     if [[ -f ${BINDIR}/usr/bin/${exec} ]]
133     then
134     rm -f ${BINDIR}/usr/bin/${exec} || die
135     fi
136     all-abis minstallexec python /usr/bin/${exec}-$(mabi) || die
137     mlink multiarch-wrapper /usr/bin/${exec} || die
138     # not our default python
139     #all-abis mlink ${exec} /usr/bin/python-$(mabi) || die
140     all-abis mlink ${exec}-$(mabi) /usr/bin/${exec/${PVER%.*}/${PVER:0:1}}-$(mabi) || die
141     done
142     fi
143    
144     # not our default python
145     # # link python3.3m-config to python-config
146     # mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python-config || die
147    
148     # link python3.3m-config to python3.3-config
149     mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER%.*}-config || die
150    
151     # link python3.3m-config to python3-config
152     mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER:0:1}-config || die
153    
154     # not our default python
155     # # link python3.3 binary with python
156     # mlink python${PVER%.*} /usr/bin/python || die
157    
158     # link python3.3 binary with python3
159     mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die
160    
161     minstalldocs LICENSE README || die
162     }