Unverified Commit 3fdc8136 authored by Gergő Gutyina's avatar Gergő Gutyina Committed by GitHub
Browse files

plasticscm-{client-{core,gui}-unwrapped,theme}: fix reproducibility (#477523)

parents 3b041bd2 537db842
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -16,11 +16,18 @@ stdenvNoCC.mkDerivation (finalAttrs: {

  src = fetchurl {
    url = "https://www.plasticscm.com/plasticrepo/stable/debian/amd64/plasticscm-client-core_${finalAttrs.version}_amd64.deb";
    hash = "sha256-NuMY75JnnWVRKBSh/1XYipqc0m+O0vt7lJMVkQyTaNA=";
    hash = "sha256-9K4pvl+hxB3+bQwC3HYaEOq5nQlCyTQQuYsuqT4BbRg=";
    nativeBuildInputs = [ dpkg ];
    downloadToTemp = true;
    recursiveHash = true;
    postFetch = ''
      mkdir -p $out
      dpkg-deb --fsys-tarfile $downloadedFile | tar --extract --directory=$out
      rm -rf $out/usr/share/doc
    '';
  };

  nativeBuildInputs = [
    dpkg
    makeWrapper
  ];

@@ -40,15 +47,16 @@ stdenvNoCC.mkDerivation (finalAttrs: {
    runtimeInputs = [
      common-updater-scripts
      curl
      dpkg
      jc
      jq
    ];
    text = ''
      eval "$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
      version="$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
        jc --pkg-index-deb |
        jq -r '[.[] | select(.package == "plasticscm-client-core")] | sort_by(.version) | last | @sh "version=\(.version) hash=\(.sha256)"')"
      # shellcheck disable=SC2154
      update-source-version plasticscm-client-core-unwrapped "$version" "sha256-$(xxd -r -p <<<"$hash" | base64)"
        jq -r '[.[] | select(.package == "plasticscm-client-core")] | sort_by(.version) | last | .version')"

      update-source-version --ignore-same-hash plasticscm-client-core-unwrapped "$version"
    '';
  });

+14 −9
Original line number Diff line number Diff line
@@ -15,13 +15,17 @@ stdenvNoCC.mkDerivation (finalAttrs: {

  src = fetchurl {
    url = "https://www.plasticscm.com/plasticrepo/stable/debian/amd64/plasticscm-client-gui_${finalAttrs.version}_amd64.deb";
    hash = "sha256-sSabW3j9h9uNQSwWKvAH+3D9lRWvMRYcuITDonD7Inw=";
    hash = "sha256-jqU4nfRtobdXiNIx9pjceje5Y+m+xFYdWQwWgEXxW+k=";
    nativeBuildInputs = [ dpkg ];
    downloadToTemp = true;
    recursiveHash = true;
    postFetch = ''
      mkdir -p $out
      dpkg-deb --fsys-tarfile $downloadedFile | tar --extract --directory=$out
      rm -rf $out/usr/share/doc
    '';
  };

  nativeBuildInputs = [
    dpkg
  ];

  dontFixup = true;

  installPhase = ''
@@ -38,15 +42,16 @@ stdenvNoCC.mkDerivation (finalAttrs: {
    runtimeInputs = [
      common-updater-scripts
      curl
      dpkg
      jc
      jq
    ];
    text = ''
      eval "$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
      version="$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
        jc --pkg-index-deb |
        jq -r '[.[] | select(.package == "plasticscm-client-gui")] | sort_by(.version) | last | @sh "version=\(.version) hash=\(.sha256)"')"
      # shellcheck disable=SC2154
      update-source-version plasticscm-client-gui-unwrapped "$version" "sha256-$(xxd -r -p <<<"$hash" | base64)"
        jq -r '[.[] | select(.package == "plasticscm-client-gui")] | sort_by(.version) | last | .version')"

      update-source-version --ignore-same-hash plasticscm-client-gui-unwrapped "$version"
    '';
  });

+14 −9
Original line number Diff line number Diff line
@@ -15,13 +15,17 @@ stdenvNoCC.mkDerivation (finalAttrs: {

  src = fetchurl {
    url = "https://www.plasticscm.com/plasticrepo/stable/debian/amd64/plasticscm-theme_${finalAttrs.version}_amd64.deb";
    hash = "sha256-sInKMW6KoUNZ/06+E8MTGyVtOd+8wFLPrFibNw/DYQ0=";
    hash = "sha256-qxOzt+cylEt0kCKb7n+fd4Ut9R4KxYArUm9Ntxe4yVU=";
    nativeBuildInputs = [ dpkg ];
    downloadToTemp = true;
    recursiveHash = true;
    postFetch = ''
      mkdir -p $out
      dpkg-deb --fsys-tarfile $downloadedFile | tar --extract --directory=$out
      rm -rf $out/usr/share/doc
    '';
  };

  nativeBuildInputs = [
    dpkg
  ];

  dontFixup = true;

  installPhase = ''
@@ -38,15 +42,16 @@ stdenvNoCC.mkDerivation (finalAttrs: {
    runtimeInputs = [
      common-updater-scripts
      curl
      dpkg
      jc
      jq
    ];
    text = ''
      eval "$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
      version="$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
        jc --pkg-index-deb |
        jq -r '[.[] | select(.package == "plasticscm-theme")] | sort_by(.version) | last | @sh "version=\(.version) hash=\(.sha256)"')"
      # shellcheck disable=SC2154
      update-source-version plasticscm-theme "$version" "sha256-$(xxd -r -p <<<"$hash" | base64)"
        jq -r '[.[] | select(.package == "plasticscm-theme")] | sort_by(.version) | last | .version')"

      update-source-version --ignore-same-hash plasticscm-theme "$version"
    '';
  });