depot/third_party/nixpkgs/pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch
Default email 3a4df29a92 Project import generated by Copybara.
GitOrigin-RevId: 3d7435c638baffaa826b85459df0fff47f12317d
2022-06-16 19:23:12 +02:00

26 lines
1,013 B
Diff

diff --git a/meson.build b/meson.build
index efc9002b..070f37e4 100644
--- a/meson.build
+++ b/meson.build
@@ -34,6 +34,12 @@ if slurmdep.found()
conf_data.set10('HAVE_SLURM', 1)
endif
+if 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() {}')
+ argpdep = cc.find_library('argp')
+else
+ argpdep = dependency('', required : false)
+endif
+
# Find HDF5 using inbuilt Meson methods. Requires Meson >= 0.50.0
hdf5dep = dependency('hdf5', language: 'c', required: true)
@@ -180,7 +186,7 @@ if zmqdep.found()
endif
executable('indexamajig', indexamajig_sources,
- dependencies: [mdep, libcrystfeldep, gsldep, pthreaddep, zmqdep],
+ dependencies: [mdep, libcrystfeldep, gsldep, pthreaddep, zmqdep, argpdep],
install: true,
install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib')