nixpkgs/pkgs/development/libraries/libstemmer/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.0 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, perl, buildPackages }:
2018-01-28 03:35:14 +00:00
stdenv.mkDerivation rec {
pname = "libstemmer";
version = "2.2.0";
2018-01-28 03:35:14 +00:00
src = fetchFromGitHub {
owner = "snowballstem";
repo = "snowball";
rev = "v${version}";
sha256 = "sha256-qXrypwv/I+5npvGHGsHveijoui0ZnoGYhskCfLkewVE=";
2018-01-28 03:35:14 +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
'';
2018-01-28 03:35:14 +00:00
meta = with lib; {
description = "Snowball Stemming Algorithms";
homepage = "https://snowballstem.org/";
2018-01-28 03:35:14 +00:00
license = licenses.bsd3;
maintainers = with maintainers; [ fpletz ];
platforms = platforms.all;
};
}