about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/spice
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/spice')
-rw-r--r--nixpkgs/pkgs/development/libraries/spice/default.nix108
-rw-r--r--nixpkgs/pkgs/development/libraries/spice/remove-rt-on-darwin.patch18
2 files changed, 126 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/spice/default.nix b/nixpkgs/pkgs/development/libraries/spice/default.nix
new file mode 100644
index 000000000000..d7855cd5cea5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spice/default.nix
@@ -0,0 +1,108 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, pixman
+, alsa-lib
+, openssl
+, libXrandr
+, libXfixes
+, libXext
+, libXrender
+, libXinerama
+, libjpeg
+, zlib
+, spice-protocol
+, python3
+, glib
+, cyrus_sasl
+, libcacard
+, lz4
+, libopus
+, gst_all_1
+, orc
+, gdk-pixbuf
+}:
+
+stdenv.mkDerivation rec {
+  pname = "spice";
+  version = "0.15.2";
+
+  src = fetchurl {
+    url = "https://www.spice-space.org/download/releases/spice-server/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-bZ62EX8DkXRxxLwQAEq+z/SKefuF64WhxF8CM3cBW4E=";
+  };
+
+  patches = [
+    ./remove-rt-on-darwin.patch
+  ];
+
+  nativeBuildInputs = [
+    glib
+    meson
+    ninja
+    pkg-config
+    python3
+    python3.pkgs.six
+    python3.pkgs.pyparsing
+  ];
+
+  buildInputs = [
+    cyrus_sasl
+    glib
+    gst_all_1.gst-plugins-base
+    libXext
+    libXfixes
+    libXinerama
+    libXrandr
+    libXrender
+    libcacard
+    libjpeg
+    libopus
+    lz4
+    openssl
+    orc
+    pixman
+    python3.pkgs.pyparsing
+    spice-protocol
+    zlib
+  ] ++ lib.optionals stdenv.isLinux [
+    alsa-lib
+  ] ++ lib.optionals stdenv.isDarwin [
+    gdk-pixbuf
+  ];
+
+  env.NIX_CFLAGS_COMPILE = "-fno-stack-protector";
+
+  mesonFlags = [
+    "-Dgstreamer=1.0"
+  ];
+
+  postPatch = ''
+    patchShebangs build-aux
+
+    # Forgotten in 0.15.2 tarball
+    sed -i /meson.add_dist_script/d meson.build
+  '';
+
+  postInstall = ''
+    ln -s spice-server $out/include/spice
+  '';
+
+  meta = with lib; {
+    description = "Complete open source solution for interaction with virtualized desktop devices";
+    longDescription = ''
+      The Spice project aims to provide a complete open source solution for interaction
+      with virtualized desktop devices.The Spice project deals with both the virtualized
+      devices and the front-end. Interaction between front-end and back-end is done using
+      VD-Interfaces. The VD-Interfaces (VDI) enable both ends of the solution to be easily
+      utilized by a third-party component.
+    '';
+    homepage = "https://www.spice-space.org/";
+    license = licenses.lgpl21;
+
+    maintainers = with maintainers; [ bluescreen303 atemu ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spice/remove-rt-on-darwin.patch b/nixpkgs/pkgs/development/libraries/spice/remove-rt-on-darwin.patch
new file mode 100644
index 000000000000..b3696d736af7
--- /dev/null
+++ b/nixpkgs/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