Unverified Commit 3eabaa6c authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #305305 from pmiddend/update-crystfel-to-0.11.0

crystfel: 0.10.2 -> 0.11.0
parents 789e6037 693a4f85
Loading
Loading
Loading
Loading
+34 −16
Original line number Diff line number Diff line
@@ -6,15 +6,16 @@
, fetchzip
, cmake
, lz4
, gfortran
, bzip2
, m4
, hdf5
, gsl
, unzip
, makeWrapper
, zlib
, meson
, git
, ninja
, pandoc
, eigen
, pkg-config
, wrapGAppsHook
@@ -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,13 +170,27 @@ 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 ];
@@ -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
  '';

+27 −0
Original line number Diff line number Diff line
diff --git a/src/gui_index.c b/src/gui_index.c
index 2cc8e8db..13be77d5 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -540,6 +540,7 @@ static void delete_gui_tempdir(char *tmpdir)
 {
 	char *path;
 	int i;
+	size_t pathlen;
 
 	/* List of files which it's safe to delete */
 	char *files[] = {"gmon.out", "mosflm.lp", "SUMMARY", "XDS.INP",
@@ -552,11 +553,12 @@ static void delete_gui_tempdir(char *tmpdir)
 
 	if ( tmpdir == NULL ) return;
 
-	path = calloc(strlen(tmpdir)+64, 1);
+	pathlen = strlen(tmpdir)+64;
+	path = calloc(pathlen, 1);
 	if ( path == NULL ) return;
 
 	for ( i=0; i<n_files; i++ ) {
-		snprintf(path, 127, "%s/%s", tmpdir, files[i]);
+		snprintf(path, pathlen, "%s/%s", tmpdir, files[i]);
 		unlink(path);
 	}
 
+9 −9
Original line number Diff line number Diff line
diff --git a/meson.build b/meson.build
index 59bbcfb7..dd75d4e2 100644
index 4717bb2a..38d8693f 100644
--- a/meson.build
+++ b/meson.build
@@ -80,6 +80,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>')
@@ -70,6 +70,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>')
   conf_data.set10('HAVE_CLOCK_GETTIME', true)
 endif
 
@@ -12,15 +12,15 @@ index 59bbcfb7..dd75d4e2 100644
+    argpdep = dependency('', required : false)
+endif
+
 # ************************ libcrystfel (subdir) ************************
 
 subdir('libcrystfel')
@@ -180,7 +186,7 @@ endif
 if cc.has_function('sched_setaffinity',
                    prefix: '#include <sched.h>',
                    args: '-D_GNU_SOURCE')
@@ -186,7 +192,7 @@ endif
 
 indexamajig = executable('indexamajig', indexamajig_sources,
                          dependencies: [mdep, libcrystfeldep, gsldep,
-                                        pthreaddep, zmqdep, asapodep],
+                                        pthreaddep, zmqdep, asapodep, argpdep],
-                                        pthreaddep, zmqdep, asapodep, asapoproddep],
+                                        pthreaddep, zmqdep, asapodep, asapoproddep, argpdep],
                          install: true,
                          install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib')
                          install_rpath: crystfel_rpath)