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

Conversation

tareksander
Copy link
Member

No description provided.

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

@Grimler91
Copy link
Member

Please use termux_setup_python_crossenv here as well, even if it is not strictly necessary (adviced by @xtkoba in #12576 (comment)), and then we can merge this 👍

@tareksander
Copy link
Member Author

I copied the pre-configure function from other packages that use termux_setup_python_crossenv is that good enough?

@Grimler91 Grimler91 merged commit 0ccdb2e into termux:master Nov 3, 2022
@Grimler91
Copy link
Member

Grimler91 commented Nov 3, 2022

I forgot that package doesn't have an setup.py or pyproject.toml file, and that we install in a debscript, so crossenv shouldn't be needed in this case, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants