Makefile 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 ${ADK_TOPDIR}/rules.mk
  4. PKG_NAME:= python2
  5. PKG_VERSION:= 2.7.5
  6. PKG_RELEASE:= 12
  7. PKG_HASH:= 8e1b5fa87b91835afb376a9c0d319d41feca07ffebc0288d97ab08d64f48afbf
  8. PKG_DESCR:= python scripting language (Version 2)
  9. PKG_SECTION:= dev/lang
  10. PKG_BUILDDEP:= libffi python2-host
  11. HOST_BUILDDEP:= libffi-host bzip2-host
  12. PKG_DEPENDS:= libpthread libffi
  13. PKG_URL:= http://www.python.org/
  14. PKG_SITES:= http://www.python.org/ftp/python/${PKG_VERSION}/
  15. PKG_OPTS:= dev
  16. PKG_HOST_DEPENDS:= !netbsd !openbsd
  17. DISTFILES:= Python-${PKG_VERSION}.tgz
  18. WRKDIST= ${WRKDIR}/Python-${PKG_VERSION}
  19. PKG_FLAVOURS_PYTHON2:= MOD_ZLIB MOD_BZ2 MOD_EXPAT MOD_SQLITE MOD_GDBM
  20. PKG_FLAVOURS_PYTHON2+= MOD_NCURSES MOD_SSL MOD_READLINE
  21. PKGFD_MOD_ZLIB:= ZLIB support
  22. PKGFB_MOD_ZLIB:= zlib
  23. PKGFS_MOD_ZLIB:= zlib
  24. PKGFD_MOD_BZ2:= BZIP2 support
  25. PKGFB_MOD_BZ2:= bzip2
  26. PKGFS_MOD_BZ2:= libbz2
  27. PKGFD_MOD_EXPAT:= XML support
  28. PKGFB_MOD_EXPAT:= expat
  29. PKGFS_MOD_EXPAT:= libexpat
  30. PKGFD_MOD_SQLITE:= SQLITE support
  31. PKGFB_MOD_SQLITE:= sqlite
  32. PKGFS_MOD_SQLITE:= libsqlite
  33. PKGFD_MOD_GDBM:= GDBM support
  34. PKGFB_MOD_GDBM:= gdbm
  35. PKGFS_MOD_GDBM:= libgdbm
  36. PKGFD_MOD_NCURSES:= NCURSES support
  37. PKGFB_MOD_NCURSES:= ncurses
  38. PKGFS_MOD_NCURSES:= libncurses
  39. PKGFD_MOD_READLINE:= READLINE support
  40. PKGFB_MOD_READLINE:= readline
  41. PKGFS_MOD_READLINE:= libreadline
  42. PKGFD_MOD_SSL:= OpenSSL support
  43. PKGFB_MOD_SSL:= openssl
  44. PKGFS_MOD_SSL:= libopenssl
  45. include ${ADK_TOPDIR}/mk/host.mk
  46. include ${ADK_TOPDIR}/mk/package.mk
  47. $(eval $(call HOST_template,PYTHON2,python2,${PKG_VERSION}-${PKG_RELEASE}))
  48. $(eval $(call PKG_template,PYTHON2,python2,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  49. define PKG_mod_template
  50. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  51. ${2}-install:
  52. echo foo $(1)
  53. ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/python2.7/lib-dynload
  54. for m in ${2}; do \
  55. ${INSTALL_DATA} $(WRKINST)/usr/lib/python2.7/lib-dynload/$$$${m}*.so $$(IDIR_$(1))/usr/lib/python2.7/lib-dynload ;\
  56. done
  57. endef
  58. $(eval $(call PKG_template,PYTHON2_MOD_ZLIB,python2-mod-zlib,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_ZLIB},${PKGFD_MOD_ZLIB},${PKG_SECTION}))
  59. $(eval $(call PKG_template,PYTHON2_MOD_BZ2,python2-mod-bz2,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_BZ2},${PKGFD_MOD_BZ2},${PKG_SECTION}))
  60. $(eval $(call PKG_template,PYTHON2_MOD_EXPAT,python2-mod-expat,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_EXPAT},${PKGFD_MOD_EXPAT},${PKG_SECTION}))
  61. $(eval $(call PKG_template,PYTHON2_MOD_SQLITE,python2-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_SQLITE},${PKGFD_MOD_SQLITE},${PKG_SECTION}))
  62. $(eval $(call PKG_template,PYTHON2_MOD_GDBM,python2-mod-gdbm,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_GDBM},${PKGFD_MOD_GDBM},${PKG_SECTION}))
  63. $(eval $(call PKG_template,PYTHON2_MOD_NCURSES,python2-mod-ncurses,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_NCURSES},${PKGFD_MOD_NCURSES},${PKG_SECTION}))
  64. $(eval $(call PKG_template,PYTHON2_MOD_SSL,python2-mod-ssl,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_SSL},${PKGFD_MOD_SSL},${PKG_SECTION}))
  65. $(eval $(call PKG_template,PYTHON2_MOD_READLINE,python2-mod-readline,$(PKG_VERSION)-${PKG_RELEASE},${PKGFS_MOD_READLINE},${PKGFD_MOD_READLINE},${PKG_SECTION}))
  66. $(eval $(call PKG_mod_template,PYTHON2_MOD_ZLIB,zlib))
  67. $(eval $(call PKG_mod_template,PYTHON2_MOD_BZ2,bz2))
  68. $(eval $(call PKG_mod_template,PYTHON2_MOD_EXPAT,pyexpat))
  69. $(eval $(call PKG_mod_template,PYTHON2_MOD_SQLITE,_sqlite))
  70. $(eval $(call PKG_mod_template,PYTHON2_MOD_GDBM,gdbm))
  71. $(eval $(call PKG_mod_template,PYTHON2_MOD_NCURSES,_curses))
  72. $(eval $(call PKG_mod_template,PYTHON2_MOD_SSL,_ssl))
  73. $(eval $(call PKG_mod_template,PYTHON2_MOD_READLINE,readline))
  74. HOST_CFLAGS+= -fPIC
  75. AUTOTOOL_STYLE:= autoreconf
  76. MAKE_ENV+= HOSTPGEN=$(STAGING_HOST_DIR)/usr/bin/pgen
  77. CONFIGURE_ENV+= ac_cv_have_long_long_format=yes \
  78. ac_cv_file__dev_ptmx=yes \
  79. ac_cv_file__dev_ptc=no
  80. CONFIGURE_ARGS:= --with-threads \
  81. --disable-ipv6 \
  82. --disable-toolbox-glue \
  83. --with-system-ffi \
  84. --without-cxx-main
  85. HOST_CONFIGURE_ENV+= MACOSX_DEPLOYMENT_TARGET=10.9
  86. HOST_CONFIGURE_ARGS+= --with-threads \
  87. --disable-ipv6 \
  88. --disable-shared \
  89. --disable-toolbox-glue \
  90. --without-cxx-main
  91. hostpre-configure:
  92. $(CP) $(ADK_TOPDIR)/package/python2/files/patch-Lib_distutils_sysconfig_py $(WRKBUILD)
  93. $(SED) "s#@@STAGING_TARGET_DIR@@#$(STAGING_TARGET_DIR)#" $(WRKBUILD)/patch-Lib_distutils_sysconfig_py
  94. $(SED) "s#@@STAGING_HOST_DIR@@#$(STAGING_HOST_DIR)#" $(WRKBUILD)/patch-Lib_distutils_sysconfig_py
  95. (cd $(WRKBUILD) && ${PATCHP0} < patch-Lib_distutils_sysconfig_py)
  96. $(SED) "s#@EXENAME@#$(STAGING_HOST_DIR)/usr/bin/python#" \
  97. $(WRKBUILD)/Misc/python-config.in
  98. hostpost-install:
  99. $(INSTALL_BIN) ${WRKBUILD}/Parser/pgen \
  100. $(STAGING_HOST_DIR)/usr/bin/pgen
  101. $(CP) $(ADK_TOPDIR)/package/python2/files/python-config.patch $(WRKBUILD)/
  102. $(SED) "s#@@STAGING_TARGET_DIR@@#$(STAGING_TARGET_DIR)#" $(WRKBUILD)/python-config.patch
  103. $(SED) "s#@@STAGING_HOST_DIR@@#$(STAGING_HOST_DIR)#" $(WRKBUILD)/python-config.patch
  104. (cd $(STAGING_HOST_DIR)/usr/bin && \
  105. ${PATCHP0} < $(WRKBUILD)/python-config.patch)
  106. pre-configure:
  107. $(CP) $(ADK_TOPDIR)/package/python2/files/patch-Lib_distutils_sysconfig_py $(WRKBUILD)
  108. $(SED) "s#@@STAGING_TARGET_DIR@@#$(STAGING_TARGET_DIR)#" $(WRKBUILD)/patch-Lib_distutils_sysconfig_py
  109. $(SED) "s#@@STAGING_HOST_DIR@@#$(STAGING_HOST_DIR)#" $(WRKBUILD)/patch-Lib_distutils_sysconfig_py
  110. (cd $(WRKBUILD) && ${PATCHP0} <$(WRKBUILD)/patch-Lib_distutils_sysconfig_py)
  111. $(SED) "s#@EXENAME@#$(STAGING_HOST_DIR)/usr/bin/python#" \
  112. $(WRKBUILD)/Misc/python-config.in
  113. python2-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  114. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib
  115. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/lib/python2.7
  116. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/include/python2.7
  117. ${INSTALL_BIN} ${WRKINST}/usr/bin/python ${IDIR_PYTHON2}/usr/bin
  118. ${CP} ${WRKINST}/usr/lib/libpython*.so* ${IDIR_PYTHON2}/usr/lib
  119. ${CP} ${WRKINST}/usr/lib/python2.7/* ${IDIR_PYTHON2}/usr/lib/python2.7
  120. ${CP} ${WRKINST}/usr/include/python2.7/pyconfig.h \
  121. ${IDIR_PYTHON2}/usr/include/python2.7
  122. @-for i in zlib bz2 _curses _ssl gdbm _sqlite pyexpat readline; do \
  123. rm ${IDIR_PYTHON2}/usr/lib/python2.7/lib-dynload/$${i}*so; \
  124. done
  125. include ${ADK_TOPDIR}/mk/host-bottom.mk
  126. include ${ADK_TOPDIR}/mk/pkg-bottom.mk