1{ lib, stdenv
2, fetchurl
3, meson
4, ninja
5, pkg-config
6, pixman
7, alsa-lib
8, openssl
9, libXrandr
10, libXfixes
11, libXext
12, libXrender
13, libXinerama
14, libjpeg
15, zlib
16, spice-protocol
17, python3
18, glib
19, cyrus_sasl
20, libcacard
21, lz4
22, libopus
23, gst_all_1
24, orc
25, gdk-pixbuf
26}:
27
28let
29 # This file was mistakenly not included with the 0.15.0 release tarball.
30 # Should be fixed with the next release.
31 # https://gitlab.freedesktop.org/spice/spice/-/issues/56
32 doxygen_sh = fetchurl {
33 url = "https://gitlab.freedesktop.org/spice/spice/-/raw/v0.15.0/doxygen.sh";
34 sha256 = "0g4bx91qclihp1jfhdhyj7wp4hf4289794xxbw32kk58lnd7bzkg";
35 };
36in
37
38stdenv.mkDerivation rec {
39 pname = "spice";
40 version = "0.15.0";
41
42 src = fetchurl {
43 url = "https://www.spice-space.org/download/releases/spice-server/${pname}-${version}.tar.bz2";
44 sha256 = "1xd0xffw0g5vvwbq4ksmm3jjfq45f9dw20xpmi82g1fj9f7wy85k";
45 };
46
47 patches = [
48 ./remove-rt-on-darwin.patch
49 ];
50 postPatch = ''
51 install ${doxygen_sh} doxygen.sh
52 patchShebangs build-aux
53
54 # https://gitlab.freedesktop.org/spice/spice-common/-/issues/5
55 substituteInPlace subprojects/spice-common/meson.build \
56 --replace \
57 "cmd = run_command(python, '-m', module)" \
58 "cmd = run_command(python, '-c', 'import @0@'.format(module))"
59 '';
60
61 nativeBuildInputs = [
62 glib
63 meson
64 ninja
65 pkg-config
66 python3
67 python3.pkgs.six
68 python3.pkgs.pyparsing
69 ];
70
71 buildInputs = [
72 cyrus_sasl
73 glib
74 gst_all_1.gst-plugins-base
75 libXext
76 libXfixes
77 libXinerama
78 libXrandr
79 libXrender
80 libcacard
81 libjpeg
82 libopus
83 lz4
84 openssl
85 orc
86 pixman
87 python3.pkgs.pyparsing
88 spice-protocol
89 zlib
90 ] ++ lib.optionals stdenv.isLinux [
91 alsa-lib
92 ] ++ lib.optionals stdenv.isDarwin [
93 gdk-pixbuf
94 ];
95
96 NIX_CFLAGS_COMPILE = "-fno-stack-protector";
97
98 mesonFlags = [
99 "-Dgstreamer=1.0"
100 ];
101
102 postInstall = ''
103 ln -s spice-server $out/include/spice
104 '';
105
106 meta = with lib; {
107 description = "Complete open source solution for interaction with virtualized desktop devices";
108 longDescription = ''
109 The Spice project aims to provide a complete open source solution for interaction
110 with virtualized desktop devices.The Spice project deals with both the virtualized
111 devices and the front-end. Interaction between front-end and back-end is done using
112 VD-Interfaces. The VD-Interfaces (VDI) enable both ends of the solution to be easily
113 utilized by a third-party component.
114 '';
115 homepage = "https://www.spice-space.org/";
116 license = licenses.lgpl21;
117
118 maintainers = with maintainers; [ bluescreen303 atemu ];
119 platforms = with platforms; linux ++ darwin;
120 };
121}