various: use finalAttrs (#486938)
This commit is contained in:
@@ -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,10 +64,12 @@ 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")) ''
|
||||
substituteInPlace test/api/run.sh --replace-fail 'run parcompwrite' ""
|
||||
substituteInPlace test/api/run.sh --replace-fail 'run example_tracer' ""
|
||||
'';
|
||||
+
|
||||
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' ""
|
||||
'';
|
||||
|
||||
# the configure script is not generated by autotools and does not accept the
|
||||
# arguments that the default configurePhase passes like --prefix and --libdir
|
||||
@@ -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,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
|
||||
];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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,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
|
||||
];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
callPackage,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "cargo-show-asm";
|
||||
version = "0.2.55";
|
||||
|
||||
src = fetchCrate {
|
||||
inherit pname version;
|
||||
inherit (finalAttrs) pname version;
|
||||
hash = "sha256-ZSPlFDnLVQp1uz1VrbXmw8bAM1/ZWojAv7PSFG+k2Pw=";
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@ rustPlatform.buildRustPackage rec {
|
||||
meta = {
|
||||
description = "Cargo subcommand showing the assembly, LLVM-IR and MIR generated for Rust code";
|
||||
homepage = "https://github.com/pacak/cargo-show-asm";
|
||||
changelog = "https://github.com/pacak/cargo-show-asm/blob/${version}/Changelog.md";
|
||||
changelog = "https://github.com/pacak/cargo-show-asm/blob/${finalAttrs.version}/Changelog.md";
|
||||
license = with lib.licenses; [
|
||||
asl20
|
||||
mit
|
||||
@@ -52,4 +52,4 @@ rustPlatform.buildRustPackage rec {
|
||||
];
|
||||
mainProgram = "cargo-asm";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
stdenv,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "cargo-spellcheck";
|
||||
version = "0.15.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "drahnr";
|
||||
repo = "cargo-spellcheck";
|
||||
tag = "v${version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-saRr1xEBefLoCgCxU/pyQOmmt/di+DOQHMoVc4LgRm0=";
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ rustPlatform.buildRustPackage rec {
|
||||
description = "Checks rust documentation for spelling and grammar mistakes";
|
||||
mainProgram = "cargo-spellcheck";
|
||||
homepage = "https://github.com/drahnr/cargo-spellcheck";
|
||||
changelog = "https://github.com/drahnr/cargo-spellcheck/blob/v${version}/CHANGELOG.md";
|
||||
changelog = "https://github.com/drahnr/cargo-spellcheck/blob/v${finalAttrs.version}/CHANGELOG.md";
|
||||
license = with lib.licenses; [
|
||||
asl20 # or
|
||||
mit
|
||||
@@ -45,4 +45,4 @@ rustPlatform.buildRustPackage rec {
|
||||
chrjabs
|
||||
];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
libiconv,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "cargo-udeps";
|
||||
version = "0.1.60";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "est31";
|
||||
repo = "cargo-udeps";
|
||||
rev = "v${version}";
|
||||
rev = "v${finalAttrs.version}";
|
||||
sha256 = "sha256-NW9yjFUV+o7vv5bYD8nxSWHOXOBnDEk36xze90wYuNg=";
|
||||
};
|
||||
|
||||
@@ -45,4 +45,4 @@ rustPlatform.buildRustPackage rec {
|
||||
];
|
||||
mainProgram = "cargo-udeps";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
makeWrapper,
|
||||
valgrind,
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "cargo-valgrind";
|
||||
version = "2.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jfrimmel";
|
||||
repo = "cargo-valgrind";
|
||||
tag = version;
|
||||
tag = finalAttrs.version;
|
||||
sha256 = "sha256-sVW3zNe0a9iQQ0vRWJofqG4gwUJ/w0U4ugVyMNtWX98=";
|
||||
};
|
||||
|
||||
@@ -52,4 +52,4 @@ rustPlatform.buildRustPackage rec {
|
||||
chrjabs
|
||||
];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -26,14 +26,14 @@ let
|
||||
homepage = "https://fmv.jku.at/kissat";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "kissat";
|
||||
version = "4.0.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "arminbiere";
|
||||
repo = "kissat";
|
||||
rev = "rel-${version}";
|
||||
rev = "rel-${finalAttrs.version}";
|
||||
sha256 = "sha256-hgB1U2Pmh1hEyNA3ej3fXxxf0YjCRgtOuSddRl6s0eo=";
|
||||
};
|
||||
|
||||
@@ -90,9 +90,9 @@ stdenv.mkDerivation rec {
|
||||
libdir=${placeholder "lib"}/lib
|
||||
includedir=\''${prefix}/include
|
||||
|
||||
Name: ${pname}
|
||||
Name: ${finalAttrs.pname}
|
||||
Description: ${meta.description}
|
||||
Version: ${version}
|
||||
Version: ${finalAttrs.version}
|
||||
Libs: -L\''${libdir} -lkissat
|
||||
Cflags: -I\''${includedir}
|
||||
EOF
|
||||
@@ -101,4 +101,4 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
|
||||
inherit meta;
|
||||
}
|
||||
})
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
openssl,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "release-plz";
|
||||
version = "0.3.154";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "MarcoIeni";
|
||||
repo = "release-plz";
|
||||
rev = "release-plz-v${version}";
|
||||
rev = "release-plz-v${finalAttrs.version}";
|
||||
hash = "sha256-sg5i7JwDkhvEBYZtm6USCDDWWnI97IIKeXHhpDP3V/o=";
|
||||
};
|
||||
|
||||
@@ -36,16 +36,16 @@ rustPlatform.buildRustPackage rec {
|
||||
doCheck = false;
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd ${meta.mainProgram} \
|
||||
--bash <($out/bin/${meta.mainProgram} generate-completions bash) \
|
||||
--fish <($out/bin/${meta.mainProgram} generate-completions fish) \
|
||||
--zsh <($out/bin/${meta.mainProgram} generate-completions zsh)
|
||||
installShellCompletion --cmd ${finalAttrs.meta.mainProgram} \
|
||||
--bash <($out/bin/${finalAttrs.meta.mainProgram} generate-completions bash) \
|
||||
--fish <($out/bin/${finalAttrs.meta.mainProgram} generate-completions fish) \
|
||||
--zsh <($out/bin/${finalAttrs.meta.mainProgram} generate-completions zsh)
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Publish Rust crates from CI with a Release PR";
|
||||
homepage = "https://release-plz.ieni.dev";
|
||||
changelog = "https://github.com/MarcoIeni/release-plz/blob/release-plz-v${version}/CHANGELOG.md";
|
||||
changelog = "https://github.com/MarcoIeni/release-plz/blob/release-plz-v${finalAttrs.version}/CHANGELOG.md";
|
||||
license = with lib.licenses; [
|
||||
asl20
|
||||
mit
|
||||
@@ -57,4 +57,4 @@ rustPlatform.buildRustPackage rec {
|
||||
mainProgram = "release-plz";
|
||||
broken = stdenv.hostPlatform.isDarwin;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "typos";
|
||||
version = "1.42.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "crate-ci";
|
||||
repo = "typos";
|
||||
tag = "v${version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-u9hjY/d4Ul+EvZIoTJzWkUl4j+Vzcvu61x2USP0hGiw=";
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ rustPlatform.buildRustPackage rec {
|
||||
description = "Source code spell checker";
|
||||
mainProgram = "typos";
|
||||
homepage = "https://github.com/crate-ci/typos";
|
||||
changelog = "https://github.com/crate-ci/typos/blob/v${version}/CHANGELOG.md";
|
||||
changelog = "https://github.com/crate-ci/typos/blob/v${finalAttrs.version}/CHANGELOG.md";
|
||||
license = with lib.licenses; [
|
||||
asl20 # or
|
||||
mit
|
||||
@@ -46,4 +46,4 @@ rustPlatform.buildRustPackage rec {
|
||||
chrjabs
|
||||
];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
pypblib,
|
||||
pytestCheckHook,
|
||||
}:
|
||||
buildPythonPackage rec {
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "python-sat";
|
||||
version = "1.8.dev28";
|
||||
pyproject = true;
|
||||
@@ -15,7 +15,7 @@ buildPythonPackage rec {
|
||||
build-system = [ setuptools ];
|
||||
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
inherit (finalAttrs) version;
|
||||
pname = "python_sat";
|
||||
hash = "sha256-eFBUismC7x2+ng+8rbXxZTis/xNKSx2I/lVkCbx4dgo=";
|
||||
};
|
||||
@@ -57,4 +57,4 @@ buildPythonPackage rec {
|
||||
];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user