diff --git a/linux_xcompile.sh b/linux_xcompile.sh index b79843a..b77b14c 100644 --- a/linux_xcompile.sh +++ b/linux_xcompile.sh @@ -1,31 +1,10 @@ # Crosscompile on linux (debian,fedora) -proto() { - echo "proto: begin." - - # (implementation...) - - echo "proto: done." -} - - -linux_patches() { - echo "linux_patches: begin." - - # (implementation...) - - echo "linux_patches: done." -} -linux_artifacts() { - echo "linux_artifacts: begin." - - # (implementation...) - - echo "linux_artifacts: done." -} - +# +# Creating the crosscompile environment on linux +# @@ -59,3 +38,192 @@ setup_rpm_user() { } + + + + +# +# linux_patches() and linux_artifacts() +# + + + + + + + + + +linux_patches() { + echo "linux_patches: begin." + + + if [ ! -d firefox-$pkgver ]; then exit 1; fi + cd firefox-$pkgver + + echo 'Applying patches...' + + patch -p1 -i ../linux/context-menu.patch + if [ $? -ne 0 ]; then exit 1; fi + patch -p1 -i ../linux/megabar.patch + if [ $? -ne 0 ]; then exit 1; fi + patch -p1 -i ../linux/mozilla-vpn-ad.patch + if [ $? -ne 0 ]; then exit 1; fi + patch -p1 -i ../linux/remove_addons.patch + if [ $? -ne 0 ]; then exit 1; fi + + + echo 'Creating mozconfig...' + cat >../mozconfig < tmp.nsi +makensis-3.01.exe -V1 tmp.nsi +if [ $? -ne 0 ]; then exit 1; fi + +# patch to permissive config +if [ ! -z $permissive ]; then + pushd librewolf + echo "Applying permissive patches..." + patch -p1 -i ../patches/permissive/librewolf-config.patch + if [ $? -ne 0 ]; then exit 1; fi + patch -p1 -i ../patches/permissive/librewolf-policies.patch + if [ $? -ne 0 ]; then exit 1; fi + popd + + # create the final zip artifact + rm -f librewolf-$pkgver.en-US.$ospkg-permissive.zip + zip -qr9 librewolf-$pkgver.en-US.$ospkg-permissive.zip librewolf + if [ $? -ne 0 ]; then exit 1; fi + + # now to try to make the installer + rm -f librewolf-$pkgver.en-US.win64-permissive-setup.exe tmp-permissive.nsi + sed "s/win64-setup/win64-permissive-setup/g" < tmp.nsi > tmp-permissive.nsi + makensis-3.01.exe -V1 tmp-permissive.nsi + if [ $? -ne 0 ]; then exit 1; fi +fi + +popd +} + + +linux_artifacts() { + echo "linux_artifacts: begin." + + if [ ! -d firefox-$pkgver ]; then exit 1; fi + cd firefox-$pkgver + + ./mach package + if [ $? -ne 0 ]; then exit 1; fi + + echo "" + echo "artifacts_win: Creating final artifacts." + echo "" + + linux_artifacts_details + + cd .. + + echo "linux_artifacts: done." +}