python: update to 2.7.6.
This commit is contained in:
parent
4e47435c13
commit
a1deb41c57
|
@ -1,264 +0,0 @@
|
|||
diff -ur Python-2.7.3.orig/configure Python-2.7.3-Source/configure
|
||||
--- Python-2.7.3.orig/configure 2012-04-09 19:07:36.000000000 -0400
|
||||
+++ Python-2.7.3-Source/configure 2012-10-23 14:10:45.305220393 -0400
|
||||
@@ -13697,7 +13697,7 @@
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test "$cross_compiling" = yes; then :
|
||||
- ac_cv_have_long_long_format=no
|
||||
+ ac_cv_have_long_long_format="cross -- assuming yes"
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
@@ -13749,7 +13749,7 @@
|
||||
$as_echo "$ac_cv_have_long_long_format" >&6; }
|
||||
fi
|
||||
|
||||
-if test "$ac_cv_have_long_long_format" = yes
|
||||
+if test "$ac_cv_have_long_long_format" != no
|
||||
then
|
||||
|
||||
$as_echo "#define PY_FORMAT_LONG_LONG \"ll\"" >>confdefs.h
|
||||
diff -ur Python-2.7.3.orig/Makefile.pre.in Python-2.7.3-Source/Makefile.pre.in
|
||||
--- Python-2.7.3.orig/Makefile.pre.in 2012-04-09 19:07:33.000000000 -0400
|
||||
+++ Python-2.7.3-Source/Makefile.pre.in 2012-10-23 14:10:45.305220393 -0400
|
||||
@@ -182,6 +182,7 @@
|
||||
|
||||
PYTHON= python$(EXE)
|
||||
BUILDPYTHON= python$(BUILDEXE)
|
||||
+HOSTPYTHON= ./$(BUILDPYTHON)
|
||||
|
||||
# The task to run while instrument when building the profile-opt target
|
||||
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
|
||||
@@ -215,6 +216,8 @@
|
||||
# Parser
|
||||
PGEN= Parser/pgen$(EXE)
|
||||
|
||||
+HOSTPGEN= $(PGEN)
|
||||
+
|
||||
POBJS= \
|
||||
Parser/acceler.o \
|
||||
Parser/grammar1.o \
|
||||
@@ -408,8 +411,8 @@
|
||||
# Build the shared modules
|
||||
sharedmods: $(BUILDPYTHON)
|
||||
@case $$MAKEFLAGS in \
|
||||
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
|
||||
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
|
||||
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
|
||||
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
|
||||
esac
|
||||
|
||||
# Build static library
|
||||
@@ -543,7 +546,7 @@
|
||||
$(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
|
||||
Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
|
||||
-@$(INSTALL) -d Include
|
||||
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
||||
+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
||||
-touch Parser/pgen.stamp
|
||||
|
||||
$(PGEN): $(PGENOBJS)
|
||||
@@ -938,26 +941,26 @@
|
||||
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
|
||||
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
|
||||
fi
|
||||
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
+ ./$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
-d $(LIBDEST) -f \
|
||||
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
||||
$(DESTDIR)$(LIBDEST)
|
||||
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
+ ./$(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
-d $(LIBDEST) -f \
|
||||
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
||||
$(DESTDIR)$(LIBDEST)
|
||||
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
+ ./$(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
-d $(LIBDEST)/site-packages -f \
|
||||
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
||||
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
+ ./$(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
-d $(LIBDEST)/site-packages -f \
|
||||
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
||||
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
|
||||
+ ./$(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
|
||||
|
||||
# Create the PLATDIR source directory, if one wasn't distributed..
|
||||
$(srcdir)/Lib/$(PLATDIR):
|
||||
@@ -1062,7 +1065,9 @@
|
||||
# Install the dynamically loadable modules
|
||||
# This goes into $(exec_prefix)
|
||||
sharedinstall: sharedmods
|
||||
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
|
||||
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
||||
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
|
||||
+ --skip-build \
|
||||
--prefix=$(prefix) \
|
||||
--install-scripts=$(BINDIR) \
|
||||
--install-platlib=$(DESTSHARED) \
|
||||
diff -ur Python-2.7.3.orig/setup.py Python-2.7.3-Source/setup.py
|
||||
--- Python-2.7.3.orig/setup.py 2012-04-09 19:07:36.000000000 -0400
|
||||
+++ Python-2.7.3-Source/setup.py 2012-10-23 14:10:56.085220237 -0400
|
||||
@@ -145,6 +145,7 @@
|
||||
def __init__(self, dist):
|
||||
build_ext.__init__(self, dist)
|
||||
self.failed = []
|
||||
+ self.cross_compile = os.environ.get('CROSS_COMPILE_TARGET') == 'yes'
|
||||
|
||||
def build_extensions(self):
|
||||
|
||||
@@ -278,6 +279,14 @@
|
||||
(ext.name, sys.exc_info()[1]))
|
||||
self.failed.append(ext.name)
|
||||
return
|
||||
+
|
||||
+ # Import check will not work when cross-compiling.
|
||||
+ if os.environ.has_key('PYTHONXCPREFIX'):
|
||||
+ self.announce(
|
||||
+ 'WARNING: skipping import check for cross-compiled: "%s"' %
|
||||
+ ext.name)
|
||||
+ return
|
||||
+
|
||||
# Workaround for Mac OS X: The Carbon-based modules cannot be
|
||||
# reliably imported into a command-line Python
|
||||
if 'Carbon' in ext.extra_link_args:
|
||||
@@ -369,9 +378,10 @@
|
||||
|
||||
def detect_modules(self):
|
||||
# Ensure that /usr/local is always used
|
||||
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
- self.add_multiarch_paths()
|
||||
+ if not self.cross_compile:
|
||||
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
+ self.add_multiarch_paths()
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
||||
@@ -408,7 +418,8 @@
|
||||
add_dir_to_list(dir_list, directory)
|
||||
|
||||
if os.path.normpath(sys.prefix) != '/usr' \
|
||||
- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
|
||||
+ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
|
||||
+ and not self.cross_compile:
|
||||
# OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
|
||||
# (PYTHONFRAMEWORK is set) to avoid # linking problems when
|
||||
# building a framework with different architectures than
|
||||
@@ -426,11 +437,23 @@
|
||||
# lib_dirs and inc_dirs are used to search for files;
|
||||
# if a file is found in one of those directories, it can
|
||||
# be assumed that no additional -I,-L directives are needed.
|
||||
- lib_dirs = self.compiler.library_dirs + [
|
||||
- '/lib64', '/usr/lib64',
|
||||
- '/lib', '/usr/lib',
|
||||
- ]
|
||||
- inc_dirs = self.compiler.include_dirs + ['/usr/include']
|
||||
+ lib_dirs = self.compiler.library_dirs
|
||||
+ inc_dirs = self.compiler.include_dirs
|
||||
+ if not self.cross_compile:
|
||||
+ lib_dirs += [
|
||||
+ '/lib64', '/usr/lib64',
|
||||
+ '/lib', '/usr/lib',
|
||||
+ ]
|
||||
+ inc_dirs += ['/usr/include']
|
||||
+ else:
|
||||
+ # The common install prefix of 3rd party libraries used during
|
||||
+ # cross compilation
|
||||
+ mydir = os.environ.get('PYTHON_XCOMPILE_DEPENDENCIES_PREFIX')
|
||||
+ if mydir:
|
||||
+ inc_dirs += [mydir + '/include' ]
|
||||
+ inc_dirs += [mydir + '/lib/libffi-3.0.10/include']
|
||||
+ lib_dirs += [mydir + '/lib' ]
|
||||
+
|
||||
exts = []
|
||||
missing = []
|
||||
|
||||
@@ -1004,13 +1027,24 @@
|
||||
# We hunt for #define SQLITE_VERSION "n.n.n"
|
||||
# We need to find >= sqlite version 3.0.8
|
||||
sqlite_incdir = sqlite_libdir = None
|
||||
- sqlite_inc_paths = [ '/usr/include',
|
||||
- '/usr/include/sqlite',
|
||||
- '/usr/include/sqlite3',
|
||||
- '/usr/local/include',
|
||||
- '/usr/local/include/sqlite',
|
||||
- '/usr/local/include/sqlite3',
|
||||
- ]
|
||||
+
|
||||
+ if not self.cross_compile:
|
||||
+ sqlite_inc_paths = [ '/usr/include',
|
||||
+ '/usr/include/sqlite',
|
||||
+ '/usr/include/sqlite3',
|
||||
+ '/usr/local/include',
|
||||
+ '/usr/local/include/sqlite',
|
||||
+ '/usr/local/include/sqlite3',
|
||||
+ ]
|
||||
+ else:
|
||||
+ # The common install prefix of 3rd party headers used during
|
||||
+ # cross compilation
|
||||
+ mydir = os.environ.get('PYTHON_XCOMPILE_DEPENDENCIES_PREFIX')
|
||||
+ if mydir:
|
||||
+ sqlite_inc_paths = [mydir + '/include' ]
|
||||
+ else:
|
||||
+ sqlite_inc_paths = []
|
||||
+
|
||||
MIN_SQLITE_VERSION_NUMBER = (3, 0, 8)
|
||||
MIN_SQLITE_VERSION = ".".join([str(x)
|
||||
for x in MIN_SQLITE_VERSION_NUMBER])
|
||||
@@ -1050,12 +1084,22 @@
|
||||
print "sqlite: %s had no SQLITE_VERSION"%(f,)
|
||||
|
||||
if sqlite_incdir:
|
||||
- sqlite_dirs_to_check = [
|
||||
- os.path.join(sqlite_incdir, '..', 'lib64'),
|
||||
- os.path.join(sqlite_incdir, '..', 'lib'),
|
||||
- os.path.join(sqlite_incdir, '..', '..', 'lib64'),
|
||||
- os.path.join(sqlite_incdir, '..', '..', 'lib'),
|
||||
- ]
|
||||
+ if not self.cross_compile:
|
||||
+ sqlite_dirs_to_check = [
|
||||
+ os.path.join(sqlite_incdir, '..', 'lib64'),
|
||||
+ os.path.join(sqlite_incdir, '..', 'lib'),
|
||||
+ os.path.join(sqlite_incdir, '..', '..', 'lib64'),
|
||||
+ os.path.join(sqlite_incdir, '..', '..', 'lib'),
|
||||
+ ]
|
||||
+ else:
|
||||
+ # The common install prefix of 3rd party headers used during
|
||||
+ # cross compilation
|
||||
+ mydir = os.environ.get('PYTHON_XCOMPILE_DEPENDENCIES_PREFIX')
|
||||
+ if mydir:
|
||||
+ sqlite_dirs_to_check = [mydir + '/lib' ]
|
||||
+ else:
|
||||
+ sqlite_dirs_to_check = []
|
||||
+
|
||||
sqlite_libfile = self.compiler.find_library_file(
|
||||
sqlite_dirs_to_check + lib_dirs, 'sqlite3')
|
||||
if sqlite_libfile:
|
||||
@@ -1864,8 +1908,15 @@
|
||||
|
||||
# Pass empty CFLAGS because we'll just append the resulting
|
||||
# CFLAGS to Python's; -g or -O2 is to be avoided.
|
||||
- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
|
||||
- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
|
||||
+ if self.cross_compile:
|
||||
+ cmd = "cd %s && env CFLAGS='' %s/configure --host=%s --build=%s %s" \
|
||||
+ % (ffi_builddir, ffi_srcdir,
|
||||
+ os.environ.get('HOSTARCH'),
|
||||
+ os.environ.get('BUILDARCH'),
|
||||
+ " ".join(config_args))
|
||||
+ else:
|
||||
+ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
|
||||
+ % (ffi_builddir, ffi_srcdir, " ".join(config_args))
|
||||
|
||||
res = os.system(cmd)
|
||||
if res or not os.path.exists(ffi_configfile):
|
|
@ -0,0 +1,105 @@
|
|||
--- Makefile.pre.in
|
||||
+++ Makefile.pre.in
|
||||
@@ -227,6 +227,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
|
||||
##########################################################################
|
||||
# Parser
|
||||
PGEN= Parser/pgen$(EXE)
|
||||
+PGEN= Parser/pgen$(EXE)
|
||||
|
||||
PSRCS= \
|
||||
Parser/acceler.c \
|
||||
@@ -593,7 +595,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule
|
||||
$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
|
||||
@$(MKDIR_P) Include
|
||||
$(MAKE) $(PGEN)
|
||||
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
||||
+ $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
||||
$(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
|
||||
$(MAKE) $(GRAMMAR_H)
|
||||
touch $(GRAMMAR_C)
|
||||
@@ -1000,12 +1002,12 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
|
||||
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
|
||||
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
|
||||
fi
|
||||
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
-d $(LIBDEST) -f \
|
||||
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
||||
$(DESTDIR)$(LIBDEST)
|
||||
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
||||
$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
||||
-d $(LIBDEST) -f \
|
||||
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
||||
@@ -1133,11 +1135,13 @@ libainstall: all python-config
|
||||
# Install the dynamically loadable modules
|
||||
# This goes into $(exec_prefix)
|
||||
sharedinstall: sharedmods
|
||||
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
||||
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
|
||||
+ --skip-build \
|
||||
--prefix=$(prefix) \
|
||||
- --install-scripts=$(BINDIR) \
|
||||
- --install-platlib=$(DESTSHARED) \
|
||||
- --root=$(DESTDIR)/
|
||||
+ --install-scripts=$(DESTDIR)$(BINDIR) \
|
||||
+ --install-platlib=$(DESTDIR)$(DESTSHARED) \
|
||||
+ --root=/
|
||||
-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py*
|
||||
|
||||
# Here are a couple of targets for MacOSX again, to install a full
|
||||
--- setup.py.orig 2013-11-10 08:36:41.000000000 +0100
|
||||
+++ setup.py 2013-11-18 21:27:27.222000786 +0100
|
||||
@@ -17,7 +17,7 @@ from distutils.command.install import in
|
||||
from distutils.command.install_lib import install_lib
|
||||
from distutils.spawn import find_executable
|
||||
|
||||
-cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
|
||||
+cross_compiling = ("_PYTHON_HOST_PLATFORM" in os.environ) or ('PYTHONXCPREFIX' in os.environ)
|
||||
|
||||
def get_platform():
|
||||
# cross build
|
||||
@@ -324,6 +324,9 @@ class PyBuildExt(build_ext):
|
||||
|
||||
# Don't try to load extensions for cross builds
|
||||
if cross_compiling:
|
||||
+ self.announce(
|
||||
+ 'WARNING: skipping import check for cross-compiled: "%s"' %
|
||||
+ ext.name)
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -478,7 +481,7 @@ class PyBuildExt(build_ext):
|
||||
for directory in reversed(options.dirs):
|
||||
add_dir_to_list(dir_list, directory)
|
||||
|
||||
- if os.path.normpath(sys.prefix) != '/usr' \
|
||||
+ if os.path.normpath(sys.prefix) != '/usr' and not cross_compiling \
|
||||
and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
|
||||
# OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
|
||||
# (PYTHONFRAMEWORK is set) to avoid # linking problems when
|
||||
@@ -554,6 +557,11 @@ class PyBuildExt(build_ext):
|
||||
if host_platform in ['darwin', 'beos']:
|
||||
math_libs = []
|
||||
|
||||
+ # Insert libraries and headers from XBPS_CROSS_BASE
|
||||
+ if 'XBPS_CROSS_BASE' in os.environ:
|
||||
+ lib_dirs += [os.environ['XBPS_CROSS_BASE'] + '/usr/lib']
|
||||
+ inc_dirs += [os.environ['XBPS_CROSS_BASE'] + '/usr/include']
|
||||
+
|
||||
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
|
||||
|
||||
#
|
||||
@@ -2020,6 +2028,11 @@ class PyBuildExt(build_ext):
|
||||
|
||||
# Pass empty CFLAGS because we'll just append the resulting
|
||||
# CFLAGS to Python's; -g or -O2 is to be avoided.
|
||||
+ if cross_compiling:
|
||||
+ cmd = "cd %s && env CFLAGS='' '%s/configure' --host=%s --build=%s %s" \
|
||||
+ % (ffi_builddir, ffi_srcdir, os.environ.get('HOSTARCH'),
|
||||
+ os.environ.get('BUILDARCH'), " ".join(config_args))
|
||||
+ else:
|
||||
cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
|
||||
% (ffi_builddir, ffi_srcdir, " ".join(config_args))
|
||||
|
|
@ -1,71 +1,56 @@
|
|||
# Template build file for 'python'.
|
||||
pkgname=python
|
||||
version=2.7.3
|
||||
revision=7
|
||||
version=2.7.6
|
||||
revision=1
|
||||
wrksrc="Python-${version}"
|
||||
short_desc="Interpreted, interactive, object-oriented programming language"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
homepage="http://www.python.org"
|
||||
license="PSF"
|
||||
distfiles="http://www.python.org/ftp/python/$version/Python-$version.tar.xz"
|
||||
checksum=61d36be58e9e9c733c49d7b76858d5c08e2c63a84f2066b29d35d3521057c985
|
||||
checksum=1fd68e81f8bf7386ff239b7faee9ba387129d2cf34eab13350bd8503a0bff6a1
|
||||
|
||||
hostmakedepends="pkg-config"
|
||||
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
|
||||
expat-devel db-devel>=5.3 sqlite-devel bzip2-devel zlib-devel"
|
||||
expat-devel sqlite-devel bzip2-devel zlib-devel"
|
||||
|
||||
# Force posix semaphores by default; sem_open requires /dev/shm and
|
||||
# it's not mounted in chroot.
|
||||
configure_args+=" --with-threads --enable-ipv6 --with-signal-module --enable-shared
|
||||
configure_args="
|
||||
--with-threads --enable-ipv6 --with-signal-module --enable-shared
|
||||
--with-system-ffi --enable-unicode=ucs4 --with-system-expat
|
||||
--with-wctype-functions ac_cv_posix_semaphores_enabled=yes
|
||||
ac_cv_broken_sem_getvalue=no"
|
||||
--with-wctype-functions ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
|
||||
ac_cv_have_long_long_format=yes"
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
# cross build; have to build it in 2 stages: native and host.
|
||||
do_configure() {
|
||||
# Native build
|
||||
env CC=gcc LD=ld AS=as RANLIB=ranlib CFLAGS= LDFLAGS= OPT="-Os" \
|
||||
./configure && make ${makejobs} python Parser/pgen
|
||||
pre_configure() {
|
||||
# Ensure that internal copies of expat, libffi and zlib are not used.
|
||||
rm -r Modules/expat
|
||||
rm -r Modules/_ctypes/libffi*
|
||||
rm -r Modules/zlib
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
env CC=gcc LD=gcc AR=ar AS=as RANLIB=ranlib \
|
||||
CFLAGS=-Os LDFLAGS= ./configure
|
||||
make python
|
||||
mkdir hostpython
|
||||
mv python hostpython
|
||||
mv Parser/pgen Parser/hostpgen
|
||||
make distclean
|
||||
patch -Np0 -i ${FILESDIR}/Python-${version}-xcompile.patch
|
||||
fi
|
||||
./configure --build=${XBPS_MACHINE}-unknown-linux-gnu ${configure_args}
|
||||
}
|
||||
|
||||
# Cross build
|
||||
patch -Np1 -i ${FILESDIR}/Python-2.7.3-xcompile.patch
|
||||
sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py
|
||||
CFLAGS="$CFLAGS -I$XBPS_CROSS_BASE/include" \
|
||||
LDFLAGS="$LDFLAGS -L$XBPS_CROSS_BASE/lib" \
|
||||
./configure ${configure_args} CC="$CC" LD="$CC" \
|
||||
ac_cv_buggy_getaddrinfo=no
|
||||
}
|
||||
do_build() {
|
||||
make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen \
|
||||
BLDSHARED="${XBPS_CROSS_TRIPLET}-gcc -shared" \
|
||||
CROSS_COMPILE=$XBPS_CROSS_TARGET CROSS_COMPILE_TARGET=yes \
|
||||
HOSTARCH=$XBPS_CROSS_TRIPLET BUILDARCH=$XBPS_MACHINE-unknown-linux-gnu \
|
||||
PYTHON_XCOMPILE_DEPENDENCIES_PREFIX="$XBPS_CROSS_BASE" ${makejobs}
|
||||
}
|
||||
do_install() {
|
||||
# cross install
|
||||
make DESTDIR=${DESTDIR} HOSTPYTHON=./hostpython \
|
||||
CROSS_COMPILE=$XBPS_CROSS_TARGET \
|
||||
CROSS_COMPILE_TARGET=yes install
|
||||
}
|
||||
else
|
||||
# Native build
|
||||
do_configure() {
|
||||
# Enable built-in SQLite3 module to load extensions (Arch fix FS#22122)
|
||||
sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py
|
||||
CC="gcc" LD="gcc" ./configure ${configure_args}
|
||||
}
|
||||
do_build() {
|
||||
make ${makejobs}
|
||||
}
|
||||
do_install() {
|
||||
make DESTDIR=${DESTDIR} install
|
||||
}
|
||||
fi
|
||||
do_build() {
|
||||
# Avoid invoking pgen for cross-compiles.
|
||||
touch Include/graminit.h Python/graminit.c
|
||||
export PATH="$PATH:$wrksrc/hostpython"
|
||||
make ${makejobs}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
export PATH="$PATH:$wrksrc/hostpython"
|
||||
make DESTDIR=${DESTDIR} altinstall
|
||||
}
|
||||
|
||||
post_install() {
|
||||
chmod 755 ${DESTDIR}/usr/lib/libpython*.so*
|
||||
|
@ -82,15 +67,14 @@ python_package() {
|
|||
}
|
||||
|
||||
python-devel_package() {
|
||||
depends="libffi-devel zlib-devel readline-devel bzip2-devel gdbm-devel
|
||||
openssl-devel expat-devel db-devel>=5.3 ncurses-devel sqlite-devel
|
||||
python>=${version}"
|
||||
short_desc="Python development files"
|
||||
depends="python>=${version}_${revision}"
|
||||
short_desc+=" - development files"
|
||||
pkg_install() {
|
||||
vmove "usr/bin/python*-config"
|
||||
vmove usr/lib/pkgconfig
|
||||
vmove usr/include
|
||||
mkdir -p ${DESTDIR}/usr/include/python2.7
|
||||
mv ${PKGDESTDIR}/usr/include/python2.7/pyconfig.h ${DESTDIR}/usr/include/python2.7
|
||||
mv ${PKGDESTDIR}/usr/include/python2.7/pyconfig.h \
|
||||
${DESTDIR}/usr/include/python2.7
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue