Closed cmacrae closed 3 years ago
It looks like there's a bug in the private frameworks. The symlinks are missing, and this prevents the linker from seeing them. Here's what I think it should be
diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix
index 8a814e9558d..4df8e6226fb 100644
--- a/pkgs/os-specific/darwin/apple-sdk/default.nix
+++ b/pkgs/os-specific/darwin/apple-sdk/default.nix
@@ -192,6 +192,20 @@ let
mkdir -p $out/Library/Frameworks/
cp -r ${darwin-stubs}/System/Library/${lib.optionalString private "Private"}Frameworks/${name}.framework \
$out/Library/Frameworks
+
+ cd $out/Library/Frameworks/${name}.framework
+
+ versions=(./Versions/*)
+ if [ "''${#versions[@]}" != 1 ]; then
+ echo "Unable to determine current version of framework ${name}"
+ exit 1
+ fi
+ current=$(basename ''${versions[0]})
+
+ chmod u+w -R .
+ ln -s "$current" Versions/Current
+ ln -s Versions/Current/* .
+
# NOTE there's no re-export checking here, this is probably wrong
'';
};
@@ -300,7 +314,7 @@ in rec {
"Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy.tbd"
];
});
- } // lib.genAttrs [ "ContactsPersistence" "UIFoundation" "GameCenter" ] (x: tbdOnlyFramework x {});
+ } // lib.genAttrs [ "ContactsPersistence" "UIFoundation" "GameCenter" "SkyLight" ] (x: tbdOnlyFramework x {});
bareFrameworks = lib.mapAttrs framework (import ./frameworks.nix {
inherit frameworks libs;
diff --git a/pkgs/os-specific/darwin/yabai/default.nix b/pkgs/os-specific/darwin/yabai/default.nix
index b371e97d06f..9abc8d8b87b 100644
--- a/pkgs/os-specific/darwin/yabai/default.nix
+++ b/pkgs/os-specific/darwin/yabai/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, Carbon, Cocoa, ScriptingBridge, xxd }:
+{ lib, stdenv, fetchFromGitHub, Carbon, Cocoa, SkyLight, ScriptingBridge, xxd }:
stdenv.mkDerivation rec {
pname = "yabai";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "1pvyjdxgy7yxxz4x87f8an0dlxvxbnmv5kya8hkzw2na453ihvab";
};
- buildInputs = [ Carbon Cocoa ScriptingBridge xxd ];
+ buildInputs = [ Carbon Cocoa ScriptingBridge SkyLight xxd ];
installPhase = ''
mkdir -p $out/bin
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index bd86fed4cb2..2342d91bcd1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -29353,7 +29353,7 @@ in
yabai = callPackage ../os-specific/darwin/yabai {
inherit (darwin.apple_sdk.frameworks)
- Carbon Cocoa ScriptingBridge;
+ Carbon Cocoa ScriptingBridge SkyLight;
};
yabause = libsForQt5.callPackage ../misc/emulators/yabause {
Unfortunately this isn't enough to link, since it seems to require symbols that are newer than macOS 10.12:
clang src/manifest.m src/osax/sa_loader.c src/osax/sa_payload.c src/osax/sa_mach_bootstrap.c -std=c99 -Wall -g -O0 -fvisibility=hidden -mmacosx-version-min=10.13 -F/System/Library/PrivateFrameworks -framework Carbon -framework Cocoa -framework CoreServices -framework SkyLight -framework ScriptingBridge -o bin/yabai
Undefined symbols for architecture x86_64:
"_SLSWindowIteratorAdvance", referenced from:
_window_tags in manifest-064ed7.o
_window_manager_set_window_layer in manifest-064ed7.o
"_SLSWindowIteratorGetParentID", referenced from:
_window_manager_set_window_layer in manifest-064ed7.o
"_SLSWindowIteratorGetTags", referenced from:
_window_tags in manifest-064ed7.o
"_SLSWindowIteratorGetWindowID", referenced from:
_window_manager_set_window_layer in manifest-064ed7.o
"_SLSWindowQueryResultCopyWindows", referenced from:
_window_tags in manifest-064ed7.o
_window_manager_set_window_layer in manifest-064ed7.o
"_SLSWindowQueryWindows", referenced from:
_window_tags in manifest-064ed7.o
_window_manager_set_window_layer in manifest-064ed7.o
ld: symbol(s) not found for architecture x86_64
Ah, sorry, I should've closed this back when you replied!
Thank you very much for the thorough response - much appreciated. I also see you've approved my associated nixpkgs PR, so thanks for that too! š
Hey @thefloweringash @LnL7 š
I'm trying to update a package I maintain in nixpkgs that depends on a private framework; namely 'SkyLight'.
As far as I understand it, all private frameworks should be exposed in nixpkgs via darwin-stubs, however I get the following issue when trying to build:
Here's the diff of what I'm trying to do to expose this framework.
Is this the right approach? What am I missing here?
Thanks in advance for any help on this.