From d397b090626b21a2f84aa594d6e550479bf1b09d Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 3 Feb 2023 16:30:04 +0100 Subject: [PATCH 1/4] virt-viewer: disable ovirtSupport --- .../virtualization/virt-viewer/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/virt-viewer/default.nix b/pkgs/applications/virtualization/virt-viewer/default.nix index 2e8aa34286a6..58948c8f80b4 100644 --- a/pkgs/applications/virtualization/virt-viewer/default.nix +++ b/pkgs/applications/virtualization/virt-viewer/default.nix @@ -11,6 +11,12 @@ , intltool , libcap ? null , libgovirt + # Currently unsupported. According to upstream, libgovirt is for a very narrow + # use-case and we don't currently cover it in Nixpkgs. It's safe to disable. + # https://gitlab.com/virt-viewer/virt-viewer/-/issues/100#note_1265011223 + # Can be enabled again once this is merged: + # https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/129 +, ovirtSupport ? false , libvirt , libvirt-glib , libxml2 @@ -71,11 +77,12 @@ stdenv.mkDerivation rec { gsettings-desktop-schemas gtk-vnc gtk3 - libgovirt libvirt libvirt-glib libxml2 vte + ] ++ optionals ovirtSupport [ + libgovirt ] ++ optionals spiceSupport ([ gdbm spice-gtk_libsoup2 @@ -87,6 +94,10 @@ stdenv.mkDerivation rec { # Required for USB redirection PolicyKit rules file propagatedUserEnvPkgs = optional spiceSupport spice-gtk_libsoup2; + mesonFlags = [ + (lib.mesonEnable "ovirt" ovirtSupport) + ]; + strictDeps = true; postPatch = '' From 910f943116daa99143ffec26785e2fa41fd68249 Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 3 Feb 2023 16:35:09 +0100 Subject: [PATCH 2/4] virt-viewer: cleanup --- .../virtualization/virt-viewer/default.nix | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/virtualization/virt-viewer/default.nix b/pkgs/applications/virtualization/virt-viewer/default.nix index 58948c8f80b4..5a4a86008776 100644 --- a/pkgs/applications/virtualization/virt-viewer/default.nix +++ b/pkgs/applications/virtualization/virt-viewer/default.nix @@ -3,13 +3,13 @@ , bash-completion , fetchurl , fetchpatch -, gdbm ? null +, gdbm , glib , gsettings-desktop-schemas , gtk-vnc , gtk3 , intltool -, libcap ? null +, libcap , libgovirt # Currently unsupported. According to upstream, libgovirt is for a very narrow # use-case and we don't currently cover it in Nixpkgs. It's safe to disable. @@ -26,20 +26,13 @@ , python3 , shared-mime-info # https://gitlab.com/virt-viewer/virt-viewer/-/issues/88 -, spice-gtk_libsoup2 ? null -, spice-protocol ? null +, spice-gtk_libsoup2 +, spice-protocol , spiceSupport ? true , vte , wrapGAppsHook }: -assert spiceSupport -> ( - gdbm != null - && (stdenv.isLinux -> libcap != null) - && spice-gtk_libsoup2 != null - && spice-protocol != null -); - with lib; stdenv.mkDerivation rec { @@ -52,10 +45,10 @@ stdenv.mkDerivation rec { }; patches = [ - # Fix build with meson 0.61 - # https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/117 + # Fix build with meson 0.61. Should be fixed in the next release. + # https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/120 (fetchpatch { - url = "https://gitlab.com/virt-viewer/virt-viewer/-/commit/ed19e51407bee53988878a6ebed4e7279d00b1a1.patch"; + url = "https://gitlab.com/virt-viewer/virt-viewer/-/commit/98d9f202ef768f22ae21b5c43a080a1aa64a7107.patch"; sha256 = "sha256-3AbnkbhWOh0aNjUkmVoSV/9jFQtvTllOr7plnkntb2o="; }) ]; From 81b570789390c69f1216044aeb5badd82d767c0a Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 3 Feb 2023 16:55:49 +0100 Subject: [PATCH 3/4] virt-viewer: use regular spice-gtk --- pkgs/applications/virtualization/virt-viewer/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/virtualization/virt-viewer/default.nix b/pkgs/applications/virtualization/virt-viewer/default.nix index 5a4a86008776..0e24dd9b08f2 100644 --- a/pkgs/applications/virtualization/virt-viewer/default.nix +++ b/pkgs/applications/virtualization/virt-viewer/default.nix @@ -25,8 +25,7 @@ , pkg-config , python3 , shared-mime-info -# https://gitlab.com/virt-viewer/virt-viewer/-/issues/88 -, spice-gtk_libsoup2 +, spice-gtk , spice-protocol , spiceSupport ? true , vte @@ -78,14 +77,14 @@ stdenv.mkDerivation rec { libgovirt ] ++ optionals spiceSupport ([ gdbm - spice-gtk_libsoup2 + spice-gtk spice-protocol ] ++ optionals stdenv.isLinux [ libcap ]); # Required for USB redirection PolicyKit rules file - propagatedUserEnvPkgs = optional spiceSupport spice-gtk_libsoup2; + propagatedUserEnvPkgs = optional spiceSupport spice-gtk; mesonFlags = [ (lib.mesonEnable "ovirt" ovirtSupport) From d8ed555748b01c4d6ba3cf23b2db6232e77c7d2a Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 3 Feb 2023 12:47:36 +0100 Subject: [PATCH 4/4] libgovirt: 0.3.8 -> 0.3.9 Also switched to the meson+ninja --- ...sable-incompatible-compiler-warnings.patch | 12 +++++++ .../virtualization/libgovirt/default.nix | 36 ++++++++++--------- .../libgovirt/no-version-script-ld-flag.patch | 14 -------- 3 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 pkgs/applications/virtualization/libgovirt/auto-disable-incompatible-compiler-warnings.patch delete mode 100644 pkgs/applications/virtualization/libgovirt/no-version-script-ld-flag.patch diff --git a/pkgs/applications/virtualization/libgovirt/auto-disable-incompatible-compiler-warnings.patch b/pkgs/applications/virtualization/libgovirt/auto-disable-incompatible-compiler-warnings.patch new file mode 100644 index 000000000000..85806bfcd892 --- /dev/null +++ b/pkgs/applications/virtualization/libgovirt/auto-disable-incompatible-compiler-warnings.patch @@ -0,0 +1,12 @@ +diff --git a/meson.build b/meson.build +index d5c3627..2bd692a 100644 +--- a/meson.build ++++ b/meson.build +@@ -86,7 +86,7 @@ govirt_global_cflags = ['-std=c99', + '-Woverride-init', + '-Wno-unused-parameter'] + +-foreach arg : govirt_global_cflags ++foreach arg : compiler.get_supported_arguments(govirt_global_cflags) + add_project_arguments(arg, language : 'c') + endforeach diff --git a/pkgs/applications/virtualization/libgovirt/default.nix b/pkgs/applications/virtualization/libgovirt/default.nix index 0815781c21f7..c93f8a689730 100644 --- a/pkgs/applications/virtualization/libgovirt/default.nix +++ b/pkgs/applications/virtualization/libgovirt/default.nix @@ -1,46 +1,48 @@ { lib , stdenv -, fetchurl -, glib +, fetchzip , gnome -, librest -, libsoup +, meson , pkg-config , gobject-introspection +, ninja +, glib +, librest_1_0 }: stdenv.mkDerivation rec { pname = "libgovirt"; - version = "0.3.8"; + version = "0.3.9"; outputs = [ "out" "dev" ]; - src = fetchurl { + src = fetchzip { url = "mirror://gnome/sources/libgovirt/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "HckYYikXa9+p8l/Y+oLAoFi2pgwcyAfHUH7IqTwPHfg="; + sha256 = "sha256-6RDuJTyaVYlO4Kq+niQyepom6xj1lqdBbyWL/VnZUdk="; }; - patches = lib.optionals stdenv.isDarwin [ - # The flag breaks the build on darwin and doesn't seem necessary - ./no-version-script-ld-flag.patch + patches = [ + # https://gitlab.gnome.org/GNOME/libgovirt/-/issues/9 + ./auto-disable-incompatible-compiler-warnings.patch ]; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang (lib.concatStringsSep " " [ + "-Wno-typedef-redefinition" + "-Wno-missing-field-initializers" + "-Wno-cast-align" + ]); nativeBuildInputs = [ + meson pkg-config gobject-introspection - ]; - - buildInputs = [ - libsoup + ninja ]; propagatedBuildInputs = [ glib - librest + librest_1_0 ]; - enableParallelBuilding = true; - passthru = { updateScript = gnome.updateScript { packageName = pname; diff --git a/pkgs/applications/virtualization/libgovirt/no-version-script-ld-flag.patch b/pkgs/applications/virtualization/libgovirt/no-version-script-ld-flag.patch deleted file mode 100644 index a837c3bf0642..000000000000 --- a/pkgs/applications/virtualization/libgovirt/no-version-script-ld-flag.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/govirt/Makefile.in -+++ b/govirt/Makefile.in -@@ -511,8 +511,7 @@ - libgovirt_la_LDFLAGS = \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - -export-dynamic \ -- -no-undefined \ -- -Wl,--version-script=$(srcdir)/govirt.sym -+ -no-undefined - - libgovirt_la_CFLAGS = \ - $(WARNINGFLAGS_C) - -Diff finished. Fri Oct 28 10:36:38 2022