Makefile.inc 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. # $OpenBSD: Makefile.inc,v 1.122 2017/04/10 11:46:22 sthen Exp $
  2. # IMPORTANT! If you make any changes to the Python ports, be sure
  3. # to also update files/CHANGES.OpenBSD for your change. This is a
  4. # requirement of the PSF license, if it constitutes a change to
  5. # Python itself.
  6. COMMENT-main = interpreted object-oriented programming language
  7. COMMENT-bsddb = Berkeley db module for Python
  8. COMMENT-gdbm = GNU dbm module for Python
  9. COMMENT-idle = IDE for Python
  10. COMMENT-tests = Python test suite
  11. COMMENT-tkinter = tk GUI module for Python
  12. COMMENT-tools = extra tools for Python
  13. DISTNAME = Python-${VERSION}${PATCHLEVEL}
  14. PKGNAME-main = python-${VERSION}${PATCHLEVEL}
  15. PKGSPEC-main = python-${VERSION_SPEC}
  16. PKGNAME-bsddb = python-bsddb-${VERSION}${PATCHLEVEL}
  17. PKGSPEC-bsddb = python-bsddb-${VERSION_SPEC}
  18. PKGNAME-gdbm = python-gdbm-${VERSION}${PATCHLEVEL}
  19. PKGSPEC-gdbm = python-gdbm-${VERSION_SPEC}
  20. PKGNAME-idle = python-idle-${VERSION}${PATCHLEVEL}
  21. PKGSPEC-idle = python-idle-${VERSION_SPEC}
  22. PKGNAME-tests = python-tests-${VERSION}${PATCHLEVEL}
  23. PKGSPEC-tests = python-tests-${VERSION_SPEC}
  24. PKGNAME-tkinter = python-tkinter-${VERSION}${PATCHLEVEL}
  25. PKGSPEC-tkinter = python-tkinter-${VERSION_SPEC}
  26. PKGNAME-tools = python-tools-${VERSION}${PATCHLEVEL}
  27. PKGSPEC-tools = python-tools-${VERSION_SPEC}
  28. CATEGORIES = lang
  29. MASTER_SITES = http://www.python.org/ftp/${PSUBDIR}/ \
  30. http://sunsite.informatik.rwth-aachen.de/python/ftp/${PSUBDIR}/
  31. PSUBDIR ?= python/${VERSION}${PATCHLEVEL}
  32. EXTRACT_SUFX = .tgz
  33. HOMEPAGE = http://www.python.org/
  34. MAINTAINER = Remi Pointel <rpointel@openbsd.org>
  35. # PSF license <http://www.python.org/${VERSION}/license.html>
  36. # A summary of changes to Python is required to be distributed
  37. PERMIT_PACKAGE_CDROM = Yes
  38. .if ${VERSION} == "2.7"
  39. LIB_SUFX =
  40. MULTI_PACKAGES = -main -tests -tools -gdbm -idle -tkinter -bsddb
  41. .else
  42. LIB_SUFX = m
  43. MULTI_PACKAGES = -main -tests -gdbm -idle -tkinter
  44. .endif
  45. # Python 2.7 lists BSD db 4.6.x as unstable on most architectures (see
  46. # setup.py:allow_db_version). XXX revisit if databases/db/v4 is updated to 4.7
  47. .if ${VERSION} == "2.7"
  48. ONLY_FOR_ARCHS-bsddb= amd64 i386
  49. .endif
  50. # All subpackages depend on the main python package.
  51. RUN_DEPENDS = ${FULLPKGNAME-main}:lang/python/${VERSION},-main
  52. LIB_DEPENDS =
  53. LIB_DEPENDS-main = archivers/bzip2 \
  54. databases/sqlite3 \
  55. devel/libffi \
  56. devel/gettext
  57. RUN_DEPENDS-main =
  58. WANTLIB-main = bz2 c crypto expat ffi intl m ncursesw panelw pthread \
  59. readline sqlite3 ssl ${LIBCXX} util z
  60. .if ${VERSION} != "2.7"
  61. LIB_DEPENDS-main += archivers/xz
  62. WANTLIB-main += lzma
  63. .endif
  64. WANTLIB-tests =
  65. WANTLIB-tools =
  66. LIB_DEPENDS-bsddb = lang/python/${VERSION},-main
  67. .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
  68. # XXX recursion: if we have java, then db/v4 depends on libxml
  69. LIB_DEPENDS-bsddb += databases/db/v4,no_tcl,no_java,bootstrap
  70. .else
  71. LIB_DEPENDS-bsddb += databases/db/v4
  72. .endif
  73. WANTLIB-bsddb = lib/db4/db>=4 pthread python${VERSION}${LIB_SUFX}
  74. LIB_DEPENDS-gdbm = databases/gdbm \
  75. lang/python/${VERSION},-main
  76. WANTLIB-gdbm = gdbm>=3 pthread python${VERSION}${LIB_SUFX}
  77. RUN_DEPENDS-idle = lang/python/${VERSION},-tkinter \
  78. ${RUN_DEPENDS}
  79. WANTLIB-idle =
  80. MODULES += x11/tk
  81. # Tcl/Tk version needs to be in sync with patch-setup_py's one
  82. MODTK_VERSION = 8.5
  83. LIB_DEPENDS-tkinter = lang/python/${VERSION},-main \
  84. ${MODTK_LIB_DEPENDS}
  85. WANTLIB-tkinter = X11 pthread python${VERSION}${LIB_SUFX} \
  86. ${MODTK_WANTLIB}
  87. AUTOCONF_VERSION = 2.69
  88. CONFIGURE_STYLE = autoconf
  89. CONFIGURE_ARGS += --enable-shared
  90. # --srcdir is needed for systrace to work correctly
  91. CONFIGURE_ARGS += --srcdir=${WRKSRC} \
  92. --with-fpectl \
  93. --with-threads \
  94. --enable-ipv6 \
  95. --with-system-expat \
  96. --with-system-ffi
  97. CONFIGURE_ENV += OPT='${CFLAGS} -fPIC' CPPFLAGS='-I${LOCALBASE}/include' \
  98. LDFLAGS='-L${LOCALBASE}/lib/' SVNVERSION=no \
  99. LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
  100. MAKE_ENV += LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
  101. MAKE_FLAGS += LD_LIBRARY_PATH=${WRKSRC} PATH="${WRKDIST}:${PORTPATH}"
  102. MAKE_FLAGS += LDFLAGS='-L${WRKSRC}'
  103. FAKE_FLAGS += RANLIB=:
  104. # Python itself is clean, but some extensions e.g. py-cryptography
  105. # and QtWebKit require W|X mappings.
  106. USE_WXNEEDED = Yes
  107. .if ${VERSION} == "3.6"
  108. ALL_TARGET = all
  109. .else
  110. ALL_TARGET = all ./Lib/plat-openbsd6
  111. .endif
  112. post-extract:
  113. rm -r ${WRKDIST}/Modules/expat
  114. post-patch:
  115. ${SUBST_CMD} ${WRKSRC}/configure.ac
  116. post-configure:
  117. @cd ${WRKSRC} && ${MAKE_PROGRAM} Makefile
  118. ADJ_FILES = ${WRKSRC}/Tools/scripts/pydoc*
  119. .if ${VERSION} == "2.7"
  120. ADJ_FILES += ${WRKSRC}/Tools/scripts/2to3
  121. .endif
  122. post-build:
  123. perl -pi -e \
  124. 's@#! */usr/bin/env +python@#!${PREFIX}/bin/python${VERSION}@' \
  125. ${ADJ_FILES}
  126. post-install:
  127. .if ${VERSION} == "2.7"
  128. ${INSTALL_SCRIPT} ${WRKSRC}/Tools/scripts/pydoc \
  129. ${PREFIX}/bin/pydoc${VERSION}
  130. @sed -e "s,@VERSION@,${VERSION},g" -e "s,@LOCALBASE@,${LOCALBASE},g" \
  131. ${FILESDIR}/idle > ${WRKSRC}/idle
  132. ${INSTALL_SCRIPT} ${WRKSRC}/idle ${PREFIX}/bin/idle${VERSION}
  133. @cd ${WRKSRC}; tar -cf - Tools | (cd ${PREFIX}/lib/python${VERSION}; \
  134. tar -xf -)
  135. ${INSTALL_SCRIPT} ${WRKSRC}/Tools/scripts/2to3 \
  136. ${PREFIX}/bin/python${VERSION}-2to3
  137. .endif
  138. ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/python${VERSION}
  139. ${INSTALL_DATA} ${FILESDIR}/CHANGES.OpenBSD \
  140. ${PREFIX}/share/doc/python${VERSION}/CHANGES.OpenBSD
  141. TEST_TARGET= test
  142. TEST_FLAGS= "EXTRATESTOPTS=-w"
  143. # Some regress tests write to $HOME
  144. PORTHOME= ${WRKDIR}