Merge pull request #202915 from dotlambda/libkkc-python3

This commit is contained in:
Martin Weinelt 2022-11-26 14:01:24 +01:00 committed by GitHub
commit 0890509525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 5 deletions

View File

@ -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;

View File

@ -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 ];
};
}

View File

@ -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
];

View File

@ -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 { };