diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2023-12-31 02:31:32 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2023-12-31 02:31:32 +0100 |
commit | 80020c7db424d64d352babc390bbf14e0aceaf23 (patch) | |
tree | f0fe36ea8af3f42d03d28a2865eeaf763b05fb2f /pkgs/desktops/gnome | |
parent | f50aae4fb10dd51bd6ffcce0eb96d02b608a9595 (diff) | |
parent | 55b9aa64c39d6c34b6ef878fbad405900782e998 (diff) |
Merge branch 'master' into staging-next
; Conflicts: ; pkgs/development/lua-modules/generated-packages.nix ; pkgs/development/lua-modules/overrides.nix
Diffstat (limited to 'pkgs/desktops/gnome')
-rw-r--r-- | pkgs/desktops/gnome/misc/gpaste/default.nix | 18 | ||||
-rw-r--r-- | pkgs/desktops/gnome/misc/gpaste/fix-paths.patch | 45 | ||||
-rw-r--r-- | pkgs/desktops/gnome/misc/gpaste/wrapper.js | 5 |
3 files changed, 19 insertions, 49 deletions
diff --git a/pkgs/desktops/gnome/misc/gpaste/default.nix b/pkgs/desktops/gnome/misc/gpaste/default.nix index 2051f19a37be0..2f66d742f969c 100644 --- a/pkgs/desktops/gnome/misc/gpaste/default.nix +++ b/pkgs/desktops/gnome/misc/gpaste/default.nix @@ -35,10 +35,6 @@ stdenv.mkDerivation rec { # TODO: switch to substituteAll with placeholder # https://github.com/NixOS/nix/issues/1846 postPatch = '' - substituteInPlace src/gnome-shell/extension.js \ - --subst-var-by typelibPath "${placeholder "out"}/lib/girepository-1.0" - substituteInPlace src/gnome-shell/prefs.js \ - --subst-var-by typelibPath "${placeholder "out"}/lib/girepository-1.0" substituteInPlace src/libgpaste/gpaste/gpaste-settings.c \ --subst-var-by gschemasCompiled ${glib.makeSchemaPath (placeholder "out") "${pname}-${version}"} ''; @@ -69,6 +65,20 @@ stdenv.mkDerivation rec { "-Dsystemd-user-unit-dir=${placeholder "out"}/etc/systemd/user" ]; + postInstall = '' + # We do not have central location to install typelibs to, + # let’s ensure GNOME Shell can still find them. + extensionDir="$out/share/gnome-shell/extensions/GPaste@gnome-shell-extensions.gnome.org" + mv "$extensionDir/"{extension,.extension-wrapped}.js + mv "$extensionDir/"{prefs,.prefs-wrapped}.js + substitute "${./wrapper.js}" "$extensionDir/extension.js" \ + --subst-var-by originalName "extension" \ + --subst-var-by typelibPath "${placeholder "out"}/lib/girepository-1.0" + substitute "${./wrapper.js}" "$extensionDir/prefs.js" \ + --subst-var-by originalName "prefs" \ + --subst-var-by typelibPath "${placeholder "out"}/lib/girepository-1.0" + ''; + meta = with lib; { homepage = "https://github.com/Keruspe/GPaste"; description = "Clipboard management system with GNOME 3 integration"; diff --git a/pkgs/desktops/gnome/misc/gpaste/fix-paths.patch b/pkgs/desktops/gnome/misc/gpaste/fix-paths.patch index ef782ce374a8a..ebebc8a20bd66 100644 --- a/pkgs/desktops/gnome/misc/gpaste/fix-paths.patch +++ b/pkgs/desktops/gnome/misc/gpaste/fix-paths.patch @@ -1,48 +1,3 @@ -diff --git a/src/gnome-shell/__nix-prepend-search-paths.js b/src/gnome-shell/__nix-prepend-search-paths.js -new file mode 100644 -index 00000000..e8e20c67 ---- /dev/null -+++ b/src/gnome-shell/__nix-prepend-search-paths.js -@@ -0,0 +1,3 @@ -+import GIRepository from 'gi://GIRepository'; -+ -+GIRepository.Repository.prepend_search_path('@typelibDir@'); -diff --git a/src/gnome-shell/extension.js b/src/gnome-shell/extension.js -index cb862a30..980767c9 100644 ---- a/src/gnome-shell/extension.js -+++ b/src/gnome-shell/extension.js -@@ -4,6 +4,8 @@ - * Copyright (c) 2010-2023, Marc-Antoine Perennou <Marc-Antoine@Perennou.com> - */ - -+import './__nix-prepend-search-paths.js'; -+ - import * as Main from 'resource:///org/gnome/shell/ui/main.js'; - import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js'; - -diff --git a/src/gnome-shell/meson.build b/src/gnome-shell/meson.build -index 86cbb0b2..80fc4d67 100644 ---- a/src/gnome-shell/meson.build -+++ b/src/gnome-shell/meson.build -@@ -1,4 +1,5 @@ - shell_extension_files = [ -+ '__nix-prepend-search-paths.js', - 'aboutItem.js', - 'actionButton.js', - 'actionButtonActor.js', -diff --git a/src/gnome-shell/prefs.js b/src/gnome-shell/prefs.js -index 4c0d9bde..58f54f9a 100644 ---- a/src/gnome-shell/prefs.js -+++ b/src/gnome-shell/prefs.js -@@ -4,6 +4,8 @@ - * Copyright (c) 2010-2023, Marc-Antoine Perennou <Marc-Antoine@Perennou.com> - */ - -+import './__nix-prepend-search-paths.js'; -+ - import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; - - import GPasteGtk from 'gi://GPasteGtk?version=4'; diff --git a/src/libgpaste/gpaste/gpaste-settings.c b/src/libgpaste/gpaste/gpaste-settings.c index 830f5e0b..c8df0e11 100644 --- a/src/libgpaste/gpaste/gpaste-settings.c diff --git a/pkgs/desktops/gnome/misc/gpaste/wrapper.js b/pkgs/desktops/gnome/misc/gpaste/wrapper.js new file mode 100644 index 0000000000000..ea6a9cba6f6fb --- /dev/null +++ b/pkgs/desktops/gnome/misc/gpaste/wrapper.js @@ -0,0 +1,5 @@ +import GIRepository from 'gi://GIRepository'; + +GIRepository.Repository.prepend_search_path('@typelibDir@'); + +export default (await import('./.@originalName@-wrapped.js')).default; |