* [PR PATCH] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter
@ 2025-01-31 17:04 ahesford
2025-02-02 23:02 ` [PR REVIEW] " sgn
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: ahesford @ 2025-01-31 17:04 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]
There is a new pull request by ahesford against master on the void-packages repository
https://github.com/ahesford/void-packages theres_a_snake_in_my_boots
https://github.com/void-linux/void-packages/pull/54161
python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter
The `2to3` script is gone in our `python3`, making the `2to3` alternative obsolete. The `idle` alternative in the main `python3` package is wrong, because it produces a dead symlink when `idle-python3` is not installed.
Rather than split off a new `idle` alternative that behaves properly, it's better to just make a fixed `idle` symlink in the `idle-python3` package, drop `idle` from the `python` alternative in the `python2` package, and move on. This means that py2 users will have to use `idle2` or `idle2.7`, but we shouldn't worry about that anymore. It's a dead package that is already marked for "limited use".
At the same time, we don't have to worry about cycles with `python2`, so we can drop the split package and build the whole thing together.
Eventually, we should drop the alternatives for `python2` entirely, but that's a broader scope that I don't want to think about at the moment.
Closes: #54154.
cc: @leahneukirchen
A patch file from https://github.com/void-linux/void-packages/pull/54161.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-theres_a_snake_in_my_boots-54161.patch --]
[-- Type: text/x-diff, Size: 16987 bytes --]
From 11cf57050f288ef0ffc66e9e7b192dcfb4bf3dd1 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Fri, 31 Jan 2025 11:29:24 -0500
Subject: [PATCH 1/3] python3: clean up alternatives
---
srcpkgs/python3/template | 54 +++++++++++++++++++++-------------------
1 file changed, 29 insertions(+), 25 deletions(-)
diff --git a/srcpkgs/python3/template b/srcpkgs/python3/template
index b4f2829f001a9d..4b65c20b7971dc 100644
--- a/srcpkgs/python3/template
+++ b/srcpkgs/python3/template
@@ -6,13 +6,13 @@
#
pkgname=python3
version=3.13.1
-revision=1
+revision=2
build_style="gnu-configure"
configure_args="--enable-shared --enable-ipv6
--enable-loadable-sqlite-extensions --with-computed-gotos
--with-dbmliborder=gdbm:ndbm --with-system-expat
--without-ensurepip ac_cv_working_tzset=yes"
-pycompile_dirs="usr/lib/python${version%.*}"
+pycompile_dirs="${py3_lib}"
hostmakedepends="pkgconf autoconf-archive automake"
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
expat-devel sqlite-devel bzip2-devel zlib-devel liblzma-devel"
@@ -32,8 +32,6 @@ checksum="9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9
skip_extraction="${_bluez}.tar.xz"
alternatives="
- python:idle:/usr/bin/idle${version%.*}
- python:2to3:/usr/bin/2to3-${version%.*}
python:pydoc:/usr/bin/pydoc${version%.*}
python:python:/usr/bin/python${version%.*}
python:python.1:/usr/share/man/man1/python${version%.*}.1"
@@ -126,36 +124,43 @@ do_install() {
rm ${DESTDIR}/${py3_lib}/LICENSE.txt
rm -f ${DESTDIR}/usr/bin/2to3
+
+ local _dst_py3_lib="${DESTDIR}/${py3_lib}"
+
# Remove files that belong to python3-tkinter and idle-python3
- rm -f ${DESTDIR}/usr/bin/idle3*
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/idlelib
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/tkinter
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/turtledemo
- rm -f ${DESTDIR}/usr/lib/python${version%.*}/turtle.py
+ rm ${DESTDIR}/usr/bin/idle3*
+ rm ${_dst_py3_lib}/turtle.py
+ rm -r ${_dst_py3_lib}/idlelib
+ rm -r ${_dst_py3_lib}/tkinter
+ rm -r ${_dst_py3_lib}/turtledemo
+
# Remove test module and tests that fail to be byte-compiled.
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/test
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/lib2to3/tests
+ rm -rf ${_dst_py3_lib}/test
+ rm -rf ${_dst_py3_lib}/lib2to3/tests
+
# Remove references to the install(1) wrapper.
sed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \
- ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
- ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
+ ${_dst_py3_lib}/_sysconfigdata_*_*.py \
+ ${_dst_py3_lib}/config-${version%.*}*/Makefile
+
if [ "$CROSS_BUILD" ]; then
# Remove references to cross toolchain.
sed -i "s/$XBPS_CROSS_TRIPLET-//g" \
- ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
- ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
+ ${_dst_py3_lib}/_sysconfigdata_*_*.py \
+ ${_dst_py3_lib}/config-${version%.*}*/Makefile
sed -i -e "s,$XBPS_CROSS_BASE,,g" \
${DESTDIR}/usr/bin/python${version%.*}-config
fi
- sed -i -e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \
+
+ sed -i -e "s,-I./External,," \
-e "s,-ffile-prefix-map=[^[:space:]]*=[.],," \
- -e "s,-I./External,," \
+ -e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \
${DESTDIR}/usr/bin/python${version%.*}-config \
- ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
- ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
+ ${_dst_py3_lib}/_sysconfigdata_*_*.py \
+ ${_dst_py3_lib}/config-${version%.*}*/Makefile
# https://peps.python.org/pep-0668/
- vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 usr/lib/python${version%.*}
+ vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 "${py3_lib}"
}
python3-devel_package() {
@@ -165,10 +170,9 @@ python3-devel_package() {
vmove usr/bin/python*-config
vmove usr/lib/pkgconfig
vmove usr/include
- mv ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/libpython${version%.*}*.a \
- ${PKGDESTDIR}/usr/lib
- mkdir -p ${DESTDIR}/usr/include/python${version%.*}
- mv ${PKGDESTDIR}/usr/include/python${version%.*}/pyconfig.h \
- ${DESTDIR}/usr/include/python${version%.*}
+ mv "${DESTDIR}/${py3_lib}"/config-*/libpython*.a "${PKGDESTDIR}/usr/lib"
+
+ mkdir -p "${DESTDIR}/${py3_inc}"
+ mv "${PKGDESTDIR}/${py3_inc}/pyconfig.h" "${DESTDIR}/${py3_inc}"
}
}
From c48d823431b07b1dcd0985cd3df0fdbda749b073 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Fri, 31 Jan 2025 11:29:24 -0500
Subject: [PATCH 2/3] python3-tkinter: clean up alternatives
---
srcpkgs/python3-tkinter/template | 36 ++++++++++++++++++--------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/srcpkgs/python3-tkinter/template b/srcpkgs/python3-tkinter/template
index 73cc637cd89a8b..b501f23cb0366a 100644
--- a/srcpkgs/python3-tkinter/template
+++ b/srcpkgs/python3-tkinter/template
@@ -9,16 +9,13 @@ _desc="Python programming language"
pkgname=python3-tkinter
version=3.13.1
-revision=1
+revision=2
build_style="gnu-configure"
configure_args="--enable-shared --enable-ipv6
--enable-loadable-sqlite-extensions --with-computed-gotos
--with-dbmliborder=gdbm:ndbm --with-system-expat --with-system-ffi
--without-ensurepip"
-pycompile_dirs="
- usr/lib/python${version%.*}/tkinter
- usr/lib/python${version%.*}/turtledemo
- usr/lib/python${version%.*}/turtle.py"
+pycompile_dirs="${py3_lib}/tkinter ${py3_lib}/turtledemo ${py3_lib}/turtle.py"
hostmakedepends="pkg-config"
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
expat-devel sqlite-devel bzip2-devel zlib-devel liblzma-devel tk-devel"
@@ -63,6 +60,7 @@ do_check() {
}
do_install() {
+
mkdir -p ${wrksrc}/tmp-destdir/usr/lib
ln -s lib ${wrksrc}/tmp-destdir/usr/lib${XBPS_TARGET_WORDSIZE}
@@ -71,25 +69,31 @@ do_install() {
# We only care for the idle and tkinter modules.
vmkdir usr/bin
- vmkdir usr/lib/python${version%.*}/lib-dynload
- mv ${wrksrc}/tmp-destdir/usr/bin/idle${version%.*} \
- ${DESTDIR}/usr/bin/idle${version%.*}
+ vmkdir "${py3_lib}/lib-dynload"
+
+ local _idle="idle${version%.*}"
+ local _src_py_lib="${wrksrc}/tmp-destdir/${py3_lib}"
+ local _dst_py_lib="${DESTDIR}/${py3_lib}"
+
+ mv "${wrksrc}/tmp-destdir/usr/bin/${_idle}" "${DESTDIR}/usr/bin"
+ mv "${_src_py_lib}/lib-dynload"/_tkinter.*.so "${_dst_py_lib}/lib-dynload"
+
for lib in idlelib tkinter turtledemo turtle.py; do
- mv ${wrksrc}/tmp-destdir/usr/lib/python${version%.*}/${lib} \
- ${DESTDIR}/usr/lib/python${version%.*}/
+ mv "${_src_py_lib}/${lib}" "${DESTDIR}/${py3_lib}"
done
- mv ${wrksrc}/tmp-destdir/usr/lib/python${version%.*}/lib-dynload/_tkinter.cpython-*.so \
- ${DESTDIR}/usr/lib/python${version%.*}/lib-dynload/
- ln -sf idle${version%.*} ${DESTDIR}/usr/bin/idle3
+
+ ln -sf "${_idle}" ${DESTDIR}/usr/bin/idle3
+ ln -sf "${_idle}" ${DESTDIR}/usr/bin/idle
}
idle-python3_package() {
short_desc="${_desc} - IDE for Python3 using Tkinter"
- pycompile_dirs="usr/lib/python${version%.*}/idlelib"
+ pycompile_dirs="${py3_lib}/idlelib"
depends="${sourcepkg}-${version}_${revision}"
+ conflicts="python<3.0.0_1 python2<=2.7.18.11_1 python3<=3.13.1_1"
pkg_install() {
- vmove usr/bin/idle3*
- vmove usr/lib/python${version%.*}/idlelib
+ vmove usr/bin/idle*
+ vmove "${py3_lib}/idlelib"
vinstall ${FILESDIR}/idle3.xpm 644 usr/share/pixmaps
vinstall ${FILESDIR}/idle3.desktop 644 usr/share/applications
}
From f82d9008e8dc32fa66ebcdcc7a3d971615a9b0ea Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Fri, 31 Jan 2025 11:31:34 -0500
Subject: [PATCH 3/3] python2: clean up alternatives, merge python2-tkinter
---
srcpkgs/idle-python2 | 2 +-
srcpkgs/python2-tkinter | 1 +
srcpkgs/python2-tkinter/files/cross.patch | 1 -
srcpkgs/python2-tkinter/template | 90 -------------------
srcpkgs/python2-tkinter/update | 1 -
.../files/idle2.desktop | 0
.../files/idle2.xpm | 0
srcpkgs/python2/template | 67 +++++++++-----
8 files changed, 46 insertions(+), 116 deletions(-)
create mode 120000 srcpkgs/python2-tkinter
delete mode 120000 srcpkgs/python2-tkinter/files/cross.patch
delete mode 100644 srcpkgs/python2-tkinter/template
delete mode 120000 srcpkgs/python2-tkinter/update
rename srcpkgs/{python2-tkinter => python2}/files/idle2.desktop (100%)
rename srcpkgs/{python2-tkinter => python2}/files/idle2.xpm (100%)
diff --git a/srcpkgs/idle-python2 b/srcpkgs/idle-python2
index 5e2384079e0e4d..551ab268585033 120000
--- a/srcpkgs/idle-python2
+++ b/srcpkgs/idle-python2
@@ -1 +1 @@
-python2-tkinter
\ No newline at end of file
+python2
\ No newline at end of file
diff --git a/srcpkgs/python2-tkinter b/srcpkgs/python2-tkinter
new file mode 120000
index 00000000000000..551ab268585033
--- /dev/null
+++ b/srcpkgs/python2-tkinter
@@ -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
deleted file mode 120000
index 352ebe295b5b38..00000000000000
--- a/srcpkgs/python2-tkinter/files/cross.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../python2/files/cross.patch
\ No newline at end of file
diff --git a/srcpkgs/python2-tkinter/template b/srcpkgs/python2-tkinter/template
deleted file mode 100644
index ffe32444395cc9..00000000000000
--- a/srcpkgs/python2-tkinter/template
+++ /dev/null
@@ -1,90 +0,0 @@
-# Template file for 'python2-tkinter'
-#
-# 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=python2-tkinter
-version=2.7.18.11
-revision=1
-_commit=a22a1d856ea8c656debe6f9a8fe9fee1ffc3f144
-pycompile_dirs="usr/lib/python2.7/lib-tk"
-hostmakedepends="pkg-config"
-makedepends="libffi-devel readline-devel gdbm-devel openssl-devel expat-devel
- sqlite-devel bzip2-devel zlib-devel tk-devel"
-short_desc="${_desc} - GUI toolkit for Python2"
-maintainer="Leah Neukirchen <leah@vuxu.org>"
-license="Python-2.0"
-homepage="https://www.python.org"
-distfiles="https://github.com/ActiveState/cpython/archive/${_commit}.tar.gz"
-checksum=aeb7b021405093b8687239009e5dadb2cb4099e69e75a246d6279770a5fee3af
-
-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() {
- 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
- fi
- ./configure ${configure_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"
- make ${makejobs}
-}
-
-do_install() {
- export PATH="$PATH:$wrksrc/hostpython"
-
- mkdir -p ${wrksrc}/tmp-destdir/usr/lib
- ln -s lib ${wrksrc}/tmp-destdir/usr/lib${XBPS_TARGET_WORDSIZE}
-
- make DESTDIR=${wrksrc}/tmp-destdir altinstall
-
- # We only care for the idle and tk modules.
- vmkdir usr/bin
- vmkdir usr/lib/python2.7/lib-dynload
- mv ${wrksrc}/tmp-destdir/usr/bin/idle ${DESTDIR}/usr/bin/idle2.7
- mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/idlelib \
- ${DESTDIR}/usr/lib/python2.7/
- mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/lib-tk \
- ${DESTDIR}/usr/lib/python2.7/
- mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/lib-dynload/_tkinter.so \
- ${DESTDIR}/usr/lib/python2.7/lib-dynload/
- ln -sf idle2.7 ${DESTDIR}/usr/bin/idle2
-}
-
-idle-python2_package() {
- short_desc="${_desc} - IDE for Python2 using Tkinter"
- pycompile_dirs="usr/lib/python2.7/idlelib"
- depends="${sourcepkg}-${version}_${revision}"
- pkg_install() {
- vmove usr/bin/idle2*
- vmove usr/lib/python2.7/idlelib
- vinstall ${FILESDIR}/idle2.xpm 644 usr/share/pixmaps
- vinstall ${FILESDIR}/idle2.desktop 644 usr/share/applications
- }
-}
diff --git a/srcpkgs/python2-tkinter/update b/srcpkgs/python2-tkinter/update
deleted file mode 120000
index b29540d8f73a12..00000000000000
--- a/srcpkgs/python2-tkinter/update
+++ /dev/null
@@ -1 +0,0 @@
-../python2/update
\ No newline at end of file
diff --git a/srcpkgs/python2-tkinter/files/idle2.desktop b/srcpkgs/python2/files/idle2.desktop
similarity index 100%
rename from srcpkgs/python2-tkinter/files/idle2.desktop
rename to srcpkgs/python2/files/idle2.desktop
diff --git a/srcpkgs/python2-tkinter/files/idle2.xpm b/srcpkgs/python2/files/idle2.xpm
similarity index 100%
rename from srcpkgs/python2-tkinter/files/idle2.xpm
rename to srcpkgs/python2/files/idle2.xpm
diff --git a/srcpkgs/python2/template b/srcpkgs/python2/template
index bc3162371e7209..e9a93d6a32f865 100644
--- a/srcpkgs/python2/template
+++ b/srcpkgs/python2/template
@@ -1,15 +1,12 @@
# Template file for 'python2'
-#
-# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python2-tkinter".
-#
pkgname=python2
version=2.7.18.11
-revision=1
+revision=2
_commit=a22a1d856ea8c656debe6f9a8fe9fee1ffc3f144
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"
+ sqlite-devel bzip2-devel zlib-devel tk-devel"
depends="ca-certificates"
short_desc="Interpreted, interactive, object-oriented programming language"
maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -21,7 +18,6 @@ checksum=aeb7b021405093b8687239009e5dadb2cb4099e69e75a246d6279770a5fee3af
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
@@ -79,25 +75,28 @@ do_install() {
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
+
+ rm ${DESTDIR}/usr/bin/smtpd.py
+
+ mv ${DESTDIR}/usr/bin/2to3{,-${py2_ver}}
+ mv ${DESTDIR}/usr/bin/pydoc{,${py2_ver}}
+ mv ${DESTDIR}/usr/bin/idle{,${py2_ver}}
+ ln -sf "idle${py2_ver}" "${DESTDIR}/usr/bin/idle2"
+
# 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
+ rm -r ${DESTDIR}/${py2_lib}/test
+ rm -r ${DESTDIR}/${py2_lib}/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
+ ${DESTDIR}/${py2_lib}/_sysconfigdata.py \
+ ${DESTDIR}/${py2_lib}/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
+ ${DESTDIR}/${py2_lib}/_sysconfigdata.py \
+ ${DESTDIR}/${py2_lib}/config/Makefile
fi
}
@@ -108,9 +107,31 @@ python2-devel_package() {
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
+ vmove "${py2_lib}/config/libpython2.7.a"
+
+ # Restore pyconfig.h to main package
+ mkdir -p "${DESTDIR}/${py2_inc}"
+ mv "${PKGDESTDIR}/${py2_inc}/pyconfig.h" "${DESTDIR}/${py2_inc}"
+ }
+}
+
+python2-tkinter_package() {
+ short_desc+=" - GUI toolkit for Python2"
+ depens="${sourcepkg}>=${version}_${revision}"
+ pkg_install() {
+ vmove "${py2_lib}/lib-tk"
+ vmove "${py2_lib}/lib-dynload/_tkinter.so"
+ }
+}
+
+idle-python2_package() {
+ short_desc="${_desc} - IDE for Python2 using Tkinter"
+ pycompile_dirs="usr/lib/python2.7/idlelib"
+ depends="${sourcepkg}-${version}_${revision}"
+ pkg_install() {
+ vmove usr/bin/idle*
+ vmove usr/lib/python2.7/idlelib
+ vinstall ${FILESDIR}/idle2.xpm 644 usr/share/pixmaps
+ vinstall ${FILESDIR}/idle2.desktop 644 usr/share/applications
}
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR REVIEW] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter
2025-01-31 17:04 [PR PATCH] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter ahesford
@ 2025-02-02 23:02 ` sgn
2025-02-02 23:02 ` sgn
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2025-02-02 23:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 310 bytes --]
New review comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/54161#discussion_r1938608404
Comment:
I would put: `depends="python>=3.0.0_1 python3>=3.13.1_2"`
conflicts resolution works before version resolution, install them first them is nearly impossible, afaik.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR REVIEW] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter
2025-01-31 17:04 [PR PATCH] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter ahesford
2025-02-02 23:02 ` [PR REVIEW] " sgn
@ 2025-02-02 23:02 ` sgn
2025-02-03 12:47 ` ahesford
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2025-02-02 23:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
New review comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/54161#discussion_r1938608404
Comment:
I would put: `depends="python>=3.0.0_1 python3>=${version}_${revision}"`
conflicts resolution works before version resolution, install them first them is nearly impossible, afaik.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR REVIEW] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter
2025-01-31 17:04 [PR PATCH] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter ahesford
2025-02-02 23:02 ` [PR REVIEW] " sgn
2025-02-02 23:02 ` sgn
@ 2025-02-03 12:47 ` ahesford
2025-02-09 1:36 ` [PR PATCH] [Updated] python3, python2: clean up templates and " ahesford
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ahesford @ 2025-02-03 12:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 531 bytes --]
New review comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/54161#discussion_r1939322883
Comment:
A dependency on `python` is not appropriate, because the these packages should function properly without installing or ignoring the convenience metapackage. The conflict is only to handle cases where people try to update `python3-tkinter` while locking `python` at 2.7, before it was a metapackage, in which case this update will overwrite the alternative symlink I'm now removing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Updated] python3, python2: clean up templates and dead alternatives, combine python2 and python2-tkinter
2025-01-31 17:04 [PR PATCH] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter ahesford
` (2 preceding siblings ...)
2025-02-03 12:47 ` ahesford
@ 2025-02-09 1:36 ` ahesford
2025-02-09 3:58 ` ahesford
2025-02-09 3:58 ` [PR PATCH] [Closed]: " ahesford
5 siblings, 0 replies; 7+ messages in thread
From: ahesford @ 2025-02-09 1:36 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]
There is an updated pull request by ahesford against master on the void-packages repository
https://github.com/ahesford/void-packages theres_a_snake_in_my_boots
https://github.com/void-linux/void-packages/pull/54161
python3, python2: clean up templates and dead alternatives, combine python2 and python2-tkinter
The `2to3` script is gone in our `python3`, making the `2to3` alternative obsolete. The `idle` alternative in the main `python3` package is wrong, because it produces a dead symlink when `idle-python3` is not installed.
Rather than split off a new `idle` alternative that behaves properly, it's better to just make a fixed `idle` symlink in the `idle-python3` package, drop `idle` from the `python` alternative in the `python2` package, and move on. This means that py2 users will have to use `idle2` or `idle2.7`, but we shouldn't worry about that anymore. It's a dead package that is already marked for "limited use".
At the same time, we don't have to worry about cycles with `python2`, so we can drop the split package and build the whole thing together.
Eventually, we should drop the alternatives for `python2` entirely, but that's a broader scope that I don't want to think about at the moment.
Closes: #54154.
cc: @leahneukirchen
A patch file from https://github.com/void-linux/void-packages/pull/54161.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-theres_a_snake_in_my_boots-54161.patch --]
[-- Type: text/x-diff, Size: 22991 bytes --]
From 67b68e95b4ba7c27bc5f5693a7652cfef3a0e98e Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Fri, 31 Jan 2025 11:29:24 -0500
Subject: [PATCH 1/7] python3: update to 3.13.2, clean up alternatives
---
srcpkgs/python3/template | 56 +++++++++++++++++++++-------------------
1 file changed, 30 insertions(+), 26 deletions(-)
diff --git a/srcpkgs/python3/template b/srcpkgs/python3/template
index b4f2829f001a9d..a3895c54c14579 100644
--- a/srcpkgs/python3/template
+++ b/srcpkgs/python3/template
@@ -5,14 +5,14 @@
# - coccinelle
#
pkgname=python3
-version=3.13.1
+version=3.13.2
revision=1
build_style="gnu-configure"
configure_args="--enable-shared --enable-ipv6
--enable-loadable-sqlite-extensions --with-computed-gotos
--with-dbmliborder=gdbm:ndbm --with-system-expat
--without-ensurepip ac_cv_working_tzset=yes"
-pycompile_dirs="usr/lib/python${version%.*}"
+pycompile_dirs="${py3_lib}"
hostmakedepends="pkgconf autoconf-archive automake"
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
expat-devel sqlite-devel bzip2-devel zlib-devel liblzma-devel"
@@ -27,13 +27,11 @@ distfiles="
https://www.python.org/ftp/python/${version%rc*}/Python-${version}.tar.xz
${KERNEL_SITE}/bluetooth/${_bluez}.tar.xz
"
-checksum="9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9
+checksum="d984bcc57cd67caab26f7def42e523b1c015bbc5dc07836cf4f0b63fa159eb56
55e2c645909ad82d833c42ce85ec20434e0ef0070941b1eab73facdd240bbd63"
skip_extraction="${_bluez}.tar.xz"
alternatives="
- python:idle:/usr/bin/idle${version%.*}
- python:2to3:/usr/bin/2to3-${version%.*}
python:pydoc:/usr/bin/pydoc${version%.*}
python:python:/usr/bin/python${version%.*}
python:python.1:/usr/share/man/man1/python${version%.*}.1"
@@ -126,36 +124,43 @@ do_install() {
rm ${DESTDIR}/${py3_lib}/LICENSE.txt
rm -f ${DESTDIR}/usr/bin/2to3
+
+ local _dst_py3_lib="${DESTDIR}/${py3_lib}"
+
# Remove files that belong to python3-tkinter and idle-python3
- rm -f ${DESTDIR}/usr/bin/idle3*
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/idlelib
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/tkinter
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/turtledemo
- rm -f ${DESTDIR}/usr/lib/python${version%.*}/turtle.py
+ rm ${DESTDIR}/usr/bin/idle3*
+ rm ${_dst_py3_lib}/turtle.py
+ rm -r ${_dst_py3_lib}/idlelib
+ rm -r ${_dst_py3_lib}/tkinter
+ rm -r ${_dst_py3_lib}/turtledemo
+
# Remove test module and tests that fail to be byte-compiled.
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/test
- rm -rf ${DESTDIR}/usr/lib/python${version%.*}/lib2to3/tests
+ rm -rf ${_dst_py3_lib}/test
+ rm -rf ${_dst_py3_lib}/lib2to3/tests
+
# Remove references to the install(1) wrapper.
sed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i \
- ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
- ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
+ ${_dst_py3_lib}/_sysconfigdata_*_*.py \
+ ${_dst_py3_lib}/config-${version%.*}*/Makefile
+
if [ "$CROSS_BUILD" ]; then
# Remove references to cross toolchain.
sed -i "s/$XBPS_CROSS_TRIPLET-//g" \
- ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
- ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
+ ${_dst_py3_lib}/_sysconfigdata_*_*.py \
+ ${_dst_py3_lib}/config-${version%.*}*/Makefile
sed -i -e "s,$XBPS_CROSS_BASE,,g" \
${DESTDIR}/usr/bin/python${version%.*}-config
fi
- sed -i -e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \
+
+ sed -i -e "s,-I./External,," \
-e "s,-ffile-prefix-map=[^[:space:]]*=[.],," \
- -e "s,-I./External,," \
+ -e "s,-fdebug-prefix-map=[^[:space:]]*=[.],," \
${DESTDIR}/usr/bin/python${version%.*}-config \
- ${DESTDIR}/usr/lib/python${version%.*}/_sysconfigdata_*_*.py \
- ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/Makefile
+ ${_dst_py3_lib}/_sysconfigdata_*_*.py \
+ ${_dst_py3_lib}/config-${version%.*}*/Makefile
# https://peps.python.org/pep-0668/
- vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 usr/lib/python${version%.*}
+ vinstall ${FILESDIR}/EXTERNALLY-MANAGED 644 "${py3_lib}"
}
python3-devel_package() {
@@ -165,10 +170,9 @@ python3-devel_package() {
vmove usr/bin/python*-config
vmove usr/lib/pkgconfig
vmove usr/include
- mv ${DESTDIR}/usr/lib/python${version%.*}/config-${version%.*}*/libpython${version%.*}*.a \
- ${PKGDESTDIR}/usr/lib
- mkdir -p ${DESTDIR}/usr/include/python${version%.*}
- mv ${PKGDESTDIR}/usr/include/python${version%.*}/pyconfig.h \
- ${DESTDIR}/usr/include/python${version%.*}
+ mv "${DESTDIR}/${py3_lib}"/config-*/libpython*.a "${PKGDESTDIR}/usr/lib"
+
+ mkdir -p "${DESTDIR}/${py3_inc}"
+ mv "${PKGDESTDIR}/${py3_inc}/pyconfig.h" "${DESTDIR}/${py3_inc}"
}
}
From 29630bd48923376d9648150d5dda7ec6cd56d399 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Fri, 31 Jan 2025 11:29:24 -0500
Subject: [PATCH 2/7] python3-tkinter: update to 3.13.2, clean up alternatives
---
srcpkgs/python3-tkinter/template | 38 ++++++++++++++++++--------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/srcpkgs/python3-tkinter/template b/srcpkgs/python3-tkinter/template
index 73cc637cd89a8b..e6b22b4c0c7599 100644
--- a/srcpkgs/python3-tkinter/template
+++ b/srcpkgs/python3-tkinter/template
@@ -8,17 +8,14 @@
_desc="Python programming language"
pkgname=python3-tkinter
-version=3.13.1
+version=3.13.2
revision=1
build_style="gnu-configure"
configure_args="--enable-shared --enable-ipv6
--enable-loadable-sqlite-extensions --with-computed-gotos
--with-dbmliborder=gdbm:ndbm --with-system-expat --with-system-ffi
--without-ensurepip"
-pycompile_dirs="
- usr/lib/python${version%.*}/tkinter
- usr/lib/python${version%.*}/turtledemo
- usr/lib/python${version%.*}/turtle.py"
+pycompile_dirs="${py3_lib}/tkinter ${py3_lib}/turtledemo ${py3_lib}/turtle.py"
hostmakedepends="pkg-config"
makedepends="libffi-devel readline-devel gdbm-devel openssl-devel
expat-devel sqlite-devel bzip2-devel zlib-devel liblzma-devel tk-devel"
@@ -28,7 +25,7 @@ maintainer="Andrew J. Hesford <ajh@sideband.org>"
homepage="https://www.python.org"
license="Python-2.0"
distfiles="https://www.python.org/ftp/python/${version%rc*}/Python-${version}.tar.xz"
-checksum=9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9
+checksum=d984bcc57cd67caab26f7def42e523b1c015bbc5dc07836cf4f0b63fa159eb56
if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
makedepends+=" libxcrypt-devel"
@@ -63,6 +60,7 @@ do_check() {
}
do_install() {
+
mkdir -p ${wrksrc}/tmp-destdir/usr/lib
ln -s lib ${wrksrc}/tmp-destdir/usr/lib${XBPS_TARGET_WORDSIZE}
@@ -71,25 +69,31 @@ do_install() {
# We only care for the idle and tkinter modules.
vmkdir usr/bin
- vmkdir usr/lib/python${version%.*}/lib-dynload
- mv ${wrksrc}/tmp-destdir/usr/bin/idle${version%.*} \
- ${DESTDIR}/usr/bin/idle${version%.*}
+ vmkdir "${py3_lib}/lib-dynload"
+
+ local _idle="idle${version%.*}"
+ local _src_py_lib="${wrksrc}/tmp-destdir/${py3_lib}"
+ local _dst_py_lib="${DESTDIR}/${py3_lib}"
+
+ mv "${wrksrc}/tmp-destdir/usr/bin/${_idle}" "${DESTDIR}/usr/bin"
+ mv "${_src_py_lib}/lib-dynload"/_tkinter.*.so "${_dst_py_lib}/lib-dynload"
+
for lib in idlelib tkinter turtledemo turtle.py; do
- mv ${wrksrc}/tmp-destdir/usr/lib/python${version%.*}/${lib} \
- ${DESTDIR}/usr/lib/python${version%.*}/
+ mv "${_src_py_lib}/${lib}" "${DESTDIR}/${py3_lib}"
done
- mv ${wrksrc}/tmp-destdir/usr/lib/python${version%.*}/lib-dynload/_tkinter.cpython-*.so \
- ${DESTDIR}/usr/lib/python${version%.*}/lib-dynload/
- ln -sf idle${version%.*} ${DESTDIR}/usr/bin/idle3
+
+ ln -sf "${_idle}" ${DESTDIR}/usr/bin/idle3
+ ln -sf "${_idle}" ${DESTDIR}/usr/bin/idle
}
idle-python3_package() {
short_desc="${_desc} - IDE for Python3 using Tkinter"
- pycompile_dirs="usr/lib/python${version%.*}/idlelib"
+ pycompile_dirs="${py3_lib}/idlelib"
depends="${sourcepkg}-${version}_${revision}"
+ conflicts="python<3.0.0_1 python2<=2.7.18.11_1 python3<=3.13.1_1"
pkg_install() {
- vmove usr/bin/idle3*
- vmove usr/lib/python${version%.*}/idlelib
+ vmove usr/bin/idle*
+ vmove "${py3_lib}/idlelib"
vinstall ${FILESDIR}/idle3.xpm 644 usr/share/pixmaps
vinstall ${FILESDIR}/idle3.desktop 644 usr/share/applications
}
From ef9bd4177fae817cfeaf17082911d0da021f00c4 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Fri, 31 Jan 2025 11:31:34 -0500
Subject: [PATCH 3/7] python2: clean up alternatives, merge python2-tkinter
---
srcpkgs/idle-python2 | 2 +-
srcpkgs/python2-tkinter | 1 +
srcpkgs/python2-tkinter/files/cross.patch | 1 -
srcpkgs/python2-tkinter/template | 90 -------------------
srcpkgs/python2-tkinter/update | 1 -
.../files/idle2.desktop | 0
.../files/idle2.xpm | 0
srcpkgs/python2/template | 67 +++++++++-----
8 files changed, 46 insertions(+), 116 deletions(-)
create mode 120000 srcpkgs/python2-tkinter
delete mode 120000 srcpkgs/python2-tkinter/files/cross.patch
delete mode 100644 srcpkgs/python2-tkinter/template
delete mode 120000 srcpkgs/python2-tkinter/update
rename srcpkgs/{python2-tkinter => python2}/files/idle2.desktop (100%)
rename srcpkgs/{python2-tkinter => python2}/files/idle2.xpm (100%)
diff --git a/srcpkgs/idle-python2 b/srcpkgs/idle-python2
index 5e2384079e0e4d..551ab268585033 120000
--- a/srcpkgs/idle-python2
+++ b/srcpkgs/idle-python2
@@ -1 +1 @@
-python2-tkinter
\ No newline at end of file
+python2
\ No newline at end of file
diff --git a/srcpkgs/python2-tkinter b/srcpkgs/python2-tkinter
new file mode 120000
index 00000000000000..551ab268585033
--- /dev/null
+++ b/srcpkgs/python2-tkinter
@@ -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
deleted file mode 120000
index 352ebe295b5b38..00000000000000
--- a/srcpkgs/python2-tkinter/files/cross.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../python2/files/cross.patch
\ No newline at end of file
diff --git a/srcpkgs/python2-tkinter/template b/srcpkgs/python2-tkinter/template
deleted file mode 100644
index ffe32444395cc9..00000000000000
--- a/srcpkgs/python2-tkinter/template
+++ /dev/null
@@ -1,90 +0,0 @@
-# Template file for 'python2-tkinter'
-#
-# 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=python2-tkinter
-version=2.7.18.11
-revision=1
-_commit=a22a1d856ea8c656debe6f9a8fe9fee1ffc3f144
-pycompile_dirs="usr/lib/python2.7/lib-tk"
-hostmakedepends="pkg-config"
-makedepends="libffi-devel readline-devel gdbm-devel openssl-devel expat-devel
- sqlite-devel bzip2-devel zlib-devel tk-devel"
-short_desc="${_desc} - GUI toolkit for Python2"
-maintainer="Leah Neukirchen <leah@vuxu.org>"
-license="Python-2.0"
-homepage="https://www.python.org"
-distfiles="https://github.com/ActiveState/cpython/archive/${_commit}.tar.gz"
-checksum=aeb7b021405093b8687239009e5dadb2cb4099e69e75a246d6279770a5fee3af
-
-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() {
- 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
- fi
- ./configure ${configure_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"
- make ${makejobs}
-}
-
-do_install() {
- export PATH="$PATH:$wrksrc/hostpython"
-
- mkdir -p ${wrksrc}/tmp-destdir/usr/lib
- ln -s lib ${wrksrc}/tmp-destdir/usr/lib${XBPS_TARGET_WORDSIZE}
-
- make DESTDIR=${wrksrc}/tmp-destdir altinstall
-
- # We only care for the idle and tk modules.
- vmkdir usr/bin
- vmkdir usr/lib/python2.7/lib-dynload
- mv ${wrksrc}/tmp-destdir/usr/bin/idle ${DESTDIR}/usr/bin/idle2.7
- mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/idlelib \
- ${DESTDIR}/usr/lib/python2.7/
- mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/lib-tk \
- ${DESTDIR}/usr/lib/python2.7/
- mv ${wrksrc}/tmp-destdir/usr/lib/python2.7/lib-dynload/_tkinter.so \
- ${DESTDIR}/usr/lib/python2.7/lib-dynload/
- ln -sf idle2.7 ${DESTDIR}/usr/bin/idle2
-}
-
-idle-python2_package() {
- short_desc="${_desc} - IDE for Python2 using Tkinter"
- pycompile_dirs="usr/lib/python2.7/idlelib"
- depends="${sourcepkg}-${version}_${revision}"
- pkg_install() {
- vmove usr/bin/idle2*
- vmove usr/lib/python2.7/idlelib
- vinstall ${FILESDIR}/idle2.xpm 644 usr/share/pixmaps
- vinstall ${FILESDIR}/idle2.desktop 644 usr/share/applications
- }
-}
diff --git a/srcpkgs/python2-tkinter/update b/srcpkgs/python2-tkinter/update
deleted file mode 120000
index b29540d8f73a12..00000000000000
--- a/srcpkgs/python2-tkinter/update
+++ /dev/null
@@ -1 +0,0 @@
-../python2/update
\ No newline at end of file
diff --git a/srcpkgs/python2-tkinter/files/idle2.desktop b/srcpkgs/python2/files/idle2.desktop
similarity index 100%
rename from srcpkgs/python2-tkinter/files/idle2.desktop
rename to srcpkgs/python2/files/idle2.desktop
diff --git a/srcpkgs/python2-tkinter/files/idle2.xpm b/srcpkgs/python2/files/idle2.xpm
similarity index 100%
rename from srcpkgs/python2-tkinter/files/idle2.xpm
rename to srcpkgs/python2/files/idle2.xpm
diff --git a/srcpkgs/python2/template b/srcpkgs/python2/template
index bc3162371e7209..e9a93d6a32f865 100644
--- a/srcpkgs/python2/template
+++ b/srcpkgs/python2/template
@@ -1,15 +1,12 @@
# Template file for 'python2'
-#
-# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/python2-tkinter".
-#
pkgname=python2
version=2.7.18.11
-revision=1
+revision=2
_commit=a22a1d856ea8c656debe6f9a8fe9fee1ffc3f144
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"
+ sqlite-devel bzip2-devel zlib-devel tk-devel"
depends="ca-certificates"
short_desc="Interpreted, interactive, object-oriented programming language"
maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -21,7 +18,6 @@ checksum=aeb7b021405093b8687239009e5dadb2cb4099e69e75a246d6279770a5fee3af
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
@@ -79,25 +75,28 @@ do_install() {
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
+
+ rm ${DESTDIR}/usr/bin/smtpd.py
+
+ mv ${DESTDIR}/usr/bin/2to3{,-${py2_ver}}
+ mv ${DESTDIR}/usr/bin/pydoc{,${py2_ver}}
+ mv ${DESTDIR}/usr/bin/idle{,${py2_ver}}
+ ln -sf "idle${py2_ver}" "${DESTDIR}/usr/bin/idle2"
+
# 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
+ rm -r ${DESTDIR}/${py2_lib}/test
+ rm -r ${DESTDIR}/${py2_lib}/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
+ ${DESTDIR}/${py2_lib}/_sysconfigdata.py \
+ ${DESTDIR}/${py2_lib}/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
+ ${DESTDIR}/${py2_lib}/_sysconfigdata.py \
+ ${DESTDIR}/${py2_lib}/config/Makefile
fi
}
@@ -108,9 +107,31 @@ python2-devel_package() {
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
+ vmove "${py2_lib}/config/libpython2.7.a"
+
+ # Restore pyconfig.h to main package
+ mkdir -p "${DESTDIR}/${py2_inc}"
+ mv "${PKGDESTDIR}/${py2_inc}/pyconfig.h" "${DESTDIR}/${py2_inc}"
+ }
+}
+
+python2-tkinter_package() {
+ short_desc+=" - GUI toolkit for Python2"
+ depens="${sourcepkg}>=${version}_${revision}"
+ pkg_install() {
+ vmove "${py2_lib}/lib-tk"
+ vmove "${py2_lib}/lib-dynload/_tkinter.so"
+ }
+}
+
+idle-python2_package() {
+ short_desc="${_desc} - IDE for Python2 using Tkinter"
+ pycompile_dirs="usr/lib/python2.7/idlelib"
+ depends="${sourcepkg}-${version}_${revision}"
+ pkg_install() {
+ vmove usr/bin/idle*
+ vmove usr/lib/python2.7/idlelib
+ vinstall ${FILESDIR}/idle2.xpm 644 usr/share/pixmaps
+ vinstall ${FILESDIR}/idle2.desktop 644 usr/share/applications
}
}
From 3a60110941cc1c94813027fe857d6e7e2001804b Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Sat, 8 Feb 2025 20:19:32 -0500
Subject: [PATCH 4/7] maturin: update to 1.8.2.
---
srcpkgs/maturin/template | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/maturin/template b/srcpkgs/maturin/template
index e9dbee2e88e957..23b841b902bc5b 100644
--- a/srcpkgs/maturin/template
+++ b/srcpkgs/maturin/template
@@ -1,6 +1,6 @@
# Template file for 'maturin'
pkgname=maturin
-version=1.8.1
+version=1.8.2
revision=1
build_style=python3-pep517
build_helper="qemu rust"
@@ -12,7 +12,7 @@ maintainer="Andrew J. Hesford <ajh@sideband.org>"
license="Apache-2.0, MIT"
homepage="https://github.com/PyO3/maturin"
distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=8ddaf1655509ae079406635654cbc0c73d622e7c2a537f2465a83e8021dd0cc4
+checksum=204f22de5c56a3d599f427344e7389270d71ea183bcc0c719c3725931459180b
# Tests use unstable features and fail to build
make_check=no
From fc2e8faa34e68f18de3c659fc80c7e1d00190c58 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Sat, 8 Feb 2025 20:19:56 -0500
Subject: [PATCH 5/7] python3-bokeh: update to 3.6.3.
---
srcpkgs/python3-bokeh/template | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/python3-bokeh/template b/srcpkgs/python3-bokeh/template
index 1a74965ee6a346..edfabc552eaf4f 100644
--- a/srcpkgs/python3-bokeh/template
+++ b/srcpkgs/python3-bokeh/template
@@ -1,6 +1,6 @@
# Template file for 'python3-bokeh'
pkgname=python3-bokeh
-version=3.6.2
+version=3.6.3
revision=1
build_style=python3-module
hostmakedepends="python3-setuptools python3-colorama"
@@ -12,7 +12,7 @@ license="BSD-3-Clause"
homepage="https://bokeh.org"
changelog="https://raw.githubusercontent.com/bokeh/bokeh/main/CHANGELOG"
distfiles="${PYPI_SITE}/b/bokeh/bokeh-${version}.tar.gz"
-checksum=2f3043d9ecb3d5dc2e8c0ebf8ad55727617188d4e534f3e7208b36357e352396
+checksum=9b81d6a9ea62e75a04a1a9d9f931942016890beec9ab5d129a2a4432cf595c0a
# Tests have unpackaged dependencies and require fetching data; skipping
make_check=no
From 496fcf6512163c24a928cd171ce086981bd21e66 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Sat, 8 Feb 2025 20:32:59 -0500
Subject: [PATCH 6/7] python3-poetry-core: update to 2.0.1.
---
srcpkgs/python3-poetry-core/template | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/srcpkgs/python3-poetry-core/template b/srcpkgs/python3-poetry-core/template
index 866e48b35bdfc2..bc085d2fd2c148 100644
--- a/srcpkgs/python3-poetry-core/template
+++ b/srcpkgs/python3-poetry-core/template
@@ -1,18 +1,23 @@
# Template file for 'python3-poetry-core'
pkgname=python3-poetry-core
-version=1.9.0
-revision=2
+version=2.0.1
+revision=1
build_style="python3-pep517"
+make_check_args="
+ --deselect tests/masonry/builders/test_sdist.py::test_sdist_mtime_zero
+ --deselect tests/masonry/builders/test_sdist.py::test_sdist_members_mtime_default
+ --deselect tests/masonry/builders/test_wheel.py::test_dist_info_date_time_default_value
+"
depends="python3"
checkdepends="python3-devel python3-setuptools python3-virtualenv python3-pyrsistent
- python3-pytest-mock python3-tomli-w"
+ python3-pytest-mock python3-tomli-w python3-trove-classifiers"
short_desc="Poetry PEP 517 Build Backend & Core Utilities"
maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
homepage="https://github.com/python-poetry/poetry-core"
changelog="https://raw.githubusercontent.com/python-poetry/poetry-core/main/CHANGELOG.md"
distfiles="https://github.com/python-poetry/poetry-core/archive/refs/tags/${version}.tar.gz"
-checksum=642f63ec06ba4e581b720def3a162bc23d11588fef9e9c5c57ab8a1e4f36e721
+checksum=1d7a1052f073896c1dad9f06bcbba711d0e6bbfe5118c5c8e39dc5ce89ae7db0
make_check_pre="env PYTHONPATH=src PATH=/usr/libexec/chroot-git:${PATH}"
post_install() {
From f8a0812d5365a934adf64d476c03932baaca823f Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Sat, 8 Feb 2025 20:34:51 -0500
Subject: [PATCH 7/7] python3-aiohappyeyeballs: update to 2.4.6.
---
srcpkgs/python3-aiohappyeyeballs/template | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/python3-aiohappyeyeballs/template b/srcpkgs/python3-aiohappyeyeballs/template
index 1748e9cef448bf..8a5cca2a0638f8 100644
--- a/srcpkgs/python3-aiohappyeyeballs/template
+++ b/srcpkgs/python3-aiohappyeyeballs/template
@@ -1,6 +1,6 @@
# Template file for 'python3-aiohappyeyeballs'
pkgname=python3-aiohappyeyeballs
-version=2.4.4
+version=2.4.6
revision=1
build_style=python3-pep517
hostmakedepends="python3-poetry-core"
@@ -12,7 +12,7 @@ license="PSF-2.0"
homepage="https://aiohappyeyeballs.readthedocs.io"
changelog="https://raw.githubusercontent.com/aio-libs/aiohappyeyeballs/main/CHANGELOG.md"
distfiles="https://github.com/aio-libs/aiohappyeyeballs/archive/v${version}.tar.gz"
-checksum=3306a0837888d7abf89e9ae6197461672ada69d641bdaa6373af593fdb678934
+checksum=2d7a8b1a4f6f65028159e26e191091d290e155b09f8e2df62cf10fc68df8ea49
pre_check() {
vsed -i -e '/^addopts/d' pyproject.toml
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Closed]: python3, python2: clean up templates and dead alternatives, combine python2 and python2-tkinter
2025-01-31 17:04 [PR PATCH] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter ahesford
` (4 preceding siblings ...)
2025-02-09 3:58 ` ahesford
@ 2025-02-09 3:58 ` ahesford
5 siblings, 0 replies; 7+ messages in thread
From: ahesford @ 2025-02-09 3:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]
There's a closed pull request on the void-packages repository
python3, python2: clean up templates and dead alternatives, combine python2 and python2-tkinter
https://github.com/void-linux/void-packages/pull/54161
Description:
The `2to3` script is gone in our `python3`, making the `2to3` alternative obsolete. The `idle` alternative in the main `python3` package is wrong, because it produces a dead symlink when `idle-python3` is not installed.
Rather than split off a new `idle` alternative that behaves properly, it's better to just make a fixed `idle` symlink in the `idle-python3` package, drop `idle` from the `python` alternative in the `python2` package, and move on. This means that py2 users will have to use `idle2` or `idle2.7`, but we shouldn't worry about that anymore. It's a dead package that is already marked for "limited use".
At the same time, we don't have to worry about cycles with `python2`, so we can drop the split package and build the whole thing together.
Eventually, we should drop the alternatives for `python2` entirely, but that's a broader scope that I don't want to think about at the moment.
Closes: #54154.
cc: @leahneukirchen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: python3, python2: clean up templates and dead alternatives, combine python2 and python2-tkinter
2025-01-31 17:04 [PR PATCH] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter ahesford
` (3 preceding siblings ...)
2025-02-09 1:36 ` [PR PATCH] [Updated] python3, python2: clean up templates and " ahesford
@ 2025-02-09 3:58 ` ahesford
2025-02-09 3:58 ` [PR PATCH] [Closed]: " ahesford
5 siblings, 0 replies; 7+ messages in thread
From: ahesford @ 2025-02-09 3:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/54161#issuecomment-2646055469
Comment:
Merged with a minor python update in 766650b66d7235e0c4b7aec36ddb11882b68ad84.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-02-09 3:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-31 17:04 [PR PATCH] python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter ahesford
2025-02-02 23:02 ` [PR REVIEW] " sgn
2025-02-02 23:02 ` sgn
2025-02-03 12:47 ` ahesford
2025-02-09 1:36 ` [PR PATCH] [Updated] python3, python2: clean up templates and " ahesford
2025-02-09 3:58 ` ahesford
2025-02-09 3:58 ` [PR PATCH] [Closed]: " ahesford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).