From nobody Tue Feb 28 05:44:50 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PQmXv4Zh7z3v0pt; Tue, 28 Feb 2023 05:45:03 +0000 (UTC) (envelope-from tcberner@gmail.com) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PQmXv0f8Jz4gyS; Tue, 28 Feb 2023 05:45:03 +0000 (UTC) (envelope-from tcberner@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf31.google.com with SMTP id y12so6125485qvt.8; Mon, 27 Feb 2023 21:45:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677563102; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1tA+9TGB80dK7swVEhnpHDssUY6JP9sTtmW/kgy4wiM=; b=CdVcuosMayn4tIS+m39yUVOSpl2ageZDiCd7k4m7oDlak5+2ExPpbiP2/kqJvPhO6V NTabGShZ6v7yGWdqBs1Z0IczKCHKT0XbcGVSHhxw7DzQetfxUYQUEA0NpiTxYPc8/AIc aukA5yILRAmxYGX7Q1UDXkVDePT5O6Qb1h0gTvGWJbjDeNvBL+z1xwukZgpfiVEwxSQq tk9G1lF5oBi5sdoarsNoBMfYct17XEwPYplEDsroFYar/s/gOJlsvsAcbdDoTjL1zCMQ RMeRJQcy3EsLCQuFUW9sr99fcvio2A2r7fhyVaUZ6Q+iopctULVU5P7P/ruVxgIKumox AF2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677563102; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1tA+9TGB80dK7swVEhnpHDssUY6JP9sTtmW/kgy4wiM=; b=2xDW9Cm+ym0fi1aKp7kRFFLenSUs7tJR5eIOduQ0AukGRRzUms5g+T+TGhlLvi7G4Y wpM8twV9pI7dBryT4E0e30ll2/O+WBYwpUDOtTJowFb/cQPL1VjUajCU+3bZqdwWfKpO YlrulM16u9m+hXmRFg5pbgXLG1GtoFJ7F8gbphanVgcWsU7ZK1Mtrj3MJTQb/dDt47Lm mcdoLctowIIRL+JXXobtlVHRDS/xFTosBpjuge4u7Sd73ZUfzJ/8q3+Y88MiVk3KwNzS HBn+ug0VStAfXTIx7UAgVxGK0nMT62gw1B6eAMEGmsKKQFfzOyAiPkMOMeljoEWc2dDB CS7g== X-Gm-Message-State: AO0yUKU8O9jqrELcjAG6qNgE71q7T9A7YLiO260LvVN9Wwp2dUftNxeH SGnRXB2DeaUVF4+LpijLYfmOT3hvFLsdNSHbBBLZVFW1 X-Google-Smtp-Source: AK7set/nmLZ1KGYBWqWLh2guH4s/kiLuGvybA43tv4VDiwfttoHHVn3XtCQfj+ih6ZnQ88I0EXYVZO25TOAOZE11n40= X-Received: by 2002:a05:6214:a03:b0:56e:9c1c:c64 with SMTP id dw3-20020a0562140a0300b0056e9c1c0c64mr496761qvb.6.1677563101684; Mon, 27 Feb 2023 21:45:01 -0800 (PST) List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 References: <202302272105.31RL593a014619@gitrepo.freebsd.org> In-Reply-To: <202302272105.31RL593a014619@gitrepo.freebsd.org> From: "Tobias C. Berner" Date: Tue, 28 Feb 2023 06:44:50 +0100 Message-ID: Subject: Re: git: a9d9d3a42723 - main - lang/python: Revert "add bytecode trigger" To: Matthias Andree Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4PQmXv0f8Jz4gyS X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Moin moin So you reverted the first major change to the python framework in ages due to a leaf-port breakin non-fatally? This looks a little bit like overstepping the bounds of good taste a bit to me. mfg Tobias On Mon, 27 Feb 2023 at 22:05, Matthias Andree wrote: > > The branch main has been updated by mandree: > > URL: https://cgit.FreeBSD.org/ports/commit/?id=a9d9d3a4272303bf226b9deb55c42303e4fcebdc > > commit a9d9d3a4272303bf226b9deb55c42303e4fcebdc > Author: Matthias Andree > AuthorDate: 2023-02-27 21:01:32 +0000 > Commit: Matthias Andree > CommitDate: 2023-02-27 21:04:52 +0000 > > lang/python: Revert "add bytecode trigger" > > This reverts commit c17ddfbf66e2801ec620d49979aca3d7077d7002. > > This causes breakage on several ports, and the next iteration > requires a full exp-run. See: > > Differential Revision: https://reviews.freebsd.org/D34739 > --- > CHANGES | 8 ------- > Mk/Uses/python.mk | 25 ++++---------------- > UPDATING | 17 -------------- > lang/python310/Makefile | 12 ++++++---- > lang/python310/files/python3.10.ucl.in | 40 -------------------------------- > lang/python311/Makefile | 12 ++++++---- > lang/python311/files/python3.11.ucl.in | 40 -------------------------------- > lang/python37/Makefile | 11 +++++---- > lang/python37/files/python3.7.ucl.in | 42 ---------------------------------- > lang/python38/Makefile | 11 +++++---- > lang/python38/files/python3.8.ucl.in | 42 ---------------------------------- > lang/python39/Makefile | 12 ++++++---- > lang/python39/files/python3.9.ucl.in | 40 -------------------------------- > 13 files changed, 43 insertions(+), 269 deletions(-) > > diff --git a/CHANGES b/CHANGES > index a8736d2217ea..2c65d5dbbe11 100644 > --- a/CHANGES > +++ b/CHANGES > @@ -10,14 +10,6 @@ in the release notes and/or placed into UPDATING. > > All ports committers are allowed to commit to this file. > > -20230215: > -AUTHOR: vishwin@FreeBSD.org > - > - USES=python now includes SUB_LIST entries to facilitate common > - substitutions for python.mk variables other than in ${PLIST}. > - They are the same as PLIST_SUB, except PYTHON_INCLUDEDIR, > - PYTHON_LIBDIR and PYTHON_SITELIBDIR include ${PREFIX}. > - > 20230111: > AUTHOR: vishwin@FreeBSD.org > > diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk > index 2da705f42be1..e8b9d2b59343 100644 > --- a/Mk/Uses/python.mk > +++ b/Mk/Uses/python.mk > @@ -257,20 +257,17 @@ > # packages for different Python versions. > # default: -py${PYTHON_SUFFIX} > # > -# Using USES=python also will add some useful entries to SUB_LIST and PLIST_SUB: > +# Using USES=python also will add some useful entries to PLIST_SUB: > # > -# PYTHON_INCLUDEDIR=${PYTHONPREFIX_INCLUDEDIR} > -# PYTHON_LIBDIR=${PYTHONPREFIX_LIBDIR} > +# PYTHON_INCLUDEDIR=${PYTHONPREFIX_INCLUDEDIR:S;${PREFIX}/;;} > +# PYTHON_LIBDIR=${PYTHONPREFIX_LIBDIR:S;${PREFIX}/;;} > # PYTHON_PLATFORM=${PYTHON_PLATFORM} > -# PYTHON_SITELIBDIR=${PYTHONPREFIX_SITELIBDIR} > +# PYTHON_SITELIBDIR=${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;} > # PYTHON_SUFFIX=${PYTHON_SUFFIX} > # PYTHON_VER=${PYTHON_VER} > # PYTHON_VERSION=${PYTHON_VERSION} > # > -# where PYTHON_INCLUDEDIR, PYTHON_LIBDIR and PYTHON_SITELIBDIR have their PREFIX > -# stripped for PLIST_SUB. > -# > -# PYTHON2 and PYTHON3 will also be set according to the Python version: > +# and PYTHON2 and PYTHON3 will be set according to the Python version: > # > # PYTHON2="" PYTHON3="@comment " for Python 2.x > # PYTHON2="@comment " PYTHON3="" for Python 3.x > @@ -788,16 +785,6 @@ ${_stage}_DEPENDS+= ${PYTHON_CMD}:${PYTHON_PORTSDIR} > PREFIX= ${PYTHONBASE} > . endif > > -# Substitutions for SUB_FILES > -SUB_LIST+= PYTHON_INCLUDEDIR=${PYTHONPREFIX_INCLUDEDIR} \ > - PYTHON_LIBDIR=${PYTHONPREFIX_LIBDIR} \ > - PYTHON_PLATFORM=${PYTHON_PLATFORM} \ > - PYTHON_SITELIBDIR=${PYTHONPREFIX_SITELIBDIR} \ > - PYTHON_SUFFIX=${PYTHON_SUFFIX} \ > - PYTHON_EXT_SUFFIX=${PYTHON_EXT_SUFFIX} \ > - PYTHON_VER=${PYTHON_VER} \ > - PYTHON_VERSION=${PYTHON_VERSION} > - > # Substitutions for pkg-plist > # Use a short form of the PYTHONPREFIX_*DIR variables; we don't need the > # base directory in the plist file. > @@ -810,10 +797,8 @@ PLIST_SUB+= PYTHON_INCLUDEDIR=${PYTHONPREFIX_INCLUDEDIR:S;${PREFIX}/;;} \ > PYTHON_VER=${PYTHON_VER} \ > PYTHON_VERSION=${PYTHON_VERSION} > . if ${PYTHON_REL} < 30000 > -SUB_LIST+= PYTHON2="" PYTHON3="@comment " > PLIST_SUB+= PYTHON2="" PYTHON3="@comment " > . else > -SUB_LIST+= PYTHON2="@comment " PYTHON3="" > PLIST_SUB+= PYTHON2="@comment " PYTHON3="" > . endif > > diff --git a/UPDATING b/UPDATING > index 3f599f6b93bf..8b85cb1b5efc 100644 > --- a/UPDATING > +++ b/UPDATING > @@ -48,23 +48,6 @@ you update your ports collection, before attempting any port upgrades. > # pkg set -o databases/mysql57-server:databases/mysql80-server > # pkg upgrade > > -20230215: > - AFFECTS: users of python > - AUTHOR: vishwin@FreeBSD.org > - > - A trigger has been added to the lang/python3* ports to compile, > - write and remove bytecode files (.pyc) in site-packages after all > - pkg transactions have been completed. pkg will no longer manage > - such files directly, as they are meant to be generated after > - installation. > - > - For those ports/packages that still package bytecode, some package > - checksum mismatches on those files may occur. This is harmless > - and will be rectified. > - > - Technical details available at: > - https://wiki.freebsd.org/Python/CompiledPackages > - > 20230213: > Affects: users of sysutils/nut* > AUTHOR: cy@FreeBSD.org > diff --git a/lang/python310/Makefile b/lang/python310/Makefile > index 4b2aafa07a63..f3c13fc09ffd 100644 > --- a/lang/python310/Makefile > +++ b/lang/python310/Makefile > @@ -1,6 +1,6 @@ > PORTNAME= python > DISTVERSION= ${PYTHON_DISTVERSION} > -PORTREVISION= 1 > +PORTREVISION= 2 > CATEGORIES= lang python > MASTER_SITES= PYTHON/ftp/python/${DISTVERSION:C/[a-z].*//} > PKGNAMESUFFIX= ${PYTHON_SUFFIX} > @@ -15,8 +15,8 @@ LICENSE= PSFL > > LIB_DEPENDS= libffi.so:devel/libffi > > -USES= compiler:c11 cpe ncurses pathfix pkgconfig \ > - python:${PYTHON_DISTVERSION:R},env readline shebangfix ssl tar:xz trigger > +USES= compiler:c11 cpe ncurses pathfix pkgconfig readline \ > + shebangfix ssl tar:xz > PATHFIX_MAKEFILEIN= Makefile.pre.in > USE_LDCONFIG= yes > GNU_CONFIGURE= yes > @@ -25,7 +25,11 @@ SHEBANG_FILES= Lib/*.py Lib/*/*.py Lib/*/*/*.py Lib/*/*/*/*.py > SHEBANG_FILES+= Lib/test/ziptestdata/exe_with_z64 \ > Lib/test/ziptestdata/exe_with_zip \ > Lib/test/ziptestdata/header.sh > -TRIGGERS= ${PYTHON_VERSION} > + > +# Duplicate python.mk variables. TODO: Let lang/python?? ports use python.mk bits. > +PYTHON_VER= ${PYTHON_DISTVERSION:R} > +PYTHON_VERSION= python${PYTHON_VER} > +PYTHON_SUFFIX= ${PYTHON_VER:S/.//g} > > DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm > CONFIGURE_ARGS+= --enable-shared --without-ensurepip \ > diff --git a/lang/python310/files/python3.10.ucl.in b/lang/python310/files/python3.10.ucl.in > deleted file mode 100644 > index 63d455839549..000000000000 > --- a/lang/python310/files/python3.10.ucl.in > +++ /dev/null > @@ -1,40 +0,0 @@ > -path_glob: "%%PYTHON_SITELIBDIR%%/*" > -trigger: { > - type: lua > - sandbox: false > - script: < -function cleanup(directory) > - for _,d in ipairs(pkg.readdir(directory)) do > - local full_path = directory .. "/" .. d > - local stat = pkg.stat(full_path) > - if stat["type"] == "dir" then > - if (d ~= "__pycache__") then > - cleanup(full_path) > - else > - for _,bytecode_file in ipairs(pkg.readdir(full_path)) do > - local file_origin = string.gsub(bytecode_file, "[.]cpython[-]%%PYTHON_SUFFIX%%[.].*pyc", ".py") > - if file_origin then > - local origin_path = directory .. "/" .. file_origin > - if (not pkg.stat(origin_path)) then > - --print(" >=> removed stale bytecode " .. bytecode_file) > - os.remove(full_path .. "/" .. bytecode_file) > - end > - end > - end > - end > - local res = pkg.readdir(full_path) > - if #res == 0 then > - --print(" >=> removed empty directory " .. full_path ) > - os.remove(full_path) > - end > - end > - end > -end > - > -print(">=> Cleaning stale bytecode files...") > -cleanup("%%PYTHON_SITELIBDIR%%") > - > -print(">=> Byte-compiling Python source files...") > -pkg.exec({"%%PYTHON_VERSION%%", "-m", "compileall", "-q", "-o", "0", "-o", "1", "-o", "2", "%%PYTHON_SITELIBDIR%%"}) > -EOS > -} > diff --git a/lang/python311/Makefile b/lang/python311/Makefile > index c1bbfa79002e..96c4215f8b0e 100644 > --- a/lang/python311/Makefile > +++ b/lang/python311/Makefile > @@ -1,6 +1,6 @@ > PORTNAME= python > DISTVERSION= ${PYTHON_DISTVERSION} > -PORTREVISION= 1 > +PORTREVISION= 2 > CATEGORIES= lang python > MASTER_SITES= PYTHON/ftp/python/${DISTVERSION:C/[a-z].*//} > PKGNAMESUFFIX= ${PYTHON_SUFFIX} > @@ -15,8 +15,8 @@ LICENSE= PSFL > > LIB_DEPENDS= libffi.so:devel/libffi > > -USES= compiler:c11 cpe ncurses pathfix pkgconfig \ > - python:${PYTHON_DISTVERSION:R},env readline shebangfix ssl tar:xz trigger > +USES= compiler:c11 cpe ncurses pathfix pkgconfig readline \ > + shebangfix ssl tar:xz > PATHFIX_MAKEFILEIN= Makefile.pre.in > USE_LDCONFIG= yes > GNU_CONFIGURE= yes > @@ -25,7 +25,11 @@ SHEBANG_FILES= Lib/*.py Lib/*/*.py Lib/*/*/*.py Lib/*/*/*/*.py > SHEBANG_FILES+= Lib/test/ziptestdata/exe_with_z64 \ > Lib/test/ziptestdata/exe_with_zip \ > Lib/test/ziptestdata/header.sh > -TRIGGERS= ${PYTHON_VERSION} > + > +# Duplicate python.mk variables. TODO: Let lang/python?? ports use python.mk bits. > +PYTHON_VER= ${PYTHON_DISTVERSION:R} > +PYTHON_VERSION= python${PYTHON_VER} > +PYTHON_SUFFIX= ${PYTHON_VER:S/.//g} > > DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm > CONFIGURE_ARGS+= --enable-shared --without-ensurepip \ > diff --git a/lang/python311/files/python3.11.ucl.in b/lang/python311/files/python3.11.ucl.in > deleted file mode 100644 > index 63d455839549..000000000000 > --- a/lang/python311/files/python3.11.ucl.in > +++ /dev/null > @@ -1,40 +0,0 @@ > -path_glob: "%%PYTHON_SITELIBDIR%%/*" > -trigger: { > - type: lua > - sandbox: false > - script: < -function cleanup(directory) > - for _,d in ipairs(pkg.readdir(directory)) do > - local full_path = directory .. "/" .. d > - local stat = pkg.stat(full_path) > - if stat["type"] == "dir" then > - if (d ~= "__pycache__") then > - cleanup(full_path) > - else > - for _,bytecode_file in ipairs(pkg.readdir(full_path)) do > - local file_origin = string.gsub(bytecode_file, "[.]cpython[-]%%PYTHON_SUFFIX%%[.].*pyc", ".py") > - if file_origin then > - local origin_path = directory .. "/" .. file_origin > - if (not pkg.stat(origin_path)) then > - --print(" >=> removed stale bytecode " .. bytecode_file) > - os.remove(full_path .. "/" .. bytecode_file) > - end > - end > - end > - end > - local res = pkg.readdir(full_path) > - if #res == 0 then > - --print(" >=> removed empty directory " .. full_path ) > - os.remove(full_path) > - end > - end > - end > -end > - > -print(">=> Cleaning stale bytecode files...") > -cleanup("%%PYTHON_SITELIBDIR%%") > - > -print(">=> Byte-compiling Python source files...") > -pkg.exec({"%%PYTHON_VERSION%%", "-m", "compileall", "-q", "-o", "0", "-o", "1", "-o", "2", "%%PYTHON_SITELIBDIR%%"}) > -EOS > -} > diff --git a/lang/python37/Makefile b/lang/python37/Makefile > index 459ebdfd771b..ec98e226f309 100644 > --- a/lang/python37/Makefile > +++ b/lang/python37/Makefile > @@ -1,6 +1,6 @@ > PORTNAME= python > DISTVERSION= ${PYTHON_DISTVERSION} > -PORTREVISION= 1 > +PORTREVISION= 2 > CATEGORIES= lang python > MASTER_SITES= PYTHON/ftp/python/${DISTVERSION} > PKGNAMESUFFIX= ${PYTHON_SUFFIX} > @@ -19,14 +19,17 @@ EXPIRATION_DATE= 2023-06-27 > LIB_DEPENDS= libffi.so:devel/libffi \ > libmpdec.so:math/mpdecimal > > -USES= cpe ncurses pathfix pkgconfig python:${PYTHON_DISTVERSION:R},env readline \ > - shebangfix ssl tar:xz trigger > +USES= cpe ncurses pathfix pkgconfig readline shebangfix ssl tar:xz > PATHFIX_MAKEFILEIN= Makefile.pre.in > USE_LDCONFIG= yes > GNU_CONFIGURE= yes > python_CMD= ${PREFIX}/bin/python${PYTHON_DISTVERSION:R} > SHEBANG_FILES= Lib/*.py Lib/*/*.py Lib/*/*/*.py Lib/*/*/*/*.py > -TRIGGERS= ${PYTHON_VERSION} > + > +# Duplicate python.mk variables. TODO: Let lang/python?? ports use python.mk bits. > +PYTHON_VER= ${PYTHON_DISTVERSION:R} > +PYTHON_VERSION= python${PYTHON_VER} > +PYTHON_SUFFIX= ${PYTHON_VER:S/.//g} > > DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm > CONFIGURE_ARGS+= --enable-shared --with-system-ffi --with-system-libmpdec --without-ensurepip > diff --git a/lang/python37/files/python3.7.ucl.in b/lang/python37/files/python3.7.ucl.in > deleted file mode 100644 > index a9ebb18f9c27..000000000000 > --- a/lang/python37/files/python3.7.ucl.in > +++ /dev/null > @@ -1,42 +0,0 @@ > -path_glob: "%%PYTHON_SITELIBDIR%%/*" > -trigger: { > - type: lua > - sandbox: false > - script: < -function cleanup(directory) > - for _,d in ipairs(pkg.readdir(directory)) do > - local full_path = directory .. "/" .. d > - local stat = pkg.stat(full_path) > - if stat["type"] == "dir" then > - if (d ~= "__pycache__") then > - cleanup(full_path) > - else > - for _,bytecode_file in ipairs(pkg.readdir(full_path)) do > - local file_origin = string.gsub(bytecode_file, "[.]cpython[-]%%PYTHON_SUFFIX%%[.].*pyc", ".py") > - if file_origin then > - local origin_path = directory .. "/" .. file_origin > - if (not pkg.stat(origin_path)) then > - --print(" >=> removed stale bytecode " .. bytecode_file) > - os.remove(full_path .. "/" .. bytecode_file) > - end > - end > - end > - end > - local res = pkg.readdir(full_path) > - if #res == 0 then > - --print(" >=> removed empty directory " .. full_path ) > - os.remove(full_path) > - end > - end > - end > -end > - > -print(">=> Cleaning stale bytecode files...") > -cleanup("%%PYTHON_SITELIBDIR%%") > - > -print(">=> Byte-compiling Python source files...") > -pkg.exec({"%%PYTHON_VERSION%%", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) > -pkg.exec({"%%PYTHON_VERSION%%", "-O", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) > -pkg.exec({"%%PYTHON_VERSION%%", "-OO", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) > -EOS > -} > diff --git a/lang/python38/Makefile b/lang/python38/Makefile > index 056ff45a8f98..07d227c23956 100644 > --- a/lang/python38/Makefile > +++ b/lang/python38/Makefile > @@ -1,6 +1,6 @@ > PORTNAME= python > DISTVERSION= ${PYTHON_DISTVERSION} > -PORTREVISION= 1 > +PORTREVISION= 2 > CATEGORIES= lang python > MASTER_SITES= PYTHON/ftp/python/${DISTVERSION} > PKGNAMESUFFIX= ${PYTHON_SUFFIX} > @@ -15,8 +15,7 @@ LICENSE= PSFL > > LIB_DEPENDS= libffi.so:devel/libffi > > -USES= cpe ncurses pathfix pkgconfig python:${PYTHON_DISTVERSION:R},env readline \ > - shebangfix ssl tar:xz trigger > +USES= cpe ncurses pathfix pkgconfig readline shebangfix ssl tar:xz > PATHFIX_MAKEFILEIN= Makefile.pre.in > USE_LDCONFIG= yes > GNU_CONFIGURE= yes > @@ -25,7 +24,11 @@ SHEBANG_FILES= Lib/*.py Lib/*/*.py Lib/*/*/*.py Lib/*/*/*/*.py > SHEBANG_FILES+= Lib/test/ziptestdata/exe_with_z64 \ > Lib/test/ziptestdata/exe_with_zip \ > Lib/test/ziptestdata/header.sh > -TRIGGERS= ${PYTHON_VERSION} > + > +# Duplicate python.mk variables. TODO: Let lang/python?? ports use python.mk bits. > +PYTHON_VER= ${PYTHON_DISTVERSION:R} > +PYTHON_VERSION= python${PYTHON_VER} > +PYTHON_SUFFIX= ${PYTHON_VER:S/.//g} > > DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm > CONFIGURE_ARGS+= --enable-shared --without-ensurepip \ > diff --git a/lang/python38/files/python3.8.ucl.in b/lang/python38/files/python3.8.ucl.in > deleted file mode 100644 > index a9ebb18f9c27..000000000000 > --- a/lang/python38/files/python3.8.ucl.in > +++ /dev/null > @@ -1,42 +0,0 @@ > -path_glob: "%%PYTHON_SITELIBDIR%%/*" > -trigger: { > - type: lua > - sandbox: false > - script: < -function cleanup(directory) > - for _,d in ipairs(pkg.readdir(directory)) do > - local full_path = directory .. "/" .. d > - local stat = pkg.stat(full_path) > - if stat["type"] == "dir" then > - if (d ~= "__pycache__") then > - cleanup(full_path) > - else > - for _,bytecode_file in ipairs(pkg.readdir(full_path)) do > - local file_origin = string.gsub(bytecode_file, "[.]cpython[-]%%PYTHON_SUFFIX%%[.].*pyc", ".py") > - if file_origin then > - local origin_path = directory .. "/" .. file_origin > - if (not pkg.stat(origin_path)) then > - --print(" >=> removed stale bytecode " .. bytecode_file) > - os.remove(full_path .. "/" .. bytecode_file) > - end > - end > - end > - end > - local res = pkg.readdir(full_path) > - if #res == 0 then > - --print(" >=> removed empty directory " .. full_path ) > - os.remove(full_path) > - end > - end > - end > -end > - > -print(">=> Cleaning stale bytecode files...") > -cleanup("%%PYTHON_SITELIBDIR%%") > - > -print(">=> Byte-compiling Python source files...") > -pkg.exec({"%%PYTHON_VERSION%%", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) > -pkg.exec({"%%PYTHON_VERSION%%", "-O", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) > -pkg.exec({"%%PYTHON_VERSION%%", "-OO", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) > -EOS > -} > diff --git a/lang/python39/Makefile b/lang/python39/Makefile > index a577ab3e0b2e..c93a47e69fc3 100644 > --- a/lang/python39/Makefile > +++ b/lang/python39/Makefile > @@ -1,6 +1,6 @@ > PORTNAME= python > DISTVERSION= ${PYTHON_DISTVERSION} > -PORTREVISION= 1 > +PORTREVISION= 2 > CATEGORIES= lang python > MASTER_SITES= PYTHON/ftp/python/${DISTVERSION} > PKGNAMESUFFIX= ${PYTHON_SUFFIX} > @@ -15,8 +15,8 @@ LICENSE= PSFL > > LIB_DEPENDS= libffi.so:devel/libffi > > -USES= compiler:c11 cpe ncurses pathfix pkgconfig \ > - python:${PYTHON_DISTVERSION:R},env readline shebangfix ssl tar:xz trigger > +USES= compiler:c11 cpe ncurses pathfix pkgconfig readline \ > + shebangfix ssl tar:xz > PATHFIX_MAKEFILEIN= Makefile.pre.in > USE_LDCONFIG= yes > GNU_CONFIGURE= yes > @@ -25,7 +25,11 @@ SHEBANG_FILES= Lib/*.py Lib/*/*.py Lib/*/*/*.py Lib/*/*/*/*.py > SHEBANG_FILES+= Lib/test/ziptestdata/exe_with_z64 \ > Lib/test/ziptestdata/exe_with_zip \ > Lib/test/ziptestdata/header.sh > -TRIGGERS= ${PYTHON_VERSION} > + > +# Duplicate python.mk variables. TODO: Let lang/python?? ports use python.mk bits. > +PYTHON_VER= ${PYTHON_DISTVERSION:R} > +PYTHON_VERSION= python${PYTHON_VER} > +PYTHON_SUFFIX= ${PYTHON_VER:S/.//g} > > DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm > CONFIGURE_ARGS+= --enable-shared --without-ensurepip \ > diff --git a/lang/python39/files/python3.9.ucl.in b/lang/python39/files/python3.9.ucl.in > deleted file mode 100644 > index 63d455839549..000000000000 > --- a/lang/python39/files/python3.9.ucl.in > +++ /dev/null > @@ -1,40 +0,0 @@ > -path_glob: "%%PYTHON_SITELIBDIR%%/*" > -trigger: { > - type: lua > - sandbox: false > - script: < -function cleanup(directory) > - for _,d in ipairs(pkg.readdir(directory)) do > - local full_path = directory .. "/" .. d > - local stat = pkg.stat(full_path) > - if stat["type"] == "dir" then > - if (d ~= "__pycache__") then > - cleanup(full_path) > - else > - for _,bytecode_file in ipairs(pkg.readdir(full_path)) do > - local file_origin = string.gsub(bytecode_file, "[.]cpython[-]%%PYTHON_SUFFIX%%[.].*pyc", ".py") > - if file_origin then > - local origin_path = directory .. "/" .. file_origin > - if (not pkg.stat(origin_path)) then > - --print(" >=> removed stale bytecode " .. bytecode_file) > - os.remove(full_path .. "/" .. bytecode_file) > - end > - end > - end > - end > - local res = pkg.readdir(full_path) > - if #res == 0 then > - --print(" >=> removed empty directory " .. full_path ) > - os.remove(full_path) > - end > - end > - end > -end > - > -print(">=> Cleaning stale bytecode files...") > -cleanup("%%PYTHON_SITELIBDIR%%") > - > -print(">=> Byte-compiling Python source files...") > -pkg.exec({"%%PYTHON_VERSION%%", "-m", "compileall", "-q", "-o", "0", "-o", "1", "-o", "2", "%%PYTHON_SITELIBDIR%%"}) > -EOS > -}