2021-06-28 23:13:55 +00:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper, cmake, git, ftgl, gl2ps, glew, gsl
|
|
|
|
, libX11, libXpm, libXft, libXext, libGLU, libGL, libxml2, lz4, xz, pcre, nlohmann_json
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config, python, xxHash, zlib, zstd
|
2021-01-05 17:05:55 +00:00
|
|
|
, libAfterImage, giflib, libjpeg, libtiff, libpng
|
2021-07-03 03:11:41 +00:00
|
|
|
, Cocoa, CoreSymbolication, OpenGL, noSplash ? false }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "root";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "6.24.00";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://root.cern.ch/download/root_v${version}.source.tar.gz";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "12crjzd7pzx5qpk2pb3z0rhmxlw5gsqaqzfl48qiq8c9l940b8wx";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper cmake pkg-config git ];
|
|
|
|
buildInputs = [ ftgl gl2ps glew pcre zlib zstd libxml2 lz4 xz gsl xxHash libAfterImage giflib libjpeg libtiff libpng nlohmann_json python.pkgs.numpy ]
|
2020-08-20 17:08:02 +00:00
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
|
2021-07-03 03:11:41 +00:00
|
|
|
++ 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 '
|
|
|
|
|
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 \
|
|
|
|
-e 'iset(nlohmann_json_DIR "${nlohmann_json}/lib/cmake/nlohmann_json/")'
|
|
|
|
|
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" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-Drpath=ON"
|
2021-06-28 23:13:55 +00:00
|
|
|
"-DCMAKE_CXX_STANDARD=17"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
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"
|
|
|
|
"-Ddavix=OFF"
|
|
|
|
"-Ddcache=OFF"
|
|
|
|
"-Dfail-on-missing=ON"
|
|
|
|
"-Dfftw3=OFF"
|
|
|
|
"-Dfitsio=OFF"
|
|
|
|
"-Dfortran=OFF"
|
|
|
|
"-Dimt=OFF"
|
|
|
|
"-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"
|
|
|
|
"-Dssl=OFF"
|
|
|
|
"-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
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do
|
|
|
|
wrapProgram "$out/bin/$prog" \
|
|
|
|
--prefix PYTHONPATH : "$out/lib"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|