python312Packages.tensordict: disable flaky test_map_iter_interrupt_early on all...
[NixPkgs.git] / pkgs / by-name / gp / gpaste / package.nix
blob7911b5ffc6c0eec19ed76ec3c174a5ec9bc82572
1 { stdenv
2 , lib
3 , fetchurl
4 , gjs
5 , glib
6 , gobject-introspection
7 , gtk3
8 , gtk4
9 , gcr_4
10 , libadwaita
11 , meson
12 , ninja
13 , pango
14 , pkg-config
15 , vala
16 , desktop-file-utils
17 , wrapGAppsHook3
20 stdenv.mkDerivation (finalAttrs: {
21   version = "45.2";
22   pname = "gpaste";
24   src = fetchurl {
25     url = "https://www.imagination-land.org/files/gpaste/GPaste-${finalAttrs.version}.tar.xz";
26     hash = "sha256-2WC0FGPQisY3YH4EgJcR/Re69fJznUD1KlCGljivyEE=";
27   };
29   patches = [
30     ./fix-paths.patch
31   ];
33   # TODO: switch to substituteAll with placeholder
34   # https://github.com/NixOS/nix/issues/1846
35   postPatch = ''
36     substituteInPlace src/libgpaste/gpaste/gpaste-settings.c \
37       --subst-var-by gschemasCompiled ${glib.makeSchemaPath (placeholder "out") "${finalAttrs.pname}-${finalAttrs.version}"}
38   '';
40   nativeBuildInputs = [
41     gobject-introspection
42     meson
43     ninja
44     pkg-config
45     vala
46     desktop-file-utils
47     wrapGAppsHook3
48   ];
50   buildInputs = [
51     gjs
52     glib
53     gtk3
54     gtk4
55     gcr_4
56     libadwaita
57     pango
58   ];
60   mesonFlags = [
61     "-Dcontrol-center-keybindings-dir=${placeholder "out"}/share/gnome-control-center/keybindings"
62     "-Ddbus-services-dir=${placeholder "out"}/share/dbus-1/services"
63     "-Dsystemd-user-unit-dir=${placeholder "out"}/etc/systemd/user"
64   ];
66   postInstall = ''
67     # We do not have central location to install typelibs to,
68     # let’s ensure GNOME Shell can still find them.
69     extensionDir="$out/share/gnome-shell/extensions/GPaste@gnome-shell-extensions.gnome.org"
70     mv "$extensionDir/"{extension,.extension-wrapped}.js
71     mv "$extensionDir/"{prefs,.prefs-wrapped}.js
72     substitute "${./wrapper.js}" "$extensionDir/extension.js" \
73       --subst-var-by originalName "extension" \
74       --subst-var-by typelibPath "${placeholder "out"}/lib/girepository-1.0"
75     substitute "${./wrapper.js}" "$extensionDir/prefs.js" \
76       --subst-var-by originalName "prefs" \
77       --subst-var-by typelibPath "${placeholder "out"}/lib/girepository-1.0"
78   '';
80   meta = with lib; {
81     homepage = "https://github.com/Keruspe/GPaste";
82     changelog = "https://github.com/Keruspe/GPaste/blob/v${finalAttrs.version}/NEWS";
83     description = "Clipboard management system with GNOME integration";
84     mainProgram = "gpaste-client";
85     license = licenses.bsd2;
86     platforms = platforms.linux;
87     maintainers = teams.gnome.members;
88   };