Skip to content

Instantly share code, notes, and snippets.

@fabricionaweb
Last active August 13, 2024 17:50
Show Gist options
  • Save fabricionaweb/95c84ba87710c781330b8842efafd0b1 to your computer and use it in GitHub Desktop.
Save fabricionaweb/95c84ba87710c781330b8842efafd0b1 to your computer and use it in GitHub Desktop.
Build python on slackware (for unraid)

Tested on Unraid 6.12


  1. Install LXC the plugin, create a Slackware 15.0, start and attach to it

  2. Upgrade security patches (press O to override when asked)

slackpkg upgrade-all
  1. Get the source from -current branch. I use rsync
slackpkg install rsync lz4 xxHash
rsync -rzvh rsync://ftp.slackware.com/slackware/slackware-current/source/d/python3/ ~/python3-src

3.1. (Optional) You can grab Python3.12 source if you want that version. It works too

wget -P ~/python3-src \
  https://www.python.org/ftp/python/3.12.5/Python-3.12.5.tar.xz \
  https://www.python.org/ftp/python/3.12.5/Python-3.12.5.tar.xz.asc \
  https://www.python.org/ftp/python/doc/3.12.5/python-3.12.5-docs-text.tar.bz2
  1. Static link the expat dependency (since its not include on Unraid, it is good to us)
sed -i 's/with-system-expat/without-system-expat/' ~/python3-src/python3.SlackBuild
  1. Include ensurepip (optional, I prefer to not)
sed -i 's/without-ensurepip/with-ensurepip/' ~/python3-src/python3.SlackBuild

5.1. (Optional) If you choose to not include ensurepip you can add those lines to /boot/config/go

# if it has pypthon then upgrade/install pip
[[ -f /usr/bin/python3 ]] && /usr/bin/python3 -m ensurepip --upgrade
  1. Install dependencies
slackpkg install kernel-headers binutils gcc-11 gc-8 make pkg-config guile flex libffi expat zlib gdbm readline
  1. Build
sh ~/python3-src/python3.SlackBuild
  1. It should go to /tmp/python3-*.txz (something like that) inside the container.

  2. On the Unraid LXC plugin Settings (/Settings/LXCSettings) get the "storage path", there will be rootfs for your Slackware container, go tmp folder.

  3. You know the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment