2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2019-05-02 02:36:32 +01:00
|
|
|
, fetchurl
|
|
|
|
, acl
|
2020-04-24 22:38:18 +01:00
|
|
|
, cyrus_sasl
|
|
|
|
, docbook_xsl
|
2021-11-11 04:35:34 +00:00
|
|
|
, libepoxy
|
2020-04-24 22:38:18 +01:00
|
|
|
, gettext
|
|
|
|
, gobject-introspection
|
2019-05-02 02:36:32 +01:00
|
|
|
, gst_all_1
|
|
|
|
, gtk-doc
|
2020-04-24 22:38:18 +01:00
|
|
|
, gtk3
|
2022-02-11 20:46:44 +00:00
|
|
|
, hwdata
|
2019-05-02 02:36:32 +01:00
|
|
|
, json-glib
|
|
|
|
, libcacard
|
2022-02-11 20:46:44 +00:00
|
|
|
, libcap_ng
|
2020-04-24 22:38:18 +01:00
|
|
|
, libdrm
|
|
|
|
, libjpeg_turbo
|
|
|
|
, libopus
|
|
|
|
, libsoup
|
|
|
|
, libusb1
|
|
|
|
, lz4
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, openssl
|
2019-05-02 02:36:32 +01:00
|
|
|
, perl
|
2020-04-24 22:38:18 +01:00
|
|
|
, phodav
|
|
|
|
, pixman
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2020-04-24 22:38:18 +01:00
|
|
|
, polkit
|
|
|
|
, python3
|
|
|
|
, spice-protocol
|
|
|
|
, usbredir
|
|
|
|
, vala
|
2022-02-11 20:46:44 +00:00
|
|
|
, wayland-protocols
|
2020-04-24 22:38:18 +01:00
|
|
|
, zlib
|
2019-05-02 02:36:32 +01:00
|
|
|
, withPolkit ? true
|
|
|
|
}:
|
2018-03-16 17:09:50 +00:00
|
|
|
|
|
|
|
# If this package is built with polkit support (withPolkit=true),
|
|
|
|
# usb redirection reqires spice-client-glib-usb-acl-helper to run setuid root.
|
|
|
|
# The helper confirms via polkit that the user has an active session,
|
|
|
|
# then adds a device acl entry for that user.
|
|
|
|
# Example NixOS config to create a setuid wrapper for the helper:
|
|
|
|
# security.wrappers.spice-client-glib-usb-acl-helper.source =
|
|
|
|
# "${pkgs.spice-gtk}/bin/spice-client-glib-usb-acl-helper";
|
|
|
|
# On non-NixOS installations, make a setuid copy of the helper
|
|
|
|
# outside the store and adjust PATH to find the setuid version.
|
|
|
|
|
|
|
|
# If this package is built without polkit support (withPolkit=false),
|
|
|
|
# usb redirection requires read-write access to usb devices.
|
|
|
|
# This can be granted by adding users to a custom group like "usb"
|
|
|
|
# and using a udev rule to put all usb devices in that group.
|
|
|
|
# Example NixOS config:
|
|
|
|
# users.groups.usb = {};
|
|
|
|
# users.users.dummy.extraGroups = [ "usb" ];
|
|
|
|
# services.udev.extraRules = ''
|
|
|
|
# KERNEL=="*", SUBSYSTEMS=="usb", MODE="0664", GROUP="usb"
|
|
|
|
# '';
|
2014-01-10 19:43:55 +00:00
|
|
|
|
2019-05-02 02:36:32 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "spice-gtk";
|
2022-02-11 20:46:44 +00:00
|
|
|
version = "0.40";
|
2014-01-10 19:43:55 +00:00
|
|
|
|
2019-05-02 02:36:32 +01:00
|
|
|
outputs = [ "out" "dev" "devdoc" "man" ];
|
2018-03-15 18:21:31 +00:00
|
|
|
|
2014-01-10 19:43:55 +00:00
|
|
|
src = fetchurl {
|
2022-02-11 20:46:44 +00:00
|
|
|
url = "https://www.spice-space.org/download/gtk/${pname}-${version}.tar.xz";
|
|
|
|
sha256 = "sha256-I/X/f6gLdWR85zzaXq+LMi80Mtu7f286g5Y0YYrbztM=";
|
2014-01-10 19:43:55 +00:00
|
|
|
};
|
|
|
|
|
2018-03-16 17:09:50 +00:00
|
|
|
postPatch = ''
|
|
|
|
# get rid of absolute path to helper in store so we can use a setuid wrapper
|
|
|
|
substituteInPlace src/usb-acl-helper.c \
|
|
|
|
--replace 'ACL_HELPER_PATH"/' '"'
|
2022-02-11 20:46:44 +00:00
|
|
|
# don't try to setcap/suid in a nix builder
|
|
|
|
substituteInPlace src/meson.build \
|
|
|
|
--replace "meson.add_install_script('../build-aux/setcap-or-suid'," \
|
|
|
|
"# meson.add_install_script('../build-aux/setcap-or-suid',"
|
2018-03-16 17:09:50 +00:00
|
|
|
'';
|
|
|
|
|
2019-05-02 02:36:32 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
docbook_xsl
|
|
|
|
gettext
|
|
|
|
gobject-introspection
|
|
|
|
gtk-doc
|
|
|
|
libsoup
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
perl
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2019-05-02 02:36:32 +01:00
|
|
|
python3
|
|
|
|
python3.pkgs.pyparsing
|
|
|
|
python3.pkgs.six
|
|
|
|
vala
|
|
|
|
];
|
2014-01-10 19:43:55 +00:00
|
|
|
|
2019-07-11 14:06:08 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good
|
|
|
|
];
|
|
|
|
|
2019-05-02 02:36:32 +01:00
|
|
|
buildInputs = [
|
|
|
|
cyrus_sasl
|
2021-11-11 04:35:34 +00:00
|
|
|
libepoxy
|
2019-05-02 02:36:32 +01:00
|
|
|
gtk3
|
|
|
|
json-glib
|
|
|
|
libcacard
|
2022-02-11 20:46:44 +00:00
|
|
|
libcap_ng
|
2019-05-02 02:36:32 +01:00
|
|
|
libdrm
|
|
|
|
libjpeg_turbo
|
2020-04-24 22:38:18 +01:00
|
|
|
libopus
|
|
|
|
libusb1
|
2019-05-02 02:36:32 +01:00
|
|
|
lz4
|
|
|
|
openssl
|
|
|
|
phodav
|
|
|
|
pixman
|
|
|
|
spice-protocol
|
|
|
|
usbredir
|
2022-02-11 20:46:44 +00:00
|
|
|
wayland-protocols
|
2019-05-02 02:36:32 +01:00
|
|
|
zlib
|
2022-02-11 20:46:44 +00:00
|
|
|
] ++ lib.optionals withPolkit [ polkit acl ] ;
|
2014-01-10 19:43:55 +00:00
|
|
|
|
2018-04-26 21:59:34 +01:00
|
|
|
PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
|
2016-01-17 23:04:40 +00:00
|
|
|
|
2019-05-02 02:36:32 +01:00
|
|
|
mesonFlags = [
|
2022-02-11 20:46:44 +00:00
|
|
|
"-Dusb-acl-helper-dir=${placeholder "out"}/bin"
|
|
|
|
"-Dusb-ids-path=${hwdata}/share/hwdata/usb.ids"
|
2022-03-03 07:43:33 +00:00
|
|
|
] ++ lib.optionals (!withPolkit) [
|
|
|
|
"-Dpolkit=disabled"
|
2014-01-10 19:43:55 +00:00
|
|
|
];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-09-03 23:49:40 +01:00
|
|
|
description = "GTK 3 SPICE widget";
|
2014-01-10 19:43:55 +00:00
|
|
|
longDescription = ''
|
2019-09-03 23:49:40 +01:00
|
|
|
spice-gtk is a GTK 3 SPICE widget. It features glib-based
|
2014-01-10 19:43:55 +00:00
|
|
|
objects for SPICE protocol parsing and a gtk widget for embedding
|
|
|
|
the SPICE display into other applications such as virt-manager.
|
|
|
|
Python bindings are available too.
|
|
|
|
'';
|
|
|
|
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.spice-space.org/";
|
2014-01-10 19:43:55 +00:00
|
|
|
license = licenses.lgpl21;
|
2018-02-20 15:58:55 +00:00
|
|
|
maintainers = [ maintainers.xeji ];
|
2014-01-10 19:43:55 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|