From 2a85869152a4967491f8084721216dd3c721d3ae Mon Sep 17 00:00:00 2001 From: "Ian M. Jones" Date: Fri, 29 Mar 2024 17:54:53 +0000 Subject: [PATCH] snippetexpander: 1.0.1 -> 1.0.2 --- pkgs/by-name/sn/snippetexpander/package.nix | 21 +++++++++--- pkgs/by-name/sn/snippetexpanderd/package.nix | 34 +++++++++++-------- .../by-name/sn/snippetexpandergui/package.nix | 26 ++++++++------ pkgs/by-name/sn/snippetexpanderx/package.nix | 10 +++--- 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 1f5f3a954ec0..2d50515c5026 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 308803ad9eec..7cde3eaf527a 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 1ce5f5d9cbe5..c43ce82c5ea7 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 bb7ad94f51c9..50da8f05503f 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"; }; }