about summary refs log tree commit diff
path: root/pkgs/applications/networking/remote
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2022-10-17 10:02:46 +0200
committerGitHub <noreply@github.com>2022-10-17 10:02:46 +0200
commiteaba04def711c69b5211d094bb5d673423121ae0 (patch)
tree8dc8a2e7148dd9b10cddd893f87306caaa5e7f26 /pkgs/applications/networking/remote
parent50add64e1d90ad9bda1ebcf11dd45ea3993a1e32 (diff)
parent0fd19392781b0bb951effc46b610f75f17bba925 (diff)
Merge pull request #196162 from wegank/freerdp-darwin
freerdp: fix build on darwin
Diffstat (limited to 'pkgs/applications/networking/remote')
-rw-r--r--pkgs/applications/networking/remote/freerdp/default.nix38
1 files changed, 35 insertions, 3 deletions
diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix
index 89e952945c87f..ea09e1a942f13 100644
--- a/pkgs/applications/networking/remote/freerdp/default.nix
+++ b/pkgs/applications/networking/remote/freerdp/default.nix
@@ -37,6 +37,11 @@
 , libjpeg_turbo
 , buildServer ? true
 , nocaps ? false
+, AudioToolbox
+, AVFoundation
+, Carbon
+, Cocoa
+, CoreMedia
 }:
 
 let
@@ -47,6 +52,11 @@ let
       dir = "libfreerdp/crypto/test";
       file = "Test_x509_cert_info.c";
     }
+  ] ++ lib.optionals stdenv.isDarwin [
+    {
+      dir = "winpr/libwinpr/sysinfo/test";
+      file = "TestGetComputerName.c";
+    }
   ];
 
 in
@@ -64,6 +74,9 @@ stdenv.mkDerivation rec {
   postPatch = ''
     export HOME=$TMP
 
+    # skip NIB file generation on darwin
+    sed -z 's/NIB file generation.*//' -i client/Mac{,/cli}/CMakeLists.txt
+
     # failing test(s)
     ${lib.concatMapStringsSep "\n" (e: ''
       substituteInPlace ${e.dir}/CMakeLists.txt \
@@ -82,7 +95,6 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [
-    alsa-lib
     cairo
     cups
     ffmpeg
@@ -111,9 +123,18 @@ stdenv.mkDerivation rec {
     orc
     pcre
     pcsclite
-    wayland
     zlib
-  ] ++ lib.optional stdenv.isLinux systemd;
+  ] ++ lib.optionals stdenv.isLinux [
+    alsa-lib
+    systemd
+    wayland
+  ] ++ lib.optionals stdenv.isDarwin [
+    AudioToolbox
+    AVFoundation
+    Carbon
+    Cocoa
+    CoreMedia
+  ];
 
   nativeBuildInputs = [ cmake pkg-config ];
 
@@ -132,8 +153,19 @@ stdenv.mkDerivation rec {
     WITH_VAAPI = true;
     WITH_JPEG = (libjpeg_turbo != null);
     WITH_CAIRO = (cairo != null);
+    WITH_X11 = true;
   };
 
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [
+    "-DTARGET_OS_IPHONE=0"
+    "-DTARGET_OS_WATCH=0"
+    "-include AudioToolbox/AudioToolbox.h"
+  ];
+
+  NIX_LDFLAGS = lib.optionals stdenv.isDarwin [
+    "-framework AudioToolbox"
+  ];
+
   meta = with lib; {
     description = "A Remote Desktop Protocol Client";
     longDescription = ''