Skip to content

Commit

Permalink
root: use pure CoreSymbolication on Darwin
Browse files Browse the repository at this point in the history
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 #128576

(cherry picked from commit 55dcd99)
  • Loading branch information
thefloweringash authored and Jonathan Ringer committed Jul 1, 2021
1 parent 3866043 commit f77d176
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions pkgs/applications/science/misc/root/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, libX11, libXpm, libXft, libXext, libGLU, libGL, libxml2, lz4, xz, pcre
, 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";
Expand All @@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper cmake pkg-config llvm_5.dev ];
buildInputs = [ ftgl gl2ps glew pcre zlib zstd llvm_5 libxml2 lz4 xz gsl xxHash libAfterImage giflib libjpeg libtiff libpng 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 = [
Expand All @@ -31,6 +31,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 = [
Expand Down
2 changes: 1 addition & 1 deletion pkgs/os-specific/darwin/apple-sdk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29947,7 +29947,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 {
Expand Down

0 comments on commit f77d176

Please sign in to comment.