33 |
# force usage of our CFLAGS |
# force usage of our CFLAGS |
34 |
export OPT="${CFLAGS}" |
export OPT="${CFLAGS}" |
35 |
|
|
36 |
sminclude mtools |
sminclude mtools multilib |
37 |
|
|
38 |
# uses PYVER and sometimes PVER; so keep both |
# uses PYVER and sometimes PVER; so keep both |
39 |
SRC_URI=( |
SRC_URI=( |
52 |
src_prepare() |
src_prepare() |
53 |
{ |
{ |
54 |
munpack ${SRCFILE} || die |
munpack ${SRCFILE} || die |
|
cd ${SRCDIR} |
|
55 |
|
|
56 |
# adds support for PYTHON_DONTCOMPILE shell environment to |
# adds support for PYTHON_DONTCOMPILE shell environment to |
57 |
# supress automatic generation of .pyc and .pyo files |
# supress automatic generation of .pyc and .pyo files |
59 |
mpatch ${PNAME}-2.4-disable_modules_and_ssl.patch || die |
mpatch ${PNAME}-2.4-disable_modules_and_ssl.patch || die |
60 |
mpatch ${PNAME}-2.5.0-mimetypes-apache.patch || die |
mpatch ${PNAME}-2.5.0-mimetypes-apache.patch || die |
61 |
|
|
62 |
if [[ $(mlibdir) = lib64 ]] |
only-m64 mpatch ${PNAME}-2.7.0-lib64-3.patch || die |
|
then |
|
|
mpatch ${PNAME}-2.7.0-lib64-3.patch || die |
|
|
fi |
|
63 |
} |
} |
64 |
|
|
65 |
src_compile() |
src_compile() |
66 |
{ |
{ |
|
cd ${SRCDIR} |
|
|
|
|
67 |
mconfigure \ |
mconfigure \ |
68 |
--with-fpectl \ |
--with-fpectl \ |
69 |
--enable-shared \ |
--enable-shared \ |
76 |
|
|
77 |
src_install() |
src_install() |
78 |
{ |
{ |
|
cd ${SRCDIR} |
|
|
|
|
79 |
# install some missing directories |
# install some missing directories |
80 |
minstalldir /usr || die |
minstalldir /usr || die |
81 |
|
|
82 |
mmake DESTDIR=${BINDIR} altinstall || die |
local abi |
83 |
|
for abi in ${MULTILIB_ABIS} |
84 |
# link python${PVER%.*}-config to python-config |
do |
85 |
mlink python${PVER%.*}-config /usr/bin/python-config || die |
case ${abi} in |
86 |
|
m32) ABI_LIBDIR="lib";; |
87 |
minstalldir /usr/$(mlibdir)/python${PVER%.*}/config || die |
m64) ABI_LIBDIR="lib64";; |
88 |
minstallfile ${SRCDIR}/Makefile.pre.in /usr/$(mlibdir)/python${PVER%.*}/config || die |
esac |
89 |
|
|
90 |
|
cd ${SRCDIR}-${abi} |
91 |
|
make DESTDIR=${BINDIR} altinstall || die |
92 |
|
|
93 |
|
minstalldir /usr/$(mlibdir)/python${PVER%.*}/config || die |
94 |
|
minstallfile ${SRCDIR}-${abi}/Makefile.pre.in /usr/$(mlibdir)/python${PVER%.*}/config || die |
95 |
|
|
96 |
|
# remove hardcoded CFLAGS from default Makefile |
97 |
|
sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/$(mlibdir)/python${PVER%.*}/config/Makefile || die |
98 |
|
|
99 |
|
if [[ ${ARCH} = x86_64 ]] |
100 |
|
then |
101 |
|
# move config header |
102 |
|
mv -v ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h \ |
103 |
|
${BINDIR}/usr/include/python${PVER%.*}/pyconfig-${abi}.h || die |
104 |
|
|
105 |
# remove hardcoded CFLAGS from default Makefile |
# install a stub header |
106 |
sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/$(mlibdir)/python${PVER%.*}/config/Makefile || die |
cat > ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h << "EOF" |
|
|
|
|
if [[ $(ARCH) = x86_64 ]] |
|
|
then |
|
|
# move config header |
|
|
all-abis mv -v ${BINDIR}/usr/include/python${PVER%.*}/pyconfig{,'${abi/m/}'}.h |
|
|
|
|
|
# install a stub header |
|
|
cat > ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h << "EOF" |
|
107 |
/* pyconfig.h - Stub Header */ |
/* pyconfig.h - Stub Header */ |
108 |
#ifndef __STUB__PYCONFIG_H__ |
#ifndef __STUB__PYCONFIG_H__ |
109 |
#define __STUB__PYCONFIG_H__ |
#define __STUB__PYCONFIG_H__ |
113 |
defined(__arch64__) || \ |
defined(__arch64__) || \ |
114 |
defined(__powerpc64__) || \ |
defined(__powerpc64__) || \ |
115 |
defined (__s390x__) |
defined (__s390x__) |
116 |
# include "pyconfig-64.h" |
# include "pyconfig-m64.h" |
117 |
#else |
#else |
118 |
# include "pyconfig-32.h" |
# include "pyconfig-m32.h" |
119 |
#endif |
#endif |
120 |
|
|
121 |
#endif /* __STUB__PYCONFIG_H__ */ |
#endif /* __STUB__PYCONFIG_H__ */ |
122 |
EOF |
EOF |
123 |
# install the multiarch-wrapper |
# install the multiarch-wrapper |
124 |
all-abis mv -v ${BINDIR}/usr/bin/python${PYVER%.*}{,-'${abi/m/}'} |
mv -v ${BINDIR}/usr/bin/python${PYVER%.*} \ |
125 |
mlink multiarch-wrapper /usr/bin/python${PYVER%.*} |
${BINDIR}/usr/bin/python${PYVER%.*}-${abi} || die |
126 |
fi |
mlink multiarch-wrapper /usr/bin/python${PYVER%.*} || die |
127 |
|
fi |
128 |
|
done |
129 |
|
|
130 |
|
# link python${PVER%.*}-config to python-config |
131 |
|
mlink python${PVER%.*}-config /usr/bin/python-config || die |
132 |
|
|
133 |
# link python2.7 binary with python |
# link python2.7 binary with python |
134 |
mlink python${PVER%.*} /usr/bin/python || die |
mlink python${PVER%.*} /usr/bin/python || die |