From 8542e24758782bc680bb8d6aa178ca2a0928da52 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sat, 28 Sep 2024 04:39:10 -0400 Subject: [PATCH] python: rename to python2, convert to metapackage metapackage points at 2.7 for now, but will change at a later date closes #38229 --- srcpkgs/python-tkinter | 1 + srcpkgs/python-tkinter/files/cross.patch | 1 - srcpkgs/python-tkinter/update | 1 - srcpkgs/python/INSTALL.msg | 2 + srcpkgs/python/template | 116 ++---------------- srcpkgs/python2-devel | 1 + srcpkgs/python2-tkinter/files/cross.patch | 1 + .../files/idle2.desktop | 0 .../files/idle2.xpm | 0 .../template | 14 ++- srcpkgs/python2-tkinter/update | 1 + srcpkgs/{python => python2}/files/cross.patch | 0 .../patches/fix-i686-rlock.patch | 0 .../patches/musl-find_library.patch | 0 .../patches/sysconfig.patch | 0 srcpkgs/python2/template | 116 ++++++++++++++++++ srcpkgs/{python => python2}/update | 0 17 files changed, 141 insertions(+), 113 deletions(-) create mode 120000 srcpkgs/python-tkinter delete mode 120000 srcpkgs/python-tkinter/files/cross.patch delete mode 120000 srcpkgs/python-tkinter/update create mode 100644 srcpkgs/python/INSTALL.msg create mode 120000 srcpkgs/python2-devel create mode 120000 srcpkgs/python2-tkinter/files/cross.patch rename srcpkgs/{python-tkinter => python2-tkinter}/files/idle2.desktop (100%) rename srcpkgs/{python-tkinter => python2-tkinter}/files/idle2.xpm (100%) rename srcpkgs/{python-tkinter => python2-tkinter}/template (88%) create mode 120000 srcpkgs/python2-tkinter/update rename srcpkgs/{python => python2}/files/cross.patch (100%) rename srcpkgs/{python => python2}/patches/fix-i686-rlock.patch (100%) rename srcpkgs/{python => python2}/patches/musl-find_library.patch (100%) rename srcpkgs/{python => python2}/patches/sysconfig.patch (100%) create mode 100644 srcpkgs/python2/template rename srcpkgs/{python => python2}/update (100%) diff --git a/srcpkgs/python-tkinter b/srcpkgs/python-tkinter new file mode 120000 index 00000000000000..5e2384079e0e4d --- /dev/null +++ b/srcpkgs/python-tkinter @@ -0,0 +1 @@ +python2-tkinter \ No newline at end of file diff --git a/srcpkgs/python-tkinter/files/cross.patch b/srcpkgs/python-tkinter/files/cross.patch deleted file mode 120000 index c27b8a16c11313..00000000000000 --- a/srcpkgs/python-tkinter/files/cross.patch +++ /dev/null @@ -1 +0,0 @@ -../../python/files/cross.patch \ No newline at end of file diff --git a/srcpkgs/python-tkinter/update b/srcpkgs/python-tkinter/update deleted file mode 120000 index 468ac2c4f9c052..00000000000000 --- a/srcpkgs/python-tkinter/update +++ /dev/null @@ -1 +0,0 @@ -../python/update \ No newline at end of file diff --git a/srcpkgs/python/INSTALL.msg b/srcpkgs/python/INSTALL.msg new file mode 100644 index 00000000000000..c601330e59e94d --- /dev/null +++ b/srcpkgs/python/INSTALL.msg @@ -0,0 +1,2 @@ +This package will install python3 soon. If you wish to keep Python 2, +mark python2 as manually installed with xbps-pkgdb(1). diff --git a/srcpkgs/python/template b/srcpkgs/python/template index 57e2d76db0a905..c7d9066c75813b 100644 --- a/srcpkgs/python/template +++ b/srcpkgs/python/template @@ -1,114 +1,16 @@ # Template file for 'python' -# -# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python-tkinter". -# pkgname=python -version=2.7.18.9 -revision=2 -_commit=76f11e17a26f8cc28f8336303b26cb503710fa7d -pycompile_dirs="usr/lib/python2.7" -hostmakedepends="pkg-config" -makedepends="libffi-devel readline-devel gdbm-devel openssl-devel expat-devel - sqlite-devel bzip2-devel zlib-devel" -depends="ca-certificates" -short_desc="Interpreted, interactive, object-oriented programming language" -maintainer="Leah Neukirchen " -license="Python-2.0" +version=2.7.9999 +revision=1 +build_style=meta +depends="python${version%%.*}" +short_desc="Python programming language (metapackage)" +maintainer="Orphaned " +license="Public Domain" homepage="https://www.python.org" -distfiles="https://github.com/ActiveState/cpython/archive/${_commit}.tar.gz" -checksum=1297e71396f5b58404157d9c6ebf5ac49dddcbad098ecda9d72570f5c7d207e4 - -alternatives=" - python:idle:/usr/bin/idle2.7 - python:2to3:/usr/bin/2to3-2.7 - python:pydoc:/usr/bin/pydoc2.7 - python:python:/usr/bin/python2.7 - python:python.1:/usr/share/man/man1/python2.7.1" - -if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then - makedepends+=" libxcrypt-devel" -fi - -pre_configure() { - # Ensure that internal copies of expat and libffi are not used. - rm -r Modules/expat - rm -r Modules/_ctypes/libffi* - # Enable loading sqlite extensions. - vsed -i '/SQLITE_OMIT_LOAD_EXTENSION/d' setup.py -} - -do_configure() { - local _args - unset GCC CC CXX CPP LD AR AS RANLIB - if [ "$CROSS_BUILD" ]; then - mkdir -p host-build - cd host-build - env -i PATH=$PATH XBPS_ARCH=$XBPS_ARCH ../configure - env -i PATH=$PATH XBPS_ARCH=$XBPS_ARCH make ${makejobs} python - mkdir -p ../hostpython - mv python ../hostpython - cd .. - patch -Np0 -i ${FILESDIR}/cross.patch - _args="--build=${XBPS_MACHINE%%-musl}" - fi - ./configure ${configure_args} ${_args} \ - --enable-shared --enable-ipv6 --with-threads --enable-unicode=ucs4 \ - --with-computed-gotos --with-wctype-functions --with-dbmliborder=gdbm:ndbm \ - --with-system-expat --with-system-ffi --without-ensurepip -} - -do_build() { - export PATH="$PATH:$wrksrc/hostpython" - export AS_DEPENDENCIES_DIR="${XBPS_CROSS_BASE}/" - make ${makejobs} -} - -do_install() { - export PATH="$PATH:$wrksrc/hostpython" - make DESTDIR=${DESTDIR} altinstall - ln -sf pydoc2.7 ${DESTDIR}/usr/bin/pydoc2 - ln -sf python2.7 ${DESTDIR}/usr/bin/python2 - ln -sf python2.7-config ${DESTDIR}/usr/bin/python-config - ln -sf python2.7-config ${DESTDIR}/usr/bin/python2-config - ln -sf python2.7.1 ${DESTDIR}/usr/share/man/man1/python2.1 - ln -sf python-2.7.pc ${DESTDIR}/usr/lib/pkgconfig/python2.pc -} - -post_install() { - chmod 755 ${DESTDIR}/usr/lib/libpython*.so* - vlicense LICENSE - rm -f ${DESTDIR}/usr/bin/smtpd.py - mv ${DESTDIR}/usr/bin/2to3{,-2.7} - mv ${DESTDIR}/usr/bin/pydoc{,2.7} - # Remove files that belong to python-tkinter and idle-python - rm ${DESTDIR}/usr/bin/idle - rm -r ${DESTDIR}/usr/lib/python2.7/idlelib - rm -r ${DESTDIR}/usr/lib/python2.7/lib-tk - # Remove test module and tests that fail to be byte-compiled. - rm -r ${DESTDIR}/usr/lib/python2.7/test - rm -r ${DESTDIR}/usr/lib/python2.7/lib2to3/tests - # Remove references to the install(1) wrapper. - vsed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \ - ${DESTDIR}/usr/lib/python${version%.*.*}/_sysconfigdata.py \ - ${DESTDIR}/usr/lib/python${version%.*.*}/config/Makefile - if [ "$CROSS_BUILD" ]; then - # Remove references to cross toolchain. - vsed -i "s/$XBPS_CROSS_TRIPLET-//g" \ - ${DESTDIR}/usr/lib/python${version%.*.*}/_sysconfigdata.py \ - ${DESTDIR}/usr/lib/python${version%.*.*}/config/Makefile - fi -} python-devel_package() { - depends="${sourcepkg}>=${version}_${revision}" + depends="python${version%%.*}-devel" short_desc+=" - development files" - pkg_install() { - vmove usr/bin/python*-config - vmove usr/lib/pkgconfig - vmove usr/include - vmove usr/lib/python2.7/config/libpython2.7.a - mkdir -p ${DESTDIR}/usr/include/python2.7 - mv ${PKGDESTDIR}/usr/include/python2.7/pyconfig.h \ - ${DESTDIR}/usr/include/python2.7 - } + build_style=meta } diff --git a/srcpkgs/python2-devel b/srcpkgs/python2-devel new file mode 120000 index 00000000000000..551ab268585033 --- /dev/null +++ b/srcpkgs/python2-devel @@ -0,0 +1 @@ +python2 \ No newline at end of file diff --git a/srcpkgs/python2-tkinter/files/cross.patch b/srcpkgs/python2-tkinter/files/cross.patch new file mode 120000 index 00000000000000..352ebe295b5b38 --- /dev/null +++ b/srcpkgs/python2-tkinter/files/cross.patch @@ -0,0 +1 @@ +../../python2/files/cross.patch \ No newline at end of file diff --git a/srcpkgs/python-tkinter/files/idle2.desktop b/srcpkgs/python2-tkinter/files/idle2.desktop similarity index 100% rename from srcpkgs/python-tkinter/files/idle2.desktop rename to srcpkgs/python2-tkinter/files/idle2.desktop diff --git a/srcpkgs/python-tkinter/files/idle2.xpm b/srcpkgs/python2-tkinter/files/idle2.xpm similarity index 100% rename from srcpkgs/python-tkinter/files/idle2.xpm rename to srcpkgs/python2-tkinter/files/idle2.xpm diff --git a/srcpkgs/python-tkinter/template b/srcpkgs/python2-tkinter/template similarity index 88% rename from srcpkgs/python-tkinter/template rename to srcpkgs/python2-tkinter/template index 37f263262aa4e0..f527446cf655d5 100644 --- a/srcpkgs/python-tkinter/template +++ b/srcpkgs/python2-tkinter/template @@ -1,12 +1,12 @@ -# Template file for 'python-tkinter' +# Template file for 'python2-tkinter' # -# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python"; IT IS SPLITTED TO AVOID -# A CYCLIC DEPENDENCY: python -> tk -> libX11 -> libxcb -> xcb-proto -> python +# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python2"; IT IS SPLITTED TO AVOID +# A CYCLIC DEPENDENCY: python2 -> tk -> libX11 -> libxcb -> xcb-proto -> python2 # _desc="Interpreted, interactive, object-oriented programming language" -pkgname=python-tkinter +pkgname=python2-tkinter version=2.7.18.9 revision=2 _commit=76f11e17a26f8cc28f8336303b26cb503710fa7d @@ -88,3 +88,9 @@ idle-python_package() { vinstall ${FILESDIR}/idle2.desktop 644 usr/share/applications } } + +python-tkinter_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" (transitional dummy package)" + build_style=meta +} diff --git a/srcpkgs/python2-tkinter/update b/srcpkgs/python2-tkinter/update new file mode 120000 index 00000000000000..b29540d8f73a12 --- /dev/null +++ b/srcpkgs/python2-tkinter/update @@ -0,0 +1 @@ +../python2/update \ No newline at end of file diff --git a/srcpkgs/python/files/cross.patch b/srcpkgs/python2/files/cross.patch similarity index 100% rename from srcpkgs/python/files/cross.patch rename to srcpkgs/python2/files/cross.patch diff --git a/srcpkgs/python/patches/fix-i686-rlock.patch b/srcpkgs/python2/patches/fix-i686-rlock.patch similarity index 100% rename from srcpkgs/python/patches/fix-i686-rlock.patch rename to srcpkgs/python2/patches/fix-i686-rlock.patch diff --git a/srcpkgs/python/patches/musl-find_library.patch b/srcpkgs/python2/patches/musl-find_library.patch similarity index 100% rename from srcpkgs/python/patches/musl-find_library.patch rename to srcpkgs/python2/patches/musl-find_library.patch diff --git a/srcpkgs/python/patches/sysconfig.patch b/srcpkgs/python2/patches/sysconfig.patch similarity index 100% rename from srcpkgs/python/patches/sysconfig.patch rename to srcpkgs/python2/patches/sysconfig.patch diff --git a/srcpkgs/python2/template b/srcpkgs/python2/template new file mode 100644 index 00000000000000..4d2b2336cdc91d --- /dev/null +++ b/srcpkgs/python2/template @@ -0,0 +1,116 @@ +# Template file for 'python2' +# +# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python2-tkinter". +# +pkgname=python2 +version=2.7.18.9 +revision=2 +_commit=76f11e17a26f8cc28f8336303b26cb503710fa7d +pycompile_dirs="usr/lib/python2.7" +hostmakedepends="pkg-config" +makedepends="libffi-devel readline-devel gdbm-devel openssl-devel expat-devel + sqlite-devel bzip2-devel zlib-devel" +depends="ca-certificates" +short_desc="Interpreted, interactive, object-oriented programming language" +maintainer="Leah Neukirchen " +license="Python-2.0" +homepage="https://www.python.org" +distfiles="https://github.com/ActiveState/cpython/archive/${_commit}.tar.gz" +checksum=1297e71396f5b58404157d9c6ebf5ac49dddcbad098ecda9d72570f5c7d207e4 + +short_desc+=" (limited install; not for regular use)" + +alternatives=" + python:idle:/usr/bin/idle2.7 + python:2to3:/usr/bin/2to3-2.7 + python:pydoc:/usr/bin/pydoc2.7 + python:python:/usr/bin/python2.7 + python:python.1:/usr/share/man/man1/python2.7.1" + +if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then + makedepends+=" libxcrypt-devel" +fi + +pre_configure() { + # Ensure that internal copies of expat and libffi are not used. + rm -r Modules/expat + rm -r Modules/_ctypes/libffi* + # Enable loading sqlite extensions. + vsed -i '/SQLITE_OMIT_LOAD_EXTENSION/d' setup.py +} + +do_configure() { + local _args + unset GCC CC CXX CPP LD AR AS RANLIB + if [ "$CROSS_BUILD" ]; then + mkdir -p host-build + cd host-build + env -i PATH=$PATH XBPS_ARCH=$XBPS_ARCH ../configure + env -i PATH=$PATH XBPS_ARCH=$XBPS_ARCH make ${makejobs} python + mkdir -p ../hostpython + mv python ../hostpython + cd .. + patch -Np0 -i ${FILESDIR}/cross.patch + _args="--build=${XBPS_MACHINE%%-musl}" + fi + ./configure ${configure_args} ${_args} \ + --enable-shared --enable-ipv6 --with-threads --enable-unicode=ucs4 \ + --with-computed-gotos --with-wctype-functions --with-dbmliborder=gdbm:ndbm \ + --with-system-expat --with-system-ffi --without-ensurepip +} + +do_build() { + export PATH="$PATH:$wrksrc/hostpython" + export AS_DEPENDENCIES_DIR="${XBPS_CROSS_BASE}/" + make ${makejobs} +} + +do_install() { + export PATH="$PATH:$wrksrc/hostpython" + make DESTDIR=${DESTDIR} altinstall + ln -sf pydoc2.7 ${DESTDIR}/usr/bin/pydoc2 + ln -sf python2.7 ${DESTDIR}/usr/bin/python2 + ln -sf python2.7-config ${DESTDIR}/usr/bin/python-config + ln -sf python2.7-config ${DESTDIR}/usr/bin/python2-config + ln -sf python2.7.1 ${DESTDIR}/usr/share/man/man1/python2.1 + ln -sf python-2.7.pc ${DESTDIR}/usr/lib/pkgconfig/python2.pc +} + +post_install() { + chmod 755 ${DESTDIR}/usr/lib/libpython*.so* + vlicense LICENSE + rm -f ${DESTDIR}/usr/bin/smtpd.py + mv ${DESTDIR}/usr/bin/2to3{,-2.7} + mv ${DESTDIR}/usr/bin/pydoc{,2.7} + # Remove files that belong to python-tkinter and idle-python + rm ${DESTDIR}/usr/bin/idle + rm -r ${DESTDIR}/usr/lib/python2.7/idlelib + rm -r ${DESTDIR}/usr/lib/python2.7/lib-tk + # Remove test module and tests that fail to be byte-compiled. + rm -r ${DESTDIR}/usr/lib/python2.7/test + rm -r ${DESTDIR}/usr/lib/python2.7/lib2to3/tests + # Remove references to the install(1) wrapper. + vsed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \ + ${DESTDIR}/usr/lib/python${version%.*.*}/_sysconfigdata.py \ + ${DESTDIR}/usr/lib/python${version%.*.*}/config/Makefile + if [ "$CROSS_BUILD" ]; then + # Remove references to cross toolchain. + vsed -i "s/$XBPS_CROSS_TRIPLET-//g" \ + ${DESTDIR}/usr/lib/python${version%.*.*}/_sysconfigdata.py \ + ${DESTDIR}/usr/lib/python${version%.*.*}/config/Makefile + fi +} + +python2-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/bin/python*-config + vmove usr/lib/pkgconfig + vmove usr/include + vmove usr/lib/python2.7/config/libpython2.7.a + mkdir -p ${DESTDIR}/usr/include/python2.7 + mv ${PKGDESTDIR}/usr/include/python2.7/pyconfig.h \ + ${DESTDIR}/usr/include/python2.7 + } +} diff --git a/srcpkgs/python/update b/srcpkgs/python2/update similarity index 100% rename from srcpkgs/python/update rename to srcpkgs/python2/update