From 1e16873f68d851872e60a108648cab0c4d4e9a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 26 May 2025 19:36:50 -0700 Subject: [PATCH 1/4] marisa: 0.2.7 -> 0.3.0 Diff: https://github.com/s-yata/marisa-trie/compare/v0.2.7...v0.3.0 Changelog: https://github.com/s-yata/marisa-trie/releases/tag/v0.3.0 --- pkgs/by-name/ma/marisa/package.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ma/marisa/package.nix b/pkgs/by-name/ma/marisa/package.nix index 4f754de872b5..027f3220b89d 100644 --- a/pkgs/by-name/ma/marisa/package.nix +++ b/pkgs/by-name/ma/marisa/package.nix @@ -2,26 +2,27 @@ lib, stdenv, fetchFromGitHub, - autoreconfHook, + cmake, }: stdenv.mkDerivation rec { pname = "marisa"; - version = "0.2.7"; + version = "0.3.0"; src = fetchFromGitHub { owner = "s-yata"; repo = "marisa-trie"; - rev = "v${version}"; - sha256 = "sha256-+OGtDbwl7ar3i65POkTGyC4AYkOT4YuASfdt5FGJ8yM="; + tag = "v${version}"; + hash = "sha256-XOXX0NuU+erL/KDAZgBeX+LKO9uSEOyP1/VuMDE5pi0="; }; enableParallelBuilding = true; - nativeBuildInputs = [ autoreconfHook ]; + nativeBuildInputs = [ cmake ]; meta = with lib; { homepage = "https://github.com/s-yata/marisa-trie"; + changelog = "https://github.com/s-yata/marisa-trie/releases/tag/${src.tag}"; description = "Static and space-efficient trie data structure library"; license = licenses.bsd3; maintainers = with maintainers; [ sifmelcara ]; From 31b5e605291373dfd5491b98ef9a305f07116766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 26 May 2025 20:08:25 -0700 Subject: [PATCH 2/4] python3Packages.marisa-trie: unvendor marisa --- .../python-modules/marisa-trie/default.nix | 17 +++++++---- .../marisa-trie/unvendor-marisa.patch | 30 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++- 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/python-modules/marisa-trie/unvendor-marisa.patch diff --git a/pkgs/development/python-modules/marisa-trie/default.nix b/pkgs/development/python-modules/marisa-trie/default.nix index 43fdeb62c572..df7746784847 100644 --- a/pkgs/development/python-modules/marisa-trie/default.nix +++ b/pkgs/development/python-modules/marisa-trie/default.nix @@ -2,6 +2,8 @@ lib, buildPythonPackage, fetchPypi, + replaceVars, + marisa-cpp, cython, setuptools, pytestCheckHook, @@ -23,22 +25,27 @@ buildPythonPackage rec { hash = "sha256-OifECOKu/APg8dJbL/KvuFqsNWj2+iripTtXouh84p0="; }; + patches = [ + (replaceVars ./unvendor-marisa.patch { + marisa = lib.getDev marisa-cpp; + }) + ]; + build-system = [ cython setuptools ]; + buildInputs = [ + marisa-cpp + ]; + nativeCheckInputs = [ pytestCheckHook readme-renderer hypothesis ]; - postPatch = '' - substituteInPlace setup.py \ - --replace "hypothesis==" "hypothesis>=" - ''; - preBuild = '' ./update_cpp.sh ''; diff --git a/pkgs/development/python-modules/marisa-trie/unvendor-marisa.patch b/pkgs/development/python-modules/marisa-trie/unvendor-marisa.patch new file mode 100644 index 000000000000..26ac8156a06b --- /dev/null +++ b/pkgs/development/python-modules/marisa-trie/unvendor-marisa.patch @@ -0,0 +1,30 @@ +diff --git a/setup.py b/setup.py +index c0c5c03..6373a2a 100755 +--- a/setup.py ++++ b/setup.py +@@ -71,15 +71,6 @@ setup( + license=LICENSE, + url="https://github.com/pytries/marisa-trie", + classifiers=CLASSIFIERS, +- libraries=[ +- ( +- "libmarisa-trie", +- { +- "sources": MARISA_FILES, +- "include_dirs": [MARISA_SOURCE_DIR, MARISA_INCLUDE_DIR], +- }, +- ) +- ], + ext_modules=[ + Extension( + "marisa_trie", +@@ -94,7 +85,8 @@ setup( + "src/std_iostream.cpp", + "src/trie.cpp", + ], +- include_dirs=[MARISA_INCLUDE_DIR], ++ include_dirs=["@marisa@/include"], ++ libraries=["marisa"], + ) + ], + python_requires=">=3.8", diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index db00c2c12939..d4d60bb0f41f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8539,7 +8539,9 @@ self: super: with self; { marisa = callPackage ../development/python-modules/marisa { inherit (pkgs) marisa; }; - marisa-trie = callPackage ../development/python-modules/marisa-trie { }; + marisa-trie = callPackage ../development/python-modules/marisa-trie { + marisa-cpp = pkgs.marisa; + }; markdown = callPackage ../development/python-modules/markdown { }; From da41306556e299aadbe88202196ae8c04cdfd073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 26 May 2025 20:15:14 -0700 Subject: [PATCH 3/4] python3Packages.marisa-trie: fetch from GitHub --- .../python-modules/marisa-trie/default.nix | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/pkgs/development/python-modules/marisa-trie/default.nix b/pkgs/development/python-modules/marisa-trie/default.nix index df7746784847..c7a9c123b044 100644 --- a/pkgs/development/python-modules/marisa-trie/default.nix +++ b/pkgs/development/python-modules/marisa-trie/default.nix @@ -1,15 +1,13 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, replaceVars, marisa-cpp, cython, setuptools, pytestCheckHook, hypothesis, - readme-renderer, - pythonOlder, }: buildPythonPackage rec { @@ -17,12 +15,11 @@ buildPythonPackage rec { version = "1.2.1"; pyproject = true; - disabled = pythonOlder "3.7"; - - src = fetchPypi { - pname = "marisa_trie"; - inherit version; - hash = "sha256-OifECOKu/APg8dJbL/KvuFqsNWj2+iripTtXouh84p0="; + src = fetchFromGitHub { + owner = "pytries"; + repo = "marisa-trie"; + tag = version; + hash = "sha256-aWfm13nrASAaD+bcMpv85emXnCFyVtZTdhl79yJuOss="; }; patches = [ @@ -42,7 +39,6 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - readme-renderer hypothesis ]; @@ -55,15 +51,6 @@ buildPythonPackage rec { "tests/test_packaging.py" ]; - disabledTests = [ - # Pins hypothesis==2.0.0 from 2016/01 which complains about - # hypothesis.errors.FailedHealthCheck: tests/test_trie.py::[...] uses - # the 'tmpdir' fixture, which is reset between function calls but not - # between test cases generated by `@given(...)`. - "test_saveload" - "test_mmap" - ]; - pythonImportsCheck = [ "marisa_trie" ]; meta = with lib; { @@ -73,7 +60,7 @@ buildPythonPackage rec { This package provides alternative Cython-based pip-installable Python bindings. ''; homepage = "https://github.com/kmike/marisa-trie"; - changelog = "https://github.com/pytries/marisa-trie/blob/${version}/CHANGES.rst"; + changelog = "https://github.com/pytries/marisa-trie/blob/${src.tag}/CHANGES.rst"; license = licenses.mit; }; } From 374e88c2bc1b68ef7e0deeba07718eea8db10981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 29 May 2025 10:41:43 -0700 Subject: [PATCH 4/4] libkkc: mark broken --- pkgs/by-name/li/libkkc/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/li/libkkc/package.nix b/pkgs/by-name/li/libkkc/package.nix index a329b39739de..5184abc5333c 100644 --- a/pkgs/by-name/li/libkkc/package.nix +++ b/pkgs/by-name/li/libkkc/package.nix @@ -58,6 +58,7 @@ stdenv.mkDerivation rec { ''; meta = with lib; { + broken = true; description = "Japanese Kana Kanji conversion input method library"; homepage = "https://github.com/ueno/libkkc"; license = licenses.gpl3Plus;