Unverified Commit 02dd9a30 authored by Matthias Beyer's avatar Matthias Beyer Committed by GitHub
Browse files

various: use finalAttrs (#486938)

parents ddd7849d 26b3fbc4
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -7,14 +7,14 @@
  version ? "3.0.0",
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "cadical";
  inherit version;

  src = fetchFromGitHub {
    owner = "arminbiere";
    repo = "cadical";
    rev = "rel-${version}";
    rev = "rel-${finalAttrs.version}";
    hash =
      {
        "3.0.0" = "sha256-pymbSC6bwQQ0YCtJd3xWZiC22UEkFiKSLObSOnoQj9I=";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
        "2.1.3" = "sha256-W3kO+6nVzkmJXyHJU+NZWP0oatK3gon4EWF1/03rgL4=";
        "2.0.0" = "sha256-qoeEM9SdpuFuBPeQlCzuhPLcJ+bMQkTUTGiT8QdU8rc=";
      }
      .${version};
      .${finalAttrs.version};
  };

  outputs = [
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
  pkgconfigItems = [
    (makePkgconfigItem {
      name = "cadical";
      inherit version;
      inherit (finalAttrs) version;
      cflags = [ "-I\${includedir}" ];
      libs = [
        "-L\${libdir}"
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
        includedir = "@includedir@";
        libdir = "@libdir@";
      };
      inherit (meta) description;
      inherit (finalAttrs.meta) description;
    })
  ];

@@ -64,7 +64,9 @@ stdenv.mkDerivation rec {
    substituteInPlace makefile.in --replace-fail "ar rc" '$(AR) rc'
  ''
  # Racy/flaky tests that sometimes spontaneously combust on darwin.
  + lib.optionalString (stdenv.hostPlatform.isDarwin && (lib.versionAtLeast version "2.1.1")) ''
  +
    lib.optionalString (stdenv.hostPlatform.isDarwin && (lib.versionAtLeast finalAttrs.version "2.1.1"))
      ''
        substituteInPlace test/api/run.sh --replace-fail 'run parcompwrite' ""
        substituteInPlace test/api/run.sh --replace-fail 'run example_tracer' ""
      '';
@@ -89,8 +91,8 @@ stdenv.mkDerivation rec {
    install -Dm0644 src/cadical.hpp "$dev/include/cadical/cadical.hpp"
    install -Dm0644 src/tracer.hpp "$dev/include/cadical/tracer.hpp"
    install -Dm0644 build/libcadical.a "$lib/lib/libcadical.a"
    mkdir -p "$out/share/doc/${pname}/"
    install -Dm0755 {LICEN?E,README*,VERSION} "$out/share/doc/${pname}/"
    mkdir -p "$out/share/doc/${finalAttrs.pname}/"
    install -Dm0755 {LICEN?E,README*,VERSION} "$out/share/doc/${finalAttrs.pname}/"

    runHook postInstall
  '';
@@ -105,4 +107,4 @@ stdenv.mkDerivation rec {
    license = lib.licenses.mit;
    homepage = "https://fmv.jku.at/cadical/";
  };
}
})
+4 −4
Original line number Diff line number Diff line
@@ -4,14 +4,14 @@
  fetchFromGitHub,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "cargo-machete";
  version = "0.9.1";

  src = fetchFromGitHub {
    owner = "bnjbvr";
    repo = "cargo-machete";
    rev = "v${version}";
    rev = "v${finalAttrs.version}";
    hash = "sha256-4tzffZeHdhAq6/K1BGkThqT+CBa3rUw+kR7aLwnqZjc=";
  };

@@ -24,11 +24,11 @@ rustPlatform.buildRustPackage rec {
    description = "Cargo tool that detects unused dependencies in Rust projects";
    mainProgram = "cargo-machete";
    homepage = "https://github.com/bnjbvr/cargo-machete";
    changelog = "https://github.com/bnjbvr/cargo-machete/blob/${src.rev}/CHANGELOG.md";
    changelog = "https://github.com/bnjbvr/cargo-machete/blob/v${finalAttrs.version}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      matthiasbeyer
      chrjabs
    ];
  };
}
})
+3 −3
Original line number Diff line number Diff line
@@ -6,14 +6,14 @@
  nix-update-script,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "cargo-nextest";
  version = "0.9.124";

  src = fetchFromGitHub {
    owner = "nextest-rs";
    repo = "nextest";
    tag = "cargo-nextest-${version}";
    tag = "cargo-nextest-${finalAttrs.version}";
    hash = "sha256-qvJ/dqbls2fVSPY++kYBIeiu14eDD8ORuvcD8dEtMZ8=";
  };

@@ -51,4 +51,4 @@ rustPlatform.buildRustPackage rec {
      chrjabs
    ];
  };
}
})
+4 −4
Original line number Diff line number Diff line
@@ -4,12 +4,12 @@
  fetchCrate,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "cargo-rdme";
  version = "1.5.0";

  src = fetchCrate {
    inherit pname version;
    inherit (finalAttrs) pname version;
    hash = "sha256-TmV6Fc5vlc4fm9w4+iuxmnonwsEbqoJ3jvpIyQOuxjg=";
  };

@@ -19,11 +19,11 @@ rustPlatform.buildRustPackage rec {
    description = "Cargo command to create the README.md from your crate's documentation";
    mainProgram = "cargo-rdme";
    homepage = "https://github.com/orium/cargo-rdme";
    changelog = "https://github.com/orium/cargo-rdme/blob/v${version}/release-notes.md";
    changelog = "https://github.com/orium/cargo-rdme/blob/v${finalAttrs.version}/release-notes.md";
    license = with lib.licenses; [ mpl20 ];
    maintainers = with lib.maintainers; [
      GoldsteinE
      chrjabs
    ];
  };
}
})
+5 −5
Original line number Diff line number Diff line
@@ -9,14 +9,14 @@
  nix-update-script,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "cargo-semver-checks";
  version = "0.46.0";

  src = fetchFromGitHub {
    owner = "obi1kenobi";
    repo = "cargo-semver-checks";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-y2tkTPctit5rx6OyohPPVo117sGICg6UEDg7RWFmtMA=";
  };

@@ -48,7 +48,7 @@ rustPlatform.buildRustPackage rec {
    substituteInPlace test_outputs/integration_snapshots__bugreport.snap \
      --replace-fail \
        'cargo-semver-checks [VERSION] ([HASH])' \
        'cargo-semver-checks ${version}'
        'cargo-semver-checks ${finalAttrs.version}'
  '';

  passthru = {
@@ -60,7 +60,7 @@ rustPlatform.buildRustPackage rec {
    description = "Tool to scan your Rust crate for semver violations";
    mainProgram = "cargo-semver-checks";
    homepage = "https://github.com/obi1kenobi/cargo-semver-checks";
    changelog = "https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v${version}";
    changelog = "https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v${finalAttrs.version}";
    license = with lib.licenses; [
      mit # or
      asl20
@@ -70,4 +70,4 @@ rustPlatform.buildRustPackage rec {
      chrjabs
    ];
  };
}
})
Loading