[Slackbuilds-users] RFC: SlackBuild to Install Newer Python to /opt
Lumin Etherlight
lumin+slackbuilds at etherlight.link
Mon Jun 8 08:19:26 UTC 2026
Hello, friends,
I was trying to package magic-wormhole[1],
but found out that it requires Python 3.10+, which
is newer than the version available in Slackware.
I solved this by compiling a python3-opt version
of python, that installs to /opt, without effect
on the base Python install.
I also wrote a SlackBuild for magic-wormhole
that installs pre-built wheels for the package and
all of its dependencies into a venv, then packages
it as an installation to /opt too. the wormhole
executables are then copied to /usr/bin, and they
work as expected; they automatically use the new
/opt Python installation, since they set it as the
shebang #! interpreter, thus using the libraries
installed in that venv.
Wormhole works, all dependencies are in the
/opt/magic-wormhole-bin venv, the Python install
it uses is in /opt/python3. This seems to be some
reasonable method to package such applications.
Close to a typical -bin package, but for Python,
basically. The final wormhole package is 26MiB,
so not too bloated. Other applications that may
depend on newer Python3 versions can perhaps do
the same, until we hopefully get a newer Python in
Slackware. No internet connection is required at
build-time for this method; all dependencies are
listed in the .info file as expected.
I have submitted both scripts; python3-opt,
and magic-wormhole-bin, for your consideration and
review. I don't expect them to be published soon,
of course, as this approach is not traditionally
used in SlackBuilds, so it will likely take some
discussion, testing, and improvement. On my side,
python3-opt was tested on clean Slackware installs
fully patched, for both 32bit and 64bit. As for
magic-wormhole-bin, it works on 64bit for now, and
that's where I tested it. It fails on 32bit, in
an isolated venv, with some Rust compiler errors,
as one of the dependencies compiles something at
some point, probably a Python plugin. I haven't
had time to debug this yet.
Feedback is, as always, much appreciated :)
[1]: https://magic-wormhole.readthedocs.io/
Best Regards,
Lumin Etherlight
More information about the SlackBuilds-users
mailing list