about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
author7c6f434c <7c6f434c@mail.ru>2022-11-03 23:21:49 +0000
committerGitHub <noreply@github.com>2022-11-03 23:21:49 +0000
commitda3ec5a60b89487494d7d817e3d9933b441cc7e7 (patch)
tree545afe53c9acc98bb62c02bab4aa6bdfbdb478a8 /pkgs/development
parent0fc1caab21db79333864da56d132dc23cc5651da (diff)
parenta3b93ae5f5ab0ef3b2826e19445c27a80d7ecf78 (diff)
Merge pull request #198257 from Atemu/spice-darwin
spice: darwin support
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/spice/default.nix13
-rw-r--r--pkgs/development/libraries/spice/remove-rt-on-darwin.patch18
2 files changed, 28 insertions, 3 deletions
diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix
index 4f639cf29f74f..ed47a87ee1161 100644
--- a/pkgs/development/libraries/spice/default.nix
+++ b/pkgs/development/libraries/spice/default.nix
@@ -22,6 +22,7 @@
 , libopus
 , gst_all_1
 , orc
+, gdk-pixbuf
 }:
 
 let
@@ -43,6 +44,9 @@ stdenv.mkDerivation rec {
     sha256 = "1xd0xffw0g5vvwbq4ksmm3jjfq45f9dw20xpmi82g1fj9f7wy85k";
   };
 
+  patches = [
+    ./remove-rt-on-darwin.patch
+  ];
   postPatch = ''
     install ${doxygen_sh} doxygen.sh
     patchShebangs build-aux
@@ -65,7 +69,6 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
-    alsa-lib
     cyrus_sasl
     glib
     gst_all_1.gst-plugins-base
@@ -84,6 +87,10 @@ stdenv.mkDerivation rec {
     python3.pkgs.pyparsing
     spice-protocol
     zlib
+  ] ++ lib.optionals stdenv.isLinux [
+    alsa-lib
+  ] ++ lib.optionals stdenv.isDarwin [
+    gdk-pixbuf
   ];
 
   NIX_CFLAGS_COMPILE = "-fno-stack-protector";
@@ -108,7 +115,7 @@ stdenv.mkDerivation rec {
     homepage = "https://www.spice-space.org/";
     license = licenses.lgpl21;
 
-    maintainers = [ maintainers.bluescreen303 ];
-    platforms = platforms.linux;
+    maintainers = with maintainers; [ bluescreen303 atemu ];
+    platforms = with platforms; linux ++ darwin;
   };
 }
diff --git a/pkgs/development/libraries/spice/remove-rt-on-darwin.patch b/pkgs/development/libraries/spice/remove-rt-on-darwin.patch
new file mode 100644
index 0000000000000..b3696d736af79
--- /dev/null
+++ b/pkgs/development/libraries/spice/remove-rt-on-darwin.patch
@@ -0,0 +1,18 @@
+--- a/meson.build
++++ b/meson.build
+@@ -103,11 +103,11 @@
+   spice_server_deps += dependency(dep)
+ endforeach
+ 
+-if host_machine.system() != 'windows'
++if (host_machine.system() != 'windows' and host_machine.system() != 'darwin')
+   foreach dep : ['rt', 'm']
+     spice_server_deps += compiler.find_library(dep)
+   endforeach
+-else
++elif host_machine.system() == 'windows'
+   foreach dep : ['ws2_32', 'shlwapi']
+     spice_server_deps += compiler.find_library(dep)
+   endforeach
+
+Diff finished.  Sun Oct 16 06:09:35 2022