about summary refs log tree commit diff
path: root/pkgs/by-name/sn
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-04-12 13:21:58 +0200
committerGitHub <noreply@github.com>2024-04-12 13:21:58 +0200
commit92323443a56f4e9fc4e4b712e3119f66d0969297 (patch)
tree3f889ae02f18c220959e97c5f8ed916462cfe44b /pkgs/by-name/sn
parent74f7e19dc14488548fc8c56b2588b6d8b1d11e7a (diff)
parent2a85869152a4967491f8084721216dd3c721d3ae (diff)
Merge pull request #300050 from ianmjones/snippetexpander-1.0.2
snippetexpander: 1.0.1 -> 1.0.2
Diffstat (limited to 'pkgs/by-name/sn')
-rw-r--r--pkgs/by-name/sn/snippetexpander/package.nix21
-rw-r--r--pkgs/by-name/sn/snippetexpanderd/package.nix34
-rw-r--r--pkgs/by-name/sn/snippetexpandergui/package.nix26
-rw-r--r--pkgs/by-name/sn/snippetexpanderx/package.nix10
4 files changed, 57 insertions, 34 deletions
diff --git a/pkgs/by-name/sn/snippetexpander/package.nix b/pkgs/by-name/sn/snippetexpander/package.nix
index 1f5f3a954ec03..2d50515c5026b 100644
--- a/pkgs/by-name/sn/snippetexpander/package.nix
+++ b/pkgs/by-name/sn/snippetexpander/package.nix
@@ -1,9 +1,11 @@
 { lib
 , buildGoModule
 , fetchFromSourcehut
+, makeWrapper
 , scdoc
 , installShellFiles
 , snippetexpanderd
+, snippetexpanderx
 }:
 
 buildGoModule rec {
@@ -11,24 +13,27 @@ buildGoModule rec {
 
   pname = "snippetexpander";
 
-  vendorHash = "sha256-wSAho59yxcXTu1zQ5x783HT4gtfSM4GdsOEeC1wfHhE=";
+  vendorHash = "sha256-W9NkENdZRzqSAONI9QS2EI5aERK+AaPqwYwITKLwXQE=";
 
   proxyVendor = true;
 
   modRoot = "cmd/snippetexpander";
 
   nativeBuildInputs = [
+    makeWrapper
     scdoc
     installShellFiles
   ];
 
   buildInputs = [
     snippetexpanderd
+    snippetexpanderx
   ];
 
   ldflags = [
     "-s"
     "-w"
+    "-X 'main.version=${src.rev}'"
   ];
 
   postInstall = ''
@@ -36,12 +41,18 @@ buildGoModule rec {
     installManPage snippetexpander.1
   '';
 
-  meta = with lib; {
+  postFixup = ''
+    # Ensure snippetexpanderd and snippetexpanderx are available to start/stop.
+    wrapProgram $out/bin/snippetexpander \
+      --prefix PATH : ${lib.makeBinPath [ snippetexpanderd snippetexpanderx ]}
+  '';
+
+  meta = {
     description = "Your little expandable text snippet helper CLI";
     homepage = "https://snippetexpander.org";
-    license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ ianmjones ];
-    platforms = platforms.linux;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ ianmjones ];
+    platforms = lib.platforms.linux;
     mainProgram = "snippetexpander";
   };
 }
diff --git a/pkgs/by-name/sn/snippetexpanderd/package.nix b/pkgs/by-name/sn/snippetexpanderd/package.nix
index 308803ad9eec4..7cde3eaf527a5 100644
--- a/pkgs/by-name/sn/snippetexpanderd/package.nix
+++ b/pkgs/by-name/sn/snippetexpanderd/package.nix
@@ -2,44 +2,49 @@
 , stdenv
 , buildGoModule
 , fetchFromSourcehut
-, pkg-config
 , makeWrapper
 , scdoc
 , installShellFiles
-, xorg
-, gtk3
+, xclip
+, wl-clipboard
+, xdotool
+, wtype
 }:
 
 buildGoModule rec {
   pname = "snippetexpanderd";
-  version = "1.0.1";
+  version = "1.0.2";
 
   src = fetchFromSourcehut {
     owner = "~ianmjones";
     repo = "snippetexpander";
     rev = "v${version}";
-    hash = "sha256-y3TJ+L3kXYfZFzAD1vmhvP6Yarctu5LHq/74005h8sI=";
+    hash = "sha256-iEoBri+NuFfLkARUBA+D/Fe9xk6PPV62N/YRqPv9C/A=";
   };
 
-  vendorHash = "sha256-QX8HI8I1ZJI6HJ1sl86OiJ4nxwFAjHH8h1zB9ASJaQs=";
+  vendorHash = "sha256-W9NkENdZRzqSAONI9QS2EI5aERK+AaPqwYwITKLwXQE=";
+
+  proxyVendor = true;
 
   modRoot = "cmd/snippetexpanderd";
 
   nativeBuildInputs = [
-    pkg-config
     makeWrapper
     scdoc
     installShellFiles
   ];
 
   buildInputs = [
-    xorg.libX11
-    gtk3
+    xclip
+    wl-clipboard
+    xdotool
+    wtype
   ];
 
   ldflags = [
     "-s"
     "-w"
+    "-X 'main.version=${src.rev}'"
   ];
 
   postInstall = ''
@@ -48,16 +53,17 @@ buildGoModule rec {
   '';
 
   postFixup = ''
+    # Ensure xclip/wcopy and xdotool/wtype are available for copy and paste duties.
     wrapProgram $out/bin/snippetexpanderd \
-      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ xorg.libX11 ]}
+      --prefix PATH : ${lib.makeBinPath [ xclip wl-clipboard xdotool wtype ]}
   '';
 
-  meta = with lib; {
+  meta = {
     description = "Your little expandable text snippet helper daemon";
     homepage = "https://snippetexpander.org";
-    license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ ianmjones ];
-    platforms = platforms.linux;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ ianmjones ];
+    platforms = lib.platforms.linux;
     mainProgram = "snippetexpanderd";
   };
 }
diff --git a/pkgs/by-name/sn/snippetexpandergui/package.nix b/pkgs/by-name/sn/snippetexpandergui/package.nix
index 1ce5f5d9cbe5e..c43ce82c5ea77 100644
--- a/pkgs/by-name/sn/snippetexpandergui/package.nix
+++ b/pkgs/by-name/sn/snippetexpandergui/package.nix
@@ -1,7 +1,7 @@
 { lib
 , buildGoModule
 , fetchFromSourcehut
-, makeWrapper
+, wrapGAppsHook
 , wails
 , scdoc
 , installShellFiles
@@ -10,6 +10,7 @@
 , webkitgtk
 , gsettings-desktop-schemas
 , snippetexpanderd
+, snippetexpanderx
 }:
 
 buildGoModule rec {
@@ -17,30 +18,31 @@ buildGoModule rec {
 
   pname = "snippetexpandergui";
 
-  vendorHash = "sha256-iZfZdT8KlfZMVLQcYmo6EooIdsSGrpO/ojwT9Ft1GQI=";
+  vendorHash = "sha256-W9NkENdZRzqSAONI9QS2EI5aERK+AaPqwYwITKLwXQE=";
 
   proxyVendor = true;
 
   modRoot = "cmd/snippetexpandergui";
 
   nativeBuildInputs = [
-    makeWrapper
     wails
     scdoc
     installShellFiles
+    wrapGAppsHook
   ];
 
   buildInputs = [
     xorg.libX11
     gtk3
     webkitgtk
-    gsettings-desktop-schemas
     snippetexpanderd
+    snippetexpanderx
   ];
 
   ldflags = [
     "-s"
     "-w"
+    "-X 'main.version=${src.rev}'"
   ];
 
   tags = [
@@ -54,17 +56,19 @@ buildGoModule rec {
     installManPage snippetexpandergui.1
   '';
 
-  postFixup = ''
-    wrapProgram $out/bin/snippetexpandergui \
-      --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}
+  preFixup = ''
+    gappsWrapperArgs+=(
+      # Ensure snippetexpanderd and snippetexpanderx are available to start/stop.
+      --prefix PATH : ${lib.makeBinPath [ snippetexpanderd snippetexpanderx ]}
+    )
   '';
 
-  meta = with lib; {
+  meta = {
     description = "Your little expandable text snippet helper GUI";
     homepage = "https://snippetexpander.org";
-    license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ ianmjones ];
-    platforms = platforms.linux;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ ianmjones ];
+    platforms = lib.platforms.linux;
     mainProgram = "snippetexpandergui";
   };
 }
diff --git a/pkgs/by-name/sn/snippetexpanderx/package.nix b/pkgs/by-name/sn/snippetexpanderx/package.nix
index bb7ad94f51c9f..50da8f05503fe 100644
--- a/pkgs/by-name/sn/snippetexpanderx/package.nix
+++ b/pkgs/by-name/sn/snippetexpanderx/package.nix
@@ -42,6 +42,8 @@ stdenv.mkDerivation rec {
     snippetexpanderd
   ];
 
+  makeFlags = [ "VERSION=${src.rev}" ];
+
   installPhase = ''
     runHook preInstall
     mkdir -p $out/bin
@@ -53,12 +55,12 @@ stdenv.mkDerivation rec {
   # There are no tests.
   doCheck = false;
 
-  meta = with lib; {
+  meta = {
     description = "Your little expandable text snippet helper auto expander daemon";
     homepage = "https://snippetexpander.org";
-    license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ ianmjones ];
-    platforms = platforms.linux;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ ianmjones ];
+    platforms = lib.platforms.linux;
     mainProgram = "snippetexpanderx";
   };
 }