Loading pkgs/applications/science/physics/crystfel/default.nix +10 −6 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ , stdenv , fetchurl , fetchFromGitHub , fetchpatch , cmake , lz4 , bzip2 Loading @@ -9,7 +10,6 @@ , m4 , hdf5 , gsl , slurm , unzip , makeWrapper , meson Loading Loading @@ -161,10 +161,10 @@ let in stdenv.mkDerivation rec { pname = "crystfel"; version = "0.10.1"; version = "0.10.2"; src = fetchurl { url = "https://www.desy.de/~twhite/${pname}/${pname}-${version}.tar.gz"; sha256 = "0i9d5ggalic7alj97dxjdys7010kxhm2cb4lwakvigl023j8ms79"; sha256 = "sha256-nCO9ndDKS54bVN9IhFBiCVNzqk7BsCljXFrOmlx+sP4="; }; nativeBuildInputs = [ meson pkg-config ninja flex bison doxygen opencl-headers makeWrapper ] ++ lib.optionals withGui [ wrapGAppsHook ]; Loading @@ -186,12 +186,16 @@ stdenv.mkDerivation rec { argp-standalone memorymappingHook ] # slurm is not available for Darwin; when it is, remove the condition ++ lib.optionals (!stdenv.isDarwin) [ slurm ] # hdf5-external-filter-plugins doesn't link on Darwin ++ lib.optionals (withBitshuffle && !stdenv.isDarwin) [ hdf5-external-filter-plugins ]; patches = [ ./link-to-argp-standalone-if-needed.patch ]; patches = [ ./link-to-argp-standalone-if-needed.patch (fetchpatch { url = "https://gitlab.desy.de/thomas.white/crystfel/-/commit/3c54d59e1c13aaae716845fed2585770c3ca9d14.diff"; hash = "sha256-oaJNBQQn0c+z4p1pnW4osRJA2KdKiz4hWu7uzoKY7wc="; }) ]; # CrystFEL calls mosflm by searching PATH for it. We could've create a wrapper script that sets the PATH, but # we'd have to do that for every CrystFEL executable (indexamajig, crystfel, partialator). Better to just Loading pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch +12 −12 Original line number Diff line number Diff line diff --git a/meson.build b/meson.build index efc9002b..070f37e4 100644 index 59bbcfb7..dd75d4e2 100644 --- a/meson.build +++ b/meson.build @@ -34,6 +34,12 @@ if slurmdep.found() conf_data.set10('HAVE_SLURM', 1) @@ -80,6 +80,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>') conf_data.set10('HAVE_CLOCK_GETTIME', true) 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() {}') Loading @@ -12,15 +12,15 @@ index efc9002b..070f37e4 100644 + argpdep = dependency('', required : false) +endif + # Find HDF5 using inbuilt Meson methods. Requires Meson >= 0.50.0 hdf5dep = dependency('hdf5', language: 'c', required: true) # ************************ libcrystfel (subdir) ************************ @@ -180,7 +186,7 @@ if zmqdep.found() endif subdir('libcrystfel') @@ -180,7 +186,7 @@ endif executable('indexamajig', indexamajig_sources, - dependencies: [mdep, libcrystfeldep, gsldep, pthreaddep, zmqdep], + dependencies: [mdep, libcrystfeldep, gsldep, pthreaddep, zmqdep, argpdep], indexamajig = executable('indexamajig', indexamajig_sources, dependencies: [mdep, libcrystfeldep, gsldep, - pthreaddep, zmqdep, asapodep], + pthreaddep, zmqdep, asapodep, argpdep], install: true, install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib') Loading
pkgs/applications/science/physics/crystfel/default.nix +10 −6 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ , stdenv , fetchurl , fetchFromGitHub , fetchpatch , cmake , lz4 , bzip2 Loading @@ -9,7 +10,6 @@ , m4 , hdf5 , gsl , slurm , unzip , makeWrapper , meson Loading Loading @@ -161,10 +161,10 @@ let in stdenv.mkDerivation rec { pname = "crystfel"; version = "0.10.1"; version = "0.10.2"; src = fetchurl { url = "https://www.desy.de/~twhite/${pname}/${pname}-${version}.tar.gz"; sha256 = "0i9d5ggalic7alj97dxjdys7010kxhm2cb4lwakvigl023j8ms79"; sha256 = "sha256-nCO9ndDKS54bVN9IhFBiCVNzqk7BsCljXFrOmlx+sP4="; }; nativeBuildInputs = [ meson pkg-config ninja flex bison doxygen opencl-headers makeWrapper ] ++ lib.optionals withGui [ wrapGAppsHook ]; Loading @@ -186,12 +186,16 @@ stdenv.mkDerivation rec { argp-standalone memorymappingHook ] # slurm is not available for Darwin; when it is, remove the condition ++ lib.optionals (!stdenv.isDarwin) [ slurm ] # hdf5-external-filter-plugins doesn't link on Darwin ++ lib.optionals (withBitshuffle && !stdenv.isDarwin) [ hdf5-external-filter-plugins ]; patches = [ ./link-to-argp-standalone-if-needed.patch ]; patches = [ ./link-to-argp-standalone-if-needed.patch (fetchpatch { url = "https://gitlab.desy.de/thomas.white/crystfel/-/commit/3c54d59e1c13aaae716845fed2585770c3ca9d14.diff"; hash = "sha256-oaJNBQQn0c+z4p1pnW4osRJA2KdKiz4hWu7uzoKY7wc="; }) ]; # CrystFEL calls mosflm by searching PATH for it. We could've create a wrapper script that sets the PATH, but # we'd have to do that for every CrystFEL executable (indexamajig, crystfel, partialator). Better to just Loading
pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch +12 −12 Original line number Diff line number Diff line diff --git a/meson.build b/meson.build index efc9002b..070f37e4 100644 index 59bbcfb7..dd75d4e2 100644 --- a/meson.build +++ b/meson.build @@ -34,6 +34,12 @@ if slurmdep.found() conf_data.set10('HAVE_SLURM', 1) @@ -80,6 +80,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>') conf_data.set10('HAVE_CLOCK_GETTIME', true) 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() {}') Loading @@ -12,15 +12,15 @@ index efc9002b..070f37e4 100644 + argpdep = dependency('', required : false) +endif + # Find HDF5 using inbuilt Meson methods. Requires Meson >= 0.50.0 hdf5dep = dependency('hdf5', language: 'c', required: true) # ************************ libcrystfel (subdir) ************************ @@ -180,7 +186,7 @@ if zmqdep.found() endif subdir('libcrystfel') @@ -180,7 +186,7 @@ endif executable('indexamajig', indexamajig_sources, - dependencies: [mdep, libcrystfeldep, gsldep, pthreaddep, zmqdep], + dependencies: [mdep, libcrystfeldep, gsldep, pthreaddep, zmqdep, argpdep], indexamajig = executable('indexamajig', indexamajig_sources, dependencies: [mdep, libcrystfeldep, gsldep, - pthreaddep, zmqdep, asapodep], + pthreaddep, zmqdep, asapodep, argpdep], install: true, install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib')