2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2020-06-18 07:06:33 +00:00
|
|
|
, rust
|
|
|
|
, Security
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-deb";
|
2021-05-03 20:48:10 +00:00
|
|
|
version = "1.29.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mmstick";
|
|
|
|
repo = pname;
|
2021-03-09 03:18:52 +00:00
|
|
|
rev = "v${version}";
|
2021-05-03 20:48:10 +00:00
|
|
|
sha256 = "sha256-2eOWhxKZ+YPj5oKTe5g7PyeakiSNnPz27dK150GAcVQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
cargoSha256 = "sha256-QmchuY+4R7w0zMOdReH1m8idl9RI1hHE9VtbwT2K9YM=";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
substituteInPlace tests/command.rs \
|
2021-03-09 03:18:52 +00:00
|
|
|
--replace 'target/debug' "target/${rust.toRustTarget stdenv.buildPlatform}/release"
|
|
|
|
|
|
|
|
# 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-06-18 07:06:33 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Generate Debian packages from information in Cargo.toml";
|
|
|
|
homepage = "https://github.com/mmstick/cargo-deb";
|
|
|
|
license = licenses.mit;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|