# build.sh - build librewolf on windows # derived from https://gitlab.com/librewolf-community/browser/linux/-/blob/master/PKGBUILD pkgname=librewolf _pkgname=LibreWolf pkgver=85.0 fetch() { rm -f firefox-$pkgver.source.tar.xz wget https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz # the settings and common submodules should be checked out to allow the build rm -f megabar.patch remove_addons.patch unity-menubar.patch wget https://gitlab.com/librewolf-community/browser/linux/-/raw/master/megabar.patch wget https://gitlab.com/librewolf-community/browser/linux/-/raw/master/remove_addons.patch wget https://gitlab.com/librewolf-community/browser/linux/-/raw/master/unity-menubar.patch } prepare() { rm -rf firefox-$pkgver tar xf firefox-$pkgver.source.tar.xz cd firefox-$pkgver cat >../mozconfig < librewolf-$pkgver.en-US.win64.zip.sha256sum rm -f ../../../librewolf-$pkgver.en-US.win64.zip* cp librewolf-$pkgver.en-US.win64.zip* ../../.. cd ../.. cd .. } installer_macos() { cd firefox-$pkgver # TODO: we want to apply the librewolf settings and make the .dmg file here. echo 'build.sh: installer_macos() Not implemented yet.' cd .. } # windows: change $PATH to find all the build tools in .mozbuild # this might do the trick on macos aswell? if [ -f '/c/mozilla-build/start-shell.bat' ]; then export TPATH=$HOME/.mozbuild/clang/bin:$HOME/.mozbuild/cbindgen:$HOME/.mozbuild/node:$HOME/.mozbuild/nasm export PATH=$TPATH:$PATH fi # process commandline arguments and do something done_something=0 if [[ "$*" == *fetch* ]]; then fetch done_something=1 fi if [[ "$*" == *prepare* ]]; then prepare done_something=1 fi if [[ "$*" == *build* ]]; then build done_something=1 fi if [[ "$*" == *package* ]]; then package done_something=1 fi if [[ "$*" == *installer_win* ]]; then installer_win done_something=1 fi if [[ "$*" == *installer_macos* ]]; then installer_macos done_something=1 fi if (( done_something == 0 )); then echo "Usage: $0 fetch | prepare | build | package | installer_win | installer_mac" exit fi