parent
0bd0386954
commit
82a7fac5af
@ -0,0 +1,41 @@ |
||||
{ callPackage, git }: |
||||
let |
||||
src = callPackage ./src.nix { }; |
||||
in |
||||
rec { |
||||
|
||||
inherit (src) packageVersion firefox source; |
||||
|
||||
patches = [ ./verify-telemetry-macros.patch ]; |
||||
|
||||
extraConfigureFlags = [ |
||||
"--with-app-name=librewolf" |
||||
"--with-app-basename=LibreWolf" |
||||
"--with-branding=browser/branding/librewolf" |
||||
"--with-distribution-id=io.gitlab.librewolf-community" |
||||
"--with-unsigned-addon-scopes=app,system" |
||||
"--allow-addon-sideload" |
||||
]; |
||||
|
||||
extraPostPatch = '' |
||||
while read patch_name; do |
||||
echo "applying LibreWolf patch: $patch_name" |
||||
patch -p1 < ${source}/$patch_name |
||||
done <${source}/assets/patches.txt |
||||
|
||||
cp -r ${source}/themes/browser . |
||||
cp ${source}/assets/search-config.json services/settings/dumps/main/search-config.json |
||||
sed -i '/MOZ_SERVICES_HEALTHREPORT/ s/True/False/' browser/moz.configure |
||||
sed -i '/MOZ_NORMANDY/ s/True/False/' browser/moz.configure |
||||
''; |
||||
|
||||
extraPrefsFiles = [ "${source}/submodules/settings/librewolf.cfg" ]; |
||||
|
||||
extraPoliciesFiles = [ "${source}/submodules/settings/distribution/policies.json" ]; |
||||
|
||||
extraPassthru = { |
||||
librewolf = { inherit src patches; }; |
||||
inherit extraPrefsFiles extraPoliciesFiles; |
||||
}; |
||||
} |
||||
|
@ -0,0 +1,11 @@ |
||||
{ |
||||
"packageVersion": "97.0-2", |
||||
"source": { |
||||
"rev": "97.0-2", |
||||
"sha256": "00fb7xr6hrcyh3s7g52fs6f7a1iggpibj0xafblnl7118fh73g25" |
||||
}, |
||||
"firefox": { |
||||
"version": "97.0", |
||||
"sha512": "a913695a42cb06ee9bda2a20e65cc573e40ca93e9f75b7ee0a43ebd1935b371e7e80d5fc8d5f126ad0712ab848635a8624bbeed43807e5c179537aa32c884186" |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
{ fetchurl, fetchFromGitLab }: |
||||
let src = builtins.fromJSON (builtins.readFile ./src.json); |
||||
in |
||||
{ |
||||
inherit (src) packageVersion; |
||||
source = fetchFromGitLab { |
||||
owner = "librewolf-community"; |
||||
repo = "browser/source"; |
||||
fetchSubmodules = true; |
||||
inherit (src.source) rev sha256; |
||||
}; |
||||
firefox = fetchurl { |
||||
url = |
||||
"mirror://mozilla/firefox/releases/${src.firefox.version}/source/firefox-${src.firefox.version}.source.tar.xz"; |
||||
inherit (src.firefox) sha512; |
||||
}; |
||||
} |
||||
|
@ -0,0 +1,65 @@ |
||||
{ writeScript |
||||
, lib |
||||
, coreutils |
||||
, gnused |
||||
, gnugrep |
||||
, curl |
||||
, gnupg |
||||
, jq |
||||
, nix-prefetch-git |
||||
, moreutils |
||||
, runtimeShell |
||||
, ... |
||||
}: |
||||
|
||||
writeScript "update-librewolf" '' |
||||
#!${runtimeShell} |
||||
PATH=${lib.makeBinPath [ coreutils curl gnugrep gnupg gnused jq moreutils nix-prefetch-git ]} |
||||
set -euo pipefail |
||||
|
||||
latestTag=$(curl https://gitlab.com/api/v4/projects/librewolf-community%2Fbrowser%2Fsource/repository/tags?per_page=1 | jq -r .[0].name) |
||||
echo "latestTag=$latestTag" |
||||
|
||||
srcJson=pkgs/applications/networking/browsers/firefox/librewolf/src.json |
||||
localRev=$(jq -r .source.rev < $srcJson) |
||||
echo "localRev=$localRev" |
||||
|
||||
if [ "$localRev" == "$latestTag" ]; then |
||||
exit 0 |
||||
fi |
||||
|
||||
prefetchOut=$(mktemp) |
||||
repoUrl=https://gitlab.com/librewolf-community/browser/source.git/ |
||||
nix-prefetch-git $repoUrl --quiet --rev $latestTag --fetch-submodules > $prefetchOut |
||||
srcDir=$(jq -r .path < $prefetchOut) |
||||
srcHash=$(jq -r .sha256 < $prefetchOut) |
||||
|
||||
ffVersion=$(<$srcDir/version) |
||||
lwRelease=$(<$srcDir/release) |
||||
lwVersion="$ffVersion-$lwRelease" |
||||
echo "lwVersion=$lwVersion" |
||||
echo "ffVersion=$ffVersion" |
||||
if [ "$lwVersion" != "$latestTag" ]; then |
||||
echo "error: Tag name does not match the computed LibreWolf version" |
||||
exit 1 |
||||
fi |
||||
|
||||
HOME=$(mktemp -d) |
||||
export GNUPGHOME=$(mktemp -d) |
||||
gpg --receive-keys 14F26682D0916CDD81E37B6D61B7B526D98F0353 |
||||
|
||||
mozillaUrl=https://archive.mozilla.org/pub/firefox/releases/ |
||||
|
||||
curl --silent --show-error -o "$HOME"/shasums "$mozillaUrl$ffVersion/SHA512SUMS" |
||||
curl --silent --show-error -o "$HOME"/shasums.asc "$mozillaUrl$ffVersion/SHA512SUMS.asc" |
||||
gpgv --keyring="$GNUPGHOME"/pubring.kbx "$HOME"/shasums.asc "$HOME"/shasums |
||||
|
||||
ffHash=$(grep '\.source\.tar\.xz$' "$HOME"/shasums | grep '^[^ ]*' -o) |
||||
echo "ffHash=$ffHash" |
||||
|
||||
jq ".source.rev = \"$latestTag\"" $srcJson | sponge $srcJson |
||||
jq ".source.sha256 = \"$srcHash\"" $srcJson | sponge $srcJson |
||||
jq ".firefox.version = \"$ffVersion\"" $srcJson | sponge $srcJson |
||||
jq ".firefox.sha512 = \"$ffHash\"" $srcJson | sponge $srcJson |
||||
jq ".packageVersion = \"$lwVersion\"" $srcJson | sponge $srcJson |
||||
'' |
Loading…
Reference in new issue