From eb8c2956daef26a8f3b563c91ef64bc4840ed50b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 24 Apr 2024 08:53:35 +0200 Subject: [PATCH 1/2] power-profiles-daemon: Fix missing typelib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gobject-instrospection before version 1.80 shipped typelibs for GLib. As a result, programs relying on libgirepository such as those using pygobject3 would find the GLib typelibs without being wrapped at all. In GNOME 46, the GLib typelibs were moved to glib package. So if we want a program to find them, they need to be explicitly passed through `GI_TYPELIB_PATH` environment variable. This can be demonstrated by running `GI_TYPELIB_PATH= powerprofilesctl`: ImportError: cannot import name Gio, introspection typelib not found Let’s add the library to path using a wrapper. --- pkgs/os-specific/linux/power-profiles-daemon/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/os-specific/linux/power-profiles-daemon/default.nix b/pkgs/os-specific/linux/power-profiles-daemon/default.nix index 11f26e5013a82..f7145bc02ebe7 100644 --- a/pkgs/os-specific/linux/power-profiles-daemon/default.nix +++ b/pkgs/os-specific/linux/power-profiles-daemon/default.nix @@ -11,6 +11,7 @@ , polkit , dbus , gobject-introspection +, wrapGAppsNoGuiHook , gettext , gtk-doc , docbook-xsl-nons @@ -49,6 +50,7 @@ stdenv.mkDerivation rec { libxml2 # for xmllint for stripping GResources libxslt # for xsltproc for building docs gobject-introspection + wrapGAppsNoGuiHook # checkInput but cheked for during the configuring (python3.pythonOnBuildForHost.withPackages (ps: with ps; [ pygobject3 @@ -95,6 +97,9 @@ stdenv.mkDerivation rec { doCheck = true; + # Only need to wrap the Python tool (powerprofilectl) + dontWrapGApps = true; + PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions"; postPatch = '' @@ -106,6 +111,10 @@ stdenv.mkDerivation rec { src/powerprofilesctl ''; + postFixup = '' + wrapGApp "$out/bin/powerprofilesctl" + ''; + passthru = { tests = { nixos = nixosTests.power-profiles-daemon; From c036e6cc9e93620f9eabd94b00b40cd95c428a44 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 24 Apr 2024 09:21:10 +0200 Subject: [PATCH 2/2] =?UTF-8?q?gnome.gpaste:=2045=20=E2=86=92=2045.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GNOME 46 support! https://www.imagination-land.org/posts/2024-03-21-gpaste-45.1-released.html No tag yet. Checked that v45 tarball matches the git repo and that 45.1 diff is okay. Also clean up the expression and fix license. --- pkgs/desktops/gnome/misc/gpaste/default.nix | 22 ++++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/desktops/gnome/misc/gpaste/default.nix b/pkgs/desktops/gnome/misc/gpaste/default.nix index e98c861f1267c..064f18586641b 100644 --- a/pkgs/desktops/gnome/misc/gpaste/default.nix +++ b/pkgs/desktops/gnome/misc/gpaste/default.nix @@ -1,6 +1,6 @@ { stdenv , lib -, fetchFromGitHub +, fetchurl , gjs , glib , gobject-introspection @@ -17,15 +17,13 @@ , wrapGAppsHook }: -stdenv.mkDerivation rec { - version = "45"; +stdenv.mkDerivation (finalAttrs: { + version = "45.1"; pname = "gpaste"; - src = fetchFromGitHub { - owner = "Keruspe"; - repo = "GPaste"; - rev = "v${version}"; - sha256 = "sha256-MpoeLXGdLfas/E3x5ojJW5Dd3H8XZORtFaBHgRGJXxg="; + src = fetchurl { + url = "https://www.imagination-land.org/files/gpaste/GPaste-${finalAttrs.version}.tar.xz"; + hash = "sha256-yYLoHn3/2xlefBeErnydNfkvtJva8/9f9JHhfschBpQ="; }; patches = [ @@ -36,7 +34,7 @@ stdenv.mkDerivation rec { # https://github.com/NixOS/nix/issues/1846 postPatch = '' substituteInPlace src/libgpaste/gpaste/gpaste-settings.c \ - --subst-var-by gschemasCompiled ${glib.makeSchemaPath (placeholder "out") "${pname}-${version}"} + --subst-var-by gschemasCompiled ${glib.makeSchemaPath (placeholder "out") "${finalAttrs.pname}-${finalAttrs.version}"} ''; nativeBuildInputs = [ @@ -81,10 +79,10 @@ stdenv.mkDerivation rec { meta = with lib; { homepage = "https://github.com/Keruspe/GPaste"; - description = "Clipboard management system with GNOME 3 integration"; + description = "Clipboard management system with GNOME integration"; mainProgram = "gpaste-client"; - license = licenses.gpl3; + license = licenses.bsd2; platforms = platforms.linux; maintainers = teams.gnome.members; }; -} +})