From 1ac1e38a17f6b8f69f0787bd7eff8c5b8b23315c Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Wed, 24 Jan 2024 12:52:48 +0100 Subject: [PATCH] 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 --- .../darwin-no-UserNotifications-includes.patch | 15 --------------- pkgs/applications/misc/synergy/default.nix | 15 +++++++-------- pkgs/top-level/all-packages.nix | 3 ++- 3 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 pkgs/applications/misc/synergy/darwin-no-UserNotifications-includes.patch diff --git a/pkgs/applications/misc/synergy/darwin-no-UserNotifications-includes.patch b/pkgs/applications/misc/synergy/darwin-no-UserNotifications-includes.patch deleted file mode 100644 index 9b37a68b9017..000000000000 --- a/pkgs/applications/misc/synergy/darwin-no-UserNotifications-includes.patch +++ /dev/null @@ -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 - #import - #import --#import --#import --#import --#import - - #import - diff --git a/pkgs/applications/misc/synergy/default.nix b/pkgs/applications/misc/synergy/default.nix index 2fe734fde00e..ef361fc6f14e 100644 --- a/pkgs/applications/misc/synergy/default.nix +++ b/pkgs/applications/misc/synergy/default.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 70421bfffb60..4cd926459db5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; };