Annotation of pkgsrc/lang/python312/Makefile, revision 1.33

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

CVSweb <webmaster@jp.NetBSD.org>