Annotation of pkgsrc/lang/python311/Makefile, revision 1.36

1.36    ! riastrad    1: # $NetBSD: Makefile,v 1.35 2024/12/05 07:51:12 adam Exp $
1.1       adam        2: 
1.36    ! riastrad    3: PKGREVISION=   1
1.1       adam        4: .include "dist.mk"
                      5: 
                      6: PKGNAME=       python311-${PY_DISTVERSION}
                      7: CATEGORIES=    lang python
                      8: 
                      9: MAINTAINER=    pkgsrc-users@NetBSD.org
                     10: HOMEPAGE=      https://www.python.org/
                     11: COMMENT=       Interpreted, interactive, object-oriented programming language
                     12: LICENSE=       python-software-foundation
                     13: 
                     14: CONFLICTS+=    python-[0-9]*
1.12      wiz        15: CONFLICTS+=    py311-cElementTree-[0-9]*
                     16: CONFLICTS+=    py311-curses-[0-9]*
                     17: CONFLICTS+=    py311-cursespanel-[0-9]*
                     18: CONFLICTS+=    py311-expat-[0-9]*
                     19: CONFLICTS+=    py311-readline-[0-9]*
                     20: CONFLICTS+=    py311-sqlite3-[0-9]*
1.13      wiz        21: SUPERSEDES+=   py311-cElementTree-[0-9]*
                     22: SUPERSEDES+=   py311-curses-[0-9]*
                     23: SUPERSEDES+=   py311-cursespanel-[0-9]*
                     24: SUPERSEDES+=   py311-expat-[0-9]*
                     25: SUPERSEDES+=   py311-readline-[0-9]*
                     26: SUPERSEDES+=   py311-sqlite3-[0-9]*
1.1       adam       27: 
                     28: PLIST_AWK=             -f ${PKGSRCDIR}/lang/python/plist-python.awk
                     29: PLIST_AWK_ENV+=                PYVERS=311
                     30: PRINT_PLIST_AWK+=      /^[^@]/ && /[^\/]+\.pyc$$/ {
                     31: PRINT_PLIST_AWK+=      sub(/__pycache__\//, "")
                     32: PRINT_PLIST_AWK+=      sub(/\.cpython-311/, "")}
                     33: PRINT_PLIST_AWK+=      /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ {
                     34: PRINT_PLIST_AWK+=      sub(/.opt-[12].pyc$$/, ".pyo")}
                     35: 
                     36: USE_LANGUAGES=         c c++
                     37: USE_TOOLS+=            pkg-config
1.17      nia        38: USE_CC_FEATURES+=      c11
1.1       adam       39: GNU_CONFIGURE=         yes
                     40: CONFIGURE_ARGS+=       --enable-shared
                     41: CONFIGURE_ARGS+=       --with-openssl=${BUILDLINK_PREFIX.openssl}
1.14      wiz        42: CONFIGURE_ARGS+=       --with-system-expat
1.1       adam       43: CONFIGURE_ARGS+=       --with-system-ffi
                     44: CONFIGURE_ARGS+=       --without-ensurepip
                     45: CONFIGURE_ENV+=                OPT=${CFLAGS:M*:Q}
                     46: CONFIGURE_ENV+=                ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
                     47: PKGCONFIG_OVERRIDE+=   Misc/python.pc.in Misc/python-embed.pc.in
                     48: 
1.29      cheusov    49: PTHREAD_OPTS+= require
                     50: .include "../../mk/pthread.buildlink3.mk"
                     51: 
                     52: .include "../../mk/bsd.prefs.mk"
                     53: 
1.12      wiz        54: # NetBSD-8 curses has enough support for py-curses
1.16      wiz        55: USE_CURSES=            getsyx wide
1.12      wiz        56: # But we build as ncurses still to get the full feature set easily
1.29      cheusov    57: .if ${OPSYS} == "NetBSD"
1.12      wiz        58: FAKE_NCURSES=          yes
1.29      cheusov    59: .endif
1.1       adam       60: 
1.4       wiz        61: .if ${USE_CROSS_COMPILE:U:tl} == yes
1.1       adam       62: TOOL_DEPENDS+=         ${PKGNAME}:../../${PKGPATH}
1.8       riastrad   63: CONFIGURE_ARGS+=       --with-build-python=${TOOLBASE:Q}/bin/python3.11
1.1       adam       64: CONFIGURE_ARGS+=       MACHDEP=${PY_PLATNAME}
                     65: CONFIGURE_ARGS+=       \
                     66:        _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
                     67: CONFIGURE_ARGS+=       ac_sys_system=${OPSYS}
                     68: .  if ${OPSYS} == "OSF1"
                     69: CONFIGURE_ARGS+=       ac_cv_buggy_getaddrinfo=true
                     70: .  else
                     71: CONFIGURE_ARGS+=       ac_cv_buggy_getaddrinfo=false
                     72: .  endif
                     73: CONFIGURE_ARGS.NetBSD+=        ac_cv_file__dev_ptmx=yes
                     74: CONFIGURE_ARGS.NetBSD+=        ac_cv_file__dev_ptc=no
                     75: .endif
                     76: 
1.25      tsutsui    77: .if ${MACHINE_ARCH} == "vax"
                     78: # XXX "checking whether float word ordering is bigendian... unknown"
                     79: CONFIGURE_ARGS+=       ax_cv_c_float_words_bigendian=no
                     80: .endif
                     81: 
1.1       adam       82: # http://bugs.python.org/issue13241
1.5       jperkin    83: .if ${MACHINE_PLATFORM:MDarwin-1[12].*}
1.1       adam       84: PKGSRC_COMPILER=       clang
                     85: PKG_CC=                        clang
                     86: PKG_CXX=               clang++
                     87: .endif
                     88: 
                     89: # Used in socketmodule.c to determine if a sethostname declaration is required
                     90: CFLAGS.SunOS+=         -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION}
                     91: LIBS.SunOS+=           -lrt    # fdatasync()
                     92: .if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
                     93: SUBST_CLASSES+=                setup
                     94: SUBST_MESSAGE.setup=   Replacing crypt with crypt_i
                     95: SUBST_STAGE.setup=     pre-configure
                     96: SUBST_FILES.setup=     setup.py
                     97: SUBST_SED.setup=       -e "s,'crypt','crypt_i',"
                     98: .endif
                     99: 
                    100: PY_VER_SUFFIX=         3.11
                    101: 
                    102: .if ${OPSYS} == "Darwin"
                    103: USE_TOOLS+=    gmake
                    104: .endif
1.7       riastrad  105: 
                    106: .include "platname.mk"
1.1       adam      107: PLIST_SUBST+=  PY_PLATNAME=${PY_PLATNAME:Q}
                    108: 
                    109: # For Xcode 5 and up, we need to search the SDK path for headers, otherwise
                    110: # certain modules will not be built.
                    111: .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
                    112: CFLAGS+=       -I${OSX_SDK_PATH:Q}/usr/include
                    113: .endif
                    114: 
1.2       jperkin   115: LDFLAGS.SunOS+=        -lresolv
                    116: 
1.28      cheusov   117: PLIST_VARS+=   nis
1.1       adam      118: .for incdir in ${_OPSYS_INCLUDE_DIRS}
1.23      thor      119: .  if exists(${incdir}/rpc/rpc.h)
                    120: HAVE_RPC_H=    yes
                    121: .  elif exists(${incdir}/tirpc/rpc/rpc.h)
                    122: CPPFLAGS+=     -I${incdir}/tirpc
1.1       adam      123: HAVE_RPC_H=    yes
                    124: .  endif
1.23      thor      125: .  if exists(${incdir}/rpcsvc/yp_prot.h)
                    126: HAVE_YP_PROT_H=        yes
                    127: .  elif exists(${incdir}/nsl/rpcsvc/yp_prot.h)
                    128: CPPFLAGS+=     -I${incdir}/nsl
1.1       adam      129: HAVE_YP_PROT_H=        yes
                    130: .  endif
                    131: .endfor
                    132: .if (${HAVE_RPC_H:Uno} == yes && ${HAVE_YP_PROT_H:Uno} == yes)
                    133: PLIST.nis=     yes
                    134: .endif
                    135: 
                    136: PLIST_SUBST+=  PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
                    137: 
                    138: PRINT_PLIST_AWK+=      { gsub(/${PY_PLATNAME}/, "$${PY_PLATNAME}") }
                    139: PRINT_PLIST_AWK+=      { gsub(/python${PY_VER_SUFFIX}/, \
                    140:                                "python$${PY_VER_SUFFIX}") }
                    141: 
                    142: TEST_TARGET=   test
                    143: INSTALL_TARGET=        altinstall
                    144: 
                    145: REPLACE_INTERPRETER+=  python
                    146: REPLACE.python.old=    .*python[^ ]*
                    147: REPLACE.python.new=    ${PREFIX}/bin/python${PY_VER_SUFFIX}
                    148: REPLACE_FILES.python+= Lib/base64.py
                    149: REPLACE_FILES.python+= Lib/cProfile.py
                    150: REPLACE_FILES.python+= Lib/cgi.py
                    151: REPLACE_FILES.python+= Lib/encodings/rot_13.py
                    152: REPLACE_FILES.python+= Lib/idlelib/pyshell.py
                    153: REPLACE_FILES.python+= Lib/lib2to3/pgen2/token.py
                    154: REPLACE_FILES.python+= Lib/lib2to3/tests/data/different_encoding.py
                    155: REPLACE_FILES.python+= Lib/lib2to3/tests/data/false_encoding.py
                    156: REPLACE_FILES.python+= Lib/lib2to3/tests/pytree_idempotency.py
                    157: REPLACE_FILES.python+= Lib/pdb.py
                    158: REPLACE_FILES.python+= Lib/platform.py
                    159: REPLACE_FILES.python+= Lib/profile.py
                    160: REPLACE_FILES.python+= Lib/pydoc.py
                    161: REPLACE_FILES.python+= Lib/quopri.py
                    162: REPLACE_FILES.python+= Lib/smtpd.py
                    163: REPLACE_FILES.python+= Lib/smtplib.py
                    164: REPLACE_FILES.python+= Lib/tabnanny.py
                    165: REPLACE_FILES.python+= Lib/tarfile.py
                    166: REPLACE_FILES.python+= Lib/test/bisect_cmd.py
                    167: REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py
                    168: REPLACE_FILES.python+= Lib/test/curses_tests.py
                    169: REPLACE_FILES.python+= Lib/test/re_tests.py
                    170: REPLACE_FILES.python+= Lib/test/regrtest.py
                    171: REPLACE_FILES.python+= Lib/timeit.py
                    172: REPLACE_FILES.python+= Lib/trace.py
                    173: REPLACE_FILES.python+= Lib/turtledemo/__main__.py
                    174: REPLACE_FILES.python+= Lib/turtledemo/bytedesign.py
                    175: REPLACE_FILES.python+= Lib/turtledemo/clock.py
                    176: REPLACE_FILES.python+= Lib/turtledemo/forest.py
                    177: REPLACE_FILES.python+= Lib/turtledemo/fractalcurves.py
                    178: REPLACE_FILES.python+= Lib/turtledemo/lindenmayer.py
                    179: REPLACE_FILES.python+= Lib/turtledemo/minimal_hanoi.py
                    180: REPLACE_FILES.python+= Lib/turtledemo/paint.py
                    181: REPLACE_FILES.python+= Lib/turtledemo/peace.py
                    182: REPLACE_FILES.python+= Lib/turtledemo/penrose.py
                    183: REPLACE_FILES.python+= Lib/turtledemo/planet_and_moon.py
                    184: REPLACE_FILES.python+= Lib/turtledemo/sorting_animate.py
                    185: REPLACE_FILES.python+= Lib/turtledemo/tree.py
                    186: REPLACE_FILES.python+= Lib/turtledemo/yinyang.py
                    187: REPLACE_FILES.python+= Lib/uu.py
                    188: REPLACE_FILES.python+= Lib/webbrowser.py
                    189: 
                    190: # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib
                    191: # Test: python -c 'from ctypes.util import find_library; print(find_library("ffi"));'
                    192: SUBST_CLASSES+=                findlib
                    193: SUBST_MESSAGE.findlib= Fixing find_library().
                    194: SUBST_STAGE.findlib=   pre-configure
                    195: SUBST_FILES.findlib=   Lib/ctypes/macholib/dyld.py
                    196: SUBST_FILES.findlib+=  Lib/ctypes/util.py
                    197: SUBST_FILES.findlib+=  Lib/distutils/unixccompiler.py
                    198: SUBST_SED.findlib=     -e 's,/usr/local,${PREFIX},'
                    199: SUBST_SED.findlib+=    -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
                    200: SUBST_NOOP_OK.findlib= yes
                    201: 
                    202: SUBST_CLASSES+=                pkgversion
                    203: SUBST_STAGE.pkgversion=        pre-configure
                    204: SUBST_FILES.pkgversion=        Lib/lib2to3/pgen2/driver.py
                    205: SUBST_VARS.pkgversion= PKGVERSION_NOREV
                    206: 
                    207: .include "options.mk"
                    208: 
                    209: CHECK_INTERPRETER_SKIP=                lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
                    210: CHECK_INTERPRETER_SKIP+=       lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_z64
                    211: CHECK_INTERPRETER_SKIP+=       lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_zip
                    212: CHECK_INTERPRETER_SKIP+=       lib/python${PY_VER_SUFFIX}/test/ziptestdata/header.sh
                    213: 
                    214: # contain CONFIGURE_ARGS and CONFIGURE_ENV
                    215: CHECK_WRKREF_SKIP+=    lib/python${PY_VER_SUFFIX}/_sysconfigdata*
                    216: CHECK_WRKREF_SKIP+=    lib/python${PY_VER_SUFFIX}/__pycache__/_sysconfigdata*
                    217: CHECK_WRKREF_SKIP+=    lib/python${PY_VER_SUFFIX}/config-${PY_VER_SUFFIX}/Makefile
                    218: 
                    219: # Avoid error: Cannot generate ./Include/opcode.h, python not found !
                    220: post-configure:
                    221:        touch ${WRKSRC}/Include/opcode.h
                    222: 
                    223: .if ${OPSYS} == "HPUX"
                    224: post-install: hpux-postinstall
                    225: .PHONY: hpux-postinstall
                    226: hpux-postinstall:
                    227:        ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.11.sl \
                    228:                ${DESTDIR}${PREFIX}/lib/libpython3.11.sl.1.0
                    229: .endif
                    230: 
                    231: INSTALLATION_DIRS+=    lib/python${PY_VER_SUFFIX}/site-packages
                    232: 
                    233: pre-install: setuptools-preinstall
                    234: .PHONY: setuptools-preinstall
                    235: setuptools-preinstall:
                    236:        ${INSTALL_DATA} ${.CURDIR}/../../devel/py-setuptools/files/_distutils_system_mod \
                    237:                ${DESTDIR}${PREFIX}/lib/python${PY_VER_SUFFIX}/site-packages/_distutils_system_mod.py
                    238: 
1.28      cheusov   239: .if ${OPSYS} == "Linux"
                    240: .include "../../databases/gdbm_compat/buildlink3.mk"
                    241: .endif
1.1       adam      242: .include "../../archivers/bzip2/buildlink3.mk"
                    243: .include "../../archivers/xz/buildlink3.mk"
1.12      wiz       244: .include "../../databases/sqlite3/buildlink3.mk"
1.10      schmonz   245: .if ${USE_BUILTIN.gettext:U:tl} == no
                    246: CONFIGURE_ENV+=                ac_cv_lib_intl_textdomain=yes
                    247: .endif
1.1       adam      248: .include "../../devel/libffi/buildlink3.mk"
                    249: .include "../../devel/libuuid/buildlink3.mk"
                    250: .include "../../devel/zlib/buildlink3.mk"
                    251: .include "../../security/openssl/buildlink3.mk"
1.12      wiz       252: .include "../../textproc/expat/buildlink3.mk"
1.1       adam      253: .include "../../mk/bdb.buildlink3.mk"
1.12      wiz       254: .include "../../mk/curses.buildlink3.mk"
1.1       adam      255: .include "../../mk/dlopen.buildlink3.mk"
                    256: .include "../../mk/oss.buildlink3.mk"
                    257: .include "../../mk/bsd.pkg.mk"

CVSweb <webmaster@jp.NetBSD.org>