depot/third_party/nixpkgs/pkgs/development/python-modules/hfst/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

43 lines
799 B
Nix

{
lib,
pkgs,
stdenv,
buildPythonPackage,
foma,
icu,
swig,
}:
buildPythonPackage rec {
pname = "hfst";
format = "setuptools";
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.hostPlatform.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 ];
};
}