about summary refs log tree commit diff
path: root/pkgs/applications/science/physics/crystfel/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/physics/crystfel/default.nix')
-rw-r--r--pkgs/applications/science/physics/crystfel/default.nix54
1 files changed, 36 insertions, 18 deletions
diff --git a/pkgs/applications/science/physics/crystfel/default.nix b/pkgs/applications/science/physics/crystfel/default.nix
index 92b48ec863091..e7eb69fb4e1c1 100644
--- a/pkgs/applications/science/physics/crystfel/default.nix
+++ b/pkgs/applications/science/physics/crystfel/default.nix
@@ -6,18 +6,19 @@
 , fetchzip
 , cmake
 , lz4
+, gfortran
 , bzip2
-, m4
 , hdf5
 , gsl
 , unzip
 , makeWrapper
+, zlib
 , meson
-, git
 , ninja
+, pandoc
 , eigen
 , pkg-config
-, wrapGAppsHook
+, wrapGAppsHook3
 , flex
 , bison
 , doxygen
@@ -40,7 +41,7 @@ let
     pname = "libccp4";
     version = "8.0.0";
     src = fetchurl {
-      url = "https://ftp.ccp4.ac.uk/opensource/${pname}-${version}.tar.gz";
+      url = "https://ftp.ccp4.ac.uk/opensource/libccp4-${version}.tar.gz";
       hash = "sha256-y4E66GYSoIZjKd6rfO6W6sVz2BvlskA0HUD5rVMi/y0=";
     };
     nativeBuildInputs = [ meson ninja ];
@@ -87,7 +88,7 @@ let
           };
       mosflmBinary = if stdenv.isDarwin then "bin/mosflm" else "mosflm-linux-64-noX11";
     in
-    stdenv.mkDerivation rec {
+    stdenv.mkDerivation {
       pname = "mosflm";
 
       inherit version src;
@@ -111,7 +112,7 @@ let
     pname = "xgandalf";
     version = "c6c5003ff1086e8c0fb5313660b4f02f3a3aab7b";
     src = fetchurl {
-      url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
+      url = "https://gitlab.desy.de/thomas.white/xgandalf/-/archive/${version}/xgandalf-${version}.tar.gz";
       hash = "sha256-/uZlBwAINSoYqgLQFTMz8rS1Rpadu79JkO6Bu/+Nx9E=";
     };
 
@@ -121,10 +122,10 @@ let
 
   pinkIndexer = stdenv.mkDerivation rec {
     pname = "pinkindexer";
-    version = "5d4e016941eb2a9e50a10df96ded7ff1e2464503";
+    version = "15caa21191e27e989b750b29566e4379bc5cd21a";
     src = fetchurl {
       url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
-      hash = "sha256-VnJOJJ247dNoBlos4Fu3GQBlAnTk9el+yZDRiicJtu0=";
+      hash = "sha256-v/SCJiHAV05Lc905y/dE8uBXlW+lLX9wau4XORYdbQg=";
     };
 
     nativeBuildInputs = [ meson pkg-config ninja ];
@@ -169,16 +170,30 @@ let
       "-DENABLE_BZIP2_PLUGIN=yes"
     ];
   };
+
+  millepede-ii = stdenv.mkDerivation rec {
+    pname = "millepede-ii";
+    version = "04-13-06";
+    src = fetchurl {
+      url = "https://gitlab.desy.de/claus.kleinwort/millepede-ii/-/archive/V${version}/millepede-ii-V${version}.tar.gz";
+      hash = "sha256-aFoo8AGBsUEN2u3AmnSpTqJ6JeNV6j9vkAFTZ34I+sI=";
+    };
+
+    nativeBuildInputs = [ gfortran ];
+    buildInputs = [ zlib ];
+
+    makeFlags = [ "PREFIX=$(out)" ];
+  };
 in
 stdenv.mkDerivation rec {
   pname = "crystfel";
-  version = "0.10.2";
+  version = "0.11.0";
   src = fetchurl {
-    url = "https://www.desy.de/~twhite/${pname}/${pname}-${version}.tar.gz";
-    sha256 = "sha256-nCO9ndDKS54bVN9IhFBiCVNzqk7BsCljXFrOmlx+sP4=";
+    url = "https://www.desy.de/~twhite/crystfel/crystfel-${version}.tar.gz";
+    sha256 = "sha256-ogNHWYfbxRmB5TdK8K0JpcCnYOOyXapQGSPh8mfp+Tc=";
   };
   nativeBuildInputs = [ meson pkg-config ninja flex bison doxygen opencl-headers makeWrapper ]
-    ++ lib.optionals withGui [ wrapGAppsHook ];
+    ++ lib.optionals withGui [ wrapGAppsHook3 ];
   buildInputs = [
     hdf5
     gsl
@@ -192,6 +207,7 @@ stdenv.mkDerivation rec {
     mosflm
     pinkIndexer
     xgandalf
+    pandoc
   ] ++ lib.optionals withGui [ gtk3 gdk-pixbuf ]
   ++ lib.optionals stdenv.isDarwin [
     argp-standalone
@@ -201,12 +217,12 @@ stdenv.mkDerivation rec {
   ++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ];
 
   patches = [
+    # on darwin at least, we need to link to a separate argp library;
+    # this patch adds a test for this and the necessary linker options
     ./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=";
-    })
+    # hotfix for an issue that occurs (at least) on NixOS:
+    # if the temporary path is too long, we get a segfault
+    ./gui-path-issue.patch
   ];
 
   # CrystFEL calls mosflm by searching PATH for it. We could've create a wrapper script that sets the PATH, but
@@ -218,7 +234,9 @@ stdenv.mkDerivation rec {
 
   postInstall = lib.optionalString withBitshuffle ''
     for file in $out/bin/*; do
-      wrapProgram $file --set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins
+      wrapProgram $file \
+        --set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins \
+        --prefix PATH ":" ${lib.makeBinPath [ millepede-ii ]}
     done
   '';