crystfel: 0.10.2 -> 0.11.0

+70 -25
+34 -16
pkgs/applications/science/physics/crystfel/default.nix
··· 6 6 , fetchzip 7 7 , cmake 8 8 , lz4 9 + , gfortran 9 10 , bzip2 10 - , m4 11 11 , hdf5 12 12 , gsl 13 13 , unzip 14 14 , makeWrapper 15 + , zlib 15 16 , meson 16 - , git 17 17 , ninja 18 + , pandoc 18 19 , eigen 19 20 , pkg-config 20 21 , wrapGAppsHook ··· 40 41 pname = "libccp4"; 41 42 version = "8.0.0"; 42 43 src = fetchurl { 43 - url = "https://ftp.ccp4.ac.uk/opensource/${pname}-${version}.tar.gz"; 44 + url = "https://ftp.ccp4.ac.uk/opensource/libccp4-${version}.tar.gz"; 44 45 hash = "sha256-y4E66GYSoIZjKd6rfO6W6sVz2BvlskA0HUD5rVMi/y0="; 45 46 }; 46 47 nativeBuildInputs = [ meson ninja ]; ··· 87 88 }; 88 89 mosflmBinary = if stdenv.isDarwin then "bin/mosflm" else "mosflm-linux-64-noX11"; 89 90 in 90 - stdenv.mkDerivation rec { 91 + stdenv.mkDerivation { 91 92 pname = "mosflm"; 92 93 93 94 inherit version src; ··· 111 112 pname = "xgandalf"; 112 113 version = "c6c5003ff1086e8c0fb5313660b4f02f3a3aab7b"; 113 114 src = fetchurl { 114 - url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz"; 115 + url = "https://gitlab.desy.de/thomas.white/xgandalf/-/archive/${version}/xgandalf-${version}.tar.gz"; 115 116 hash = "sha256-/uZlBwAINSoYqgLQFTMz8rS1Rpadu79JkO6Bu/+Nx9E="; 116 117 }; 117 118 ··· 121 122 122 123 pinkIndexer = stdenv.mkDerivation rec { 123 124 pname = "pinkindexer"; 124 - version = "5d4e016941eb2a9e50a10df96ded7ff1e2464503"; 125 + version = "15caa21191e27e989b750b29566e4379bc5cd21a"; 125 126 src = fetchurl { 126 127 url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz"; 127 - hash = "sha256-VnJOJJ247dNoBlos4Fu3GQBlAnTk9el+yZDRiicJtu0="; 128 + hash = "sha256-v/SCJiHAV05Lc905y/dE8uBXlW+lLX9wau4XORYdbQg="; 128 129 }; 129 130 130 131 nativeBuildInputs = [ meson pkg-config ninja ]; ··· 169 170 "-DENABLE_BZIP2_PLUGIN=yes" 170 171 ]; 171 172 }; 173 + 174 + millepede-ii = stdenv.mkDerivation rec { 175 + pname = "millepede-ii"; 176 + version = "04-13-06"; 177 + src = fetchurl { 178 + url = "https://gitlab.desy.de/claus.kleinwort/millepede-ii/-/archive/V${version}/millepede-ii-V${version}.tar.gz"; 179 + hash = "sha256-aFoo8AGBsUEN2u3AmnSpTqJ6JeNV6j9vkAFTZ34I+sI="; 180 + }; 181 + 182 + nativeBuildInputs = [ gfortran ]; 183 + buildInputs = [ zlib ]; 184 + 185 + makeFlags = [ "PREFIX=$(out)" ]; 186 + }; 172 187 in 173 188 stdenv.mkDerivation rec { 174 189 pname = "crystfel"; 175 - version = "0.10.2"; 190 + version = "0.11.0"; 176 191 src = fetchurl { 177 - url = "https://www.desy.de/~twhite/${pname}/${pname}-${version}.tar.gz"; 178 - sha256 = "sha256-nCO9ndDKS54bVN9IhFBiCVNzqk7BsCljXFrOmlx+sP4="; 192 + url = "https://www.desy.de/~twhite/crystfel/crystfel-${version}.tar.gz"; 193 + sha256 = "sha256-ogNHWYfbxRmB5TdK8K0JpcCnYOOyXapQGSPh8mfp+Tc="; 179 194 }; 180 195 nativeBuildInputs = [ meson pkg-config ninja flex bison doxygen opencl-headers makeWrapper ] 181 196 ++ lib.optionals withGui [ wrapGAppsHook ]; ··· 192 207 mosflm 193 208 pinkIndexer 194 209 xgandalf 210 + pandoc 195 211 ] ++ lib.optionals withGui [ gtk3 gdk-pixbuf ] 196 212 ++ lib.optionals stdenv.isDarwin [ 197 213 argp-standalone ··· 201 217 ++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ]; 202 218 203 219 patches = [ 220 + # on darwin at least, we need to link to a separate argp library; 221 + # this patch adds a test for this and the necessary linker options 204 222 ./link-to-argp-standalone-if-needed.patch 205 - ./disable-fmemopen-on-aarch64-darwin.patch 206 - (fetchpatch { 207 - url = "https://gitlab.desy.de/thomas.white/crystfel/-/commit/3c54d59e1c13aaae716845fed2585770c3ca9d14.diff"; 208 - hash = "sha256-oaJNBQQn0c+z4p1pnW4osRJA2KdKiz4hWu7uzoKY7wc="; 209 - }) 223 + # hotfix for an issue that occurs (at least) on NixOS: 224 + # if the temporary path is too long, we get a segfault 225 + ./gui-path-issue.patch 210 226 ]; 211 227 212 228 # CrystFEL calls mosflm by searching PATH for it. We could've create a wrapper script that sets the PATH, but ··· 218 234 219 235 postInstall = lib.optionalString withBitshuffle '' 220 236 for file in $out/bin/*; do 221 - wrapProgram $file --set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins 237 + wrapProgram $file \ 238 + --set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins \ 239 + --prefix PATH ":" ${lib.makeBinPath [ millepede-ii ]} 222 240 done 223 241 ''; 224 242
+27
pkgs/applications/science/physics/crystfel/gui-path-issue.patch
··· 1 + diff --git a/src/gui_index.c b/src/gui_index.c 2 + index 2cc8e8db..13be77d5 100644 3 + --- a/src/gui_index.c 4 + +++ b/src/gui_index.c 5 + @@ -540,6 +540,7 @@ static void delete_gui_tempdir(char *tmpdir) 6 + { 7 + char *path; 8 + int i; 9 + + size_t pathlen; 10 + 11 + /* List of files which it's safe to delete */ 12 + char *files[] = {"gmon.out", "mosflm.lp", "SUMMARY", "XDS.INP", 13 + @@ -552,11 +553,12 @@ static void delete_gui_tempdir(char *tmpdir) 14 + 15 + if ( tmpdir == NULL ) return; 16 + 17 + - path = calloc(strlen(tmpdir)+64, 1); 18 + + pathlen = strlen(tmpdir)+64; 19 + + path = calloc(pathlen, 1); 20 + if ( path == NULL ) return; 21 + 22 + for ( i=0; i<n_files; i++ ) { 23 + - snprintf(path, 127, "%s/%s", tmpdir, files[i]); 24 + + snprintf(path, pathlen, "%s/%s", tmpdir, files[i]); 25 + unlink(path); 26 + } 27 +