about summary refs log tree commit diff
path: root/pkgs/applications/networking/remote
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2022-10-15 18:32:57 +0200
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2022-10-15 18:32:57 +0200
commit49bcb8429f41a2d86ad7a9e58cee4f6d21fce63c (patch)
treecb68dfa3964b9594cad42b17c27564ddf8df66af /pkgs/applications/networking/remote
parentb286501a5eadad160362299c15941a642c427317 (diff)
freerdp: fix build on darwin
Diffstat (limited to 'pkgs/applications/networking/remote')
-rw-r--r--pkgs/applications/networking/remote/freerdp/default.nix33
1 files changed, 30 insertions, 3 deletions
diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix
index 89e952945c87f..073da8d2c882a 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
@@ -64,6 +69,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 +90,6 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [
-    alsa-lib
     cairo
     cups
     ffmpeg
@@ -111,9 +118,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 +148,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 = ''