diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index 385500459de..0eb846a73a3 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -6,11 +6,11 @@ stdenv.mkDerivation rec { pname = "root"; - version = "6.20.08"; + version = "6.22.06"; src = fetchurl { url = "https://root.cern.ch/download/root_v${version}.source.tar.gz"; - sha256 = "1s9sqapw2f31m3gcm8nyg7dl8g9mgj92ny28jsli9j08955j4byh"; + sha256 = "0mqvj42nax0bmz8h83jjlwjm3xxjy1n0n10inc8csip9ly28fs64"; }; nativeBuildInputs = [ makeWrapper cmake pkgconfig ]; @@ -70,7 +70,14 @@ stdenv.mkDerivation rec { "-Dxrootd=OFF" ] ++ stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.lib.getDev stdenv.cc.libc}/include" - ++ stdenv.lib.optional stdenv.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"; + ++ stdenv.lib.optionals stdenv.isDarwin [ + "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" + "-DCMAKE_DISABLE_FIND_PACKAGE_Python2=TRUE" + + # fatal error: module map file '/nix/store/-Libsystem-osx-10.12.6/include/module.modulemap' not found + # fatal error: could not build module '_Builtin_intrinsics' + "-Druntime_cxxmodules=OFF" + ]; enableParallelBuilding = true; diff --git a/pkgs/applications/science/misc/root/sw_vers.patch b/pkgs/applications/science/misc/root/sw_vers.patch index 339ac2f5bd2..b2ee1b6a4ce 100644 --- a/pkgs/applications/science/misc/root/sw_vers.patch +++ b/pkgs/applications/science/misc/root/sw_vers.patch @@ -1,19 +1,7 @@ -diff a/build/unix/compiledata.sh b/build/unix/compiledata.sh ---- a/build/unix/compiledata.sh -+++ b/build/unix/compiledata.sh -@@ -41,7 +41,7 @@ EXPLLINKLIBS="\$LinkedLibs" - - if [ "$ARCH" = "macosx" ] || [ "$ARCH" = "macosx64" ] || \ - [ "$ARCH" = "macosxicc" ]; then -- macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2` -+ macosx_minor=12 - SOEXT="so" - if [ $macosx_minor -ge 5 ]; then - if [ "x`echo $SOFLAGS | grep -- '-install_name'`" != "x" ]; then diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake --- a/cmake/modules/SetUpMacOS.cmake +++ b/cmake/modules/SetUpMacOS.cmake -@@ -8,17 +8,8 @@ set(ROOT_ARCHITECTURE macosx) +@@ -8,17 +8,10 @@ set(ROOT_ARCHITECTURE macosx) set(ROOT_PLATFORM macosx) if (CMAKE_SYSTEM_NAME MATCHES Darwin) @@ -21,8 +9,8 @@ diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake - COMMAND cut -d . -f 1-2 - OUTPUT_VARIABLE MACOSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - -- MESSAGE(STATUS "Found a Mac OS X System ${MACOSX_VERSION}") -- + MESSAGE(STATUS "Found a macOS system ${MACOSX_VERSION}") + - if(MACOSX_VERSION VERSION_GREATER 10.7 AND ${CMAKE_CXX_COMPILER_ID} MATCHES Clang) set(libcxx ON CACHE BOOL "Build using libc++" FORCE) - endif() @@ -31,7 +19,7 @@ diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake #TODO: check haveconfig and rpath -> set rpath true #TODO: check Thread, define link command #TODO: more stuff check configure script -@@ -31,23 +22,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) +@@ -37,23 +30,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m64") @@ -56,7 +44,7 @@ diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake if (CMAKE_COMPILER_IS_GNUCXX) message(STATUS "Found GNU compiler collection") -@@ -98,7 +73,6 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) +@@ -115,7 +92,6 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) endif() #---Set Linker flags---------------------------------------------------------------------- @@ -67,24 +55,24 @@ diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake diff a/config/root-config.in b/config/root-config.in --- a/config/root-config.in +++ b/config/root-config.in -@@ -305,12 +305,6 @@ macosxicc) - auxlibs="-lm -ldl" +@@ -312,12 +312,6 @@ macosxicc) ;; - macosx64) -- # MacOS X with gcc (GNU cc v4.x) in 64 bit mode + macosx64|macosxarm64) + # MacOS X with gcc (GNU cc v4.x) in 64 bit mode +- macosx_major=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1 | sed -e 's/^[[:space:]]*//'` - macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2` - # cannot find the one linked to libGraf if relocated after built -- if [ $macosx_minor -le 4 ]; then +- if [ $macosx_major -eq 10 -a $macosx_minor -le 4 ]; then - rootlibs="$rootlibs -lfreetype" - fi auxcflags="${cxxversionflag} -m64" auxldflags="-m64" auxlibs="-lm -ldl" -@@ -371,18 +365,11 @@ freebsd* | openbsd* | linux*) +@@ -378,18 +372,11 @@ freebsd* | openbsd* | linux*) done ;; macosx*) -- if [ $macosx_minor -ge 5 ]; then +- if [ \( $macosx_major -eq 10 -a $macosx_minor -ge 5 \) -o $macosx_major -gt 10 ]; then auxcflags="-pthread $auxcflags" auxlibs="-lpthread $auxlibs" - else @@ -93,7 +81,7 @@ diff a/config/root-config.in b/config/root-config.in - fi for f in $features ; do if test "x$f" = "xrpath" ; then -- if [ $macosx_minor -ge 5 ]; then +- if [ \( $macosx_major -eq 10 -a $macosx_minor -ge 5 \) -o $macosx_major -gt 10 ]; then auxlibs="-Wl,-rpath,$libdir $auxlibs" - fi fi