Makefile 5.1 KB

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