Commit b499d925 authored by squalus's avatar squalus
Browse files

librewolf-unwrapped: use settings from submodule

Upstream has pinned the settings repo using submodules since
https://codeberg.org/librewolf/source/commit/3379ed0351

Use submodules to fetch the correct rev of the settings repo rather than
guessing by choosing the latest rev
parent 98ff8810
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -33,9 +33,9 @@ rec {
    cat ${source}/patches/pref-pane/preferences.ftl >> browser/locales/en-US/browser/preferences/preferences.ftl
  '';

  extraPrefsFiles = [ "${src.settings}/librewolf.cfg" ];
  extraPrefsFiles = [ "${source}/settings/librewolf.cfg" ];

  extraPoliciesFiles = [ "${src.settings}/distribution/policies.json" ];
  extraPoliciesFiles = [ "${source}/settings/distribution/policies.json" ];

  extraPassthru = {
    librewolf = {
+0 −4
Original line number Diff line number Diff line
@@ -4,10 +4,6 @@
    "rev": "129.0.1-1",
    "sha256": "0pvv3v23q31hdjvqi1f3cqfyjrb8dbrrbfwxj2wacak1g0mzbxf4"
  },
  "settings": {
    "rev": "cbcf862e283669b49ecdf985d2d747eca9f4a794",
    "sha256": "0aisg6l8xhk32wp8d9n532zgkk1nr4y4nsvqa9v8943g6vm4abb7"
  },
  "firefox": {
    "version": "129.0.1",
    "sha512": "27c463e8277994c62bab85cf0e2f0cea16a9b272694b61fa56a6b3bd7c70d6481774288386094836a54df54c1b1144d61be67f4f5eac418c05479d452221c027"
+0 −6
Original line number Diff line number Diff line
@@ -10,12 +10,6 @@ in
    fetchSubmodules = true;
    inherit (src.source) rev sha256;
  };
  settings = fetchFromGitea {
    domain = "codeberg.org";
    owner = "librewolf";
    repo = "settings";
    inherit (src.settings) rev sha256;
  };
  firefox = fetchurl {
    url =
      "mirror://mozilla/firefox/releases/${src.firefox.version}/source/firefox-${src.firefox.version}.source.tar.xz";
+0 −9
Original line number Diff line number Diff line
@@ -57,18 +57,9 @@ writeScript "update-librewolf" ''
  ffHash=$(grep '\.source\.tar\.xz$' "$HOME"/shasums | grep '^[^ ]*' -o)
  echo "ffHash=$ffHash"

  # upstream does not specify settings rev, so just get the latest. see https://github.com/NixOS/nixpkgs/issues/252276
  settingsRev=$(curl 'https://codeberg.org/api/v1/repos/librewolf/settings/commits?sha=master&limit=1' | jq -r .[0].sha)
  echo "settingsRev=$settingsRev"
  repoUrl=https://codeberg.org/librewolf/settings
  nix-prefetch-git $repoUrl --quiet --rev $settingsRev > $prefetchOut
  settingsSha256=$(jq -r .sha256 < $prefetchOut)

  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
  jq ".settings.rev = \"$settingsRev\"" $srcJson | sponge $srcJson
  jq ".settings.sha256 = \"$settingsSha256\"" $srcJson | sponge $srcJson
''