tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
zchunk: fix build on darwin
Andrew Dunham
3 years ago
3ad87b45
ed56c826
+23
-1
2 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
zchunk
0001-meson-fix-argp-standalone.patch
default.nix
+18
pkgs/development/libraries/zchunk/0001-meson-fix-argp-standalone.patch
···
1
1
+
diff --git a/meson.build b/meson.build
2
2
+
index 1c6b32d..aa7dd25 100644
3
3
+
--- a/meson.build
4
4
+
+++ b/meson.build
5
5
+
@@ -58,10 +58,10 @@ endif
6
6
+
7
7
+
# argp-standalone dependency (if required)
8
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
9
+
- if fs.is_dir(join_paths([get_option('prefix'), 'include']))
10
10
+
- inc += include_directories(join_paths([get_option('prefix'), 'include']))
11
11
+
+ argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false)
12
12
+
+ if not argplib.found()
13
13
+
+ argplib = dependency('argp-standalone')
14
14
+
endif
15
15
+
- argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib']))
16
16
+
else
17
17
+
argplib = dependency('', required : false)
18
18
+
endif
+5
-1
pkgs/development/libraries/zchunk/default.nix
···
20
20
hash = "sha256-7H1WF5VkpA65xCdEa0Sw4r4jj+kGhDVCMr5AeE+3Ii4=";
21
21
};
22
22
23
23
+
# unbreak on darwin by finding argp-standalone, based on the patch from
24
24
+
# buildroot:
25
25
+
# https://github.com/buildroot/buildroot/raw/master/package/zchunk/0001-meson-fix-argp-standalone-wrap-and-find_library.patch
26
26
+
patches = lib.optional stdenv.isDarwin ./0001-meson-fix-argp-standalone.patch;
27
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
50
-
broken = stdenv.isDarwin; # does not find argp-standalone
51
55
};
52
56
}