# 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 #srcdir=/c/mozilla-source 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 cp librewolf-$pkgver.en-US.win64.zip* ../../.. cd ../.. cd .. } # windows: change $PATH to find all the build tools in .mozbuild # this might do the trick on macos aswell export TPATH=$HOME/.mozbuild/clang/bin:$HOME/.mozbuild/cbindgen:$HOME/.mozbuild/node:$HOME/.mozbuild/nasm export PATH=$TPATH:$PATH # 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 (( done_something == 0 )); then echo "Usage: $0 fetch | prepare | build | package" fi