-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add package: termux-gui-pm #12315
Conversation
cat <<- EOF > ./postinst | ||
#!${TERMUX_PREFIX}/bin/sh | ||
echo "Installing python bindings for Termux:GUI" | ||
pip install --upgrade termuxgui |
There was a problem hiding this comment.
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 (?)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Please use |
I copied the pre-configure function from other packages that use |
70d282a
to
5398171
Compare
5398171
to
0ccdb2e
Compare
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! |
No description provided.