synergy: fix x86_64-darwin build

* qt5 uses apple_sdk_11, so being a qt app, synergy must do the same
* remove the optionality of UserNotification framework
* filter out network tests, which do not run in sandbox
* consider the withGUI flag during install phase on darwin
This commit is contained in:
Michael Roitzsch 2024-01-24 12:52:48 +01:00
parent faa94b7afc
commit 1ac1e38a17
3 changed files with 9 additions and 24 deletions

View File

@ -1,15 +0,0 @@
diff --git a/src/gui/src/OSXHelpers.mm b/src/gui/src/OSXHelpers.mm
index 0c98afc1..38c190a6 100644
--- a/src/gui/src/OSXHelpers.mm
+++ b/src/gui/src/OSXHelpers.mm
@@ -20,10 +20,6 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import <Cocoa/Cocoa.h>
-#import <UserNotifications/UNNotification.h>
-#import <UserNotifications/UNUserNotificationCenter.h>
-#import <UserNotifications/UNNotificationContent.h>
-#import <UserNotifications/UNNotificationTrigger.h>
#import <QtGlobal>

View File

@ -27,12 +27,12 @@
, avahi-compat
# MacOS / darwin
, darwin
, ApplicationServices
, Carbon
, Cocoa
, CoreServices
, ScreenSaver
, UserNotifications
}:
stdenv.mkDerivation rec {
@ -50,10 +50,6 @@ stdenv.mkDerivation rec {
patches = [
# Without this OpenSSL from nixpkgs is not detected
./darwin-non-static-openssl.patch
] ++ lib.optionals (stdenv.isDarwin && !(darwin.apple_sdk.frameworks ? UserNotifications)) [
# We cannot include UserNotifications because of a build failure in the Apple SDK.
# The functions used from it are already implicitly included anyways.
./darwin-no-UserNotifications-includes.patch
];
postPatch = ''
@ -79,8 +75,7 @@ stdenv.mkDerivation rec {
Cocoa
CoreServices
ScreenSaver
] ++ lib.optionals (stdenv.isDarwin && darwin.apple_sdk.frameworks ? UserNotifications) [
darwin.apple_sdk.frameworks.UserNotifications
UserNotifications
] ++ lib.optionals stdenv.isLinux [
util-linux
libselinux
@ -110,6 +105,10 @@ stdenv.mkDerivation rec {
checkPhase = ''
runHook preCheck
'' + lib.optionalString stdenv.isDarwin ''
# filter out tests failing with sandboxing on darwin
export GTEST_FILTER=-ServerConfigTests.serverconfig_will_deem_equal_configs_with_same_cell_names:NetworkAddress.hostname_valid_parsing
'' + ''
bin/unittests
runHook postCheck
'';
@ -126,7 +125,7 @@ stdenv.mkDerivation rec {
cp ../res/synergy.svg $out/share/icons/hicolor/scalable/apps/
substitute ../res/synergy.desktop $out/share/applications/synergy.desktop \
--replace "/usr/bin" "$out/bin"
'' + lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString (stdenv.isDarwin && withGUI) ''
mkdir -p $out/Applications
cp -r bundle/Synergy.app $out/Applications
ln -s $out/bin $out/Applications/Synergy.app/Contents/MacOS

View File

@ -35572,7 +35572,8 @@ with pkgs;
};
synergy = libsForQt5.callPackage ../applications/misc/synergy {
inherit (darwin.apple_sdk.frameworks) ApplicationServices Carbon Cocoa CoreServices ScreenSaver;
stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
inherit (darwin.apple_sdk_11_0.frameworks) ApplicationServices Carbon Cocoa CoreServices ScreenSaver UserNotifications;
};
synergyWithoutGUI = synergy.override { withGUI = false; };