From 027b2935ca165874939c289dbc73c3857b745128 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Wed, 11 Dec 2024 00:10:06 +0100 Subject: [PATCH] clapgrep: init at 1.3.1 (#360741) --- pkgs/by-name/cl/clapgrep/package.nix | 73 ++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 pkgs/by-name/cl/clapgrep/package.nix diff --git a/pkgs/by-name/cl/clapgrep/package.nix b/pkgs/by-name/cl/clapgrep/package.nix new file mode 100644 index 000000000000..06b6ea3f6986 --- /dev/null +++ b/pkgs/by-name/cl/clapgrep/package.nix @@ -0,0 +1,73 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + + wrapGAppsHook4, + pkg-config, + blueprint-compiler, + + gtk4, + libadwaita, + glib, + + nix-update-script, +}: +let + version = "1.3.1"; + appid = "de.leopoldluley.Clapgrep"; +in +rustPlatform.buildRustPackage { + pname = "clapgrep"; + inherit version; + + src = fetchFromGitHub { + owner = "luleyleo"; + repo = "clapgrep"; + rev = "refs/tags/v${version}"; + hash = "sha256-MYV8MrCIpa8eqp2iCLTNLZrVQOyGsMEGqlnEF43fyls="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-tpWv8CznTxoAgOf0mb99peqUTQSfv+16dAmX8n7XVDQ="; + + nativeBuildInputs = [ + wrapGAppsHook4 + pkg-config + blueprint-compiler + ]; + + buildInputs = [ + gtk4 + libadwaita + glib + ]; + + env.APP_ID = appid; + + # see Justfile + postInstall = '' + mv $out/bin/clapgrep-gnome $out/bin/clapgrep + install -D assets/${appid}.desktop -t $out/share/applications + install -D assets/${appid}.metainfo.xml -t $out/share/metainfo + install -D assets/icons/hicolor/scalable/apps/${appid}.svg -t $out/share/icons/hicolor/scalable/apps + + mkdir -p assets/locale + cat po/LINGUAS | while read lang; do + mkdir -p assets/locale/$lang/LC_MESSAGES; + msgfmt -o assets/locale/$lang/LC_MESSAGES/${appid}.mo po/$lang.po; + done + cp -r assets/locale -t $out/share + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Search through all your files"; + homepage = "https://github.com/luleyleo/clapgrep"; + license = with lib.licenses; [ gpl3Only ]; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ pluiedev ]; + mainProgram = "clapgrep"; + }; +}