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 diff --git a/pkgs/applications/virtualization/virt-viewer/default.nix b/pkgs/applications/virtualization/virt-viewer/default.nix index 2e8aa34286a6..0e24dd9b08f2 100644 --- a/pkgs/applications/virtualization/virt-viewer/default.nix +++ b/pkgs/applications/virtualization/virt-viewer/default.nix @@ -3,14 +3,20 @@ , 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. + # 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 @@ -19,21 +25,13 @@ , pkg-config , python3 , shared-mime-info -# https://gitlab.com/virt-viewer/virt-viewer/-/issues/88 -, spice-gtk_libsoup2 ? null -, spice-protocol ? null +, spice-gtk +, 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 { @@ -46,10 +44,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="; }) ]; @@ -71,21 +69,26 @@ stdenv.mkDerivation rec { gsettings-desktop-schemas gtk-vnc gtk3 - libgovirt libvirt libvirt-glib libxml2 vte + ] ++ optionals ovirtSupport [ + 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) + ]; strictDeps = true;