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
, fetchzip
7
, cmake
8
, lz4
0
9
, bzip2
10
-
, m4
11
, hdf5
12
, gsl
13
, unzip
14
, makeWrapper
0
15
, meson
16
-
, git
17
, ninja
0
18
, eigen
19
, pkg-config
20
, wrapGAppsHook
···
40
pname = "libccp4";
41
version = "8.0.0";
42
src = fetchurl {
43
-
url = "https://ftp.ccp4.ac.uk/opensource/${pname}-${version}.tar.gz";
44
hash = "sha256-y4E66GYSoIZjKd6rfO6W6sVz2BvlskA0HUD5rVMi/y0=";
45
};
46
nativeBuildInputs = [ meson ninja ];
···
87
};
88
mosflmBinary = if stdenv.isDarwin then "bin/mosflm" else "mosflm-linux-64-noX11";
89
in
90
-
stdenv.mkDerivation rec {
91
pname = "mosflm";
92
93
inherit version src;
···
111
pname = "xgandalf";
112
version = "c6c5003ff1086e8c0fb5313660b4f02f3a3aab7b";
113
src = fetchurl {
114
-
url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
115
hash = "sha256-/uZlBwAINSoYqgLQFTMz8rS1Rpadu79JkO6Bu/+Nx9E=";
116
};
117
···
121
122
pinkIndexer = stdenv.mkDerivation rec {
123
pname = "pinkindexer";
124
-
version = "5d4e016941eb2a9e50a10df96ded7ff1e2464503";
125
src = fetchurl {
126
url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
127
-
hash = "sha256-VnJOJJ247dNoBlos4Fu3GQBlAnTk9el+yZDRiicJtu0=";
128
};
129
130
nativeBuildInputs = [ meson pkg-config ninja ];
···
169
"-DENABLE_BZIP2_PLUGIN=yes"
170
];
171
};
0
0
0
0
0
0
0
0
0
0
0
0
0
0
172
in
173
stdenv.mkDerivation rec {
174
pname = "crystfel";
175
-
version = "0.10.2";
176
src = fetchurl {
177
-
url = "https://www.desy.de/~twhite/${pname}/${pname}-${version}.tar.gz";
178
-
sha256 = "sha256-nCO9ndDKS54bVN9IhFBiCVNzqk7BsCljXFrOmlx+sP4=";
179
};
180
nativeBuildInputs = [ meson pkg-config ninja flex bison doxygen opencl-headers makeWrapper ]
181
++ lib.optionals withGui [ wrapGAppsHook ];
···
192
mosflm
193
pinkIndexer
194
xgandalf
0
195
] ++ lib.optionals withGui [ gtk3 gdk-pixbuf ]
196
++ lib.optionals stdenv.isDarwin [
197
argp-standalone
···
201
++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ];
202
203
patches = [
0
0
204
./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
-
})
210
];
211
212
# CrystFEL calls mosflm by searching PATH for it. We could've create a wrapper script that sets the PATH, but
···
218
219
postInstall = lib.optionalString withBitshuffle ''
220
for file in $out/bin/*; do
221
-
wrapProgram $file --set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins
0
0
222
done
223
'';
224
···
6
, fetchzip
7
, cmake
8
, lz4
9
+
, gfortran
10
, bzip2
0
11
, hdf5
12
, gsl
13
, unzip
14
, makeWrapper
15
+
, zlib
16
, meson
0
17
, ninja
18
+
, pandoc
19
, eigen
20
, pkg-config
21
, wrapGAppsHook
···
41
pname = "libccp4";
42
version = "8.0.0";
43
src = fetchurl {
44
+
url = "https://ftp.ccp4.ac.uk/opensource/libccp4-${version}.tar.gz";
45
hash = "sha256-y4E66GYSoIZjKd6rfO6W6sVz2BvlskA0HUD5rVMi/y0=";
46
};
47
nativeBuildInputs = [ meson ninja ];
···
88
};
89
mosflmBinary = if stdenv.isDarwin then "bin/mosflm" else "mosflm-linux-64-noX11";
90
in
91
+
stdenv.mkDerivation {
92
pname = "mosflm";
93
94
inherit version src;
···
112
pname = "xgandalf";
113
version = "c6c5003ff1086e8c0fb5313660b4f02f3a3aab7b";
114
src = fetchurl {
115
+
url = "https://gitlab.desy.de/thomas.white/xgandalf/-/archive/${version}/xgandalf-${version}.tar.gz";
116
hash = "sha256-/uZlBwAINSoYqgLQFTMz8rS1Rpadu79JkO6Bu/+Nx9E=";
117
};
118
···
122
123
pinkIndexer = stdenv.mkDerivation rec {
124
pname = "pinkindexer";
125
+
version = "15caa21191e27e989b750b29566e4379bc5cd21a";
126
src = fetchurl {
127
url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
128
+
hash = "sha256-v/SCJiHAV05Lc905y/dE8uBXlW+lLX9wau4XORYdbQg=";
129
};
130
131
nativeBuildInputs = [ meson pkg-config ninja ];
···
170
"-DENABLE_BZIP2_PLUGIN=yes"
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
+
};
187
in
188
stdenv.mkDerivation rec {
189
pname = "crystfel";
190
+
version = "0.11.0";
191
src = fetchurl {
192
+
url = "https://www.desy.de/~twhite/crystfel/crystfel-${version}.tar.gz";
193
+
sha256 = "sha256-ogNHWYfbxRmB5TdK8K0JpcCnYOOyXapQGSPh8mfp+Tc=";
194
};
195
nativeBuildInputs = [ meson pkg-config ninja flex bison doxygen opencl-headers makeWrapper ]
196
++ lib.optionals withGui [ wrapGAppsHook ];
···
207
mosflm
208
pinkIndexer
209
xgandalf
210
+
pandoc
211
] ++ lib.optionals withGui [ gtk3 gdk-pixbuf ]
212
++ lib.optionals stdenv.isDarwin [
213
argp-standalone
···
217
++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ];
218
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
222
./link-to-argp-standalone-if-needed.patch
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
0
0
226
];
227
228
# CrystFEL calls mosflm by searching PATH for it. We could've create a wrapper script that sets the PATH, but
···
234
235
postInstall = lib.optionalString withBitshuffle ''
236
for file in $out/bin/*; do
237
+
wrapProgram $file \
238
+
--set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins \
239
+
--prefix PATH ":" ${lib.makeBinPath [ millepede-ii ]}
240
done
241
'';
242
+27
pkgs/applications/science/physics/crystfel/gui-path-issue.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
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
+
+9
-9
pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch
···
1
diff --git a/meson.build b/meson.build
2
-
index 59bbcfb7..dd75d4e2 100644
3
--- a/meson.build
4
+++ b/meson.build
5
-
@@ -80,6 +80,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>')
6
conf_data.set10('HAVE_CLOCK_GETTIME', true)
7
endif
8
···
12
+ argpdep = dependency('', required : false)
13
+endif
14
+
15
-
# ************************ libcrystfel (subdir) ************************
16
-
17
-
subdir('libcrystfel')
18
-
@@ -180,7 +186,7 @@ endif
19
20
indexamajig = executable('indexamajig', indexamajig_sources,
21
dependencies: [mdep, libcrystfeldep, gsldep,
22
-
- pthreaddep, zmqdep, asapodep],
23
-
+ pthreaddep, zmqdep, asapodep, argpdep],
24
install: true,
25
-
install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib')
26
···
1
diff --git a/meson.build b/meson.build
2
+
index 4717bb2a..38d8693f 100644
3
--- a/meson.build
4
+++ b/meson.build
5
+
@@ -70,6 +70,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>')
6
conf_data.set10('HAVE_CLOCK_GETTIME', true)
7
endif
8
···
12
+ argpdep = dependency('', required : false)
13
+endif
14
+
15
+
if cc.has_function('sched_setaffinity',
16
+
prefix: '#include <sched.h>',
17
+
args: '-D_GNU_SOURCE')
18
+
@@ -186,7 +192,7 @@ endif
19
20
indexamajig = executable('indexamajig', indexamajig_sources,
21
dependencies: [mdep, libcrystfeldep, gsldep,
22
+
- pthreaddep, zmqdep, asapodep, asapoproddep],
23
+
+ pthreaddep, zmqdep, asapodep, asapoproddep, argpdep],
24
install: true,
25
+
install_rpath: crystfel_rpath)
26