From e72c65fbdd9eb9111172e038e673c1449893db9b Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 31 Mar 2023 11:39:26 -0400 Subject: difftastic: 0.45.0 -> 0.46.0 Diff: https://github.com/wilfred/difftastic/compare/0.45.0...0.46.0 Changelog: https://github.com/Wilfred/difftastic/blob/0.46.0/CHANGELOG.md --- pkgs/tools/text/difftastic/Cargo.lock | 2 +- pkgs/tools/text/difftastic/default.nix | 41 +++++++++++++--------------------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/pkgs/tools/text/difftastic/Cargo.lock b/pkgs/tools/text/difftastic/Cargo.lock index 9a1cd8b7af7..4b5db36d6f6 100644 --- a/pkgs/tools/text/difftastic/Cargo.lock +++ b/pkgs/tools/text/difftastic/Cargo.lock @@ -232,7 +232,7 @@ checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] name = "difftastic" -version = "0.45.0" +version = "0.46.0" dependencies = [ "assert_cmd", "bumpalo", diff --git a/pkgs/tools/text/difftastic/default.nix b/pkgs/tools/text/difftastic/default.nix index b0f88ce32bd..9af09d4ada8 100644 --- a/pkgs/tools/text/difftastic/default.nix +++ b/pkgs/tools/text/difftastic/default.nix @@ -1,44 +1,30 @@ { lib +, fetchpatch , rustPlatform , fetchFromGitHub -, fetchpatch , testers , difftastic }: +let + mimallocPatch = fetchpatch { + name = "fix-build-on-older-macos-releases.patch"; + url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch"; + sha256 = "sha256-DK0LqsVXXiEVQSQCxZ5jyZMg0UJJx9a/WxzCroYSHZc="; + }; +in + rustPlatform.buildRustPackage rec { pname = "difftastic"; - version = "0.45.0"; + version = "0.46.0"; src = fetchFromGitHub { owner = "wilfred"; repo = pname; rev = version; - sha256 = "sha256-AJwOft5hZoeraDDjwUBsdXn3V+4p8jOGSCYFCEOkWJA="; + sha256 = "sha256-uXSmEJUpcw/PQ5I9nR1b6N1fcOdCSCM4KF0XnGNJkME="; }; - depsExtraArgs = { - postBuild = let - mimallocPatch = fetchpatch { - name = "mimalloc-older-macos-fixes.patch"; - url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch"; - stripLen = 1; - extraPrefix = "libmimalloc-sys/c_src/mimalloc/"; - sha256 = "1cqgay6ayzxsj8v1dy8405kwd8av34m4bjc84iyg9r52amlijbg4"; - }; - in '' - pushd $name - patch -p1 < ${mimallocPatch} - substituteInPlace libmimalloc-sys/.cargo-checksum.json \ - --replace \ - '6a2e9f0db0d3de160f9f15ddc8a870dbc42bba724f19f1e69b8c4952cb36821a' \ - '201ab8874d9ba863406e084888e492b785a7edae00a222f395c079028d21a89a' \ - --replace \ - 'a87a27e8432a63e5de25703ff5025588afd458e3a573e51b3c3dee2281bff0d4' \ - 'ab98a2da81d2145003a9cba7b7025efbd2c7b37c7a23c058c150705a3ec39298' - popd - ''; - }; cargoLock = { lockFile = ./Cargo.lock; outputHashes = { @@ -46,6 +32,11 @@ rustPlatform.buildRustPackage rec { }; }; + postPatch = '' + patch -d $cargoDepsCopy/libmimalloc-sys-0.1.24/c_src/mimalloc \ + -p1 < ${mimallocPatch} + ''; + passthru.tests.version = testers.testVersion { package = difftastic; }; meta = with lib; { -- cgit 1.4.1