nixpkgs/pkgs/applications/science/misc/root/5.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

157 lines
4.1 KiB
Nix
Raw Normal View History

2021-07-14 20:23:09 +00:00
{ lib
, stdenv
, fetchurl
, fetchpatch
, cmake
, pcre
, pkg-config
2023-01-05 09:56:07 +00:00
, python3
2021-07-14 20:23:09 +00:00
, libX11
, libXpm
, libXft
, libXext
, libGLU
, libGL
, zlib
, libxml2
2022-09-30 01:42:56 +00:00
, libxcrypt
2021-07-14 20:23:09 +00:00
, lz4
, xz
2022-11-10 23:59:19 +00:00
, gsl
2021-07-14 20:23:09 +00:00
, xxHash
, Cocoa
, OpenGL
, noSplash ? false
}:
2018-09-24 18:27:20 +00:00
stdenv.mkDerivation rec {
pname = "root";
version = "5.34.38";
2018-09-24 18:27:20 +00:00
src = fetchurl {
url = "https://root.cern.ch/download/root_v${version}.source.tar.gz";
sha256 = "1ln448lszw4d6jmbdphkr2plwxxlhmjkla48vmmq750xc1lxlfrc";
2018-09-24 18:27:20 +00:00
};
nativeBuildInputs = [ cmake pkg-config ];
2023-01-05 09:56:07 +00:00
buildInputs = [ pcre python3 zlib libxml2 lz4 xz gsl xxHash libxcrypt ]
2021-01-15 13:21:58 +00:00
++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
++ lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ]
2021-07-14 20:23:09 +00:00
;
2018-09-24 18:27:20 +00:00
patches = [
./sw_vers_root5.patch
2018-12-15 17:55:38 +00:00
# prevents rootcint from looking in /usr/includes and such
./purify_include_paths_root5.patch
# disable dictionary generation for stuff that includes libc headers
# our glibc requires a modern compiler
./disable_libc_dicts_root5.patch
2021-09-01 11:14:56 +00:00
(fetchpatch {
name = "root5-gcc9-fix.patch";
url = "https://github.com/root-project/root/commit/348f30a6a3b5905ef734a7bd318bc0ee8bca6dc9.diff";
sha256 = "0dvrsrkpacyn5z87374swpy7aciv9a8s6m61b4iqd7a956r67rn3";
})
(fetchpatch {
name = "root5-gcc10-fix.patch";
url = "https://github.com/root-project/root/commit/3c243b18768d3c3501faf3ca4e4acfc071021350.diff";
sha256 = "1hjmgnp4zx6im8ps78673x0rrhmfyy1nffhgxjlfl1r2z8cq210z";
})
2023-01-05 09:56:07 +00:00
(fetchpatch {
name = "root5-python37-fix.patch";
url = "https://github.com/root-project/root/commit/c75458024082de0cc35b45505c652b8460a9e71b.patch";
sha256 = "sha256-A5zEjQE9OGPFp/L1HUs4NIdxQMRiwbwCRNWOLN2ENrM=";
})
2018-09-24 18:27:20 +00:00
];
preConfigure = ''
# binutils 2.37 fixes
fixupList=(
cint/demo/gl/make0
cint/demo/exception/Makefile
cint/demo/makecint/KRcc/Makefile
cint/demo/makecint/Stub2/Make2
cint/demo/makecint/Array/Makefile
cint/demo/makecint/DArray/Makefile
cint/demo/makecint/ReadFile/Makefile
cint/demo/makecint/stl/Makefile
cint/demo/makecint/Stub2/Make1
cint/cint/include/makemat
cint/cint/lib/WildCard/Makefile
cint/cint/include/make.arc
cint/cint/lib/qt/Makefile
cint/cint/lib/pthread/Makefile
graf2d/asimage/src/libAfterImage/Makefile.in
)
for toFix in "''${fixupList[@]}"; do
substituteInPlace "$toFix" --replace "clq" "cq"
done
2018-09-24 18:27:20 +00:00
patchShebangs build/unix/
2021-01-15 13:21:58 +00:00
ln -s ${lib.getDev stdenv.cc.libc}/include/AvailabilityMacros.h cint/cint/include/
2022-04-16 21:20:16 +00:00
# __malloc_hook is deprecated
substituteInPlace misc/memstat/src/TMemStatHook.cxx \
--replace "defined(R__GNU) && (defined(R__LINUX) || defined(__APPLE__))" \
"defined(R__GNU) && (defined(__APPLE__))"
2018-12-15 17:55:38 +00:00
''
# Fix CINTSYSDIR for "build" version of rootcint
# This is probably a bug that breaks out-of-source builds
+ ''
substituteInPlace cint/cint/src/loadfile.cxx\
--replace 'env = "cint";' 'env = "'`pwd`'/cint";'
2021-01-15 13:21:58 +00:00
'' + lib.optionalString noSplash ''
2018-09-24 18:27:20 +00:00
substituteInPlace rootx/src/rootx.cxx --replace "gNoLogo = false" "gNoLogo = true"
'';
cmakeFlags = [
"-Drpath=ON"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
2022-05-16 15:53:27 +00:00
"-DCMAKE_CXX_FLAGS=-std=c++11"
2018-09-24 18:27:20 +00:00
"-Dalien=OFF"
"-Dbonjour=OFF"
"-Dcastor=OFF"
"-Dchirp=OFF"
"-Ddavix=OFF"
"-Ddcache=OFF"
"-Dfftw3=OFF"
"-Dfitsio=OFF"
"-Dfortran=OFF"
"-Dgfal=OFF"
"-Dgsl_shared=ON"
"-Dgviz=OFF"
"-Dhdfs=OFF"
"-Dkrb5=OFF"
"-Dldap=OFF"
"-Dmathmore=ON"
"-Dmonalisa=OFF"
"-Dmysql=OFF"
"-Dodbc=OFF"
"-Dopengl=ON"
"-Doracle=OFF"
"-Dpgsql=OFF"
"-Dpythia6=OFF"
"-Dpythia8=OFF"
"-Drfio=OFF"
"-Dsqlite=OFF"
"-Dssl=OFF"
"-Dxml=ON"
"-Dxrootd=OFF"
]
2021-01-15 13:21:58 +00:00
++ lib.optional stdenv.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks";
2018-09-24 18:27:20 +00:00
setupHook = ./setup-hook.sh;
meta = with lib; {
homepage = "https://root.cern.ch/";
2018-09-24 18:27:20 +00:00
description = "A data analysis framework";
platforms = platforms.unix;
2022-11-10 23:59:19 +00:00
broken = !stdenv.isx86_64;
2018-09-24 18:27:20 +00:00
maintainers = with maintainers; [ veprbl ];
2020-06-26 22:43:21 +00:00
license = licenses.lgpl21;
2018-09-24 18:27:20 +00:00
};
}