From e476dfaab3561ed663f43db81394c04107eeb182 Mon Sep 17 00:00:00 2001 From: "Ian M. Jones" Date: Fri, 24 Nov 2023 16:48:16 +0000 Subject: [PATCH] snippetexpander: init at 1.0.1 --- pkgs/by-name/sn/snippetexpander/package.nix | 47 +++++++++++++ pkgs/by-name/sn/snippetexpanderd/package.nix | 63 +++++++++++++++++ .../by-name/sn/snippetexpandergui/package.nix | 70 +++++++++++++++++++ pkgs/by-name/sn/snippetexpanderx/package.nix | 64 +++++++++++++++++ 4 files changed, 244 insertions(+) create mode 100644 pkgs/by-name/sn/snippetexpander/package.nix create mode 100644 pkgs/by-name/sn/snippetexpanderd/package.nix create mode 100644 pkgs/by-name/sn/snippetexpandergui/package.nix create mode 100644 pkgs/by-name/sn/snippetexpanderx/package.nix diff --git a/pkgs/by-name/sn/snippetexpander/package.nix b/pkgs/by-name/sn/snippetexpander/package.nix new file mode 100644 index 000000000000..1f5f3a954ec0 --- /dev/null +++ b/pkgs/by-name/sn/snippetexpander/package.nix @@ -0,0 +1,47 @@ +{ lib +, buildGoModule +, fetchFromSourcehut +, scdoc +, installShellFiles +, snippetexpanderd +}: + +buildGoModule rec { + inherit (snippetexpanderd) src version; + + pname = "snippetexpander"; + + vendorHash = "sha256-wSAho59yxcXTu1zQ5x783HT4gtfSM4GdsOEeC1wfHhE="; + + proxyVendor = true; + + modRoot = "cmd/snippetexpander"; + + nativeBuildInputs = [ + scdoc + installShellFiles + ]; + + buildInputs = [ + snippetexpanderd + ]; + + ldflags = [ + "-s" + "-w" + ]; + + postInstall = '' + make man + installManPage snippetexpander.1 + ''; + + meta = with lib; { + description = "Your little expandable text snippet helper CLI"; + homepage = "https://snippetexpander.org"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ianmjones ]; + platforms = platforms.linux; + mainProgram = "snippetexpander"; + }; +} diff --git a/pkgs/by-name/sn/snippetexpanderd/package.nix b/pkgs/by-name/sn/snippetexpanderd/package.nix new file mode 100644 index 000000000000..308803ad9eec --- /dev/null +++ b/pkgs/by-name/sn/snippetexpanderd/package.nix @@ -0,0 +1,63 @@ +{ lib +, stdenv +, buildGoModule +, fetchFromSourcehut +, pkg-config +, makeWrapper +, scdoc +, installShellFiles +, xorg +, gtk3 +}: + +buildGoModule rec { + pname = "snippetexpanderd"; + version = "1.0.1"; + + src = fetchFromSourcehut { + owner = "~ianmjones"; + repo = "snippetexpander"; + rev = "v${version}"; + hash = "sha256-y3TJ+L3kXYfZFzAD1vmhvP6Yarctu5LHq/74005h8sI="; + }; + + vendorHash = "sha256-QX8HI8I1ZJI6HJ1sl86OiJ4nxwFAjHH8h1zB9ASJaQs="; + + modRoot = "cmd/snippetexpanderd"; + + nativeBuildInputs = [ + pkg-config + makeWrapper + scdoc + installShellFiles + ]; + + buildInputs = [ + xorg.libX11 + gtk3 + ]; + + ldflags = [ + "-s" + "-w" + ]; + + postInstall = '' + make man + installManPage snippetexpanderd.1 snippetexpander-placeholders.5 + ''; + + postFixup = '' + wrapProgram $out/bin/snippetexpanderd \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ xorg.libX11 ]} + ''; + + meta = with lib; { + description = "Your little expandable text snippet helper daemon"; + homepage = "https://snippetexpander.org"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ianmjones ]; + platforms = platforms.linux; + mainProgram = "snippetexpanderd"; + }; +} diff --git a/pkgs/by-name/sn/snippetexpandergui/package.nix b/pkgs/by-name/sn/snippetexpandergui/package.nix new file mode 100644 index 000000000000..1ce5f5d9cbe5 --- /dev/null +++ b/pkgs/by-name/sn/snippetexpandergui/package.nix @@ -0,0 +1,70 @@ +{ lib +, buildGoModule +, fetchFromSourcehut +, makeWrapper +, wails +, scdoc +, installShellFiles +, xorg +, gtk3 +, webkitgtk +, gsettings-desktop-schemas +, snippetexpanderd +}: + +buildGoModule rec { + inherit (snippetexpanderd) src version; + + pname = "snippetexpandergui"; + + vendorHash = "sha256-iZfZdT8KlfZMVLQcYmo6EooIdsSGrpO/ojwT9Ft1GQI="; + + proxyVendor = true; + + modRoot = "cmd/snippetexpandergui"; + + nativeBuildInputs = [ + makeWrapper + wails + scdoc + installShellFiles + ]; + + buildInputs = [ + xorg.libX11 + gtk3 + webkitgtk + gsettings-desktop-schemas + snippetexpanderd + ]; + + ldflags = [ + "-s" + "-w" + ]; + + tags = [ + "desktop" + "production" + ]; + + postInstall = '' + mv build/linux/share $out/share + make man + 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} + ''; + + meta = with lib; { + description = "Your little expandable text snippet helper GUI"; + homepage = "https://snippetexpander.org"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ianmjones ]; + platforms = platforms.linux; + mainProgram = "snippetexpandergui"; + }; +} diff --git a/pkgs/by-name/sn/snippetexpanderx/package.nix b/pkgs/by-name/sn/snippetexpanderx/package.nix new file mode 100644 index 000000000000..3c91adbbbc0c --- /dev/null +++ b/pkgs/by-name/sn/snippetexpanderx/package.nix @@ -0,0 +1,64 @@ +{ lib +, stdenv +, fetchFromSourcehut +, pkg-config +, vala +, wrapGAppsHook +, installShellFiles +, scdoc +, at-spi2-atk +, at-spi2-core +, dbus +, gtk3 +, ibus +, libgee +, xorg +, snippetexpanderd +}: + +stdenv.mkDerivation rec { + inherit (snippetexpanderd) src version; + + pname = "snippetexpanderx"; + + sourceRoot = "source/cmd/snippetexpanderx"; + + nativeBuildInputs = [ + pkg-config + vala + wrapGAppsHook + installShellFiles + scdoc + ]; + + buildInputs = [ + at-spi2-atk + at-spi2-core + dbus + gtk3 + ibus + libgee + xorg.libX11 + snippetexpanderd + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + install -m555 snippetexpanderx $out/bin/ + installManPage snippetexpanderx.1 + runHook postInstall + ''; + + # There are no tests. + doCheck = false; + + meta = with lib; { + description = "Your little expandable text snippet helper auto expander daemon"; + homepage = "https://snippetexpander.org"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ianmjones ]; + platforms = platforms.linux; + mainProgram = "snippetexpanderx"; + }; +}