From 6997aefc84d092acf94ef0b7d97e1fe6e01af7d2 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Mon, 30 Jan 2023 19:24:17 +0800 Subject: [PATCH] cinnamon.cinnamon-common: use correct python for scrollbar-test-widget.py Loading Themes module Traceback (most recent call last): File "/xxxxxx/share/cinnamon/cinnamon-settings/bin/scrollbar-test-widget.py", line 6, in import gi ModuleNotFoundError: No module named 'gi' This file is being called as Gio.Subprocess.new(['python3', '/xxxxxx/scrollbar-test-widget.py', str(self.content_widget.get_id())], Gio.SubprocessFlags.NONE) --- .../cinnamon/cinnamon-common/default.nix | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/pkgs/desktops/cinnamon/cinnamon-common/default.nix b/pkgs/desktops/cinnamon/cinnamon-common/default.nix index bd2e2a32cd76..ef3013f2e404 100644 --- a/pkgs/desktops/cinnamon/cinnamon-common/default.nix +++ b/pkgs/desktops/cinnamon/cinnamon-common/default.nix @@ -53,6 +53,23 @@ , perl }: +let + pythonEnv = python3.withPackages (pp: with pp; [ + dbus-python + setproctitle + pygobject3 + pycairo + pp.xapp # don't omit `pp.`, see #213561 + pillow + pyinotify # for looking-glass + pytz + tinycss2 + python-pam + pexpect + distro + requests + ]); +in stdenv.mkDerivation rec { pname = "cinnamon-common"; version = "5.6.7"; @@ -70,21 +87,6 @@ stdenv.mkDerivation rec { ]; buildInputs = [ - (python3.withPackages (pp: with pp; [ - dbus-python - setproctitle - pygobject3 - pycairo - python3.pkgs.xapp # The scope prefix is required - pillow - pyinotify # for looking-glass - pytz - tinycss2 - python-pam - pexpect - distro - requests - ])) atk cacert cinnamon-control-center @@ -106,6 +108,7 @@ stdenv.mkDerivation rec { muffin networkmanager polkit + pythonEnv libxml2 libgnomekbd gst_all_1.gstreamer @@ -154,6 +157,8 @@ stdenv.mkDerivation rec { sed "s|/usr/share/sounds|/run/current-system/sw/share/sounds|g" -i ./files/usr/share/cinnamon/cinnamon-settings/bin/SettingsWidgets.py + sed "s|'python3'|'${pythonEnv.interpreter}'|g" -i ./files/usr/share/cinnamon/cinnamon-settings/bin/CinnamonGtkSettings.py + sed "s|/usr/share/%s|/run/current-system/sw/share/%s|g" -i ./files/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py sed "s|/usr/bin/cinnamon-screensaver-command|/run/current-system/sw/bin/cinnamon-screensaver-command|g" \