Merge pull request #212827 from figsoda/hck

hck: 0.8.2 -> 0.9.1
This commit is contained in:
Nick Cao 2023-01-27 07:41:26 +08:00 committed by GitHub
commit b213fede46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,38 +2,23 @@
, rustPlatform
, fetchFromGitHub
, cmake
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "hck";
version = "0.8.2";
version = "0.9.1";
src = fetchFromGitHub {
owner = "sstadick";
repo = pname;
rev = "v${version}";
sha256 = "sha256-66wunZuRAJ6QVWgBUy2+HGaow33F5+16LitGSQC4kCE=";
sha256 = "sha256-wsuXEHwnTP+vl8Gn1mfH+cKoasDdZ+ILiAaJ7510lsI=";
};
cargoSha256 = "sha256-4CAj94wm9qxr9wejD2ffKSdRV1UeofMhxNxLi++At+I=";
cargoSha256 = "sha256-qWat0QIMLmMrbK/QCr3dSyWP27wFFQ+IDQAzLngThQE=";
nativeBuildInputs = [ cmake ];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
# 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)
'';
meta = with lib; {
description = "A close to drop in replacement for cut that can use a regex delimiter instead of a fixed string";
homepage = "https://github.com/sstadick/hck";