-
Notifications
You must be signed in to change notification settings - Fork 0
/
overlay.nix
229 lines (183 loc) · 6.97 KB
/
overlay.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
{ acts-src
, algorithms-src
, dd4hep-src
, edm4eic-src
, edm4hep-src
, epic-src
, eicrecon-src
, geant4-src
, jana2-src
, juggler-src
, podio-src
, ...
}:
final: prev: with final; {
acts = callPackage pkgs/acts { inherit acts-src; };
algorithms = callPackage pkgs/algorithms { inherit algorithms-src; };
afterburner = callPackage pkgs/afterburner {};
aida = callPackage pkgs/aida {};
athena = callPackage pkgs/athena {};
# geant4 requires at least version 2.4.6.0
clhep = prev.clhep.overrideAttrs (old:
final.lib.optionalAttrs (final.lib.versionOlder prev.clhep.version "2.4.7.1") rec {
version = "2.4.7.1";
src = fetchurl {
url = "https://proj-clhep.web.cern.ch/proj-clhep/dist1/clhep-${version}.tgz";
hash = "sha256-HIMEp3cqxrmRlfEwA3jG4930rQfIXWSgRQVlKruKVfk=";
};
}
);
epic = callPackage pkgs/epic { inherit epic-src; };
edm4eic = callPackage pkgs/edm4eic { inherit edm4eic-src; };
edm4hep = callPackage pkgs/edm4hep { inherit edm4hep-src; };
eicrecon = callPackage pkgs/eicrecon { inherit eicrecon-src; };
eic-smear = callPackage pkgs/eic-smear {};
fastjet = prev.fastjet.overrideAttrs (prev: {
configureFlags = prev.configureFlags ++ [
"--enable-auto-ptr=no"
];
});
# Required by a recent EICrecon
fmt = if final.lib.versionOlder prev.fmt.version "9" then fmt_9 else prev.fmt;
# Also update an input hardcoded in nixpkgs' spdlog (it switched to fmt
# later, so we'd like to stay forward-compatible)
fmt_8 = prev.fmt_9;
ftgl = prev.ftgl.overrideAttrs (_: lib.optionalAttrs stdenv.isDarwin {
# Fix build on GitHub Actions
# https://github.com/NixOS/nixpkgs/pull/191577
postPatch = ''
substituteInPlace m4/gl.m4 \
--replace ' -dylib_file $GL_DYLIB: $GL_DYLIB' ""
'';
});
fun4all = callPackage pkgs/fun4all {};
gaudi = callPackage pkgs/gaudi {
inherit (darwin.apple_sdk.frameworks) Foundation;
};
geant4 = (prev.geant4.override {
enableQt = true;
enableOpenGLX11 = !stdenv.isDarwin; # https://github.com/NixOS/nixpkgs/pull/346021
}).overrideAttrs (prev: rec {
version = "11.1.3";
src = geant4-src;
postPatch = ''
substituteInPlace source/externals/ptl/cmake/Modules/PTLPackageConfigHelpers.cmake \
--replace '${"$"}{prefix}/${"$"}{PTL_INSTALL_' '${"$"}{PTL_INSTALL_'
'';
cmakeFlags = prev.cmakeFlags ++ [
"-DCMAKE_CXX_STANDARD=20"
"-DGEANT4_BUILD_TLS_MODEL=global-dynamic"
];
});
genfit = callPackage pkgs/genfit {};
hepmc3 = prev.hepmc3.overrideAttrs (old:
(final.lib.optionalAttrs (final.lib.versionOlder prev.hepmc3.version "3.2.6") rec {
version = "3.2.6";
src = final.fetchurl {
url = "http://hepmc.web.cern.ch/hepmc/releases/HepMC3-${version}.tar.gz";
hash = "sha256-JI87WzbddzhEy+c9UfYIkUWDNLmGsll1TFnb9Lvx1SU=";
};
}) // {
postPatch = old.postPatch or "" + ''
substituteInPlace CMakeLists.txt \
--replace 'SET(CMAKE_INSTALL_RPATH "''${CMAKE_INSTALL_PREFIX}/''${CMAKE_INSTALL_LIBDIR}")' \
'SET(CMAKE_INSTALL_RPATH "''${CMAKE_INSTALL_FULL_LIBDIR}")'
'';
# Prevent patchelf from stripping search paths for plugins
# (it can't see them because they are dlopen'ed)
dontPatchELF = true;
});
hepmcmerger = callPackage pkgs/hepmcmerger {};
irt = callPackage pkgs/irt {};
jana2 = callPackage pkgs/jana2 { inherit jana2-src; };
juggler = callPackage pkgs/juggler { inherit juggler-src; };
k4FWCore = callPackage pkgs/k4FWCore {};
npdet = callPackage pkgs/npdet {};
npsim = callPackage pkgs/npsim {};
llvm_13 = prev.llvm_13.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [
# Fix compilation with C++20 for clang
(final.fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/a2ac383b44172ec47e4086d7572597ab251a4793.diff";
hash = "sha256-PoqxmQsIkrCyvvdFvkuEof+C3HWOjgGFRUfvVlZYPsI=";
stripLen = 1;
})
];
});
root = prev.root.overrideAttrs (prev: {
cmakeFlags = prev.cmakeFlags ++ [
"-DCMAKE_CXX_STANDARD=20"
"-Dssl=ON" # for Gaudi
"-Dbuiltin_unuran=ON"
"-Dunuran=ON" "-Dmathmore=ON" # for sartre
"-Droot7=ON" "-Dwebgui=ON" "-Dbuiltin_openui5=ON" # ROOT::ROOTGeomViewer for dd4hep
] ++ final.lib.optionals final.stdenv.isDarwin [
# https://github.com/AIDASoft/podio/issues/367
"-Dimt=OFF"
];
NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) "--version-script,${./pkgs/root/version.map}";
preConfigure = builtins.replaceStrings [ "rm -rf builtins/*" ] [ "" ] prev.preConfigure;
buildInputs = prev.buildInputs ++ [
openssl
pythia6
] ++ final.lib.optionals final.stdenv.isDarwin [
memorymappingHook # for roofit/xroofit/src/xRooNLLVar.cxx
];
});
dd4hep = callPackage pkgs/dd4hep {
inherit dd4hep-src;
inherit (darwin.apple_sdk.frameworks) AGL OpenGL;
};
onnxruntime = prev.onnxruntime.overrideAttrs (old: let
eigen = fetchFromGitLab {
owner = "libeigen";
repo = "eigen";
# https://github.com/microsoft/onnxruntime/blob/v1.16.3/cgmanifests/cgmanifest.json#L571
rev = "e7248b26a1ed53fa030c5c459f7ea095dfd276ac";
hash = "sha256-uQ1YYV3ojbMVfHdqjXRyUymRPjJZV3WHT36PTxPRius=";
};
onnx = fetchFromGitHub {
owner = "onnx";
repo = "onnx";
rev = "refs/tags/v1.14.1";
hash = "sha256-ZVSdk6LeAiZpQrrzLxphMbc1b3rNUMpcxcXPP8s/5tE=";
};
in final.lib.optionalAttrs (final.lib.versionOlder prev.onnxruntime.version "1.16") rec {
version = "1.16.3";
src = fetchFromGitHub {
owner = "microsoft";
repo = "onnxruntime";
rev = "refs/tags/v${version}";
hash = "sha256-bTW9Pc3rvH+c8VIlDDEtAXyA3sajVyY5Aqr6+SxaMF4=";
fetchSubmodules = true;
};
cmakeFlags = old.cmakeFlags ++ [
"-DFETCHCONTENT_SOURCE_DIR_EIGEN=${eigen}"
"-DFETCHCONTENT_SOURCE_DIR_ONNX=${onnx}"
];
# https://github.com/microsoft/onnxruntime/issues/13225
postPatch = (old.postPatch or "") + lib.optionalString stdenv.isDarwin ''
sed \
-i onnxruntime/test/framework/inference_session_test.cc \
-e '/InterThreadPoolWithDenormalAsZero/areturn;'
'';
});
opencascade-occt = prev.opencascade-occt.overrideAttrs (old:
final.lib.optionalAttrs (final.lib.versionOlder prev.opencascade-occt.version "7.7.2") rec {
version = "7.7.2";
commit = "V${builtins.replaceStrings ["."] ["_"] version}";
src = fetchurl {
name = "occt-${commit}.tar.gz";
url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=${commit};sf=tgz";
hash = "sha256-M0G/pJuxsJu5gRk0rIgC173/XxI1ERpmCtWjgr/0dyY=";
};
}
);
osg-ca-certs = callPackage pkgs/osg-ca-certs {};
podio = callPackage pkgs/podio { inherit podio-src; };
pythia6 = callPackage pkgs/pythia6 {};
rave = callPackage pkgs/rave {};
sartre = callPackage pkgs/sartre {};
veccore = callPackage pkgs/veccore {};
vecgeom = callPackage pkgs/vecgeom {};
}