summaryrefslogtreecommitdiff
path: root/package/python2/Makefile
diff options
context:
space:
mode:
authorWaldemar Brodkorb <mail@waldemar-brodkorb.de>2013-10-29 09:17:25 +0100
committerWaldemar Brodkorb <mail@waldemar-brodkorb.de>2013-10-29 09:17:25 +0100
commit1e8a2130a5b5ce6697956379e17bdeee435286ae (patch)
tree03b6973807cff8fbf3a11e6a114d234175727ca5 /package/python2/Makefile
parent6c4a3cbc980b8c99b6064073bcb54bdbe73bcd0a (diff)
update python2 and use new host infrastructure
Diffstat (limited to 'package/python2/Makefile')
-rw-r--r--package/python2/Makefile155
1 files changed, 90 insertions, 65 deletions
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