nixpkgs/pkgs/tools/compression/crabz/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.3 KiB
Nix
Raw Normal View History

2021-10-10 01:54:08 +02:00
{ lib
, rustPlatform
, fetchFromGitHub
, cmake
, stdenv
, libiconv
, CoreFoundation
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "crabz";
2022-07-26 14:29:53 +02:00
version = "0.7.5";
2021-10-10 01:54:08 +02:00
src = fetchFromGitHub {
owner = "sstadick";
repo = pname;
rev = "v${version}";
2022-07-26 14:29:53 +02:00
sha256 = "sha256-9PZbrdgHX7zOftecvsyVjYUkBlFEt20lYtLSkFcb8dg=";
2021-10-10 01:54:08 +02:00
};
2022-07-26 14:29:53 +02:00
cargoSha256 = "sha256-tT6RCL5pOAMZw7cQr0BCAde9Y/1FeBBLXF6uXfM1I0A=";
2021-10-10 01:54:08 +02:00
nativeBuildInputs = [ cmake ];
buildInputs = lib.optionals stdenv.isDarwin [
libiconv
CoreFoundation
Security
];
2021-10-30 21:08:32 +02:00
# link System as a dylib instead of a framework on macos
postPatch = lib.optionalString stdenv.isDarwin ''
core_affinity=../$(stripHash $cargoDeps)/core_affinity
oldHash=$(sha256sum $core_affinity/src/lib.rs | cut -d " " -f 1)
substituteInPlace $core_affinity/src/lib.rs --replace framework dylib
substituteInPlace $core_affinity/.cargo-checksum.json \
--replace $oldHash $(sha256sum $core_affinity/src/lib.rs | cut -d " " -f 1)
'';
2021-10-10 01:54:08 +02:00
meta = with lib; {
description = "A cross platform, fast, compression and decompression tool";
homepage = "https://github.com/sstadick/crabz";
changelog = "https://github.com/sstadick/crabz/blob/v${version}/CHANGELOG.md";
license = with licenses; [ unlicense /* or */ mit ];
maintainers = with maintainers; [ figsoda ];
};
}