Unverified Commit 0444b58f authored by Erik Arvstedt's avatar Erik Arvstedt
Browse files

electrs: fix package update script

Using `update-source-version` requires a separate attrset for cargo deps.
Also convert pkg to `finalAttrs` format.
parent ee3e5053
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -8,19 +8,21 @@
let
  rocksdb = rocksdb_7_10;
in
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "electrs";
  version = "0.10.9";

  src = fetchFromGitHub {
    owner = "romanz";
    repo = "electrs";
    rev = "v${version}";
    rev = "v${finalAttrs.version}";
    hash = "sha256-Xo7aqP4tIh/kYthPucscxnl+ZtVioEja4TTFdH0Q350=";
  };

  useFetchCargoVendor = true;
  cargoHash = "sha256-wDEtVsgkddGv89tTy96wYzNWVicn34Gxi+YAo7yAfQA=";
  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit (finalAttrs) pname version src;
    hash = "sha256-wDEtVsgkddGv89tTy96wYzNWVicn34Gxi+YAo7yAfQA=";
  };

  # needed for librocksdb-sys
  nativeBuildInputs = [ rustPlatform.bindgenHook ];
@@ -38,4 +40,4 @@ rustPlatform.buildRustPackage rec {
    maintainers = with maintainers; [ prusnak ];
    mainProgram = "electrs";
  };
}
})
+3 −1
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
#!nix-shell -i bash -p coreutils curl jq git gnupg common-updater-scripts
set -euo pipefail

trap 'echo "Error at ${BASH_SOURCE[0]}:$LINENO"' ERR

# Fetch latest release, GPG-verify the tag, update derivation

scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
@@ -34,6 +36,6 @@ git -C $repo verify-tag v${version}
rm -rf $repo/.git
hash=$(nix --extra-experimental-features nix-command hash path $repo)

(cd "$nixpkgs" && update-source-version electrs "$version" "$hash" && update-source-version electrs --ignore-same-version --source-key=cargoDeps)
(cd "$nixpkgs" && update-source-version electrs "$version" "$hash" && update-source-version electrs --ignore-same-version --source-key=cargoDeps.vendorStaging)
echo
echo "electrs: $oldVersion -> $version"