diff --git a/artifacts_deb.sh b/artifacts_deb.sh index d2c3305..f11f6c3 100644 --- a/artifacts_deb.sh +++ b/artifacts_deb.sh @@ -1,38 +1,53 @@ -#!/usr/bin/bash +exe= +objdir=obj-x86_64-pc-linux-gnu/dist/firefox +ospkg=deb # sanity checks -if [ ! -d obj-x86_64-pc-linux-gnu/dist/firefox ]; then - echo "installer_deb.sh: directory obj-x86_64-pc-linux-gnu/dist/firefox not found." +if [ ! -d $objdir ]; then + echo "artifacts_win.sh: directory $objdir not found. did you run './build.sh build'?" exit 1; fi rm -rf ../firefox ../librewolf -cp -r obj-x86_64-pc-linux-gnu/dist/firefox .. - +cp -r $objdir .. pushd .. -mv firefox librewolf +mv firefox librewolf # apply the LibreWolf settings cp -rv settings/* librewolf # rename the executable manually -cd librewolf ; mv -v firefox librewolf ; cd .. - -# recreate the zip file.. - +pushd librewolf ; mv -v firefox$exe librewolf$exe ; popd # clean garbage files cd librewolf ; rm -rf maintenanceservice* pingsender* firefox.*.xml precomplete removed-files ; cd .. +# copy the windows icon +cp -v common/source_files/browser/branding/librewolf/firefox.ico librewolf/librewolf.ico -# copy the files to register LibreWolf as local app. -cp -v branding_files/register-librewolf branding_files/start-librewolf* librewolf - -# be sure to remove the previous zip file.. -rm -f librewolf-$pkgver.en-US.deb.zip* - -zip -r9 librewolf-$pkgver.en-US.deb.zip librewolf -if [ $? -ne 0 ]; then exit 1; fi -sha256sum librewolf-$pkgver.en-US.deb.zip > librewolf-$pkgver.en-US.deb.zip.sha256sum +# create the final zip artifact +rm -f librewolf-$pkgver.en-US.$ospkg.zip +zip -qr9 librewolf-$pkgver.en-US.$ospkg.zip librewolf if [ $? -ne 0 ]; then exit 1; fi +# now to try to make the installer +# (create a .deb here) + +# patch to experimental config +if [ ! -z $experimental ]; then + pushd librewolf + echo "Applying experimental patches..." + patch -p1 -i ../patches/librewolf-config.patch + if [ $? -ne 0 ]; then exit 1; fi + patch -p1 -i ../patches/librewolf-policies.patch + if [ $? -ne 0 ]; then exit 1; fi + popd + + # create the final zip artifact + rm -f librewolf-$pkgver.en-US.$ospkg-experimental.zip + zip -qr9 librewolf-$pkgver.en-US.$ospkg-experimental.zip librewolf + if [ $? -ne 0 ]; then exit 1; fi + + # now to try to make the installer + # (create a .deb here) +fi popd diff --git a/artifacts_win.sh b/artifacts_win.sh index 88b3d6a..a4fe005 100644 --- a/artifacts_win.sh +++ b/artifacts_win.sh @@ -1,5 +1,6 @@ exe=.exe objdir=obj-x86_64-pc-mingw32/dist/firefox +ospkg=win64 # sanity checks if [ ! -d $objdir ]; then @@ -23,8 +24,8 @@ cd librewolf ; rm -rf maintenanceservice* pingsender* firefox.*.xml precomplete cp -v common/source_files/browser/branding/librewolf/firefox.ico librewolf/librewolf.ico # create the final zip artifact -rm -f librewolf-$pkgver.en-US.win64.zip -zip -qr9 librewolf-$pkgver.en-US.win64.zip librewolf +rm -f librewolf-$pkgver.en-US.$ospkg.zip +zip -qr9 librewolf-$pkgver.en-US.$ospkg.zip librewolf if [ $? -ne 0 ]; then exit 1; fi # now to try to make the installer @@ -44,8 +45,8 @@ if [ ! -z $experimental ]; then popd # create the final zip artifact - rm -f librewolf-$pkgver.en-US.win64-experimental.zip - zip -qr9 librewolf-$pkgver.en-US.win64-experimental.zip librewolf + rm -f librewolf-$pkgver.en-US.$ospkg-experimental.zip + zip -qr9 librewolf-$pkgver.en-US.$ospkg-experimental.zip librewolf if [ $? -ne 0 ]; then exit 1; fi # now to try to make the installer diff --git a/build.sh b/build.sh index e719fe3..4f64e39 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # build.sh - build librewolf on windows # derived from https://gitlab.com/librewolf-community/browser/linux/-/blob/master/PKGBUILD # @@ -53,6 +53,7 @@ clean() { # linux rm -f librewolf-$pkgver.en-US.deb.zip + rm -f librewolf-$pkgver.en-US.deb-experimental.zip rm -f librewolf-$pkgver.en-US.rpm.zip echo "clean: done." @@ -281,27 +282,6 @@ artifacts_win() { echo "artifacts_win: done." } -artifacts_exp() { - echo "artifacts_exp: begin." - if [ ! -d firefox-$pkgver ]; then exit 1; fi - cd firefox-$pkgver - - ./mach package - if [ $? -ne 0 ]; then exit 1; fi - - echo "" - echo "artifacts_exp: Creating final artifacts." - echo "" - - # enable artifacts_win.sh to apply patches - experimental=experimental - - . ../artifacts_win.sh - - cd .. - echo "artifacts_exp: done." -} - artifacts_deb() { echo "artifacts_deb: begin." @@ -347,7 +327,7 @@ rustup() { # rust needs special love: https://www.atechtown.com/install-rust-language-on-debian-10/ echo "rustup: begin." curl https://sh.rustup.rs -sSf | sh - source $HOME/.cargo/env + . $HOME/.cargo/env cargo install cbindgen echo "rustup: done." } @@ -404,7 +384,7 @@ if [ -f '/c/mozilla-build/start-shell.bat' ]; then fi if [ -f $HOME/.cargo/env ]; then - source $HOME/.cargo/env + . $HOME/.cargo/env fi @@ -424,6 +404,9 @@ if [[ "$*" == *policies_diff* ]]; then policies_diff done_something=1 fi + +# + if [[ "$*" == *clean* ]]; then clean done_something=1 @@ -432,6 +415,13 @@ if [[ "$*" == *git_subs* ]]; then git_subs done_something=1 fi +if [[ "$*" == *rustup* ]]; then + rustup + done_something=1 +fi + +# + if [[ "$*" == *deps_deb* ]]; then deps_deb done_something=1 @@ -444,10 +434,9 @@ if [[ "$*" == *deps_pkg* ]]; then deps_pkg done_something=1 fi -if [[ "$*" == *rustup* ]]; then - rustup - done_something=1 -fi + +# + if [[ "$*" == *fetch* ]]; then fetch done_something=1 @@ -468,28 +457,35 @@ if [[ "$*" == *build* ]]; then build done_something=1 fi -if [[ "$*" == *artifacts_win* ]]; then - artifacts_win - done_something=1 -fi + +# + if [[ "$*" == *artifacts_exp* ]]; then + experimental=experimental artifacts_exp done_something=1 +else + if [[ "$*" == *artifacts_win* ]]; then + artifacts_win + done_something=1 + fi fi -if [[ "$*" == *artifacts_deb* ]]; then +if [[ "$*" == *artifacts_deb_exp* ]]; then + experimental=experimental artifacts_deb done_something=1 +else + if [[ "$*" == *artifacts_deb* ]]; then + artifacts_deb + done_something=1 + fi fi - if [[ "$*" == *artifacts_rpm* ]]; then artifacts_rpm done_something=1 fi - - - # by default, give help.. if (( done_something == 0 )); then cat <