diff options
author | Matthias Andree <mandree@FreeBSD.org> | 2023-02-27 22:01:32 +0100 |
---|---|---|
committer | Matthias Andree <mandree@FreeBSD.org> | 2023-02-27 22:04:52 +0100 |
commit | a9d9d3a4272303bf226b9deb55c42303e4fcebdc (patch) | |
tree | ba0584b450ab30f0fb60240580bf79b3b45d8671 /lang/python37 | |
parent | dns/libdjbdns: Deprecate and set expiration date to 2023-06-30 (diff) |
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
Diffstat (limited to 'lang/python37')
-rw-r--r-- | lang/python37/Makefile | 11 | ||||
-rw-r--r-- | lang/python37/files/python3.7.ucl.in | 42 |
2 files changed, 7 insertions, 46 deletions
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: <<EOS -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 -} |