#!/usr/bin/env bash

cd ~/.local/share/torbrowser/tor-browser_en-US/
guix shell --check --pure --expression='(list (@@ (gnu packages gcc) gcc-11) "lib")' coreutils bash grep sed gcc-toolchain patchelf gtk+ dbus-glib libxt libevent openssl << EOF
cd Browser
patchelf --set-interpreter \$LIBRARY_PATH/ld-linux-x86-64.so.2 firefox.real
patchelf --set-interpreter \$LIBRARY_PATH/ld-linux-x86-64.so.2 TorBrowser/Tor/tor
LD_LIBRARY_PATH=\$LIBRARY_PATH ./start-tor-browser
EOF
