hfst: init at 3.16.0

This commit is contained in:
Jussi Kuokkanen 2023-06-19 15:18:07 +03:00
parent 22f9b7b279
commit b02e3765e7
5 changed files with 198 additions and 3 deletions

View file

@ -0,0 +1,95 @@
{ lib
, stdenv
, autoconf
, automake
, autoreconfHook
, cg3
, fetchFromGitHub
, hfst
, hfst-ospell
, icu
, libtool
, libvoikko
, pkg-config
, python3
, python3Packages
, zip
}:
stdenv.mkDerivation (finalAttrs: {
pname = "omorfi";
version = "0.9.9";
src = fetchFromGitHub {
owner = "flammie";
repo = "omorfi";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-UoqdwNWCNOPX6u1YBlnXUcB/fmcvcy/HXbYciVrMBOY=";
};
# Fix for omorfi-hyphenate.sh file not found error
postInstall = ''
ln -s $out/share/omorfi/{omorfi.hyphenate-rules.hfst,omorfi.hyphenate.hfst}
'';
nativeBuildInputs = [
autoreconfHook
cg3
makeWrapper
pkg-config
python3
zip
python3.pkgs.wrapPython
];
>>>>>>> 2ea2d99a91e (hfst changes):pkgs/development/libraries/omorfi/default.nix
buildInputs = [
hfst
hfst-ospell
python3Packages.hfst-python
icu
];
nativeBuildInputs = [
autoconf
automake
autoreconfHook
cg3
libtool
pkg-config
python3
libvoikko
zip
];
propagatedBuildInputs = [
hfst
python3Packages.hfst
icu
];
# Enable all features
configureFlags = [
"--enable-labeled-segments"
"--enable-lemmatiser"
"--enable-segmenter"
"--enable-hyphenator"
];
# Fix for omorfi-hyphenate.sh file not found error
postInstall = ''
mv $out/share/omorfi/omorfi.hyphenate-rules.hfst $out/share/omorfi/omorfi.hyphenate.hfst
'';
src = fetchFromGitHub {
owner = "flammie";
repo = "omorfi";
rev = "refs/tags/v${version}";
hash = "sha256-UoqdwNWCNOPX6u1YBlnXUcB/fmcvcy/HXbYciVrMBOY=";
};
meta = with lib; {
description = "Analysis for Finnish text";
homepage = "https://github.com/flammie/omorfi";
license = licenses.gpl3;
maintainers = with maintainers; [ lurkki ];
};
})

View file

@ -0,0 +1,53 @@
{ lib
, autoreconfHook
, bison
, flex
, foma
, fetchFromGitHub
, gettext
, icu
, stdenv
, swig
, pkg-config
, zlib
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hfst";
version = "3.16.0";
src = fetchFromGitHub {
owner = "hfst";
repo = "hfst";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-2ST0s08Pcp+hTn7rUTgPE1QkH6PPWtiuFezXV3QW0kU=";
};
nativeBuildInputs = [
autoreconfHook
bison
flex
pkg-config
swig
];
buildInputs = [
foma
gettext
icu
zlib
];
configureFlags = [
"--enable-all-tools"
"--with-foma-upstream=true"
];
meta = with lib; {
description = "FST language processing library";
homepage = "https://github.com/hfst/hfst";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ lurkki ];
platforms = platforms.unix;
};
})

View file

@ -0,0 +1,45 @@
{ lib
, pkgs
, stdenv
, buildPythonPackage
, foma
, icu
, swig
}:
buildPythonPackage rec {
pname = "hfst";
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 ];
};
}

View file

@ -41286,9 +41286,9 @@ with pkgs;
libvoikko = callPackage ../development/libraries/libvoikko { };
hfst = callPackage ../development/libraries/hfst/hfst.nix { };
hfst = callPackage ../development/libraries/hfst { };
hfst-ospell = callPackage ../applications/misc/hfst-ospell/default.nix { };
hfst-ospell = callPackage ../applications/misc/hfst-ospell { };
omorfi = callPackage ../applications/misc/omorfi/omorfi.nix { };
omorfi = callPackage ../applications/misc/omorfi { };
}

View file

@ -4636,6 +4636,8 @@ self: super: with self; {
hexdump = callPackage ../development/python-modules/hexdump { };
hfst = callPackage ../development/python-modules/hfst { };
hg-commitsigs = callPackage ../development/python-modules/hg-commitsigs { };
hg-evolve = callPackage ../development/python-modules/hg-evolve { };