Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include ${TOPDIR}/rules.mk
  4. PKG_NAME:= python2
  5. PKG_VERSION:= 2.7.1
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 15ed56733655e3fab785e49a7278d2fb
  8. PKG_DESCR:= Python scripting language (Version 2)
  9. PKG_SECTION:= lang
  10. PKG_DEPENDS:= libpthread zlib libffi libopenssl
  11. PKG_BUILDDEP:= zlib libffi openssl
  12. PKG_URL:= http://www.python.org/
  13. PKG_SITES:= http://www.python.org/ftp/python/${PKG_VERSION}/
  14. PKG_OPTS:= noscripts
  15. PKG_HOST_DEPENDS:= !netbsd !openbsd !cygwin
  16. DISTFILES= Python-${PKG_VERSION}.tgz
  17. WRKDIST= ${WRKDIR}/Python-${PKG_VERSION}
  18. include ${TOPDIR}/mk/package.mk
  19. $(eval $(call PKG_template,PYTHON2,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  20. MAKE_ENV+= OPT="$(TARGET_CFLAGS)" \
  21. RANLIB="${TARGET_CROSS}ranlib" \
  22. HOSTPYTHON=./hostpython \
  23. HOSTPGEN=./Parser/hostpgen
  24. CONFIGURE_ENV+= OPT="$(TARGET_CFLAGS)" \
  25. ac_cv_have_long_long_format=yes
  26. CONFIGURE_ARGS:= --with-threads \
  27. --disable-toolbox-glue \
  28. --with-system-ffi \
  29. --without-cxx-main
  30. post-extract:
  31. $(CP) ./files/posixmodule.c ${WRKBUILD}/Modules/posixmodule.c
  32. $(CP) ./files/python-config.in ${WRKBUILD}/Misc/python-config.in
  33. (cd ${WRKBUILD}; rm -rf config.{cache,status} ; \
  34. OPT="$(CFLAGS_FOR_BUILD)" \
  35. ./configure --without-cxx-main --without-threads \
  36. --prefix=$(STAGING_HOST_DIR)/usr \
  37. );
  38. $(MAKE) -C ${WRKBUILD} python Parser/pgen
  39. $(MAKE) -C ${WRKBUILD} install
  40. ${CP} ${WRKBUILD}/Parser/pgen ${STAGING_HOST_DIR}/usr/bin/pgen
  41. ${CP} ${WRKBUILD}/python ${STAGING_HOST_DIR}/usr/bin/hostpython
  42. ${CP} ${WRKBUILD}/Parser/pgen ${WRKBUILD}/Parser/hostpgen
  43. ${CP} ${WRKBUILD}/python ${WRKBUILD}/hostpython
  44. $(MAKE) -C ${WRKBUILD} clean
  45. pre-configure:
  46. $(SED) "s#@@CPU_ARCH@@#$(CPU_ARCH)#" ${WRKBUILD}/configure
  47. post-install:
  48. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib
  49. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/lib/python2.7
  50. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/include/python2.7
  51. ${INSTALL_BIN} ${WRKINST}/usr/bin/python ${IDIR_PYTHON2}/usr/bin
  52. ${CP} ${WRKINST}/usr/lib/libpython*.so* ${IDIR_PYTHON2}/usr/lib
  53. ${CP} ${WRKINST}/usr/lib/python2.7/* ${IDIR_PYTHON2}/usr/lib/python2.7
  54. ${CP} ${WRKINST}/usr/include/python2.7/* ${IDIR_PYTHON2}/usr/include/python2.7
  55. -find ${IDIR_PYTHON2} -name "\*.pyc" -o -name "*\.pyo" -exec rm {} \;
  56. # workaround, copy host python-config to target scripts directory
  57. ${CP} ${STAGING_HOST_DIR}/usr/bin/python*-config ${STAGING_DIR}/scripts
  58. include ${TOPDIR}/mk/pkg-bottom.mk