Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3, python2: clean up templates andgg dead alternatives, combine python2 and python2-tkinter #54161

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions srcpkgs/python3-tkinter/template
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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}

Expand All @@ -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"
Copy link
Member

@sgn sgn Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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
}
Expand Down