zchunk: fix build on darwin

+23 -1
+18
pkgs/development/libraries/zchunk/0001-meson-fix-argp-standalone.patch
··· 1 + diff --git a/meson.build b/meson.build 2 + index 1c6b32d..aa7dd25 100644 3 + --- a/meson.build 4 + +++ b/meson.build 5 + @@ -58,10 +58,10 @@ endif 6 + 7 + # argp-standalone dependency (if required) 8 + 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() {}') 9 + - if fs.is_dir(join_paths([get_option('prefix'), 'include'])) 10 + - inc += include_directories(join_paths([get_option('prefix'), 'include'])) 11 + + argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false) 12 + + if not argplib.found() 13 + + argplib = dependency('argp-standalone') 14 + endif 15 + - argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib'])) 16 + else 17 + argplib = dependency('', required : false) 18 + endif
+5 -1
pkgs/development/libraries/zchunk/default.nix
··· 20 20 hash = "sha256-7H1WF5VkpA65xCdEa0Sw4r4jj+kGhDVCMr5AeE+3Ii4="; 21 21 }; 22 22 23 + # unbreak on darwin by finding argp-standalone, based on the patch from 24 + # buildroot: 25 + # https://github.com/buildroot/buildroot/raw/master/package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch 26 + patches = lib.optional stdenv.isDarwin ./0001-meson-fix-argp-standalone.patch; 27 + 23 28 nativeBuildInputs = [ 24 29 meson 25 30 ninja ··· 47 52 license = licenses.bsd2; 48 53 maintainers = with maintainers; [ AndersonTorres ]; 49 54 platforms = platforms.unix; 50 - broken = stdenv.isDarwin; # does not find argp-standalone 51 55 }; 52 56 }