about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/zchunk
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/libraries/zchunk
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/zchunk')
-rw-r--r--nixpkgs/pkgs/development/libraries/zchunk/0001-meson-fix-argp-standalone.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/zchunk/default.nix10
2 files changed, 25 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/libraries/zchunk/0001-meson-fix-argp-standalone.patch b/nixpkgs/pkgs/development/libraries/zchunk/0001-meson-fix-argp-standalone.patch
new file mode 100644
index 000000000000..cd51d17b1500
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zchunk/0001-meson-fix-argp-standalone.patch
@@ -0,0 +1,18 @@
+diff --git a/meson.build b/meson.build
+index 1c6b32d..aa7dd25 100644
+--- a/meson.build
++++ b/meson.build
+@@ -58,10 +58,10 @@ endif
+ 
+ # argp-standalone dependency (if required)
+ if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
+-    if fs.is_dir(join_paths([get_option('prefix'), 'include']))
+-        inc += include_directories(join_paths([get_option('prefix'), 'include']))
++    argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false)
++    if not argplib.found()
++        argplib = dependency('argp-standalone')
+     endif
+-    argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib']))
+ else
+     argplib = dependency('', required : false)
+ endif
diff --git a/nixpkgs/pkgs/development/libraries/zchunk/default.nix b/nixpkgs/pkgs/development/libraries/zchunk/default.nix
index c639eb7b30e9..815326e53838 100644
--- a/nixpkgs/pkgs/development/libraries/zchunk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zchunk/default.nix
@@ -11,15 +11,20 @@
 
 stdenv.mkDerivation rec {
   pname = "zchunk";
-  version = "1.2.0";
+  version = "1.2.2";
 
   src = fetchFromGitHub {
     owner = "zchunk";
     repo = pname;
     rev = version;
-    hash = "sha256-7H1WF5VkpA65xCdEa0Sw4r4jj+kGhDVCMr5AeE+3Ii4=";
+    hash = "sha256-/gtkw020pybUDUeYydXgJ4PLvdOqZ0RbrLOfNMDaCmA=";
   };
 
+  # unbreak on darwin by finding argp-standalone, based on the patch from
+  # buildroot:
+  #    https://github.com/buildroot/buildroot/raw/master/package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch
+  patches = lib.optional stdenv.isDarwin ./0001-meson-fix-argp-standalone.patch;
+
   nativeBuildInputs = [
     meson
     ninja
@@ -47,6 +52,5 @@ stdenv.mkDerivation rec {
     license = licenses.bsd2;
     maintainers = with maintainers; [ AndersonTorres ];
     platforms = platforms.unix;
-    broken = stdenv.isDarwin; # does not find argp-standalone
   };
 }