2021-07-16 19:40:57 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2022-11-21 17:40:18 +00:00
|
|
|
, callPackage
|
|
|
|
, fetchFromGitHub
|
2021-09-18 10:52:07 +00:00
|
|
|
, fetchpatch
|
2021-07-16 19:40:57 +00:00
|
|
|
, makeWrapper
|
|
|
|
, cmake
|
2022-11-21 17:40:18 +00:00
|
|
|
, coreutils
|
2021-07-16 19:40:57 +00:00
|
|
|
, git
|
2022-11-21 17:40:18 +00:00
|
|
|
, davix
|
2021-07-16 19:40:57 +00:00
|
|
|
, ftgl
|
|
|
|
, gl2ps
|
|
|
|
, glew
|
2022-11-21 17:40:18 +00:00
|
|
|
, gnugrep
|
|
|
|
, gnused
|
2021-07-16 19:40:57 +00:00
|
|
|
, gsl
|
2022-01-19 23:45:15 +00:00
|
|
|
, lapack
|
2021-07-16 19:40:57 +00:00
|
|
|
, libX11
|
|
|
|
, libXpm
|
|
|
|
, libXft
|
|
|
|
, libXext
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
2022-10-30 15:09:59 +00:00
|
|
|
, libxcrypt
|
2021-07-16 19:40:57 +00:00
|
|
|
, libxml2
|
2021-09-18 10:52:07 +00:00
|
|
|
, llvm_9
|
2022-11-21 17:40:18 +00:00
|
|
|
, lsof
|
2021-07-16 19:40:57 +00:00
|
|
|
, lz4
|
|
|
|
, xz
|
2022-11-21 17:40:18 +00:00
|
|
|
, man
|
2022-01-19 23:45:15 +00:00
|
|
|
, openblas
|
2022-11-21 17:40:18 +00:00
|
|
|
, openssl
|
2021-07-16 19:40:57 +00:00
|
|
|
, pcre
|
|
|
|
, nlohmann_json
|
|
|
|
, pkg-config
|
2022-11-21 17:40:18 +00:00
|
|
|
, procps
|
2021-07-16 19:40:57 +00:00
|
|
|
, python
|
2022-11-21 17:40:18 +00:00
|
|
|
, which
|
2021-07-16 19:40:57 +00:00
|
|
|
, xxHash
|
|
|
|
, zlib
|
|
|
|
, zstd
|
|
|
|
, libAfterImage
|
|
|
|
, giflib
|
|
|
|
, libjpeg
|
|
|
|
, libtiff
|
|
|
|
, libpng
|
2022-11-21 17:40:18 +00:00
|
|
|
, patchRcPathCsh
|
|
|
|
, patchRcPathFish
|
|
|
|
, patchRcPathPosix
|
2021-09-18 10:52:07 +00:00
|
|
|
, tbb
|
2021-07-16 19:40:57 +00:00
|
|
|
, Cocoa
|
|
|
|
, CoreSymbolication
|
|
|
|
, OpenGL
|
|
|
|
, noSplash ? false
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
_llvm_9 = llvm_9.overrideAttrs (prev: {
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = (prev.patches or [ ]) ++ [
|
2022-08-12 12:06:08 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/root-project/root/commit/a9c961cf4613ff1f0ea50f188e4a4b0eb749b17d.diff";
|
|
|
|
stripLen = 3;
|
|
|
|
hash = "sha256-LH2RipJICEDWOr7JzX5s0QiUhEwXNMFEJihYKy9qWpo=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "root";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "6.26.08";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
passthru = {
|
|
|
|
tests = import ./tests { inherit callPackage; };
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "root-project";
|
|
|
|
repo = "root";
|
|
|
|
rev = "v${builtins.replaceStrings [ "." ] [ "-" ] version}";
|
|
|
|
sha256 = "sha256-cNd1GvEbO/a+WdDe8EHYGmdlw3TrOT2fWaSk+s7fw7U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper cmake pkg-config git ];
|
2021-07-16 19:40:57 +00:00
|
|
|
buildInputs = [
|
2022-11-21 17:40:18 +00:00
|
|
|
davix
|
2021-07-16 19:40:57 +00:00
|
|
|
ftgl
|
|
|
|
gl2ps
|
|
|
|
glew
|
|
|
|
pcre
|
|
|
|
zlib
|
|
|
|
zstd
|
2022-01-19 23:45:15 +00:00
|
|
|
lapack
|
2022-10-30 15:09:59 +00:00
|
|
|
libxcrypt
|
2021-07-16 19:40:57 +00:00
|
|
|
libxml2
|
2022-08-12 12:06:08 +00:00
|
|
|
_llvm_9
|
2021-07-16 19:40:57 +00:00
|
|
|
lz4
|
|
|
|
xz
|
|
|
|
gsl
|
2022-01-19 23:45:15 +00:00
|
|
|
openblas
|
2022-11-21 17:40:18 +00:00
|
|
|
openssl
|
2021-07-16 19:40:57 +00:00
|
|
|
xxHash
|
|
|
|
libAfterImage
|
|
|
|
giflib
|
|
|
|
libjpeg
|
|
|
|
libtiff
|
|
|
|
libpng
|
|
|
|
nlohmann_json
|
2022-11-21 17:40:18 +00:00
|
|
|
patchRcPathCsh
|
|
|
|
patchRcPathFish
|
|
|
|
patchRcPathPosix
|
2021-07-16 19:40:57 +00:00
|
|
|
python.pkgs.numpy
|
2021-09-18 10:52:07 +00:00
|
|
|
tbb
|
2021-07-16 19:40:57 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
|
|
|
|
++ lib.optionals (stdenv.isDarwin) [ Cocoa CoreSymbolication OpenGL ]
|
|
|
|
;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./sw_vers.patch
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
# Fix build against vanilla LLVM 9
|
|
|
|
postPatch = ''
|
|
|
|
sed \
|
|
|
|
-e '/#include "llvm.*RTDyldObjectLinkingLayer.h"/i#define private protected' \
|
|
|
|
-e '/#include "llvm.*RTDyldObjectLinkingLayer.h"/a#undef private' \
|
|
|
|
-i interpreter/cling/lib/Interpreter/IncrementalJIT.h
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
rm -rf builtins/*
|
|
|
|
substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \
|
|
|
|
--replace 'set(lcgpackages ' '#set(lcgpackages '
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
# Don't require textutil on macOS
|
|
|
|
: > cmake/modules/RootCPack.cmake
|
|
|
|
|
|
|
|
# Hardcode path to fix use with cmake
|
|
|
|
sed -i cmake/scripts/ROOTConfig.cmake.in \
|
2022-03-10 19:12:11 +00:00
|
|
|
-e '1iset(nlohmann_json_DIR "${nlohmann_json}/lib/cmake/nlohmann_json/")'
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patchShebangs build/unix/
|
2021-01-17 00:15:33 +00:00
|
|
|
'' + lib.optionalString noSplash ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace rootx/src/rootx.cxx --replace "gNoLogo = false" "gNoLogo = true"
|
2021-07-03 03:11:41 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
# Eliminate impure reference to /System/Library/PrivateFrameworks
|
|
|
|
substituteInPlace core/CMakeLists.txt \
|
|
|
|
--replace "-F/System/Library/PrivateFrameworks" ""
|
2022-11-21 17:40:18 +00:00
|
|
|
'' + lib.optionalString (stdenv.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
|
|
|
|
MACOSX_DEPLOYMENT_TARGET=10.16
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-Drpath=ON"
|
2021-12-30 13:39:12 +00:00
|
|
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
2021-09-18 10:52:07 +00:00
|
|
|
"-Dbuiltin_llvm=OFF"
|
2021-06-28 23:13:55 +00:00
|
|
|
"-Dbuiltin_nlohmannjson=OFF"
|
|
|
|
"-Dbuiltin_openui5=OFF"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dalien=OFF"
|
|
|
|
"-Dbonjour=OFF"
|
|
|
|
"-Dcastor=OFF"
|
|
|
|
"-Dchirp=OFF"
|
|
|
|
"-Dclad=OFF"
|
2022-11-21 17:40:18 +00:00
|
|
|
"-Ddavix=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Ddcache=OFF"
|
|
|
|
"-Dfail-on-missing=ON"
|
|
|
|
"-Dfftw3=OFF"
|
|
|
|
"-Dfitsio=OFF"
|
|
|
|
"-Dfortran=OFF"
|
2021-09-18 10:52:07 +00:00
|
|
|
"-Dimt=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dgfal=OFF"
|
|
|
|
"-Dgviz=OFF"
|
|
|
|
"-Dhdfs=OFF"
|
2021-06-28 23:13:55 +00:00
|
|
|
"-Dhttp=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dkrb5=OFF"
|
|
|
|
"-Dldap=OFF"
|
|
|
|
"-Dmonalisa=OFF"
|
|
|
|
"-Dmysql=OFF"
|
|
|
|
"-Dodbc=OFF"
|
|
|
|
"-Dopengl=ON"
|
|
|
|
"-Doracle=OFF"
|
|
|
|
"-Dpgsql=OFF"
|
|
|
|
"-Dpythia6=OFF"
|
|
|
|
"-Dpythia8=OFF"
|
|
|
|
"-Drfio=OFF"
|
2021-06-28 23:13:55 +00:00
|
|
|
"-Droot7=OFF"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dsqlite=OFF"
|
2022-11-21 17:40:18 +00:00
|
|
|
"-Dssl=ON"
|
2022-01-19 23:45:15 +00:00
|
|
|
"-Dtmva=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dvdt=OFF"
|
2021-06-28 23:13:55 +00:00
|
|
|
"-Dwebgui=OFF"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dxml=ON"
|
|
|
|
"-Dxrootd=OFF"
|
|
|
|
]
|
2021-01-17 00:15:33 +00:00
|
|
|
++ lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include"
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
2021-01-05 17:05:55 +00:00
|
|
|
"-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"
|
|
|
|
"-DCMAKE_DISABLE_FIND_PACKAGE_Python2=TRUE"
|
|
|
|
|
|
|
|
# fatal error: module map file '/nix/store/<hash>-Libsystem-osx-10.12.6/include/module.modulemap' not found
|
|
|
|
# fatal error: could not build module '_Builtin_intrinsics'
|
|
|
|
"-Druntime_cxxmodules=OFF"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
NIX_LDFLAGS = lib.optionalString (stdenv.isLinux && stdenv.isAarch64 && stdenv.cc.isGNU) "-lgcc";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do
|
|
|
|
wrapProgram "$out/bin/$prog" \
|
2022-01-27 00:19:43 +00:00
|
|
|
--set PYTHONPATH "$out/lib" \
|
|
|
|
--set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib"
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
# Make ldd and sed available to the ROOT executable
|
|
|
|
wrapProgram "$out/bin/root" --prefix PATH : "${lib.makeBinPath [
|
|
|
|
gnused # sed
|
|
|
|
stdenv.cc # c++ ld etc.
|
|
|
|
stdenv.cc.libc # ldd
|
|
|
|
]}"
|
|
|
|
|
|
|
|
# Patch thisroot.{sh,csh,fish}
|
|
|
|
|
|
|
|
# The main target of `thisroot.sh` is "bash-like shells",
|
|
|
|
# but it also need to support Bash-less POSIX shell like dash,
|
|
|
|
# as they are mentioned in `thisroot.sh`.
|
|
|
|
|
|
|
|
# `thisroot.sh` would include commands `lsof` and `procps` since ROOT 6.28.
|
|
|
|
# See https://github.com/root-project/root/pull/10332
|
|
|
|
|
|
|
|
patchRcPathPosix "$out/bin/thisroot.sh" "${lib.makeBinPath [
|
|
|
|
coreutils # dirname tail
|
|
|
|
gnugrep # grep
|
|
|
|
gnused # sed
|
|
|
|
lsof # lsof # for ROOT (>=6.28)
|
|
|
|
man # manpath
|
|
|
|
procps # ps # for ROOT (>=6.28)
|
|
|
|
which # which
|
|
|
|
]}"
|
|
|
|
patchRcPathCsh "$out/bin/thisroot.csh" "${lib.makeBinPath [
|
|
|
|
coreutils
|
|
|
|
gnugrep
|
|
|
|
gnused
|
|
|
|
lsof # lsof # for ROOT (>=6.28)
|
|
|
|
man
|
|
|
|
which
|
|
|
|
]}"
|
|
|
|
patchRcPathFish "$out/bin/thisroot.fish" "${lib.makeBinPath [
|
|
|
|
coreutils
|
|
|
|
man
|
|
|
|
which
|
|
|
|
]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://root.cern.ch/";
|
|
|
|
description = "A data analysis framework";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.veprbl ];
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
};
|
|
|
|
}
|