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

1.27    ! adam        1: # $NetBSD: Makefile,v 1.26 2025/01/07 19:35:08 riastradh Exp $
1.1       adam        2: 
                      3: .include "dist.mk"
                      4: 
                      5: PKGNAME=       python312-${PY_DISTVERSION}
                      6: CATEGORIES=    lang python
                      7: 
                      8: MAINTAINER=    pkgsrc-users@NetBSD.org
                      9: HOMEPAGE=      https://www.python.org/
                     10: COMMENT=       Interpreted, interactive, object-oriented programming language
                     11: LICENSE=       python-software-foundation
                     12: 
                     13: CONFLICTS+=    python-[0-9]*
1.2       wiz        14: CONFLICTS+=    py312-cElementTree-[0-9]*
                     15: CONFLICTS+=    py312-curses-[0-9]*
                     16: CONFLICTS+=    py312-cursespanel-[0-9]*
                     17: CONFLICTS+=    py312-expat-[0-9]*
                     18: CONFLICTS+=    py312-readline-[0-9]*
                     19: CONFLICTS+=    py312-sqlite3-[0-9]*
1.3       wiz        20: SUPERSEDES+=   py312-cElementTree-[0-9]*
                     21: SUPERSEDES+=   py312-curses-[0-9]*
                     22: SUPERSEDES+=   py312-cursespanel-[0-9]*
                     23: SUPERSEDES+=   py312-expat-[0-9]*
                     24: SUPERSEDES+=   py312-readline-[0-9]*
                     25: SUPERSEDES+=   py312-sqlite3-[0-9]*
1.1       adam       26: 
                     27: PLIST_AWK=             -f ${PKGSRCDIR}/lang/python/plist-python.awk
                     28: PLIST_AWK_ENV+=                PYVERS=312
                     29: PRINT_PLIST_AWK+=      /^[^@]/ && /[^\/]+\.pyc$$/ {
                     30: PRINT_PLIST_AWK+=      sub(/__pycache__\//, "")
                     31: PRINT_PLIST_AWK+=      sub(/\.cpython-312/, "")}
                     32: PRINT_PLIST_AWK+=      /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ {
                     33: PRINT_PLIST_AWK+=      sub(/.opt-[12].pyc$$/, ".pyo")}
                     34: 
                     35: USE_LANGUAGES=         c c++
                     36: USE_TOOLS+=            pkg-config
1.7       nia        37: USE_CC_FEATURES+=      c11
1.1       adam       38: GNU_CONFIGURE=         yes
                     39: CONFIGURE_ARGS+=       --enable-shared
                     40: CONFIGURE_ARGS+=       --with-openssl=${BUILDLINK_PREFIX.openssl}
1.4       wiz        41: CONFIGURE_ARGS+=       --with-system-expat
1.1       adam       42: CONFIGURE_ARGS+=       --without-ensurepip
                     43: CONFIGURE_ENV+=                OPT=${CFLAGS:M*:Q}
                     44: CONFIGURE_ENV+=                ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
                     45: CONFIGURE_ENV+=                py_cv_module__gdbm="n/a"
1.2       wiz        46: # example module
1.1       adam       47: CONFIGURE_ENV+=                py_cv_module_xxlimited="n/a"
                     48: PKGCONFIG_OVERRIDE+=   Misc/python.pc.in Misc/python-embed.pc.in
                     49: 
1.2       wiz        50: # libpanelw seems to be a Linux thing?
                     51: SUBST_CLASSES+=                panel
                     52: SUBST_MESSAGE.panel=   Replacing panelw with panel.
                     53: SUBST_STAGE.panel=     pre-configure
                     54: SUBST_FILES.panel+=    configure
                     55: SUBST_SED.panel+=      -e "s,panelw,panel,"
                     56: 
1.1       adam       57: PTHREAD_OPTS+= require
                     58: .include "../../mk/pthread.buildlink3.mk"
                     59: 
                     60: .include "../../mk/bsd.prefs.mk"
                     61: 
1.16      cheusov    62: # NetBSD-8 curses has enough support for py-curses
                     63: USE_CURSES=            getsyx update_panels wide
                     64: # But we build as ncurses still to get the full feature set easily
                     65: .if ${OPSYS} == "NetBSD"
                     66: FAKE_NCURSES=          yes
                     67: .endif
                     68: 
1.26      riastrad   69: .if ${USE_CROSS_COMPILE:tl} == yes
1.1       adam       70: TOOL_DEPENDS+=         ${PKGNAME}:../../${PKGPATH}
1.25      riastrad   71: CONFIGURE_ARGS+=       \
                     72:        --with-build-python=${TOOLBASE:Q}/bin/python${PY_VER_SUFFIX}
1.1       adam       73: CONFIGURE_ARGS+=       MACHDEP=${PY_PLATNAME}
                     74: CONFIGURE_ARGS+=       \
                     75:        _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
                     76: CONFIGURE_ARGS+=       ac_sys_system=${OPSYS}
                     77: .  if ${OPSYS} == "OSF1"
                     78: CONFIGURE_ARGS+=       ac_cv_buggy_getaddrinfo=true
                     79: .  else
                     80: CONFIGURE_ARGS+=       ac_cv_buggy_getaddrinfo=false
                     81: .  endif
                     82: CONFIGURE_ARGS.NetBSD+=        ac_cv_file__dev_ptmx=yes
                     83: CONFIGURE_ARGS.NetBSD+=        ac_cv_file__dev_ptc=no
                     84: .endif
                     85: 
                     86: # http://bugs.python.org/issue13241
                     87: .if ${MACHINE_PLATFORM:MDarwin-1[12].*}
                     88: PKGSRC_COMPILER=       clang
                     89: PKG_CC=                        clang
                     90: PKG_CXX=               clang++
                     91: .endif
                     92: 
                     93: # Used in socketmodule.c to determine if a sethostname declaration is required
                     94: CFLAGS.SunOS+=         -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION}
                     95: LIBS.SunOS+=           -lrt    # fdatasync()
                     96: 
1.15      charlott   97: LIBS.DragonFly+=       -lcrypt
1.1       adam       98: LIBS.NetBSD+=          -lcrypt
                     99: 
                    100: PY_VER_SUFFIX=         3.12
                    101: 
                    102: .if ${OPSYS} == "Darwin"
                    103: USE_TOOLS+=    gmake
                    104: .endif
                    105: 
                    106: .include "platname.mk"
                    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: 
                    115: LDFLAGS.SunOS+=        -lresolv
                    116: 
1.16      cheusov   117: PLIST_VARS+=   nis tkinter
1.1       adam      118: .for incdir in ${_OPSYS_INCLUDE_DIRS}
1.13      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.13      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/pdb.py
                    155: REPLACE_FILES.python+= Lib/platform.py
                    156: REPLACE_FILES.python+= Lib/profile.py
                    157: REPLACE_FILES.python+= Lib/pydoc.py
                    158: REPLACE_FILES.python+= Lib/quopri.py
                    159: REPLACE_FILES.python+= Lib/smtplib.py
                    160: REPLACE_FILES.python+= Lib/tabnanny.py
                    161: REPLACE_FILES.python+= Lib/tarfile.py
                    162: REPLACE_FILES.python+= Lib/test/bisect_cmd.py
                    163: REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py
                    164: REPLACE_FILES.python+= Lib/test/curses_tests.py
                    165: REPLACE_FILES.python+= Lib/test/re_tests.py
                    166: REPLACE_FILES.python+= Lib/test/regrtest.py
1.14      adam      167: REPLACE_FILES.python+= Lib/test/support/smtpd.py
1.1       adam      168: REPLACE_FILES.python+= Lib/test/test_lib2to3/data/different_encoding.py
                    169: REPLACE_FILES.python+= Lib/test/test_lib2to3/data/false_encoding.py
                    170: REPLACE_FILES.python+= Lib/test/test_lib2to3/pytree_idempotency.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_SED.findlib=     -e 's,/usr/local,${PREFIX},'
                    198: SUBST_SED.findlib+=    -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
                    199: SUBST_NOOP_OK.findlib= yes
                    200: 
                    201: SUBST_CLASSES+=                pkgversion
                    202: SUBST_STAGE.pkgversion=        pre-configure
                    203: SUBST_FILES.pkgversion=        Lib/lib2to3/pgen2/driver.py
                    204: SUBST_VARS.pkgversion= PKGVERSION_NOREV
                    205: 
                    206: .include "options.mk"
                    207: 
                    208: CHECK_INTERPRETER_SKIP+=       lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_z64
                    209: CHECK_INTERPRETER_SKIP+=       lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_zip
                    210: CHECK_INTERPRETER_SKIP+=       lib/python${PY_VER_SUFFIX}/test/ziptestdata/header.sh
                    211: CHECK_INTERPRETER_SKIP+=       lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
                    212: 
                    213: # contain CONFIGURE_ARGS and CONFIGURE_ENV
                    214: CHECK_WRKREF_SKIP+=    lib/python${PY_VER_SUFFIX}/_sysconfigdata*
                    215: CHECK_WRKREF_SKIP+=    lib/python${PY_VER_SUFFIX}/__pycache__/_sysconfigdata*
                    216: CHECK_WRKREF_SKIP+=    lib/python${PY_VER_SUFFIX}/config-${PY_VER_SUFFIX}/Makefile
                    217: 
                    218: # Avoid error: Cannot generate ./Include/opcode.h, python not found !
                    219: post-configure:
                    220:        touch ${WRKSRC}/Include/opcode.h
                    221: 
                    222: .if ${OPSYS} == "HPUX"
                    223: post-install: hpux-postinstall
                    224: .PHONY: hpux-postinstall
                    225: hpux-postinstall:
                    226:        ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.12.sl \
                    227:                ${DESTDIR}${PREFIX}/lib/libpython3.12.sl.1.0
                    228: .endif
                    229: 
                    230: INSTALLATION_DIRS+=    lib/python${PY_VER_SUFFIX}/site-packages
                    231: 
                    232: pre-install: setuptools-preinstall
                    233: .PHONY: setuptools-preinstall
                    234: setuptools-preinstall:
                    235:        ${INSTALL_DATA} ${.CURDIR}/../../devel/py-setuptools/files/_distutils_system_mod \
                    236:                ${DESTDIR}${PREFIX}/lib/python${PY_VER_SUFFIX}/site-packages/_distutils_system_mod.py
                    237: 
1.16      cheusov   238: .if ${OPSYS} == "Linux"
                    239: .include "../../databases/gdbm_compat/buildlink3.mk"
                    240: .endif
1.1       adam      241: .include "../../archivers/bzip2/buildlink3.mk"
                    242: .include "../../archivers/xz/buildlink3.mk"
1.2       wiz       243: .include "../../databases/sqlite3/buildlink3.mk"
1.1       adam      244: .if ${USE_BUILTIN.gettext:U:tl} == no
                    245: CONFIGURE_ENV+=                ac_cv_lib_intl_textdomain=yes
                    246: .endif
                    247: .include "../../devel/libffi/buildlink3.mk"
                    248: .include "../../devel/libuuid/buildlink3.mk"
                    249: .include "../../devel/zlib/buildlink3.mk"
                    250: .include "../../security/openssl/buildlink3.mk"
1.2       wiz       251: .include "../../textproc/expat/buildlink3.mk"
1.1       adam      252: .include "../../mk/bdb.buildlink3.mk"
1.2       wiz       253: .include "../../mk/curses.buildlink3.mk"
1.1       adam      254: .include "../../mk/dlopen.buildlink3.mk"
                    255: .include "../../mk/oss.buildlink3.mk"
                    256: .include "../../mk/bsd.pkg.mk"

CVSweb <webmaster@jp.NetBSD.org>