From 68f6f4675efd351c8d3f24e6a74edbe0fd65e65d Mon Sep 17 00:00:00 2001 From: linsui <36977733+linsui@users.noreply.github.com> Date: Mon, 22 Dec 2025 19:34:44 +0800 Subject: [PATCH] slobdict: init at 1.0.0 --- pkgs/by-name/sl/slobdict/package.nix | 88 ++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 pkgs/by-name/sl/slobdict/package.nix diff --git a/pkgs/by-name/sl/slobdict/package.nix b/pkgs/by-name/sl/slobdict/package.nix new file mode 100644 index 000000000000..29a9d5a6b3c1 --- /dev/null +++ b/pkgs/by-name/sl/slobdict/package.nix @@ -0,0 +1,88 @@ +{ + lib, + blueprint-compiler, + meson, + ninja, + fetchFromGitHub, + python3Packages, + wrapGAppsHook4, + gobject-introspection, + pkg-config, + gtk4, + webkitgtk_6_0, + glib, + libadwaita, + libzim, +}: + +python3Packages.buildPythonApplication rec { + pname = "slobdict"; + version = "1.0.0"; + + pyproject = false; # built with meson + + src = fetchFromGitHub { + owner = "MuntashirAkon"; + repo = "SlobDict"; + tag = version; + hash = "sha256-V6EmEpxUMZUN9lHSNs4nZBZI2QNxUUWWODukm01lYxY="; + }; + + nativeBuildInputs = [ + blueprint-compiler + gobject-introspection + meson + ninja + pkg-config + wrapGAppsHook4 + ]; + + buildInputs = [ + gtk4 + glib + libadwaita + libzim + webkitgtk_6_0 + ]; + + dependencies = with python3Packages; [ + pygobject3 + pyglossary + + # Optional deps of pyglossary + pyyaml + beautifulsoup4 + biplist + # colorize-pinyin not packaged + html5lib + marisa-trie + mistune + polib + prompt-toolkit + pymorphy3 + # python-romkan-ng not packaged + xxhash + ]; + + # Prevent double wrapping, let the Python wrapper use the args in preFixup. + dontWrapGApps = true; + + postInstall = '' + chmod +x $out/bin/slobdict + ''; + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + strictDeps = true; + + meta = { + homepage = "https://github.com/MuntashirAkon/SlobDict"; + description = "Modern, lightweight GTK 4 dictionary app"; + mainProgram = "slobdict"; + maintainers = with lib.maintainers; [ linsui ]; + license = lib.licenses.agpl3Plus; + platforms = lib.platforms.linux; + }; +}