From bc3ae46139acfb0a3780ffe77efdedbd093f2543 Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 12 May 2023 12:12:56 -0400 Subject: [PATCH] kind2: 0.3.7 -> 0.3.10 Diff: https://diff.rs/kind2/0.3.7/0.3.10 --- pkgs/development/compilers/kind2/default.nix | 38 ++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/kind2/default.nix b/pkgs/development/compilers/kind2/default.nix index f3ed8a45b88a..d307f6eac8b7 100644 --- a/pkgs/development/compilers/kind2/default.nix +++ b/pkgs/development/compilers/kind2/default.nix @@ -3,31 +3,57 @@ , fetchCrate , stdenv , darwin +, fetchpatch }: rustPlatform.buildRustPackage rec { pname = "kind2"; - version = "0.3.7"; + version = "0.3.10"; src = fetchCrate { inherit pname version; - sha256 = "sha256-ZG0BbGcjQBqeNTqfy7WweVHK7sUuKeQSsFi9KIsyIE4="; + hash = "sha256-X2sjfYrSSym289jDJV3hNmcwyQCMnrabmGCUKD5wfdY="; }; - cargoSha256 = "sha256-j64L3HNk2r+MH9eDHWT/ARJ9DT4CchcuVxtIYYVsDxo="; + cargoHash = "sha256-KzoEh/kMKsHx9K3t1/uQZ7fdsZEM+v8UOft8JjEB1Zw="; buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk_11_0.frameworks.Security - ] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ - darwin.apple_sdk_11_0.frameworks.CoreFoundation ]; + postPatch = + let + hvmPatch = fetchpatch { + name = "revert-fix-remove-feature-automic-mut-ptr.patch"; + url = "https://github.com/higherorderco/hvm/commit/c0e35c79b4e31c266ad33beadc397c428e4090ee.patch"; + hash = "sha256-9xxu7NOtz3Tuzf5F0Mi4rw45Xnyh7h9hbTrzq4yfslg="; + revert = true; + }; + in + '' + pushd $cargoDepsCopy/hvm + + oldLibHash=$(sha256sum src/lib.rs | cut -d " " -f 1) + oldMainHash=$(sha256sum src/main.rs | cut -d " " -f 1) + + patch -p1 < ${hvmPatch} + + newLibHash=$(sha256sum src/lib.rs | cut -d " " -f 1) + newMainHash=$(sha256sum src/main.rs | cut -d " " -f 1) + + substituteInPlace .cargo-checksum.json \ + --replace "$oldLibHash" "$newLibHash" \ + --replace "$oldMainHash" "$newMainHash" + + popd + ''; + # requires nightly features RUSTC_BOOTSTRAP = true; meta = with lib; { description = "A functional programming language and proof assistant"; - homepage = "https://github.com/kindelia/kind"; + homepage = "https://github.com/higherorderco/kind"; license = licenses.mit; maintainers = with maintainers; [ figsoda ]; };