From d279b5d1fe744cac44da7cd1b51f9ba6a2cc4647 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 22 Oct 2013 19:29:20 +0200 Subject: fix libmix packages, while checking all packages make some style cleanup --- package/python2/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index 075920912..c020e645d 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -26,9 +26,9 @@ PKGSS_PYTHON2_BZIP2:= bzip2 include ${TOPDIR}/mk/package.mk -$(eval $(call PKG_template,PYTHON2,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) -$(eval $(call PKG_template,PYTHON2_BZIP2,${PKG_NAME}-bzip2,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_BZIP2},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) -$(eval $(call PKG_template,PYTHON2_READLINE,${PKG_NAME}-readline,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_READLINE},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) +$(eval $(call PKG_template,PYTHON2,python2,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) +$(eval $(call PKG_template,PYTHON2_BZIP2,python2-bzip2,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_BZIP2},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) +$(eval $(call PKG_template,PYTHON2_READLINE,python2-readline,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_READLINE},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) ifeq ($(ADK_HOST_CYGWIN),y) EXE:= .exe @@ -72,7 +72,7 @@ pre-configure: $(SED) "s#@@CPU_ARCH@@#$(CPU_ARCH)#" ${WRKBUILD}/configure $(SED) "s#@@STAGING_DIR@@#$(STAGING_DIR)#" ${WRKBUILD}/setup.py -post-install: +python2-install: ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/lib/python2.7 ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/include/python2.7 -- cgit v1.2.3 From d946003a107c44059d7bf580bd055c4b35c8d53f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 24 Oct 2013 15:01:29 +0200 Subject: finetune python2 package --- package/python2/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index c020e645d..b97266468 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -13,7 +13,7 @@ PKG_BUILDDEP:= zlib libffi openssl readline bzip2 PKG_DEPENDS:= libpthread zlib libffi libopenssl libgcc PKG_URL:= http://www.python.org/ PKG_SITES:= http://www.python.org/ftp/python/${PKG_VERSION}/ -PKG_OPTS:= noscripts +PKG_OPTS:= dev noscripts PKG_HOST_DEPENDS:= !netbsd !openbsd @@ -27,8 +27,8 @@ PKGSS_PYTHON2_BZIP2:= bzip2 include ${TOPDIR}/mk/package.mk $(eval $(call PKG_template,PYTHON2,python2,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) -$(eval $(call PKG_template,PYTHON2_BZIP2,python2-bzip2,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_BZIP2},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) -$(eval $(call PKG_template,PYTHON2_READLINE,python2-readline,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_READLINE},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) +$(eval $(call PKG_template,PYTHON2_BZIP2,python2-bzip2,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_BZIP2},${PKG_DESCR},${PKG_SECTION})) +$(eval $(call PKG_template,PYTHON2_READLINE,python2-readline,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_READLINE},${PKG_DESCR},${PKG_SECTION})) ifeq ($(ADK_HOST_CYGWIN),y) EXE:= .exe @@ -79,7 +79,8 @@ python2-install: ${INSTALL_BIN} ${WRKINST}/usr/bin/python ${IDIR_PYTHON2}/usr/bin ${CP} ${WRKINST}/usr/lib/libpython*.so* ${IDIR_PYTHON2}/usr/lib ${CP} ${WRKINST}/usr/lib/python2.7/* ${IDIR_PYTHON2}/usr/lib/python2.7 - ${CP} ${WRKINST}/usr/include/python2.7/* ${IDIR_PYTHON2}/usr/include/python2.7 + ${CP} ${WRKINST}/usr/include/python2.7/pyconfig.h \ + ${IDIR_PYTHON2}/usr/include/python2.7 -find ${IDIR_PYTHON2} -name "\*.pyc" -o -name "*\.pyo" -exec rm {} \; -rm ${IDIR_PYTHON2}/usr/lib/python2.7/lib-dynload/readline.so -rm ${IDIR_PYTHON2}/usr/lib/python2.7/lib-dynload/bz2.so -- cgit v1.2.3 From 1e8a2130a5b5ce6697956379e17bdeee435286ae Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 29 Oct 2013 09:17:25 +0100 Subject: update python2 and use new host infrastructure --- package/python2/Makefile | 155 +++++++++++--------- package/python2/patches/patch-Makefile_pre_in | 198 ++++++-------------------- package/python2/patches/patch-configure | 26 ---- package/python2/patches/patch-setup_py | 157 ++++++++++---------- 4 files changed, 206 insertions(+), 330 deletions(-) delete mode 100644 package/python2/patches/patch-configure (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index b97266468..fdf39f45f 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -4,13 +4,13 @@ include ${TOPDIR}/rules.mk PKG_NAME:= python2 -PKG_VERSION:= 2.7.1 -PKG_RELEASE:= 3 -PKG_MD5SUM:= 15ed56733655e3fab785e49a7278d2fb +PKG_VERSION:= 2.7.5 +PKG_RELEASE:= 1 +PKG_MD5SUM:= b4f01a1d0ba0b46b05c73b2ac909b1df PKG_DESCR:= Python scripting language (Version 2) PKG_SECTION:= lang -PKG_BUILDDEP:= zlib libffi openssl readline bzip2 -PKG_DEPENDS:= libpthread zlib libffi libopenssl libgcc +PKG_BUILDDEP:= libffi python2-host +PKG_DEPENDS:= libpthread libffi libgcc PKG_URL:= http://www.python.org/ PKG_SITES:= http://www.python.org/ftp/python/${PKG_VERSION}/ PKG_OPTS:= dev noscripts @@ -20,59 +20,96 @@ PKG_HOST_DEPENDS:= !netbsd !openbsd DISTFILES= Python-${PKG_VERSION}.tgz WRKDIST= ${WRKDIR}/Python-${PKG_VERSION} -PKG_SUBPKGS:= PYTHON2 PYTHON2_READLINE PYTHON2_BZIP2 -PKGSS_PYTHON2_READLINE:=libreadline -PKGSS_PYTHON2_BZIP2:= bzip2 +PKG_FLAVOURS_PYTHON2:= MOD_ZLIB MOD_BZ2 MOD_EXPAT MOD_SQLITE MOD_GDBM +PKG_FLAVOURS_PYTHON2+= MOD_NCURSES MOD_SSL MOD_READLINE + +PKGFD_MOD_ZLIB:= ZLIB support +PKGFB_MOD_ZLIB:= zlib +PKGFS_MOD_ZLIB:= zlib +PKGFD_MOD_BZ2:= BZIP2 support +PKGFB_MOD_BZ2:= bzip2 +PKGFS_MOD_BZ2:= libbz2 +PKGFD_MOD_EXPAT:= XML support +PKGFB_MOD_EXPAT:= expat +PKGFS_MOD_EXPAT:= libexpat +PKGFD_MOD_SQLITE:= SQLITE support +PKGFB_MOD_SQLITE:= sqlite +PKGFS_MOD_SQLITE:= libsqlite +PKGFD_MOD_GDBM:= GDBM support +PKGFB_MOD_GDBM:= gdbm +PKGFS_MOD_GDBM:= libgdbm +PKGFD_MOD_NCURSES:= NCURSES support +PKGFB_MOD_NCURSES:= ncurses +PKGFS_MOD_NCURSES:= libncurses +PKGFD_MOD_READLINE:= READLINE support +PKGFB_MOD_READLINE:= readline +PKGFS_MOD_READLINE:= libreadline +PKGFD_MOD_SSL:= OpenSSL support +PKGFB_MOD_SSL:= openssl +PKGFS_MOD_SSL:= libopenssl +include ${TOPDIR}/mk/host.mk include ${TOPDIR}/mk/package.mk +$(eval $(call HOST_template,PYTHON2,python2,${PKG_VERSION}-${PKG_RELEASE})) $(eval $(call PKG_template,PYTHON2,python2,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) -$(eval $(call PKG_template,PYTHON2_BZIP2,python2-bzip2,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_BZIP2},${PKG_DESCR},${PKG_SECTION})) -$(eval $(call PKG_template,PYTHON2_READLINE,python2-readline,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_PYTHON2_READLINE},${PKG_DESCR},${PKG_SECTION})) - -ifeq ($(ADK_HOST_CYGWIN),y) -EXE:= .exe -endif - -TARGET_CFLAGS+= -fPIC -TARGET_LDFLAGS+= -L. -MAKE_ENV+= OPT="$(TARGET_CFLAGS)" \ - RANLIB="${TARGET_CROSS}ranlib" \ - HOSTPYTHON=./hostpython \ - HOSTPGEN=./Parser/hostpgen -CONFIGURE_ENV+= OPT="$(TARGET_CFLAGS)" \ - ac_cv_have_long_long_format=yes + +define PKG_mod_template + +INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install + +${2}-install: + echo foo $(1) + ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/python2.7/lib-dynload + for m in ${2}; do \ + ${INSTALL_DATA} $(WRKINST)/usr/lib/python2.7/lib-dynload/$$$${m}*.so $$(IDIR_$(1))/usr/lib/python2.7/lib-dynload ;\ + done +endef + +$(eval $(call PKG_template,PYTHON2_MOD_ZLIB,python2-mod-zlib,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_ZLIB},${PKGFD_MOD_ZLIB},${PKG_SECTION})) +$(eval $(call PKG_template,PYTHON2_MOD_BZ2,python2-mod-bz2,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_BZ2},${PKGFD_MOD_BZ2},${PKG_SECTION})) +$(eval $(call PKG_template,PYTHON2_MOD_EXPAT,python2-mod-expat,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_EXPAT},${PKGFD_MOD_EXPAT},${PKG_SECTION})) +$(eval $(call PKG_template,PYTHON2_MOD_SQLITE,python2-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_SQLITE},${PKGFD_MOD_SQLITE},${PKG_SECTION})) +$(eval $(call PKG_template,PYTHON2_MOD_GDBM,python2-mod-gdbm,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_GDBM},${PKGFD_MOD_GDBM},${PKG_SECTION})) +$(eval $(call PKG_template,PYTHON2_MOD_NCURSES,python2-mod-ncurses,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_NCURSES},${PKGFD_MOD_NCURSES},${PKG_SECTION})) +$(eval $(call PKG_template,PYTHON2_MOD_SSL,python2-mod-ssl,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_SSL},${PKGFD_MOD_SSL},${PKG_SECTION})) +$(eval $(call PKG_template,PYTHON2_MOD_READLINE,python2-mod-readline,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_READLINE},${PKGFD_MOD_READLINE},${PKG_SECTION})) + +$(eval $(call PKG_mod_template,PYTHON2_MOD_ZLIB,zlib)) +$(eval $(call PKG_mod_template,PYTHON2_MOD_BZ2,bz2)) +$(eval $(call PKG_mod_template,PYTHON2_MOD_EXPAT,pyexpat)) +$(eval $(call PKG_mod_template,PYTHON2_MOD_SQLITE,_sqlite)) +$(eval $(call PKG_mod_template,PYTHON2_MOD_GDBM,gdbm)) +$(eval $(call PKG_mod_template,PYTHON2_MOD_NCURSES,_curses)) +$(eval $(call PKG_mod_template,PYTHON2_MOD_SSL,_ssl)) +$(eval $(call PKG_mod_template,PYTHON2_MOD_READLINE,readline)) + +MAKE_ENV+= HOSTPGEN=$(STAGING_HOST_DIR)/usr/bin/pgen +CONFIGURE_ENV+= ac_cv_have_long_long_format=yes \ + ac_cv_file__dev_ptmx=yes \ + ac_cv_file__dev_ptc=no CONFIGURE_ARGS:= --with-threads \ + --disable-ipv6 \ --disable-toolbox-glue \ --with-system-ffi \ --without-cxx-main -post-extract: - $(CP) ${WRKBUILD}/setup.py ${WRKBUILD}/setup.py.sav - $(CP) ./files/setup.py ${WRKBUILD}/setup.py - $(CP) ./files/posixmodule.c ${WRKBUILD}/Modules/posixmodule.c - $(CP) ./files/python-config.in ${WRKBUILD}/Misc/python-config.in - $(CP) ./files/build_scripts.py ${WRKBUILD}/Lib/distutils/command/build_scripts.py - $(CP) ./files/sysconfig.py ${WRKBUILD}/Lib/distutils/sysconfig.py - (cd ${WRKBUILD}; rm -rf config.{cache,status} ; \ - OPT="$(CFLAGS_FOR_BUILD)" \ - ./configure --without-cxx-main --with-threads \ - --prefix=$(STAGING_HOST_DIR)/usr \ - ); - $(MAKE) -C ${WRKBUILD} python$(EXE) Parser/pgen$(EXE) - $(MAKE) -C ${WRKBUILD} install - ${CP} ${WRKBUILD}/Parser/pgen ${STAGING_HOST_DIR}/usr/bin/pgen - ${CP} ${WRKBUILD}/python ${STAGING_HOST_DIR}/usr/bin/hostpython - ${CP} ${WRKBUILD}/Parser/pgen ${WRKBUILD}/Parser/hostpgen - ${CP} ${WRKBUILD}/python ${WRKBUILD}/hostpython - $(MAKE) -C ${WRKBUILD} distclean - $(CP) ${WRKBUILD}/setup.py.sav ${WRKBUILD}/setup.py - -pre-configure: - $(SED) "s#@@CPU_ARCH@@#$(CPU_ARCH)#" ${WRKBUILD}/configure - $(SED) "s#@@STAGING_DIR@@#$(STAGING_DIR)#" ${WRKBUILD}/setup.py - -python2-install: +HOST_CONFIGURE_ARGS:= --without-threads \ + --disable-toolbox-glue \ + --without-cxx-main + +python2-hostinstall: + $(INSTALL_BIN) ${HOST_WRKINST}/usr/bin/python \ + $(STAGING_HOST_DIR)/usr/bin + $(INSTALL_BIN) ${WRKBUILD}/Parser/pgen \ + $(STAGING_HOST_DIR)/usr/bin/pgen + $(CP) $(HOST_WRKINST)/usr/lib/python2.7 \ + $(STAGING_HOST_DIR)/usr/lib + $(INSTALL_DIR) $(STAGING_HOST_DIR)/usr/include/python2.7 + ${CP} ${HOST_WRKINST}/usr/include/python2.7/pyconfig.h \ + $(STAGING_HOST_DIR)/usr/include/python2.7 + +python2-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m} ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/lib/python2.7 ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/include/python2.7 @@ -81,21 +118,9 @@ python2-install: ${CP} ${WRKINST}/usr/lib/python2.7/* ${IDIR_PYTHON2}/usr/lib/python2.7 ${CP} ${WRKINST}/usr/include/python2.7/pyconfig.h \ ${IDIR_PYTHON2}/usr/include/python2.7 - -find ${IDIR_PYTHON2} -name "\*.pyc" -o -name "*\.pyo" -exec rm {} \; - -rm ${IDIR_PYTHON2}/usr/lib/python2.7/lib-dynload/readline.so - -rm ${IDIR_PYTHON2}/usr/lib/python2.7/lib-dynload/bz2.so - # workaround, copy host python-config to target scripts directory - ${CP} ${STAGING_HOST_DIR}/usr/bin/python*-config ${STAGING_DIR}/scripts - (cd ${STAGING_DIR}/usr/bin/ && ln -sf $(STAGING_HOST_DIR)/usr/bin/hostpython hostpython) - -python2-readline-install: - ${INSTALL_DIR} ${IDIR_PYTHON2_READLINE}/usr/lib/python2.7/lib-dynload - ${CP} ${WRKINST}/usr/lib/python2.7/lib-dynload/readline.so \ - ${IDIR_PYTHON2_READLINE}/usr/lib/python2.7/lib-dynload - -python2-bzip2-install: - ${INSTALL_DIR} ${IDIR_PYTHON2_BZIP2}/usr/lib/python2.7/lib-dynload - ${CP} ${WRKINST}/usr/lib/python2.7/lib-dynload/bz2.so \ - ${IDIR_PYTHON2_BZIP2}/usr/lib/python2.7/lib-dynload + for i in zlib bz2 _curses _ssl gdbm _sqlite pyexpat readline; do \ + rm ${IDIR_PYTHON2}/usr/lib/python2.7/lib-dynload/$${i}*so; \ + done +include ${TOPDIR}/mk/host-bottom.mk include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/python2/patches/patch-Makefile_pre_in b/package/python2/patches/patch-Makefile_pre_in index f18bd9a72..e4f59f0ba 100644 --- a/package/python2/patches/patch-Makefile_pre_in +++ b/package/python2/patches/patch-Makefile_pre_in @@ -1,166 +1,48 @@ -diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in ---- Python-2.7.1.orig/Makefile.pre.in 2010-10-14 13:37:30.000000000 +0200 -+++ Python-2.7.1/Makefile.pre.in 2013-07-11 11:56:32.128103200 +0200 -@@ -59,7 +59,7 @@ MAKESETUP= $(srcdir)/Modules/makese - # Compiler options - OPT= @OPT@ - BASECFLAGS= @BASECFLAGS@ --CFLAGS= $(BASECFLAGS) @CFLAGS@ $(OPT) $(EXTRA_CFLAGS) -+CFLAGS= $(BASECFLAGS) @CFLAGS@ $(EXTRA_CFLAGS) - # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to - # be able to build extension modules using the directories specified in the - # environment variables -@@ -179,6 +179,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ - - 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 -@@ -211,6 +212,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ +--- Python-2.7.5.orig/Makefile.pre.in 2013-05-12 05:32:49.000000000 +0200 ++++ Python-2.7.5/Makefile.pre.in 2013-10-29 08:12:25.000000000 +0100 +@@ -227,6 +227,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ ########################################################################## # Parser PGEN= Parser/pgen$(EXE) -+HOSTPGEN?= $(PGEN)$(EXE) - - POBJS= \ - Parser/acceler.o \ -@@ -380,7 +382,7 @@ build_all_generate_profile: - $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov" - - run_profile_task: -- ./$(BUILDPYTHON) $(PROFILE_TASK) -+ $(HOSTPYTHON) $(PROFILE_TASK) - - build_all_use_profile: - $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use" -@@ -398,14 +400,13 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA - $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) - - platform: $(BUILDPYTHON) -- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform -+ $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform - - - # 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;; \ -+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ - esac - - # Build static library -@@ -538,7 +539,7 @@ Modules/python.o: $(srcdir)/Modules/pyth - - $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) - -@$(INSTALL) -d Include -- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) - - $(PGEN): $(PGENOBJS) - $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) -@@ -702,7 +703,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho - - TESTOPTS= -l $(EXTRATESTOPTS) - TESTPROG= $(srcdir)/Lib/test/regrtest.py --TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) -+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) - test: all platform - -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f - -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -@@ -725,7 +726,7 @@ testuniversal: all platform - -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f - -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS) - $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS) -- $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS) -+ $(RUNSHARED) /usr/libexec/oah/translate $(HOSTPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS) - - - # Like testall, but with a single pass only -@@ -920,26 +921,26 @@ libinstall: build_all $(srcdir)/Lib/$(PL - done; \ - done - $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt ++HOSTPGEN?= Parser/pgen$(EXE) + + PSRCS= \ + Parser/acceler.c \ +@@ -593,7 +594,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p + $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) + @$(MKDIR_P) Include + $(MAKE) $(PGEN) +- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) + $(MAKE) $(GRAMMAR_H) + touch $(GRAMMAR_C) +@@ -1000,28 +1001,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL + $(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) +- $(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) \ -- ./$(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()" +- $(PYTHON_FOR_BUILD) -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) \ +- $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt # Create the PLATDIR source directory, if one wasn't distributed.. $(srcdir)/Lib/$(PLATDIR): -@@ -1044,11 +1045,12 @@ libainstall: all python-config - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: sharedmods -- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ -+ CROSS_COMPILE='$(CROSS_COMPILE)' \ -+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --install-platlib=$(DESTSHARED) \ -- --root=/$(DESTDIR) -+ --root=$(DESTDIR) - - # Here are a couple of targets for MacOSX again, to install a full - # framework-based Python. frameworkinstall installs everything, the -@@ -1082,7 +1084,7 @@ frameworkinstallstructure: $(LDLIBRARY) - fi; \ - done - $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers -- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist -+ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist - $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current - $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) - $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers -@@ -1117,7 +1119,7 @@ frameworkinstallextras: - # This installs a few of the useful scripts in Tools/scripts - scriptsinstall: - SRCDIR=$(srcdir) $(RUNSHARED) \ -- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \ -+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \ - --prefix=$(prefix) \ - --install-scripts=$(BINDIR) \ - --root=/$(DESTDIR) -@@ -1139,7 +1141,7 @@ config.status: $(srcdir)/configure - - # Run reindent on the library - reindent: -- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib -+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib - - # Rerun configure with the same options as it was run last time, - # provided the config.status script exists -@@ -1242,7 +1244,7 @@ funny: - - # Perform some verification checks on any modified files. - patchcheck: -- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py -+ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py - - # Dependencies - diff --git a/package/python2/patches/patch-configure b/package/python2/patches/patch-configure deleted file mode 100644 index e47d860fd..000000000 --- a/package/python2/patches/patch-configure +++ /dev/null @@ -1,26 +0,0 @@ ---- Python-2.7.1.orig/configure 2010-11-01 02:47:19.000000000 +0100 -+++ Python-2.7.1/configure 2011-10-14 17:36:48.000000000 +0200 -@@ -2972,12 +2972,12 @@ fi - $as_echo_n "checking MACHDEP... " >&6; } - if test -z "$MACHDEP" - then -- ac_sys_system=`uname -s` -+ ac_sys_system=Linux - if test "$ac_sys_system" = "AIX" \ - -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then - ac_sys_release=`uname -v` - else -- ac_sys_release=`uname -r` -+ ac_sys_release=2.6 - fi - ac_md_system=`echo $ac_sys_system | - tr -d '/ ' | tr '[A-Z]' '[a-z]'` -@@ -3150,7 +3150,7 @@ EXPORT_MACOSX_DEPLOYMENT_TARGET='#' - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking machine type as reported by uname -m" >&5 - $as_echo_n "checking machine type as reported by uname -m... " >&6; } --ac_sys_machine=`uname -m` -+ac_sys_machine=x86_64 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_sys_machine" >&5 - $as_echo "$ac_sys_machine" >&6; } - diff --git a/package/python2/patches/patch-setup_py b/package/python2/patches/patch-setup_py index fb91da1d3..f8f2fa1c0 100644 --- a/package/python2/patches/patch-setup_py +++ b/package/python2/patches/patch-setup_py @@ -1,96 +1,91 @@ -diff -Nur Python-2.7.orig/setup.py Python-2.7/setup.py ---- Python-2.7.1.orig/setup.py 2010-10-31 17:40:21.000000000 +0100 -+++ Python-2.7.1/setup.py 2011-10-06 20:34:53.328787057 +0200 -@@ -21,7 +21,7 @@ from distutils.spawn import find_executa - COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') +--- Python-2.7.5.orig/setup.py 2013-05-12 05:32:54.000000000 +0200 ++++ Python-2.7.5/setup.py 2013-10-29 07:33:37.000000000 +0100 +@@ -74,7 +74,7 @@ def find_file(filename, std_dirs, paths) + 'paths' is a list of additional locations to check; if the file is + found in one of them, the resulting list will contain the directory. + """ +- if host_platform == 'darwin': ++ if host_platform == 'darwin' and not cross_compiling: + # Honor the MacOSX SDK setting when one was specified. + # An SDK is a directory with the same structure as a real + # system, but with only header files and libraries. +@@ -84,7 +84,7 @@ def find_file(filename, std_dirs, paths) + for dir in std_dirs: + f = os.path.join(dir, filename) - # This global variable is used to hold the list of modules to be disabled. --disabled_module_list = [] -+disabled_module_list = ['nis'] +- if host_platform == 'darwin' and is_macosx_sdk_path(dir): ++ if host_platform == 'darwin' and is_macosx_sdk_path(dir) and not cross_compiling: + f = os.path.join(sysroot, dir[1:], filename) - def add_dir_to_list(dirlist, dir): - """Add the directory 'dir' to the list 'dirlist' (at the front) if -@@ -307,48 +307,14 @@ class PyBuildExt(build_ext): - ext_filename = os.path.join( - self.build_lib, - self.get_ext_filename(self.get_ext_fullname(ext.name))) -- try: -- imp.load_dynamic(ext.name, ext_filename) -- except ImportError, why: -- self.failed.append(ext.name) -- self.announce('*** WARNING: renaming "%s" since importing it' -- ' failed: %s' % (ext.name, why), level=3) -- assert not self.inplace -- basename, tail = os.path.splitext(ext_filename) -- newname = basename + "_failed" + tail -- if os.path.exists(newname): -- os.remove(newname) -- os.rename(ext_filename, newname) -- -- # XXX -- This relies on a Vile HACK in -- # distutils.command.build_ext.build_extension(). The -- # _built_objects attribute is stored there strictly for -- # use here. -- # If there is a failure, _built_objects may not be there, -- # so catch the AttributeError and move on. -- try: -- for filename in self._built_objects: -- os.remove(filename) -- except AttributeError: -- self.announce('unable to remove files (ignored)') -- except: -- exc_type, why, tb = sys.exc_info() -- self.announce('*** WARNING: importing extension "%s" ' -- 'failed with %s: %s' % (ext.name, exc_type, why), -- level=3) -- self.failed.append(ext.name) + if os.path.exists(f): return [] +@@ -93,7 +93,7 @@ def find_file(filename, std_dirs, paths) + for dir in paths: + f = os.path.join(dir, filename) - def get_platform(self): -- # Get value of sys.platform -- for platform in ['cygwin', 'beos', 'darwin', 'atheos', 'osf1']: -- if sys.platform.startswith(platform): -- return platform -- return sys.platform -+ return 'linux' +- if host_platform == 'darwin' and is_macosx_sdk_path(dir): ++ if host_platform == 'darwin' and is_macosx_sdk_path(dir) and not cross_compiling: + f = os.path.join(sysroot, dir[1:], filename) + + if os.path.exists(f): +@@ -107,7 +107,7 @@ def find_library_file(compiler, libname, + if result is None: + return None + +- if host_platform == 'darwin': ++ if host_platform == 'darwin' and not cross_compiling: + sysroot = macosx_sdk_root() + + # Check whether the found file is in one of the standard directories +@@ -116,7 +116,7 @@ def find_library_file(compiler, libname, + # Ensure path doesn't end with path separator + p = p.rstrip(os.sep) + +- if host_platform == 'darwin' and is_macosx_sdk_path(p): ++ if host_platform == 'darwin' and is_macosx_sdk_path(p) and not cross_compiling: + if os.path.join(sysroot, p[1:]) == dirname: + return [ ] + +@@ -129,7 +129,7 @@ def find_library_file(compiler, libname, + # Ensure path doesn't end with path separator + p = p.rstrip(os.sep) + +- if host_platform == 'darwin' and is_macosx_sdk_path(p): ++ if host_platform == 'darwin' and is_macosx_sdk_path(p) and not cross_compiling: + if os.path.join(sysroot, p[1:]) == dirname: + return [ p ] + +@@ -437,10 +437,12 @@ class PyBuildExt(build_ext): 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') -+ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') -+ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ++ if not cross_compiling: ++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') ++ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + self.add_gcc_paths() +- self.add_multiarch_paths() ++ if not cross_compiling: ++ self.add_multiarch_paths() # Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files. -@@ -384,17 +350,6 @@ class PyBuildExt(build_ext): - for directory in reversed(options.dirs): +@@ -477,7 +479,8 @@ class PyBuildExt(build_ext): add_dir_to_list(dir_list, directory) -- if os.path.normpath(sys.prefix) != '/usr' \ + if os.path.normpath(sys.prefix) != '/usr' \ - 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 -- # building a framework with different architectures than -- # the one that is currently installed (issue #7473) -- add_dir_to_list(self.compiler.library_dirs, -- sysconfig.get_config_var("LIBDIR")) -- add_dir_to_list(self.compiler.include_dirs, -- sysconfig.get_config_var("INCLUDEDIR")) -- - try: - have_unicode = unicode - except NameError: -@@ -403,11 +358,8 @@ class PyBuildExt(build_ext): - # 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 + ['@@STAGING_DIR@@/usr/lib'] -+ inc_dirs = self.compiler.include_dirs + ['@@STAGING_DIR@@/usr/include'] - exts = [] - missing = [] ++ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \ ++ and not cross_compiling: + # 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 +@@ -530,7 +533,7 @@ class PyBuildExt(build_ext): + if host_platform == 'hp-ux11': + lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] +- if host_platform == 'darwin': ++ if host_platform == 'darwin' and not cross_compiling: + # This should work on any unixy platform ;-) + # If the user has bothered specifying additional -I and -L flags + # in OPT and LDFLAGS we might as well use them here. -- cgit v1.2.3 From 1a3f7151d55fd0eb4508bfbd65d70bd9d3cf6399 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 30 Oct 2013 15:44:51 +0100 Subject: fix python cross-compile, when a python host binary is available --- package/python2/Makefile | 7 ++--- package/python2/patches/patch-Makefile_pre_in | 2 +- package/python2/patches/patch-setup_py | 38 ++++++++++++++++++++++++--- 3 files changed, 39 insertions(+), 8 deletions(-) (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index fdf39f45f..c0678a528 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -5,11 +5,11 @@ include ${TOPDIR}/rules.mk PKG_NAME:= python2 PKG_VERSION:= 2.7.5 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= b4f01a1d0ba0b46b05c73b2ac909b1df PKG_DESCR:= Python scripting language (Version 2) PKG_SECTION:= lang -PKG_BUILDDEP:= libffi python2-host +PKG_BUILDDEP:= libffi python2-host autotool PKG_DEPENDS:= libpthread libffi libgcc PKG_URL:= http://www.python.org/ PKG_SITES:= http://www.python.org/ftp/python/${PKG_VERSION}/ @@ -84,6 +84,7 @@ $(eval $(call PKG_mod_template,PYTHON2_MOD_NCURSES,_curses)) $(eval $(call PKG_mod_template,PYTHON2_MOD_SSL,_ssl)) $(eval $(call PKG_mod_template,PYTHON2_MOD_READLINE,readline)) +AUTOTOOL_STYLE:= autoreconf MAKE_ENV+= HOSTPGEN=$(STAGING_HOST_DIR)/usr/bin/pgen CONFIGURE_ENV+= ac_cv_have_long_long_format=yes \ ac_cv_file__dev_ptmx=yes \ @@ -118,7 +119,7 @@ python2-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m} ${CP} ${WRKINST}/usr/lib/python2.7/* ${IDIR_PYTHON2}/usr/lib/python2.7 ${CP} ${WRKINST}/usr/include/python2.7/pyconfig.h \ ${IDIR_PYTHON2}/usr/include/python2.7 - for i in zlib bz2 _curses _ssl gdbm _sqlite pyexpat readline; do \ + @-for i in zlib bz2 _curses _ssl gdbm _sqlite pyexpat readline; do \ rm ${IDIR_PYTHON2}/usr/lib/python2.7/lib-dynload/$${i}*so; \ done diff --git a/package/python2/patches/patch-Makefile_pre_in b/package/python2/patches/patch-Makefile_pre_in index e4f59f0ba..8c6aba5c2 100644 --- a/package/python2/patches/patch-Makefile_pre_in +++ b/package/python2/patches/patch-Makefile_pre_in @@ -1,5 +1,5 @@ --- Python-2.7.5.orig/Makefile.pre.in 2013-05-12 05:32:49.000000000 +0200 -+++ Python-2.7.5/Makefile.pre.in 2013-10-29 08:12:25.000000000 +0100 ++++ Python-2.7.5/Makefile.pre.in 2013-10-30 14:10:07.000000000 +0100 @@ -227,6 +227,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ ########################################################################## # Parser diff --git a/package/python2/patches/patch-setup_py b/package/python2/patches/patch-setup_py index f8f2fa1c0..0cb811de9 100644 --- a/package/python2/patches/patch-setup_py +++ b/package/python2/patches/patch-setup_py @@ -1,5 +1,5 @@ --- Python-2.7.5.orig/setup.py 2013-05-12 05:32:54.000000000 +0200 -+++ Python-2.7.5/setup.py 2013-10-29 07:33:37.000000000 +0100 ++++ Python-2.7.5/setup.py 2013-10-30 14:18:23.000000000 +0100 @@ -74,7 +74,7 @@ def find_file(filename, std_dirs, paths) 'paths' is a list of additional locations to check; if the file is found in one of them, the resulting list will contain the directory. @@ -54,7 +54,23 @@ if os.path.join(sysroot, p[1:]) == dirname: return [ p ] -@@ -437,10 +437,12 @@ class PyBuildExt(build_ext): +@@ -162,6 +162,7 @@ class PyBuildExt(build_ext): + + def build_extensions(self): + ++ self.compiler.library_dirs = [] + # Detect which modules should be compiled + missing = self.detect_modules() + +@@ -281,6 +282,7 @@ class PyBuildExt(build_ext): + + def build_extension(self, ext): + ++ + if ext.name == '_ctypes': + if not self.configure_ctypes(ext): + return +@@ -437,10 +439,12 @@ class PyBuildExt(build_ext): def detect_modules(self): # Ensure that /usr/local is always used @@ -70,7 +86,7 @@ # Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files. -@@ -477,7 +479,8 @@ class PyBuildExt(build_ext): +@@ -477,7 +481,8 @@ class PyBuildExt(build_ext): add_dir_to_list(dir_list, directory) if os.path.normpath(sys.prefix) != '/usr' \ @@ -80,7 +96,21 @@ # 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 -@@ -530,7 +533,7 @@ class PyBuildExt(build_ext): +@@ -495,8 +500,13 @@ class PyBuildExt(build_ext): + # 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. ++ if cross_compiling: ++ add_dir_to_list(self.compiler.library_dirs, ++ sysconfig.get_config_var('srcdir')) ++ + inc_dirs = self.compiler.include_dirs[:] + lib_dirs = self.compiler.library_dirs[:] ++ + if not cross_compiling: + for d in ( + '/usr/include', +@@ -530,7 +540,7 @@ class PyBuildExt(build_ext): if host_platform == 'hp-ux11': lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] -- cgit v1.2.3 From 61cc800e46cc943824dc6a0b8e8d413f2795db9f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 30 Oct 2013 15:49:49 +0100 Subject: missed one patch for python2 --- package/python2/patches/patch-configure_ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 package/python2/patches/patch-configure_ac (limited to 'package/python2') diff --git a/package/python2/patches/patch-configure_ac b/package/python2/patches/patch-configure_ac new file mode 100644 index 000000000..0ec10f1de --- /dev/null +++ b/package/python2/patches/patch-configure_ac @@ -0,0 +1,22 @@ +--- Python-2.7.5.orig/configure.ac 2013-05-12 05:32:54.000000000 +0200 ++++ Python-2.7.5/configure.ac 2013-10-30 15:33:30.000000000 +0100 +@@ -19,7 +19,7 @@ AC_SUBST(host) + if test "$cross_compiling" = yes; then + AC_MSG_CHECKING([for python interpreter for cross build]) + if test -z "$PYTHON_FOR_BUILD"; then +- for interp in python$PACKAGE_VERSION python2 python; do ++ for interp in python; do + which $interp >/dev/null 2>&1 || continue + if $interp -c 'import sys;sys.exit(not (sys.version_info@<:@:2@:>@ >= (2,7) and sys.version_info@<:@0@:>@ < 3))'; then + break +@@ -1066,9 +1066,7 @@ then + if test "$Py_DEBUG" = 'true' ; then + # Optimization messes up debuggers, so turn it off for + # debug builds. +- OPT="-g -O0 -Wall $STRICT_PROTO" +- else +- OPT="-g $WRAP -O3 -Wall $STRICT_PROTO" ++ OPT="$STRICT_PROTO" + fi + ;; + *) -- cgit v1.2.3 From 94722f640dd0851e151211c4399bcade1c82a37c Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 31 Oct 2013 08:52:29 +0100 Subject: fix libxml2-python package --- package/python2/Makefile | 14 ++------------ package/python2/patches/patch-Misc_python-config_in | 13 +++++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 package/python2/patches/patch-Misc_python-config_in (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index c0678a528..82c89c433 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= python2 PKG_VERSION:= 2.7.5 -PKG_RELEASE:= 2 +PKG_RELEASE:= 3 PKG_MD5SUM:= b4f01a1d0ba0b46b05c73b2ac909b1df PKG_DESCR:= Python scripting language (Version 2) PKG_SECTION:= lang @@ -95,21 +95,11 @@ CONFIGURE_ARGS:= --with-threads \ --with-system-ffi \ --without-cxx-main +HOST_STYLE:= auto HOST_CONFIGURE_ARGS:= --without-threads \ --disable-toolbox-glue \ --without-cxx-main -python2-hostinstall: - $(INSTALL_BIN) ${HOST_WRKINST}/usr/bin/python \ - $(STAGING_HOST_DIR)/usr/bin - $(INSTALL_BIN) ${WRKBUILD}/Parser/pgen \ - $(STAGING_HOST_DIR)/usr/bin/pgen - $(CP) $(HOST_WRKINST)/usr/lib/python2.7 \ - $(STAGING_HOST_DIR)/usr/lib - $(INSTALL_DIR) $(STAGING_HOST_DIR)/usr/include/python2.7 - ${CP} ${HOST_WRKINST}/usr/include/python2.7/pyconfig.h \ - $(STAGING_HOST_DIR)/usr/include/python2.7 - python2-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m} ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/lib/python2.7 diff --git a/package/python2/patches/patch-Misc_python-config_in b/package/python2/patches/patch-Misc_python-config_in new file mode 100644 index 000000000..7ea806bea --- /dev/null +++ b/package/python2/patches/patch-Misc_python-config_in @@ -0,0 +1,13 @@ +--- Python-2.7.5.orig/Misc/python-config.in 2013-05-12 05:32:49.000000000 +0200 ++++ Python-2.7.5/Misc/python-config.in 2013-10-30 21:09:36.000000000 +0100 +@@ -37,8 +37,8 @@ for opt in opt_flags: + print sysconfig.EXEC_PREFIX + + elif opt in ('--includes', '--cflags'): +- flags = ['-I' + sysconfig.get_python_inc(), +- '-I' + sysconfig.get_python_inc(plat_specific=True)] ++ flags = ['-I' + re.sub('host_', 'target_', sysconfig.get_python_inc()), ++ '-I' + re.sub('host_', 'target_', sysconfig.get_python_inc(plat_specific=True))] + if opt == '--cflags': + flags.extend(getvar('CFLAGS').split()) + print ' '.join(flags) -- cgit v1.2.3 From b520d5c344c10b079673446d7f3cce1c24449d2a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 31 Oct 2013 09:20:22 +0100 Subject: forgot to import regular expression module --- package/python2/Makefile | 2 +- package/python2/patches/patch-Misc_python-config_in | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index 82c89c433..2eb0e7bde 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= python2 PKG_VERSION:= 2.7.5 -PKG_RELEASE:= 3 +PKG_RELEASE:= 2 PKG_MD5SUM:= b4f01a1d0ba0b46b05c73b2ac909b1df PKG_DESCR:= Python scripting language (Version 2) PKG_SECTION:= lang diff --git a/package/python2/patches/patch-Misc_python-config_in b/package/python2/patches/patch-Misc_python-config_in index 7ea806bea..9734d4fbd 100644 --- a/package/python2/patches/patch-Misc_python-config_in +++ b/package/python2/patches/patch-Misc_python-config_in @@ -1,6 +1,14 @@ --- Python-2.7.5.orig/Misc/python-config.in 2013-05-12 05:32:49.000000000 +0200 -+++ Python-2.7.5/Misc/python-config.in 2013-10-30 21:09:36.000000000 +0100 -@@ -37,8 +37,8 @@ for opt in opt_flags: ++++ Python-2.7.5/Misc/python-config.in 2013-10-30 21:29:47.000000000 +0100 +@@ -3,6 +3,7 @@ + import sys + import os + import getopt ++import re + from distutils import sysconfig + + valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', +@@ -37,8 +38,8 @@ for opt in opt_flags: print sysconfig.EXEC_PREFIX elif opt in ('--includes', '--cflags'): -- cgit v1.2.3 From 5e1af1d22d4e680d1b5f5486df023a2f0ddb9c9c Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 31 Oct 2013 09:21:12 +0100 Subject: bump version --- package/python2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index 2eb0e7bde..ad4b4d781 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= python2 PKG_VERSION:= 2.7.5 -PKG_RELEASE:= 2 +PKG_RELEASE:= 4 PKG_MD5SUM:= b4f01a1d0ba0b46b05c73b2ac909b1df PKG_DESCR:= Python scripting language (Version 2) PKG_SECTION:= lang -- cgit v1.2.3 From caec12548668dd7dd564ce732d8c77a76dfe4788 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 1 Nov 2013 15:25:48 +0100 Subject: fix macos x host compile --- package/python2/Makefile | 2 +- package/python2/patches/patch-Makefile_pre_in | 11 ++++++++++- package/python2/patches/patch-setup_py | 11 ++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index ad4b4d781..5c759eaca 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -96,7 +96,7 @@ CONFIGURE_ARGS:= --with-threads \ --without-cxx-main HOST_STYLE:= auto -HOST_CONFIGURE_ARGS:= --without-threads \ +HOST_CONFIGURE_ARGS:= --with-threads \ --disable-toolbox-glue \ --without-cxx-main diff --git a/package/python2/patches/patch-Makefile_pre_in b/package/python2/patches/patch-Makefile_pre_in index 8c6aba5c2..26077c7fc 100644 --- a/package/python2/patches/patch-Makefile_pre_in +++ b/package/python2/patches/patch-Makefile_pre_in @@ -1,5 +1,5 @@ --- Python-2.7.5.orig/Makefile.pre.in 2013-05-12 05:32:49.000000000 +0200 -+++ Python-2.7.5/Makefile.pre.in 2013-10-30 14:10:07.000000000 +0100 ++++ Python-2.7.5/Makefile.pre.in 2013-11-01 14:54:24.000000000 +0100 @@ -227,6 +227,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ ########################################################################## # Parser @@ -8,6 +8,15 @@ PSRCS= \ Parser/acceler.c \ +@@ -456,7 +457,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx + *) quiet="";; \ + esac; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ +- $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build ++ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py build + + # Build static library + # avoid long command lines, same as LIBRARY_OBJS @@ -593,7 +594,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) @$(MKDIR_P) Include diff --git a/package/python2/patches/patch-setup_py b/package/python2/patches/patch-setup_py index 0cb811de9..3a80230c2 100644 --- a/package/python2/patches/patch-setup_py +++ b/package/python2/patches/patch-setup_py @@ -1,5 +1,5 @@ --- Python-2.7.5.orig/setup.py 2013-05-12 05:32:54.000000000 +0200 -+++ Python-2.7.5/setup.py 2013-10-30 14:18:23.000000000 +0100 ++++ Python-2.7.5/setup.py 2013-11-01 14:53:38.000000000 +0100 @@ -74,7 +74,7 @@ def find_file(filename, std_dirs, paths) 'paths' is a list of additional locations to check; if the file is found in one of them, the resulting list will contain the directory. @@ -119,3 +119,12 @@ # This should work on any unixy platform ;-) # If the user has bothered specifying additional -I and -L flags # in OPT and LDFLAGS we might as well use them here. +@@ -837,7 +847,7 @@ class PyBuildExt(build_ext): + openssl_ver >= min_openssl_ver) + + if have_any_openssl: +- if have_usable_openssl: ++ if have_usable_openssl and host_platform != 'darwin': + # The _hashlib module wraps optimized implementations + # of hash functions from the OpenSSL library. + exts.append( Extension('_hashlib', ['_hashopenssl.c'], -- cgit v1.2.3 From 2cb5bb7b747132f9d1d6010e406464e1b4f2492d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 2 Nov 2013 17:01:52 +0100 Subject: pgen is not automatically installed --- package/python2/Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index 5c759eaca..948a012d4 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -100,6 +100,10 @@ HOST_CONFIGURE_ARGS:= --with-threads \ --disable-toolbox-glue \ --without-cxx-main +hostpost-install: + $(INSTALL_BIN) ${WRKBUILD}/Parser/pgen \ + $(STAGING_HOST_DIR)/usr/bin/pgen + python2-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m} ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/lib/python2.7 -- cgit v1.2.3 From e6905e7a46dc8a218eb67d38f3250363ade738ab Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 3 Nov 2013 18:16:06 +0100 Subject: fix pycurl build --- package/python2/Makefile | 2 +- package/python2/patches/patch-Lib_distutils_sysconfig_py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 package/python2/patches/patch-Lib_distutils_sysconfig_py (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index 948a012d4..ee4768c3d 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= python2 PKG_VERSION:= 2.7.5 -PKG_RELEASE:= 4 +PKG_RELEASE:= 5 PKG_MD5SUM:= b4f01a1d0ba0b46b05c73b2ac909b1df PKG_DESCR:= Python scripting language (Version 2) PKG_SECTION:= lang diff --git a/package/python2/patches/patch-Lib_distutils_sysconfig_py b/package/python2/patches/patch-Lib_distutils_sysconfig_py new file mode 100644 index 000000000..30aae0816 --- /dev/null +++ b/package/python2/patches/patch-Lib_distutils_sysconfig_py @@ -0,0 +1,10 @@ +--- Python-2.7.5.orig/Lib/distutils/sysconfig.py 2013-05-12 05:32:42.000000000 +0200 ++++ Python-2.7.5/Lib/distutils/sysconfig.py 2013-11-03 18:03:53.000000000 +0100 +@@ -76,6 +76,7 @@ def get_python_inc(plat_specific=0, pref + """ + if prefix is None: + prefix = plat_specific and EXEC_PREFIX or PREFIX ++ prefix = re.sub('host_', 'target_', prefix) + + if os.name == "posix": + if python_build: -- cgit v1.2.3 From ae3d4616ed9c19a29d656193254657f93d612fa2 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 27 Nov 2013 21:30:43 +0100 Subject: try to fixup mesalib compile, it needs libxml2 python module --- package/python2/Makefile | 12 +- package/python2/files/build_scripts.py | 99 - .../python2/files/patch-Lib_distutils_sysconfig_py | 10 + package/python2/files/patch-Misc_python-config_in | 21 + package/python2/files/posixmodule.c | 9365 -------------------- package/python2/files/python-config.in | 57 - package/python2/files/setup.py | 2076 ----- package/python2/files/sysconfig.py | 572 -- .../patches/patch-Lib_distutils_sysconfig_py | 10 - .../python2/patches/patch-Misc_python-config_in | 21 - 10 files changed, 41 insertions(+), 12202 deletions(-) delete mode 100644 package/python2/files/build_scripts.py create mode 100644 package/python2/files/patch-Lib_distutils_sysconfig_py create mode 100644 package/python2/files/patch-Misc_python-config_in delete mode 100644 package/python2/files/posixmodule.c delete mode 100644 package/python2/files/python-config.in delete mode 100644 package/python2/files/setup.py delete mode 100644 package/python2/files/sysconfig.py delete mode 100644 package/python2/patches/patch-Lib_distutils_sysconfig_py delete mode 100644 package/python2/patches/patch-Misc_python-config_in (limited to 'package/python2') diff --git a/package/python2/Makefile b/package/python2/Makefile index ee4768c3d..1fa0cce94 100644 --- a/package/python2/Makefile +++ b/package/python2/Makefile @@ -5,11 +5,11 @@ include ${TOPDIR}/rules.mk PKG_NAME:= python2 PKG_VERSION:= 2.7.5 -PKG_RELEASE:= 5 +PKG_RELEASE:= 6 PKG_MD5SUM:= b4f01a1d0ba0b46b05c73b2ac909b1df PKG_DESCR:= Python scripting language (Version 2) PKG_SECTION:= lang -PKG_BUILDDEP:= libffi python2-host autotool +PKG_BUILDDEP:= autotool libffi python2-host PKG_DEPENDS:= libpthread libffi libgcc PKG_URL:= http://www.python.org/ PKG_SITES:= http://www.python.org/ftp/python/${PKG_VERSION}/ @@ -104,6 +104,14 @@ hostpost-install: $(INSTALL_BIN) ${WRKBUILD}/Parser/pgen \ $(STAGING_HOST_DIR)/usr/bin/pgen +pre-configure: + (cd $(WRKBUILD) && patch -p1 < \ + $(TOPDIR)/package/python2/files/patch-Lib_distutils_sysconfig_py ) + (cd $(WRKBUILD) && patch -p1 < \ + $(TOPDIR)/package/python2/files/patch-Misc_python-config_in ) + $(SED) "s#@EXENAME@#$(STAGING_HOST_DIR)/usr/bin/python#" \ + $(WRKBUILD)/Misc/python-config.in + python2-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m} ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/lib/python2.7 diff --git a/package/python2/files/build_scripts.py b/package/python2/files/build_scripts.py deleted file mode 100644 index fe81a5341..000000000 --- a/package/python2/files/build_scripts.py +++ /dev/null @@ -1,99 +0,0 @@ -"""distutils.command.build_scripts - -Implements the Distutils 'build_scripts' command.""" - -__revision__ = "$Id: build_scripts.py 77704 2010-01-23 09:23:15Z tarek.ziade $" - -import os, re -from stat import ST_MODE -from distutils.core import Command -from distutils.dep_util import newer -from distutils.util import convert_path -from distutils import log - -# check if Python is called on the first line with this expression -first_line_re = re.compile('^#!.*python[0-9.]*([ \t].*)?$') - -class build_scripts (Command): - - description = "\"build\" scripts (copy and fixup #! line)" - - user_options = [ - ('build-dir=', 'd', "directory to \"build\" (copy) to"), - ('force', 'f', "forcibly build everything (ignore file timestamps"), - ('executable=', 'e', "specify final destination interpreter path"), - ] - - boolean_options = ['force'] - - - def initialize_options (self): - self.build_dir = None - self.scripts = None - self.force = None - self.executable = None - self.outfiles = None - - def finalize_options (self): - self.set_undefined_options('build', - ('build_scripts', 'build_dir'), - ('force', 'force'), - ('executable', 'executable')) - self.scripts = self.distribution.scripts - - def get_source_files(self): - return self.scripts - - def run (self): - if not self.scripts: - return - self.copy_scripts() - - - def copy_scripts (self): - """Copy each script listed in 'self.scripts'; if it's marked as a - Python script in the Unix way (first line matches 'first_line_re', - ie. starts with "\#!" and contains "python"), then adjust the first - line to refer to the current Python interpreter as we copy. - """ - _sysconfig = __import__('sysconfig') - self.mkpath(self.build_dir) - outfiles = [] - for script in self.scripts: - adjust = 0 - script = convert_path(script) - outfile = os.path.join(self.build_dir, os.path.basename(script)) - outfiles.append(outfile) - - if not self.force and not newer(script, outfile): - log.debug("not copying %s (up-to-date)", script) - continue - - # Always open the file, but ignore failures in dry-run mode -- - # that way, we'll get accurate feedback if we can read the - # script. - try: - f = open(script, "r") - except IOError: - if not self.dry_run: - raise - f = None - if f: - f.close() - self.copy_file(script, outfile) - - if os.name == 'posix': - for file in outfiles: - if self.dry_run: - log.info("changing mode of %s", file) - else: - oldmode = os.stat(file)[ST_MODE] & 07777 - newmode = (oldmode | 0555) & 07777 - if newmode != oldmode: - log.info("changing mode of %s from %o to %o", - file, oldmode, newmode) - os.chmod(file, newmode) - - # copy_scripts () - -# class build_scripts diff --git a/package/python2/files/patch-Lib_distutils_sysconfig_py b/package/python2/files/patch-Lib_distutils_sysconfig_py new file mode 100644 index 000000000..30aae0816 --- /dev/null +++ b/package/python2/files/patch-Lib_distutils_sysconfig_py @@ -0,0 +1,10 @@ +--- Python-2.7.5.orig/Lib/distutils/sysconfig.py 2013-05-12 05:32:42.000000000 +0200 ++++ Python-2.7.5/Lib/distutils/sysconfig.py 2013-11-03 18:03:53.000000000 +0100 +@@ -76,6 +76,7 @@ def get_python_inc(plat_specific=0, pref + """ + if prefix is None: + prefix = plat_specific and EXEC_PREFIX or PREFIX ++ prefix = re.sub('host_', 'target_', prefix) + + if os.name == "posix": + if python_build: diff --git a/package/python2/files/patch-Misc_python-config_in b/package/python2/files/patch-Misc_python-config_in new file mode 100644 index 000000000..9734d4fbd --- /dev/null +++ b/package/python2/files/patch-Misc_python-config_in @@ -0,0 +1,21 @@ +--- Python-2.7.5.orig/Misc/python-config.in 2013-05-12 05:32:49.000000000 +0200 ++++ Python-2.7.5/Misc/python-config.in 2013-10-30 21:29:47.000000000 +0100 +@@ -3,6 +3,7 @@ + import sys + import os + import getopt ++import re + from distutils import sysconfig + + valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', +@@ -37,8 +38,8 @@ for opt in opt_flags: + print sysconfig.EXEC_PREFIX + + elif opt in ('--includes', '--cflags'): +- flags = ['-I' + sysconfig.get_python_inc(), +- '-I' + sysconfig.get_python_inc(plat_specific=True)] ++ flags = ['-I' + re.sub('host_', 'target_', sysconfig.get_python_inc()), ++ '-I' + re.sub('host_', 'target_', sysconfig.get_python_inc(plat_specific=True))] + if opt == '--cflags': + flags.extend(getvar('CFLAGS').split()) + print ' '.join(flags) diff --git a/package/python2/files/posixmodule.c b/package/python2/files/posixmodule.c deleted file mode 100644 index 312861b65..000000000 --- a/package/python2/files/posixmodule.c +++ /dev/null @@ -1,9365 +0,0 @@ - -/* POSIX module implementation */ - -/* This file is also used for Windows NT/MS-Win and OS/2. In that case the - module actually calls itself 'nt' or 'os2', not 'posix', and a few - functions are either unimplemented or implemented differently. The source - assumes that for Windows NT, the macro 'MS_WINDOWS' is defined independent - of the compiler used. Different compilers define their own feature - test macro, e.g. '__BORLANDC__' or '_MSC_VER'. For OS/2, the compiler - independent macro PYOS_OS2 should be defined. On OS/2 the default - compiler is assumed to be IBM's VisualAge C++ (VACPP). PYCC_GCC is used - as the compiler specific macro for the EMX port of gcc to OS/2. */ - -/* See also ../Dos/dosmodule.c */ - -#ifdef __APPLE__ - /* - * Step 1 of support for weak-linking a number of symbols existing on - * OSX 10.4 and later, see the comment in the #ifdef __APPLE__ block - * at the end of this file for more information. - */ -# pragma weak lchown -# pragma weak statvfs -# pragma weak fstatvfs - -#endif /* __APPLE__ */ - -#define PY_SSIZE_T_CLEAN - -#include "Python.h" -#include "structseq.h" - -#if defined(__VMS) -# include -#endif /* defined(__VMS) */ - -#ifdef __cplusplus -extern "C" { -#endif - -PyDoc_STRVAR(posix__doc__, -"This module provides access to operating system functionality that is\n\ -standardized by the C Standard and the POSIX standard (a thinly\n\ -disguised Unix interface). Refer to the library manual and\n\ -corresponding Unix manual entries for more information on calls."); - -#ifndef Py_USING_UNICODE -/* This is used in signatures of functions. */ -#define Py_UNICODE void -#endif - -#if defined(PYOS_OS2) -#define INCL_DOS -#define INCL_DOSERRORS -#define INCL_DOSPROCESS -#define INCL_NOPMAPI -#include -#if defined(PYCC_GCC) -#include -#include -#include -#include -#endif -#include "osdefs.h" -#endif - -#ifdef HAVE_SYS_TYPES_H -#include -#endif /* HAVE_SYS_TYPES_H */ - -#ifdef HAVE_SYS_STAT_H -#include -#endif /* HAVE_SYS_STAT_H */ - -#ifdef HAVE_SYS_WAIT_H -#include /* For WNOHANG */ -#endif - -#ifdef HAVE_SIGNAL_H -#include -#endif - -#ifdef HAVE_FCNTL_H -#include -#endif /* HAVE_FCNTL_H */ - -#ifdef HAVE_GRP_H -#include -#endif - -#ifdef HAVE_SYSEXITS_H -#include -#endif /* HAVE_SYSEXITS_H */ - -#ifdef HAVE_SYS_LOADAVG_H -#include -#endif - -/* Various compilers have only certain posix functions */ -/* XXX Gosh I wish these were all moved into pyconfig.h */ -#if defined(PYCC_VACPP) && defined(PYOS_OS2) -#include -#else -#if defined(__WATCOMC__) && !defined(__QNX__) /* Watcom compiler */ -#define HAVE_GETCWD 1 -#define HAVE_OPENDIR 1 -#define HAVE_SYSTEM 1 -#if defined(__OS2__) -#define HAVE_EXECV 1 -#define HAVE_WAIT 1 -#endif -#include -#else -#ifdef __BORLANDC__ /* Borland compiler */ -#define HAVE_EXECV 1 -#define HAVE_GETCWD 1 -#define HAVE_OPENDIR 1 -#define HAVE_PIPE 1 -#define HAVE_POPEN 1 -#define HAVE_SYSTEM 1 -#define HAVE_WAIT 1 -#else -#ifdef _MSC_VER /* Microsoft compiler */ -#define HAVE_GETCWD 1 -#define HAVE_SPAWNV 1 -#define HAVE_EXECV 1 -#define HAVE_PIPE 1 -#define HAVE_POPEN 1 -#define HAVE_SYSTEM 1 -#define HAVE_CWAIT 1 -#define HAVE_FSYNC 1 -#define fsync _commit -#else -#if defined(PYOS_OS2) && defined(PYCC_GCC) || defined(__VMS) -/* Everything needed is defined in PC/os2emx/pyconfig.h or vms/pyconfig.h */ -#else /* all other compilers */ -/* Unix functions that the configure script doesn't check for */ -#define HAVE_EXECV 1 -#define HAVE_FORK 1 -#if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */ -#define HAVE_FORK1 1 -#endif -#define HAVE_GETCWD 1 -#define HAVE_GETEGID 1 -#define HAVE_GETEUID 1 -#define HAVE_GETGID 1 -#define HAVE_GETPPID 1 -#define HAVE_GETUID 1 -#define HAVE_KILL 1 -#define HAVE_OPENDIR 1 -#define HAVE_PIPE 1 -#ifndef __rtems__ -#define HAVE_POPEN 1 -#endif -#define HAVE_SYSTEM 1 -#define HAVE_WAIT 1 -#define HAVE_TTYNAME 1 -#endif /* PYOS_OS2 && PYCC_GCC && __VMS */ -#endif /* _MSC_VER */ -#endif /* __BORLANDC__ */ -#endif /* ! __WATCOMC__ || __QNX__ */ -#endif /* ! __IBMC__ */ - -#ifndef _MSC_VER - -#if defined(__sgi)&&_COMPILER_VERSION>=700 -/* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode - (default) */ -extern char *ctermid_r(char *); -#endif - -#ifndef HAVE_UNISTD_H -#if defined(PYCC_VACPP) -extern int mkdir(char *); -#else -#if ( defined(__WATCOMC__) || defined(_MSC_VER) ) && !defined(__QNX__) -extern int mkdir(const char *); -#else -extern int mkdir(const char *, mode_t); -#endif -#endif -#if defined(__IBMC__) || defined(__IBMCPP__) -extern int chdir(char *); -extern int rmdir(char *); -#else -extern int chdir(const char *); -extern int rmdir(const char *); -#endif -#ifdef __BORLANDC__ -extern int chmod(const char *, int); -#else -extern int chmod(const char *, mode_t); -#endif -/*#ifdef HAVE_FCHMOD -extern int fchmod(int, mode_t); -#endif*/ -/*#ifdef HAVE_LCHMOD -extern int lchmod(const char *, mode_t); -#endif*/ -extern int chown(const char *, uid_t, gid_t); -extern char *getcwd(char *, int); -extern char *strerror(int); -extern int link(const char *, const char *); -extern int rename(const char *, const char *); -extern int stat(const char *, struct stat *); -extern int unlink(const char *); -extern int pclose(FILE *); -#ifdef HAVE_SYMLINK -extern int symlink(const char *, const char *); -#endif /* HAVE_SYMLINK */ -#ifdef HAVE_LSTAT -extern int lstat(const char *, struct stat *); -#endif /* HAVE_LSTAT */ -#endif /* !HAVE_UNISTD_H */ - -#endif /*