diff options
Diffstat (limited to 'pkgs/applications/science/physics/crystfel/default.nix')
-rw-r--r-- | pkgs/applications/science/physics/crystfel/default.nix | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/pkgs/applications/science/physics/crystfel/default.nix b/pkgs/applications/science/physics/crystfel/default.nix index 0a981f0adf4e..116c3f5d8456 100644 --- a/pkgs/applications/science/physics/crystfel/default.nix +++ b/pkgs/applications/science/physics/crystfel/default.nix @@ -6,7 +6,6 @@ , cmake , lz4 , bzip2 -, gfortran , m4 , hdf5 , gsl @@ -38,14 +37,12 @@ let libccp4 = stdenv.mkDerivation rec { pname = "libccp4"; - version = "6.5.1"; + version = "8.0.0"; src = fetchurl { - # Original mirror, now times out - # url = "ftp://ftp.ccp4.ac.uk/opensource/${pname}-${version}.tar.gz"; - url = "https://deb.debian.org/debian/pool/main/libc/${pname}/${pname}_${version}.orig.tar.gz"; - sha256 = "1rfvjliny29vy5bdi6rrjaw9hhhhh72pw536xwvqipqcjlylf2r8"; + url = "http://ftp.ccp4.ac.uk/opensource/${pname}-${version}.tar.gz"; + hash = "sha256-y4E66GYSoIZjKd6rfO6W6sVz2BvlskA0HUD5rVMi/y0="; }; - nativeBuildInputs = [ gfortran m4 ]; + nativeBuildInputs = [ meson ninja ]; buildInputs = [ hdf5 gsl ]; configureFlags = [ "FFLAGS=-fallow-argument-mismatch" ]; @@ -53,15 +50,12 @@ let # libccp4 tries to read syminfo.lib by looking at an environment variable, which hinders reproducibility. # We hard-code this by providing a little patch and then passing the absolute path to syminfo.lib as a # preprocessor flag. - preBuild = '' - makeFlagsArray+=(CFLAGS='-DNIX_PROVIDED_SYMOP_FILE=\"${placeholder "out"}/share/syminfo.lib\"') - export NIX_LDFLAGS="-L${gfortran.cc}/lib64 -L${gfortran.cc}/lib $NIX_LDFLAGS"; - ''; - makeFlags = [ "CFLAGS='-DNIX_PROVIDED_SYMOP_FILE=\"${placeholder "out"}/share/syminfo.lib\"" ]; + env.NIX_CFLAGS_COMPILE = "-DNIX_PROVIDED_SYMOP_FILE=\"${placeholder "out"}/share/ccp4/syminfo.lib\""; patches = [ + # This circumvents the original autoconf/CMake based build and uses meson instead + ./add-meson-build.patch ./libccp4-use-hardcoded-syminfo-lib.patch - ./0002-fix-ftbfs-with-gcc-10.patch ]; }; # This is the statically-linked, pre-built binary of mosflm. Compiling it ourselves turns out to be very difficult @@ -143,10 +137,10 @@ let pname = "HDF5-External-Filter-Plugins"; version = "0.1.0"; src = fetchFromGitHub { - owner = "nexusformat"; + owner = "spanezz"; repo = pname; - rev = "d469f175e5273c1d488e71a6134f84088f57d39c"; - sha256 = "1jrzzh75i68ad1yrim7s1nx9wy0s49ghkziahs71mm5azprm6gh9"; + rev = "master"; + hash = "sha256-Lkhhfhs0dIEplTAod1VBeO4vWH5/MIdfRvhAI3bCgD4="; }; nativeBuildInputs = [ cmake ]; @@ -184,13 +178,14 @@ stdenv.mkDerivation rec { ] ++ lib.optionals withGui [ gtk3 gdk-pixbuf ] ++ lib.optionals stdenv.isDarwin [ argp-standalone + ] ++ lib.optionals (stdenv.isDarwin && !stdenv.isAarch64) [ memorymappingHook ] - # hdf5-external-filter-plugins doesn't link on Darwin - ++ lib.optionals (withBitshuffle && !stdenv.isDarwin) [ hdf5-external-filter-plugins ]; + ++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ]; patches = [ ./link-to-argp-standalone-if-needed.patch + ./disable-fmemopen-on-aarch64-darwin.patch (fetchpatch { url = "https://gitlab.desy.de/thomas.white/crystfel/-/commit/3c54d59e1c13aaae716845fed2585770c3ca9d14.diff"; hash = "sha256-oaJNBQQn0c+z4p1pnW4osRJA2KdKiz4hWu7uzoKY7wc="; @@ -204,7 +199,7 @@ stdenv.mkDerivation rec { sed -i -e 's#execlp("mosflm"#execl("${mosflm}/bin/mosflm"#' libcrystfel/src/indexers/mosflm.c; ''; - postInstall = lib.optionalString (withBitshuffle && !stdenv.isDarwin) '' + postInstall = lib.optionalString withBitshuffle '' for file in $out/bin/*; do wrapProgram $file --set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins done @@ -224,7 +219,7 @@ stdenv.mkDerivation rec { downloadPage = "https://www.desy.de/~twhite/crystfel/download.html"; license = licenses.gpl3Plus; maintainers = with maintainers; [ pmiddend ]; - platforms = [ "x86_64-linux" "x86_64-darwin" ]; + platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; }; } |