From 195f48cb7884e22cfb70f1a4ad6bdfc18b990692 Mon Sep 17 00:00:00 2001 From: zendo Date: Wed, 5 Oct 2022 19:24:48 +0800 Subject: [PATCH 1/2] python3Packages.wn: init at 0.9.2 --- .../development/python-modules/wn/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/wn/default.nix diff --git a/pkgs/development/python-modules/wn/default.nix b/pkgs/development/python-modules/wn/default.nix new file mode 100644 index 000000000000..21f0ec0d08c8 --- /dev/null +++ b/pkgs/development/python-modules/wn/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, flit-core +, requests +, tomli +}: + +buildPythonPackage rec { + pname = "wn"; + version = "0.9.2"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-TghCKPKLxRTpvojmZi8tPGmU/D2W+weZl64PArAwDCE="; + }; + + nativeBuildInputs = [ flit-core ]; + + propagatedBuildInputs = [ + requests + tomli + ]; + + checkInputs = [ pytestCheckHook ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + pythonImportsCheck = [ "wn" ]; + + meta = with lib; { + description = "A modern, interlingual wordnet interface for Python"; + homepage = "https://github.com/goodmami/wn"; + license = licenses.mit; + maintainers = with maintainers; [ zendo ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4336b1767bc7..54a6fbb61860 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11844,6 +11844,8 @@ in { wled = callPackage ../development/python-modules/wled { }; + wn = callPackage ../development/python-modules/wn { }; + woob = callPackage ../development/python-modules/woob { }; woodblock = callPackage ../development/python-modules/woodblock { }; From 242949ca5f47129aa630a782de2e5f154d7e0b96 Mon Sep 17 00:00:00 2001 From: zendo Date: Wed, 5 Oct 2022 19:26:52 +0800 Subject: [PATCH 2/2] wordbook: init at unstable-2022-11-02 --- pkgs/applications/misc/wordbook/default.nix | 69 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 71 insertions(+) create mode 100644 pkgs/applications/misc/wordbook/default.nix diff --git a/pkgs/applications/misc/wordbook/default.nix b/pkgs/applications/misc/wordbook/default.nix new file mode 100644 index 000000000000..757fed5265f2 --- /dev/null +++ b/pkgs/applications/misc/wordbook/default.nix @@ -0,0 +1,69 @@ +{ lib +, fetchFromGitHub +, python3 +, meson +, ninja +, pkg-config +, glib +, gtk4 +, libadwaita +, librsvg +, espeak-ng +, gobject-introspection +, wrapGAppsHook4 +, appstream-glib +, desktop-file-utils +}: + +python3.pkgs.buildPythonApplication rec { + pname = "wordbook"; + version = "unstable-2022-11-02"; + format = "other"; + + src = fetchFromGitHub { + owner = "fushinari"; + repo = "Wordbook"; + rev = "2d79e9e9ef21ba4b54d0b46c764a1481a06f0f1b"; + hash = "sha256-ktusZEQ7m8P0kiH09r3XC6q9bQCWVCn543IMLKmULDo="; + }; + + nativeBuildInputs = [ + meson + ninja + pkg-config + wrapGAppsHook4 + appstream-glib + desktop-file-utils + gobject-introspection + ]; + + buildInputs = [ + glib + gtk4 + librsvg + libadwaita + ]; + + propagatedBuildInputs = with python3.pkgs; [ + pygobject3 + wn + ]; + + # prevent double wrapping + dontWrapGApps = true; + + preFixup = '' + makeWrapperArgs+=( + --prefix PATH ":" "${lib.makeBinPath [ espeak-ng ]}" + "''${gappsWrapperArgs[@]}" + ) + ''; + + meta = with lib; { + description = "Offline English-English dictionary application built for GNOME"; + homepage = "https://github.com/fushinari/Wordbook"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ zendo ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aff908337054..5c684801e1b2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32344,6 +32344,8 @@ with pkgs; cl-wordle = callPackage ../games/cl-wordle { }; + wordbook = callPackage ../applications/misc/wordbook { }; + wordnet = callPackage ../applications/misc/wordnet { inherit (darwin.apple_sdk.frameworks) Cocoa; };