@@ -9,21 +9,30 @@
99
1010rustPlatform.buildRustPackage rec {
1111 pname = "hck";
12− version = "0.6.7";
12+ version = "0.7.0";
1313
1414 src = fetchFromGitHub {
1515 owner = "sstadick";
1616 repo = pname;
1717 rev = "v${version}";
18− sha256 = "sha256-m4YVz3kh4nOkdf6PbbyxjKacUVKdFQet76CMrFYMRHI=";
18+ sha256 = "sha256-BP1B1FlN+9qpkqv4WfT7OSyPCb7K47uxJQKXAW1Kkck=";
1919 };
2020
21− cargoSha256 = "sha256-4z1kHSev+5+0wpYFEGvvafB50Wz1wr6zObCjvHR9FPU=";
21+ cargoSha256 = "sha256-Lp0VGt6z9mE8b9Fi6Fz3MjmHmbr9Az72D7BzOju9uOI=";
2222
2323 nativeBuildInputs = [ cmake ];
2424
2525 buildInputs = lib.optionals stdenv.isDarwin [ CoreFoundation Security ];
2626
27+ # link System as a dylib instead of a framework on macos
28+ postPatch = lib.optionalString stdenv.isDarwin ''
29+ core_affinity=../$(stripHash $cargoDeps)/core_affinity
30+ oldHash=$(sha256sum $core_affinity/src/lib.rs | cut -d " " -f 1)
31+ substituteInPlace $core_affinity/src/lib.rs --replace framework dylib
32+ substituteInPlace $core_affinity/.cargo-checksum.json \
33+ --replace $oldHash $(sha256sum $core_affinity/src/lib.rs | cut -d " " -f 1)
34+ '';
35+
2736 meta = with lib; {
2837 description = "A close to drop in replacement for cut that can use a regex delimiter instead of a fixed string";
2938 homepage = "https://github.com/sstadick/hck";