From 55dcd998597257714c4a5362c14845a9363dde66 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Tue, 29 Jun 2021 10:52:55 +0900 Subject: [PATCH] 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 --- pkgs/applications/science/misc/root/default.nix | 8 ++++++-- pkgs/os-specific/darwin/apple-sdk/default.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index b3d0e96a5648..a97be6ec76fd 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -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 = [ diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 1b60abf562b8..56b77fbf2148 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -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; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5afb6fa3f613..80f7df1a29ea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 {