There’s some link in the readme but for the tl;dr version I’ll try write it up myself:
First step is to install the build tools, which is Snapcraft itself and a backend for it to work in, so that the build environment is reproducible. This either comes down to building in a VM or building in a container, and I’d recommend the container, i.e, LXD.
sudo snap install snapcraft --classic
sudo snap install multipass # If you want the VM approach
sudo snap install lxd # If you want the container approach
sudo lxd init --auto # If you picked LXD, this will set it up magically, but may require a reboot
Next, grab the repository
git clone https://github.com/MrCarroll/root-snap/
cd root-snap
git checkout 6-24
The main branch builds the latest master/HEAD. The branches are generally all similar but may have subtle changes in e.g what packages are pinned.
#If using multipass
snapcraft
#If using LXD
snapcraft --use-lxd
The command will build ROOT from scratch in a clean environment, grab all the Python packages, and bundle them up into a single .snap
file at the end.
sudo snap install root-framework_local_file.snap --dangerous
The dangerous flag acknowledges your local copy is unsigned. It’s still heavily sandboxed, you could remove a lot of the sandboxing with --devmode
which is a cheat mode to completely remove all the AppArmor policies (but keeps its own mount namespace & etc)
sudo snap alias root-framework root
sudo snap alias root-framework.pyroot pyroot
sudo snap alias root-framework.rootbrowse rootbrowse
# Continue for however many you actually care about
These final steps alias the built in package names to their normal names
Since all the Python packages will be in the .snap file, and will never update unless you explicitly rebuild and reinstall it, they’ll be frozen forever and copyable across other machines, along with the entire GCC toolchain and ROOT libraries they depend upon.
(But Python will still increase in 3.8.X, though it’s very very very much ensured to be compatible and would never jump to a new major version, this is because the Python installation is actually in the core20 snap and not the ROOT snap, but you could actually change that too though I’d not personally bother).