mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
fix(nix): make the package code correct
- testDeps should be separate, in nativeBuildInputs to allow for disabling checks. - rust should be a native dependency as it doesn't need to be put nowhere next to the resulting binary.
This commit is contained in:
28
default.nix
28
default.nix
@@ -9,20 +9,6 @@
|
|||||||
darwin,
|
darwin,
|
||||||
python3,
|
python3,
|
||||||
}: let
|
}: let
|
||||||
testDeps = [
|
|
||||||
python3
|
|
||||||
];
|
|
||||||
|
|
||||||
buildDeps = rust:
|
|
||||||
[
|
|
||||||
rust
|
|
||||||
]
|
|
||||||
++ (lib.optionals stdenv.isDarwin [
|
|
||||||
libiconv
|
|
||||||
darwin.apple_sdk.frameworks.Foundation
|
|
||||||
])
|
|
||||||
++ testDeps;
|
|
||||||
|
|
||||||
mkPackage = rust:
|
mkPackage = rust:
|
||||||
(makeRustPlatform {
|
(makeRustPlatform {
|
||||||
cargo = rust;
|
cargo = rust;
|
||||||
@@ -31,12 +17,22 @@
|
|||||||
.buildRustPackage {
|
.buildRustPackage {
|
||||||
pname = packageToml.name;
|
pname = packageToml.name;
|
||||||
inherit (packageToml) version;
|
inherit (packageToml) version;
|
||||||
|
|
||||||
src = builtins.path {
|
src = builtins.path {
|
||||||
path = ./.;
|
path = ./.;
|
||||||
inherit (packageToml) name;
|
inherit (packageToml) name;
|
||||||
};
|
};
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
|
||||||
buildInputs = buildDeps rust;
|
|
||||||
dontUseCargoParallelTests = true;
|
dontUseCargoParallelTests = true;
|
||||||
|
|
||||||
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ rust ];
|
||||||
|
buildInputs = (lib.optional stdenv.isDarwin [
|
||||||
|
libiconv
|
||||||
|
darwin.apple_sdk.frameworks.Foundation
|
||||||
|
]);
|
||||||
|
|
||||||
|
nativeCheckInputs = [python3];
|
||||||
};
|
};
|
||||||
in (mkPackage rust-bin.stable.latest.minimal)
|
in (mkPackage rust-bin.stable.latest.minimal)
|
||||||
|
|||||||
Reference in New Issue
Block a user