@@ -1,15 +1,17 @@
11{ stdenv
22, fetchFromGitHub
3+, fetchpatch
34, pkgconfig
45, meson
56, ninja
67, zstd
78, curl
9+, argp-standalone
810}:
911
1012stdenv.mkDerivation rec {
1113 pname = "zchunk";
12− version = "1.1.6";
14+ version = "1.1.8";
1315
1416 outputs = [ "out" "lib" "dev" ];
1517
@@ -17,7 +19,7 @@ stdenv.mkDerivation rec {
1719 owner = "zchunk";
1820 repo = pname;
1921 rev = version;
20− sha256 = "1j05f26xppwbkxrm11895blm75i1a6p9q23x7wlkqw198mpnpbbv";
22+ sha256 = "0q1jafxh5nqgn2w5ciljkh8h46xma0qia8a5rj9m0pxixcacqj6q";
2123 };
2224
2325 nativeBuildInputs = [
@@ -29,7 +31,17 @@ stdenv.mkDerivation rec {
2931 buildInputs = [
3032 zstd
3133 curl
32− ];
34+ ] ++ stdenv.lib.optional stdenv.isDarwin argp-standalone;
35+
36+ # Darwin needs a patch for argp-standalone usage and differing endian.h location on macOS
37+ # https://github.com/zchunk/zchunk/pull/35
38+ patches = [
39+ (fetchpatch {
40+ name = "darwin-support.patch";
41+ url = "https://github.com/zchunk/zchunk/commit/f7db2ac0a95028a7f82ecb89862426bf53a69232.patch";
42+ sha256 = "0cm84gyii4ly6nsmagk15g9kbfa13rw395nqk3fdcwm0dpixlkh4";
43+ })
44+];
3345
3446 meta = with stdenv.lib; {
3547 description = "File format designed for highly efficient deltas while maintaining good compression";