From 49bcb8429f41a2d86ad7a9e58cee4f6d21fce63c Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sat, 15 Oct 2022 18:32:57 +0200 Subject: [PATCH 1/3] freerdp: fix build on darwin --- .../networking/remote/freerdp/default.nix | 33 +++++++++++++++++-- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix index 89e952945c87..073da8d2c882 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 = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3c8775a8e0da..26159bd3648f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28418,6 +28418,7 @@ with pkgs; xrdp = callPackage ../applications/networking/remote/xrdp { }; freerdp = callPackage ../applications/networking/remote/freerdp { + inherit (darwin.apple_sdk.frameworks) AudioToolbox AVFoundation Carbon Cocoa CoreMedia; inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good; }; From 45d64841040bf1bebead657a1477a54ac3e36ac9 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sat, 15 Oct 2022 18:33:14 +0200 Subject: [PATCH 2/3] gtk-frdp: fix build on darwin --- pkgs/development/libraries/gtk-frdp/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/gtk-frdp/default.nix b/pkgs/development/libraries/gtk-frdp/default.nix index 4498930bd838..a76805d8d1fb 100644 --- a/pkgs/development/libraries/gtk-frdp/default.nix +++ b/pkgs/development/libraries/gtk-frdp/default.nix @@ -44,6 +44,11 @@ stdenv.mkDerivation rec { }; }; + NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [ + "-DTARGET_OS_IPHONE=0" + "-DTARGET_OS_WATCH=0" + ]; + meta = with lib; { homepage = "https://gitlab.gnome.org/GNOME/gtk-frdp"; description = "RDP viewer widget for GTK"; From 0fd19392781b0bb951effc46b610f75f17bba925 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 16 Oct 2022 14:58:19 +0200 Subject: [PATCH 3/3] freerdp: fix tests on hydra --- pkgs/applications/networking/remote/freerdp/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix index 073da8d2c882..ea09e1a942f1 100644 --- a/pkgs/applications/networking/remote/freerdp/default.nix +++ b/pkgs/applications/networking/remote/freerdp/default.nix @@ -52,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