Merge pull request #205394 from ShamrockLee/root-update

undefined
This commit is contained in:
Dmitry Kalinkin 2022-12-17 19:58:37 -05:00 committed by GitHub
commit 199975755e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 20 deletions

View File

@ -1,7 +1,7 @@
{ stdenv
, lib
, callPackage
, fetchFromGitHub
, fetchurl
, fetchpatch
, makeWrapper
, cmake
@ -48,6 +48,7 @@
, patchRcPathFish
, patchRcPathPosix
, tbb
, xrootd
, Cocoa
, CoreSymbolication
, OpenGL
@ -70,20 +71,21 @@ in
stdenv.mkDerivation rec {
pname = "root";
version = "6.26.08";
version = "6.26.10";
passthru = {
tests = import ./tests { inherit callPackage; };
};
src = fetchFromGitHub {
owner = "root-project";
repo = "root";
rev = "v${builtins.replaceStrings [ "." ] [ "-" ] version}";
sha256 = "sha256-cNd1GvEbO/a+WdDe8EHYGmdlw3TrOT2fWaSk+s7fw7U=";
src = fetchurl {
url = "https://root.cern.ch/download/root_v${version}.source.tar.gz";
hash = "sha256-jla+w5cQQBeqVPnrVU3noaE0R0/gs7sPQ6cPxPq9Yl8=";
};
nativeBuildInputs = [ makeWrapper cmake pkg-config git ];
propagatedBuildInputs = [
nlohmann_json
];
buildInputs = [
davix
ftgl
@ -107,12 +109,12 @@ stdenv.mkDerivation rec {
libjpeg
libtiff
libpng
nlohmann_json
patchRcPathCsh
patchRcPathFish
patchRcPathPosix
python.pkgs.numpy
tbb
xrootd
]
++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
++ lib.optionals (stdenv.isDarwin) [ Cocoa CoreSymbolication OpenGL ]
@ -195,7 +197,7 @@ stdenv.mkDerivation rec {
"-Dvdt=OFF"
"-Dwebgui=OFF"
"-Dxml=ON"
"-Dxrootd=OFF"
"-Dxrootd=ON"
]
++ lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include"
++ lib.optionals stdenv.isDarwin [
@ -209,19 +211,23 @@ stdenv.mkDerivation rec {
NIX_LDFLAGS = lib.optionalString (stdenv.isLinux && stdenv.isAarch64 && stdenv.cc.isGNU) "-lgcc";
# 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.
postInstall = ''
for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do
wrapProgram "$out/bin/$prog" \
--set PYTHONPATH "$out/lib" \
--set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib"
--set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib:${lib.makeLibraryPath [ xrootd ]}"
done
# 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
]}"
# 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 ]}"
# Patch thisroot.{sh,csh,fish}

View File

@ -1,4 +1,11 @@
{ lib, stdenv, fetchurl, cmake, coreutils, python, root }:
{ lib
, stdenv
, fetchurl
, cmake
, coreutils
, python
, root
}:
let
pythonVersion = with lib.versions; "${major python.version}${minor python.version}";
@ -16,9 +23,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-zQ91yA91VJxZzCqCns52Acd96Xyypat1eQysjh1YUDI=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ root_py ]
++ lib.optional withPython python;
nativeBuildInputs = [
cmake
];
buildInputs = [
root_py
]
++ lib.optional withPython python;
cmakeFlags = [
"-DHEPMC3_ENABLE_PYTHON=${if withPython then "ON" else "OFF"}"