root: use pure CoreSymbolication on Darwin

The current build works by linking against CoreSymbolication in
/System/Library/PrivateFrameworks. This is impure and doesn't work in
newer versions of macOS.

See https://github.com/NixOS/nixpkgs/issues/128576
This commit is contained in:
Andrew Childs 2021-06-29 10:52:55 +09:00
parent 16fbc036ef
commit 55dcd99859
3 changed files with 8 additions and 4 deletions

View File

@ -2,7 +2,7 @@
, libX11, libXpm, libXft, libXext, libGLU, libGL, libxml2, lz4, xz, pcre, nlohmann_json
, pkg-config, python, xxHash, zlib, zstd
, libAfterImage, giflib, libjpeg, libtiff, libpng
, Cocoa, OpenGL, noSplash ? false }:
, Cocoa, CoreSymbolication, OpenGL, noSplash ? false }:
stdenv.mkDerivation rec {
pname = "root";
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
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 ]
++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
++ lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ]
++ lib.optionals (stdenv.isDarwin) [ Cocoa CoreSymbolication OpenGL ]
;
patches = [
@ -38,6 +38,10 @@ stdenv.mkDerivation rec {
patchShebangs build/unix/
'' + lib.optionalString noSplash ''
substituteInPlace rootx/src/rootx.cxx --replace "gNoLogo = false" "gNoLogo = true"
'' + lib.optionalString stdenv.isDarwin ''
# Eliminate impure reference to /System/Library/PrivateFrameworks
substituteInPlace core/CMakeLists.txt \
--replace "-F/System/Library/PrivateFrameworks" ""
'';
cmakeFlags = [

View File

@ -326,7 +326,7 @@ in rec {
"Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy.tbd"
];
});
} // lib.genAttrs [ "ContactsPersistence" "GameCenter" "SkyLight" "UIFoundation" ] (x: tbdOnlyFramework x {});
} // lib.genAttrs [ "ContactsPersistence" "CoreSymbolication" "GameCenter" "SkyLight" "UIFoundation" ] (x: tbdOnlyFramework x {});
bareFrameworks = lib.mapAttrs framework (import ./frameworks.nix {
inherit frameworks libs;

View File

@ -30401,7 +30401,7 @@ in
root = callPackage ../applications/science/misc/root {
python = python3;
inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL;
inherit (darwin.apple_sdk.frameworks) Cocoa CoreSymbolication OpenGL;
};
root5 = lowPrio (callPackage ../applications/science/misc/root/5.nix {