2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, pkgs
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, foma
|
|
|
|
, icu
|
|
|
|
, swig
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hfst";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2023-08-04 22:07:22 +00:00
|
|
|
inherit (pkgs.hfst) version src;
|
|
|
|
|
|
|
|
sourceRoot = "${src.name}/python";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# omorfi-python looks for 'hfst' Python package
|
|
|
|
sed -i 's/libhfst_swig/hfst/' setup.py;
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
swig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
icu
|
|
|
|
pkgs.hfst
|
|
|
|
];
|
|
|
|
|
|
|
|
setupPyBuildFlags = [
|
|
|
|
"--inplace"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Find foma in Darwin tests
|
|
|
|
preCheck = lib.optionalString stdenv.isDarwin ''
|
|
|
|
export DYLD_LIBRARY_PATH="${foma}/lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for HFST";
|
|
|
|
homepage = "https://github.com/hfst/hfst";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ lurkki ];
|
|
|
|
};
|
|
|
|
}
|