2020-01-09 13:30:54 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2020-05-13 00:38:15 +01:00
|
|
|
, rust
|
|
|
|
, Security
|
|
|
|
}:
|
2019-11-11 15:50:48 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-deb";
|
2021-02-25 03:41:24 +00:00
|
|
|
version = "1.29.1";
|
2019-11-11 15:50:48 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mmstick";
|
2020-01-09 13:30:54 +00:00
|
|
|
repo = pname;
|
2021-02-25 05:13:28 +00:00
|
|
|
rev = "v${version}";
|
2021-02-25 03:41:24 +00:00
|
|
|
sha256 = "sha256-oWivGy2azF9zpeZ0UAi7Bxm4iXFWAjcBG0pN7qtkSU8=";
|
2019-11-11 15:50:48 +00:00
|
|
|
};
|
|
|
|
|
2020-01-09 13:30:54 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
2019-11-11 15:50:48 +00:00
|
|
|
|
2021-02-25 05:13:28 +00:00
|
|
|
cargoSha256 = "0j9frvcmy9hydw73v0ffr0bjvq2ykylnpmiw700z344djpaaa08y";
|
2019-11-11 15:50:48 +00:00
|
|
|
|
2020-05-13 00:38:15 +01:00
|
|
|
preCheck = ''
|
|
|
|
substituteInPlace tests/command.rs \
|
2021-02-25 03:37:19 +00:00
|
|
|
--replace 'target/debug' "target/${rust.toRustTarget stdenv.buildPlatform}/release"
|
2021-02-25 05:13:28 +00:00
|
|
|
|
|
|
|
# This is an FHS specific assert depending on glibc location
|
|
|
|
substituteInPlace src/dependencies.rs \
|
|
|
|
--replace 'assert!(deps.iter().any(|d| d.starts_with("libc")));' '// no libc assert here'
|
2020-05-13 00:38:15 +01:00
|
|
|
'';
|
|
|
|
|
2020-01-09 13:30:54 +00:00
|
|
|
meta = with lib; {
|
2019-11-11 15:50:48 +00:00
|
|
|
description = "Generate Debian packages from information in Cargo.toml";
|
|
|
|
homepage = "https://github.com/mmstick/cargo-deb";
|
|
|
|
license = licenses.mit;
|
2020-11-17 11:02:06 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne ];
|
2019-11-11 15:50:48 +00:00
|
|
|
};
|
|
|
|
}
|