From 1ea8bf15cb6178b3d402f9a918ccaa7d6e2bc347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 25 Nov 2022 13:06:44 -0800 Subject: [PATCH 1/3] python310Packages.marisa: init at 0.2.6 --- .../python-modules/marisa/default.nix | 32 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 +++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/python-modules/marisa/default.nix diff --git a/pkgs/development/python-modules/marisa/default.nix b/pkgs/development/python-modules/marisa/default.nix new file mode 100644 index 000000000000..21a457b5b34e --- /dev/null +++ b/pkgs/development/python-modules/marisa/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, marisa +, swig +}: + +buildPythonPackage rec { + pname = "marisa"; + inherit (marisa) src version; + + nativeBuildInputs = [ swig ]; + + buildInputs = [ marisa ]; + + preBuild = '' + make -C bindings swig-python + + cd bindings/python + ''; + + # upstream has no tests + doCheck = false; + + pythonImportsCheck = [ "marisa" ]; + + meta = { + description = "Python bindings for marisa"; + homepage = "https://github.com/s-yata/marisa-trie"; + license = with lib.licenses; [ bsd2 lgpl21Plus ]; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5dcbcdf5abb3..98dd267fa44f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5535,6 +5535,10 @@ self: super: with self; { mariadb = callPackage ../development/python-modules/mariadb { }; + marisa = callPackage ../development/python-modules/marisa { + inherit (pkgs) marisa; + }; + marisa-trie = callPackage ../development/python-modules/marisa-trie { }; markdown2 = callPackage ../development/python-modules/markdown2 { }; From 34465f99eee4b5ce9f9c2ee690403d52750b6940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 25 Nov 2022 13:08:03 -0800 Subject: [PATCH 2/3] libkkc-data: build using python3 --- pkgs/data/misc/libkkc-data/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/data/misc/libkkc-data/default.nix b/pkgs/data/misc/libkkc-data/default.nix index 7fcd2fbf516f..516dd61c60f3 100644 --- a/pkgs/data/misc/libkkc-data/default.nix +++ b/pkgs/data/misc/libkkc-data/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, python2, libkkc }: +{ lib, stdenv, fetchurl, fetchpatch, python3, libkkc }: stdenv.mkDerivation rec { pname = "libkkc-data"; @@ -9,7 +9,16 @@ stdenv.mkDerivation rec { sha256 = "16avb50jasq2f1n9xyziky39dhlnlad0991pisk3s11hl1aqfrwy"; }; - nativeBuildInputs = [ python2.pkgs.marisa ]; + patches = [ + (fetchpatch { + name = "build-python3.patch"; + url = "https://github.com/ueno/libkkc/commit/ba1c1bd3eb86d887fc3689c3142732658071b5f7.patch"; + relative = "data/templates/libkkc-data"; + hash = "sha256-q4zUclJtDQ1E5v2PW00zRZz6GXllLUcp2h3tugufrRU="; + }) + ]; + + nativeBuildInputs = [ python3.pkgs.marisa ]; strictDeps = true; From d568d9f9366d33067eb9e9d5569a285cd4d23733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 25 Nov 2022 13:08:15 -0800 Subject: [PATCH 3/3] libkkc: build using python3 --- pkgs/tools/inputmethods/libkkc/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/inputmethods/libkkc/default.nix b/pkgs/tools/inputmethods/libkkc/default.nix index 0252efa3cdaa..06bc775689f2 100644 --- a/pkgs/tools/inputmethods/libkkc/default.nix +++ b/pkgs/tools/inputmethods/libkkc/default.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, fetchurl -, vala, gobject-introspection, intltool, python2Packages, glib +{ lib, stdenv, fetchurl, fetchpatch +, vala, gobject-introspection, intltool, python3, glib , pkg-config , libgee, json-glib, marisa, libkkc-data }: @@ -13,9 +13,17 @@ stdenv.mkDerivation rec { sha256 = "89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef"; }; + patches = [ + (fetchpatch { + name = "build-python3.patch"; + url = "https://github.com/ueno/libkkc/commit/ba1c1bd3eb86d887fc3689c3142732658071b5f7.patch"; + hash = "sha256-4IVpcJJFrxmxJGNiRHteleAa6trOwbvMHRTE/qyjOPY="; + }) + ]; + nativeBuildInputs = [ vala gobject-introspection - python2Packages.python python2Packages.marisa + python3 python3.pkgs.marisa intltool glib pkg-config ];