2022-09-30 11:47:45 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, perl, buildPackages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "libstemmer";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "2.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-09-30 11:47:45 +00:00
|
|
|
owner = "snowballstem";
|
|
|
|
repo = "snowball";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-qXrypwv/I+5npvGHGsHveijoui0ZnoGYhskCfLkewVE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'' + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
|
|
substituteInPlace GNUmakefile \
|
|
|
|
--replace './snowball' '${lib.getBin buildPackages.libstemmer}/bin/snowball'
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeTarget = "libstemmer.a";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
install -Dt $out/lib libstemmer.a
|
|
|
|
install -Dt $out/include include/libstemmer.h
|
|
|
|
install -Dt $out/bin {snowball,stemwords}
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Snowball Stemming Algorithms";
|
2022-09-30 11:47:45 +00:00
|
|
|
homepage = "https://snowballstem.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|