tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
crystfel: 0.10.2 -> 0.11.0
Philipp Middendorf
2 years ago
693a4f85
6d2f58d4
+70
-25
3 changed files
expand all
collapse all
unified
split
pkgs
applications
science
physics
crystfel
default.nix
gui-path-issue.patch
link-to-argp-standalone-if-needed.patch
+34
-16
pkgs/applications/science/physics/crystfel/default.nix
···
6
6
, fetchzip
7
7
, cmake
8
8
, lz4
9
9
+
, gfortran
9
10
, bzip2
10
10
-
, m4
11
11
, hdf5
12
12
, gsl
13
13
, unzip
14
14
, makeWrapper
15
15
+
, zlib
15
16
, meson
16
16
-
, git
17
17
, ninja
18
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
43
-
url = "https://ftp.ccp4.ac.uk/opensource/${pname}-${version}.tar.gz";
44
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
90
-
stdenv.mkDerivation rec {
91
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
114
-
url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
115
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
124
-
version = "5d4e016941eb2a9e50a10df96ded7ff1e2464503";
125
125
+
version = "15caa21191e27e989b750b29566e4379bc5cd21a";
125
126
src = fetchurl {
126
127
url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
127
127
-
hash = "sha256-VnJOJJ247dNoBlos4Fu3GQBlAnTk9el+yZDRiicJtu0=";
128
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
173
+
174
174
+
millepede-ii = stdenv.mkDerivation rec {
175
175
+
pname = "millepede-ii";
176
176
+
version = "04-13-06";
177
177
+
src = fetchurl {
178
178
+
url = "https://gitlab.desy.de/claus.kleinwort/millepede-ii/-/archive/V${version}/millepede-ii-V${version}.tar.gz";
179
179
+
hash = "sha256-aFoo8AGBsUEN2u3AmnSpTqJ6JeNV6j9vkAFTZ34I+sI=";
180
180
+
};
181
181
+
182
182
+
nativeBuildInputs = [ gfortran ];
183
183
+
buildInputs = [ zlib ];
184
184
+
185
185
+
makeFlags = [ "PREFIX=$(out)" ];
186
186
+
};
172
187
in
173
188
stdenv.mkDerivation rec {
174
189
pname = "crystfel";
175
175
-
version = "0.10.2";
190
190
+
version = "0.11.0";
176
191
src = fetchurl {
177
177
-
url = "https://www.desy.de/~twhite/${pname}/${pname}-${version}.tar.gz";
178
178
-
sha256 = "sha256-nCO9ndDKS54bVN9IhFBiCVNzqk7BsCljXFrOmlx+sP4=";
192
192
+
url = "https://www.desy.de/~twhite/crystfel/crystfel-${version}.tar.gz";
193
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
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
220
+
# on darwin at least, we need to link to a separate argp library;
221
221
+
# this patch adds a test for this and the necessary linker options
204
222
./link-to-argp-standalone-if-needed.patch
205
205
-
./disable-fmemopen-on-aarch64-darwin.patch
206
206
-
(fetchpatch {
207
207
-
url = "https://gitlab.desy.de/thomas.white/crystfel/-/commit/3c54d59e1c13aaae716845fed2585770c3ca9d14.diff";
208
208
-
hash = "sha256-oaJNBQQn0c+z4p1pnW4osRJA2KdKiz4hWu7uzoKY7wc=";
209
209
-
})
223
223
+
# hotfix for an issue that occurs (at least) on NixOS:
224
224
+
# if the temporary path is too long, we get a segfault
225
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
221
-
wrapProgram $file --set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins
237
237
+
wrapProgram $file \
238
238
+
--set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins \
239
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
1
+
diff --git a/src/gui_index.c b/src/gui_index.c
2
2
+
index 2cc8e8db..13be77d5 100644
3
3
+
--- a/src/gui_index.c
4
4
+
+++ b/src/gui_index.c
5
5
+
@@ -540,6 +540,7 @@ static void delete_gui_tempdir(char *tmpdir)
6
6
+
{
7
7
+
char *path;
8
8
+
int i;
9
9
+
+ size_t pathlen;
10
10
+
11
11
+
/* List of files which it's safe to delete */
12
12
+
char *files[] = {"gmon.out", "mosflm.lp", "SUMMARY", "XDS.INP",
13
13
+
@@ -552,11 +553,12 @@ static void delete_gui_tempdir(char *tmpdir)
14
14
+
15
15
+
if ( tmpdir == NULL ) return;
16
16
+
17
17
+
- path = calloc(strlen(tmpdir)+64, 1);
18
18
+
+ pathlen = strlen(tmpdir)+64;
19
19
+
+ path = calloc(pathlen, 1);
20
20
+
if ( path == NULL ) return;
21
21
+
22
22
+
for ( i=0; i<n_files; i++ ) {
23
23
+
- snprintf(path, 127, "%s/%s", tmpdir, files[i]);
24
24
+
+ snprintf(path, pathlen, "%s/%s", tmpdir, files[i]);
25
25
+
unlink(path);
26
26
+
}
27
27
+
+9
-9
pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch
···
1
1
diff --git a/meson.build b/meson.build
2
2
-
index 59bbcfb7..dd75d4e2 100644
2
2
+
index 4717bb2a..38d8693f 100644
3
3
--- a/meson.build
4
4
+++ b/meson.build
5
5
-
@@ -80,6 +80,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>')
5
5
+
@@ -70,6 +70,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>')
6
6
conf_data.set10('HAVE_CLOCK_GETTIME', true)
7
7
endif
8
8
···
12
12
+ argpdep = dependency('', required : false)
13
13
+endif
14
14
+
15
15
-
# ************************ libcrystfel (subdir) ************************
16
16
-
17
17
-
subdir('libcrystfel')
18
18
-
@@ -180,7 +186,7 @@ endif
15
15
+
if cc.has_function('sched_setaffinity',
16
16
+
prefix: '#include <sched.h>',
17
17
+
args: '-D_GNU_SOURCE')
18
18
+
@@ -186,7 +192,7 @@ endif
19
19
20
20
indexamajig = executable('indexamajig', indexamajig_sources,
21
21
dependencies: [mdep, libcrystfeldep, gsldep,
22
22
-
- pthreaddep, zmqdep, asapodep],
23
23
-
+ pthreaddep, zmqdep, asapodep, argpdep],
22
22
+
- pthreaddep, zmqdep, asapodep, asapoproddep],
23
23
+
+ pthreaddep, zmqdep, asapodep, asapoproddep, argpdep],
24
24
install: true,
25
25
-
install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib')
25
25
+
install_rpath: crystfel_rpath)
26
26