From 924193b5e31f19d58207c1e07a38ed30d43ecd92 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 4 Jun 2023 17:38:12 +0800 Subject: [PATCH 01/10] cinnamon.cinnamon-common: fix all hardcode absolute paths in applets This will be helpful to the a11y and the printer applet. --- pkgs/desktops/cinnamon/cinnamon-common/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/desktops/cinnamon/cinnamon-common/default.nix b/pkgs/desktops/cinnamon/cinnamon-common/default.nix index e50e14ea8d94..54971c332ca1 100644 --- a/pkgs/desktops/cinnamon/cinnamon-common/default.nix +++ b/pkgs/desktops/cinnamon/cinnamon-common/default.nix @@ -155,13 +155,15 @@ stdenv.mkDerivation rec { -e s,/usr/share/locale,/run/current-system/sw/share/locale,g \ {} + + # All optional and may introduce circular dependency. + find ./files/usr/share/cinnamon/applets -type f -exec sed -i \ + -e '/^#/!s,/usr/bin,/run/current-system/sw/bin,g' \ + {} + + 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/bin/cinnamon-screensaver-command|/run/current-system/sw/bin/cinnamon-screensaver-command|g" \ - -i ./files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js -i ./files/usr/share/cinnamon/applets/user@cinnamon.org/applet.js - sed "s|\"/usr/lib\"|\"${cinnamon-control-center}/lib\"|g" -i ./files/usr/share/cinnamon/cinnamon-settings/bin/capi.py sed 's|"lspci"|"${pciutils}/bin/lspci"|g' -i ./files/usr/share/cinnamon/cinnamon-settings/modules/cs_info.py From ad888c99e5ca0521720f5e371b41dd8b86953706 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 4 Jun 2023 17:47:07 +0800 Subject: [PATCH 02/10] cinnamon.cinnamon-common: group and sort substitutions This is a cosmetic change. I perfer working under the cinnamon-settings folder for more targeted result. --- .../cinnamon/cinnamon-common/default.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkgs/desktops/cinnamon/cinnamon-common/default.nix b/pkgs/desktops/cinnamon/cinnamon-common/default.nix index 54971c332ca1..32248fe9832b 100644 --- a/pkgs/desktops/cinnamon/cinnamon-common/default.nix +++ b/pkgs/desktops/cinnamon/cinnamon-common/default.nix @@ -160,17 +160,15 @@ stdenv.mkDerivation rec { -e '/^#/!s,/usr/bin,/run/current-system/sw/bin,g' \ {} + - sed "s|/usr/share/sounds|/run/current-system/sw/share/sounds|g" -i ./files/usr/share/cinnamon/cinnamon-settings/bin/SettingsWidgets.py + pushd ./files/usr/share/cinnamon/cinnamon-settings + sed "s|\"/usr/lib\"|\"${cinnamon-control-center}/lib\"|g" -i ./bin/capi.py + sed "s|'python3'|'${pythonEnv.interpreter}'|g" -i ./bin/CinnamonGtkSettings.py + sed "s|/usr/share/sounds|/run/current-system/sw/share/sounds|g" -i ./bin/SettingsWidgets.py + sed "s|msgfmt|${gettext}/bin/msgfmt|g" -i ./bin/Spices.py + sed 's|"lspci"|"${pciutils}/bin/lspci"|g' -i ./modules/cs_info.py + popd - sed "s|'python3'|'${pythonEnv.interpreter}'|g" -i ./files/usr/share/cinnamon/cinnamon-settings/bin/CinnamonGtkSettings.py - - sed "s|\"/usr/lib\"|\"${cinnamon-control-center}/lib\"|g" -i ./files/usr/share/cinnamon/cinnamon-settings/bin/capi.py - - sed 's|"lspci"|"${pciutils}/bin/lspci"|g' -i ./files/usr/share/cinnamon/cinnamon-settings/modules/cs_info.py - - sed "s| cinnamon-session| ${cinnamon-session}/bin/cinnamon-session|g" -i ./files/usr/bin/cinnamon-session-cinnamon -i ./files/usr/bin/cinnamon-session-cinnamon2d - - sed "s|msgfmt|${gettext}/bin/msgfmt|g" -i ./files/usr/share/cinnamon/cinnamon-settings/bin/Spices.py + sed "s| cinnamon-session| ${cinnamon-session}/bin/cinnamon-session|g" -i ./files/usr/bin/cinnamon-session-{cinnamon,cinnamon2d} patchShebangs src/data-to-c.pl ''; From 4fe173493a7c7786766b4394d37d6916f960e30d Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 4 Jun 2023 17:55:00 +0800 Subject: [PATCH 03/10] cinnamon.cinnamon-common: rewrite some substitutions with substituteInPlace This is a cosmetic change. This is not a 1:1 port (the cs_info.py one), but substituted content shouldn't change. --- pkgs/desktops/cinnamon/cinnamon-common/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/desktops/cinnamon/cinnamon-common/default.nix b/pkgs/desktops/cinnamon/cinnamon-common/default.nix index 32248fe9832b..77828a6c105a 100644 --- a/pkgs/desktops/cinnamon/cinnamon-common/default.nix +++ b/pkgs/desktops/cinnamon/cinnamon-common/default.nix @@ -161,11 +161,11 @@ stdenv.mkDerivation rec { {} + pushd ./files/usr/share/cinnamon/cinnamon-settings - sed "s|\"/usr/lib\"|\"${cinnamon-control-center}/lib\"|g" -i ./bin/capi.py - sed "s|'python3'|'${pythonEnv.interpreter}'|g" -i ./bin/CinnamonGtkSettings.py - sed "s|/usr/share/sounds|/run/current-system/sw/share/sounds|g" -i ./bin/SettingsWidgets.py - sed "s|msgfmt|${gettext}/bin/msgfmt|g" -i ./bin/Spices.py - sed 's|"lspci"|"${pciutils}/bin/lspci"|g' -i ./modules/cs_info.py + substituteInPlace ./bin/capi.py --replace '"/usr/lib"' '"${cinnamon-control-center}/lib"' + substituteInPlace ./bin/CinnamonGtkSettings.py --replace "'python3'" "'${pythonEnv.interpreter}'" + substituteInPlace ./bin/SettingsWidgets.py --replace "/usr/share/sounds" "/run/current-system/sw/share/sounds" + substituteInPlace ./bin/Spices.py --replace "msgfmt" "${gettext}/bin/msgfmt" + substituteInPlace ./modules/cs_info.py --replace "lspci" "${pciutils}/bin/lspci" popd sed "s| cinnamon-session| ${cinnamon-session}/bin/cinnamon-session|g" -i ./files/usr/bin/cinnamon-session-{cinnamon,cinnamon2d} From f5a786a4bbb5933b74013fc944a5e2feff77730a Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sun, 4 Jun 2023 18:06:16 +0800 Subject: [PATCH 04/10] cinnamon.cinnamon-common: unbreak cinnamon-spice-updater Cinnamon updates failed: No module named 'cinnamon' --- pkgs/desktops/cinnamon/cinnamon-common/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/cinnamon/cinnamon-common/default.nix b/pkgs/desktops/cinnamon/cinnamon-common/default.nix index 77828a6c105a..d7583606792a 100644 --- a/pkgs/desktops/cinnamon/cinnamon-common/default.nix +++ b/pkgs/desktops/cinnamon/cinnamon-common/default.nix @@ -179,8 +179,12 @@ stdenv.mkDerivation rec { --prefix XDG_DATA_DIRS : "${gnome.caribou}/share" ) + buildPythonPath "$out ${python3.pkgs.xapp}" + + # https://github.com/NixOS/nixpkgs/issues/200397 + patchPythonScript $out/bin/cinnamon-spice-updater + # https://github.com/NixOS/nixpkgs/issues/129946 - buildPythonPath "${python3.pkgs.xapp}" patchPythonScript $out/share/cinnamon/cinnamon-desktop-editor/cinnamon-desktop-editor.py ''; From 1e8e84a59fdbdcb6a053066eb04d5596feb266ac Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Mon, 5 Jun 2023 13:08:33 +0800 Subject: [PATCH 05/10] cinnamon.cinnamon-common: unbreak cinnamon-settings-users ValueError: Namespace Gtk not available --- pkgs/desktops/cinnamon/cinnamon-common/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/desktops/cinnamon/cinnamon-common/default.nix b/pkgs/desktops/cinnamon/cinnamon-common/default.nix index d7583606792a..0e33b9887ede 100644 --- a/pkgs/desktops/cinnamon/cinnamon-common/default.nix +++ b/pkgs/desktops/cinnamon/cinnamon-common/default.nix @@ -186,6 +186,9 @@ stdenv.mkDerivation rec { # https://github.com/NixOS/nixpkgs/issues/129946 patchPythonScript $out/share/cinnamon/cinnamon-desktop-editor/cinnamon-desktop-editor.py + + # Called as `pkexec cinnamon-settings-users.py`. + wrapGApp $out/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.py ''; passthru = { From 64aa3024b585f5eb77d52cafe6476eaba0329197 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 8 Jun 2023 19:33:53 +0800 Subject: [PATCH 06/10] cinnamon.xapp: actually fix gtk3 module target dir Before: $out/gtk-3.0/modules/libxapp-gtk3-module.so After: $out/lib/gtk-3.0/modules/libxapp-gtk3-module.so cat gtk+-3.0.pc | grep "libdir=" says `libdir=${prefix}/lib`, so install this there. Another package that installs gtk3 module: libcanberra-gtk3 --- pkgs/desktops/cinnamon/xapp/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/desktops/cinnamon/xapp/default.nix b/pkgs/desktops/cinnamon/xapp/default.nix index 719a8dd3968a..e09912478429 100644 --- a/pkgs/desktops/cinnamon/xapp/default.nix +++ b/pkgs/desktops/cinnamon/xapp/default.nix @@ -79,12 +79,11 @@ stdenv.mkDerivation rec { # Patch pastebin & inxi location sed "s|/usr/bin/pastebin|$out/bin/pastebin|" -i scripts/upload-system-info sed "s|'inxi'|'${inxi}/bin/inxi'|" -i scripts/upload-system-info - - # Patch gtk3 module target dir - substituteInPlace libxapp/meson.build \ - --replace "gtk3_dep.get_pkgconfig_variable('libdir')" "'$out'" ''; + # Fix gtk3 module target dir. Proper upstream solution should be using define_variable. + PKG_CONFIG_GTK__3_0_LIBDIR = "${placeholder "out"}/lib"; + meta = with lib; { homepage = "https://github.com/linuxmint/xapp"; description = "Cross-desktop libraries and common resources"; From a0aef0bec7ef05e23b80a4ead5db5195b63053d8 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 8 Jun 2023 19:36:06 +0800 Subject: [PATCH 07/10] sticky: 1.14 -> 1.16 https://github.com/linuxmint/sticky/compare/1.14...1.16 --- pkgs/applications/misc/sticky/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/sticky/default.nix b/pkgs/applications/misc/sticky/default.nix index 6b90e9689d44..f8581135bb55 100644 --- a/pkgs/applications/misc/sticky/default.nix +++ b/pkgs/applications/misc/sticky/default.nix @@ -12,14 +12,14 @@ python3.pkgs.buildPythonApplication rec { pname = "sticky"; - version = "1.14"; + version = "1.16"; format = "other"; src = fetchFromGitHub { owner = "linuxmint"; repo = pname; rev = version; - hash = "sha256-7UZbCbzQ1ZrSzxTUdbA+wsH3p27qj/c/cM4GY/kzG6E="; + hash = "sha256-+opzjvSdGwwn1imNzSsfD9rfs4naSXzcMBJRPhKW2WM="; }; postPatch = '' From 3b369e73789c607ef0f8a8521d7f12aad6077678 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 8 Jun 2023 19:38:54 +0800 Subject: [PATCH 08/10] cinnamon.warpinator: 1.6.2 -> 1.6.3 https://github.com/linuxmint/warpinator/compare/1.6.2...1.6.3 --- pkgs/desktops/cinnamon/warpinator/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/cinnamon/warpinator/default.nix b/pkgs/desktops/cinnamon/warpinator/default.nix index 6f70d8f9bda7..e380eb40ada0 100644 --- a/pkgs/desktops/cinnamon/warpinator/default.nix +++ b/pkgs/desktops/cinnamon/warpinator/default.nix @@ -33,13 +33,13 @@ let in stdenv.mkDerivation rec { pname = "warpinator"; - version = "1.6.2"; + version = "1.6.3"; src = fetchFromGitHub { owner = "linuxmint"; repo = pname; rev = version; - hash = "sha256-crGW1FBfTEiKqx981EzG414we4icyBv/keGtMlr8UFc="; + hash = "sha256-iCq2cwZgsq5/bJqjYuZ6dZLqz2nIpgHCrIQeMVxJNXY="; }; nativeBuildInputs = [ From e04a86f07c4ac3b28d97d903fb344c3683f5db3d Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Mon, 5 Jun 2023 23:38:56 +0800 Subject: [PATCH 09/10] cinnamon.mint-cursor-themes: 1.0.1 -> 1.0.2 https://github.com/linuxmint/mint-cursor-themes/compare/e17f8a46...d2c1428b --- pkgs/desktops/cinnamon/mint-cursor-themes/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/desktops/cinnamon/mint-cursor-themes/default.nix b/pkgs/desktops/cinnamon/mint-cursor-themes/default.nix index 31b453b0bea9..e0402b2f721b 100644 --- a/pkgs/desktops/cinnamon/mint-cursor-themes/default.nix +++ b/pkgs/desktops/cinnamon/mint-cursor-themes/default.nix @@ -5,14 +5,14 @@ stdenvNoCC.mkDerivation rec { pname = "mint-cursor-themes"; - version = "1.0.1"; + version = "1.0.2"; src = fetchFromGitHub { owner = "linuxmint"; repo = pname; # They don't really do tags, this is just a named commit. - rev = "e17f8a4620827235dabbe5221bd0ee8c44dad0d5"; - hash = "sha256-yLUmIVh884uDVkNil7qxf6t/gykipzBvPgzwmY3zvQk="; + rev = "d2c1428b499a347c291dafb13c89699fdbdd4be7"; + hash = "sha256-i2Wf+OKwal9G5hkcAdmGSgX6txu1AHajqqPJdhpJoA0="; }; installPhase = '' From 33e6485a1c884337c7e707202278af695d36f7d9 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 8 Jun 2023 19:41:58 +0800 Subject: [PATCH 10/10] cinnamon.bulky: 2.8 -> 2.9 https://github.com/linuxmint/bulky/compare/2.8...2.9 --- pkgs/desktops/cinnamon/bulky/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/cinnamon/bulky/default.nix b/pkgs/desktops/cinnamon/bulky/default.nix index 3858623902e7..9b4a7bf6b5f8 100644 --- a/pkgs/desktops/cinnamon/bulky/default.nix +++ b/pkgs/desktops/cinnamon/bulky/default.nix @@ -13,13 +13,13 @@ stdenv.mkDerivation rec { pname = "bulky"; - version = "2.8"; + version = "2.9"; src = fetchFromGitHub { owner = "linuxmint"; repo = "bulky"; rev = version; - hash = "sha256-DZjX4xPyA30TTyOX+VyGSY/FWPX2316CYImDWRma9r0="; + hash = "sha256-eCu7AgL4bzstu8vsqBJImRZm1qMVnnycuOShY5fB+C4="; }; nativeBuildInputs = [