nixpkgs-suyu/pkgs/tools/package-management/cargo-deb/default.nix

41 lines
1 KiB
Nix
Raw Normal View History

2020-01-09 14:30:54 +01:00
{ stdenv
, lib
, fetchFromGitHub
, rustPlatform
2020-05-13 01:38:15 +02:00
, rust
2021-05-09 21:31:25 +02:00
, libiconv
2020-05-13 01:38:15 +02:00
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-deb";
2021-05-28 12:34:12 +02:00
version = "1.30.0";
src = fetchFromGitHub {
owner = "mmstick";
2020-01-09 14:30:54 +01:00
repo = pname;
rev = "v${version}";
2021-05-28 12:34:12 +02:00
sha256 = "sha256-rAmG6Aj0D9dHVueh1BN1Chhit+XFhqGib1WTvMDy0LI=";
};
2021-05-09 21:31:25 +02:00
buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ];
2021-05-28 12:34:12 +02:00
cargoSha256 = "sha256-MEpyEdjLWNZvqE7gJLvQ169tgmJRzec4vqQI9fF3xr8=";
2020-05-13 01:38:15 +02:00
preCheck = ''
substituteInPlace tests/command.rs \
--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-05-13 01:38:15 +02:00
'';
2020-01-09 14:30:54 +01:00
meta = with lib; {
description = "Generate Debian packages from information in Cargo.toml";
homepage = "https://github.com/mmstick/cargo-deb";
license = licenses.mit;
maintainers = with maintainers; [ Br1ght0ne ];
};
}