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

Add package: termux-gui-pm #12315

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Changes from all commits
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
21 changes: 21 additions & 0 deletions packages/termux-gui-pm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TERMUX_PKG_HOMEPAGE="https://github.com/tareksander/termux-gui-pm"
TERMUX_PKG_DESCRIPTION="A graphical package manager for various package formats for Termux and proot-distro distros"
TERMUX_PKG_LICENSE="MPL-2.0"
TERMUX_PKG_MAINTAINER="@tareksander"
TERMUX_PKG_VERSION="1.0.0"
TERMUX_PKG_DEPENDS="python"
TERMUX_PKG_PLATFORM_INDEPENDENT=true
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_SRCURL="https://github.com/tareksander/termux-gui-pm/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256="3a5a829b721d17f2002406571852e63d1984acc9732e58f2f76a2966381297c6"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_UPDATE_TAG_TYPE="newest-tag"

termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!${TERMUX_PREFIX}/bin/sh
echo "Installing python bindings for Termux:GUI"
pip install --upgrade termuxgui
Copy link
Member

@Grimler91 Grimler91 Oct 10, 2022

Choose a reason for hiding this comment

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

Could be nice to add termuxgui==$TERMUX_PKG_VERSION here, since package will be auto-update I guess there could be a risk of risk github being updated before pypi, leading to pip install --upgrade termuxgui installing an older version (?)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll make sure to only release updates to the apps when the update is already on pypi. $TERMUX_PKG_VERSION can't be used, since the library and all programs don't share the same version. I also though about packaging the python library as a Termux package, but the installation path changes with every minor version of python (e.g. /data/data/com.termux/files/usr/lib/python3.10/site-packages would change to /data/data/com.termux/files/usr/lib/python3.11/site-packages). Are there other python libraries packaged as Termux packages? How do they handle that? Could I ship the wheel in the package instead and reinstall it with a dpkg hook after a python upgrade to avoid dependency on the python version?

Copy link
Member

Choose a reason for hiding this comment

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

Revision of other python packages have to be increased when python is updated, so that they are install to the new path.

You could perhaps drop using pip all together and use the termux_setup_python_crossenv function to install termux-gui-pm from source into TERMUX_PREFIX, see for example python-apt for another fairly small python package that uses it

Copy link
Member Author

Choose a reason for hiding this comment

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

I looked how linux distributions deal with this, and on debian there is a directory /usr/lib/python3/dist-packages added to the python module search path where all python3 modules from apt packages are placed. If that was implemented for Termux, there would be no need to manually increase the revision to rebuild the packages after each python release. Debian seems to modify Lib/sysconfig.py for that with this patch. Is that a good idea? Should I create an issue for something like that?

Copy link
Member

Choose a reason for hiding this comment

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

Probably a good idea to discuss it, it would not work (I think) for packages with native libraries as (I guess) the ABI can change on major python updates, but for termux-gui-pm it should work so might be a good idea

EOF
}