2021-07-16 19:40:57 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2022-11-21 17:40:18 +00:00
|
|
|
, callPackage
|
2022-12-28 21:21:41 +00:00
|
|
|
, fetchurl
|
2023-11-16 04:20:00 +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
|
2023-10-09 19:29:22 +00:00
|
|
|
, gtest
|
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
|
2023-10-09 19:29:22 +00:00
|
|
|
, llvm_13
|
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
|
2022-12-28 21:21:41 +00:00
|
|
|
, xrootd
|
2021-07-16 19:40:57 +00:00
|
|
|
, Cocoa
|
|
|
|
, CoreSymbolication
|
|
|
|
, OpenGL
|
|
|
|
, noSplash ? false
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "root";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "6.28.08";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
passthru = {
|
|
|
|
tests = import ./tests { inherit callPackage; };
|
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://root.cern.ch/download/root_v${version}.source.tar.gz";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-o+ZLTAH4fNm75X5h75a0FibkmwRGCVBw1B2b+6NSaGI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper cmake pkg-config git ];
|
2022-12-28 21:21:41 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
nlohmann_json
|
|
|
|
];
|
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
|
2023-10-09 19:29:22 +00:00
|
|
|
llvm_13
|
2021-07-16 19:40:57 +00:00
|
|
|
lz4
|
|
|
|
xz
|
|
|
|
gsl
|
2023-10-09 19:29:22 +00:00
|
|
|
gtest
|
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
|
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
|
2022-12-28 21:21:41 +00:00
|
|
|
xrootd
|
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
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
rm -rf builtins/*
|
|
|
|
substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \
|
|
|
|
--replace 'set(lcgpackages ' '#set(lcgpackages '
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
substituteInPlace interpreter/llvm/src/tools/clang/tools/driver/CMakeLists.txt \
|
|
|
|
--replace 'add_clang_symlink(''${link} clang)' ""
|
|
|
|
|
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"
|
2023-03-15 16:39:30 +00:00
|
|
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
2021-09-18 10:52:07 +00:00
|
|
|
"-Dbuiltin_llvm=OFF"
|
2023-10-09 19:29:22 +00:00
|
|
|
"-Dbuiltin_freetype=OFF"
|
|
|
|
"-Dbuiltin_gtest=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"
|
2023-01-20 10:41:00 +00:00
|
|
|
"-Dgnuinstall=ON"
|
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"
|
2022-12-28 21:21:41 +00:00
|
|
|
"-Dxrootd=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
]
|
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-28 21:21:41 +00:00
|
|
|
# Workaround the xrootd runpath bug #169677 by prefixing [DY]LD_LIBRARY_PATH with ${lib.makeLibraryPath xrootd}.
|
|
|
|
# TODO: Remove the [DY]LDLIBRARY_PATH prefix for xrootd when #200830 get merged.
|
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" \
|
2022-12-28 21:21:41 +00:00
|
|
|
--set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib:${lib.makeLibraryPath [ xrootd ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
# Make ldd and sed available to the ROOT executable by prefixing PATH.
|
|
|
|
wrapProgram "$out/bin/root" \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [
|
|
|
|
gnused # sed
|
|
|
|
stdenv.cc # c++ ld etc.
|
|
|
|
stdenv.cc.libc # ldd
|
|
|
|
]}" \
|
|
|
|
--prefix ${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xrootd ]}"
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
# 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`.
|
|
|
|
|
|
|
|
patchRcPathPosix "$out/bin/thisroot.sh" "${lib.makeBinPath [
|
|
|
|
coreutils # dirname tail
|
|
|
|
gnugrep # grep
|
|
|
|
gnused # sed
|
2023-10-09 19:29:22 +00:00
|
|
|
lsof # lsof
|
2022-11-21 17:40:18 +00:00
|
|
|
man # manpath
|
2023-10-09 19:29:22 +00:00
|
|
|
procps # ps
|
2022-11-21 17:40:18 +00:00
|
|
|
which # which
|
|
|
|
]}"
|
|
|
|
patchRcPathCsh "$out/bin/thisroot.csh" "${lib.makeBinPath [
|
|
|
|
coreutils
|
|
|
|
gnugrep
|
|
|
|
gnused
|
2023-10-09 19:29:22 +00:00
|
|
|
lsof # lsof
|
2022-11-21 17:40:18 +00:00
|
|
|
man
|
|
|
|
which
|
|
|
|
]}"
|
|
|
|
patchRcPathFish "$out/bin/thisroot.fish" "${lib.makeBinPath [
|
|
|
|
coreutils
|
|
|
|
man
|
|
|
|
which
|
|
|
|
]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
# To use the debug information on the fly (without installation)
|
|
|
|
# add the outPath of root.debug into NIX_DEBUG_INFO_DIRS (in PATH-like format)
|
|
|
|
# and make sure that gdb from Nixpkgs can be found in PATH.
|
|
|
|
#
|
|
|
|
# Darwin currently fails to support it (#203380)
|
|
|
|
# we set it to true hoping to benefit from the future fix.
|
|
|
|
# Before that, please make sure if root.debug exists before using it.
|
|
|
|
separateDebugInfo = true;
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|