pending
This commit is contained in:
parent
57fa994768
commit
6416e62afe
3 changed files with 88 additions and 9 deletions
69
pystemmer.nix
Normal file
69
pystemmer.nix
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
lib,
|
||||
python,
|
||||
fetchFromGitHub,
|
||||
fetchpatch2,
|
||||
buildPythonPackage,
|
||||
cython,
|
||||
setuptools,
|
||||
pkgsHostHost,
|
||||
buildPackages,
|
||||
pkgsCross,
|
||||
pkgs,
|
||||
libstemmer,
|
||||
}: let
|
||||
#inherit (targetPackages) libstemmer;
|
||||
#libstemmer = builtins.trace "${pkgsHostHost.libstemmer} ${buildPackages.libstemmer} ${pkgs.libstemmer}" pkgsHostHost.libstemmer;#targetPackages.libstemmer;
|
||||
in buildPythonPackage rec {
|
||||
pname = "pystemmer";
|
||||
version = "2.2.0.1-fix";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "snowballstem";
|
||||
repo = "pystemmer";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-ngPx95ybgJmndpNPBwCa3BCNsozRg+dlEw+nhlIwI58=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(fetchpatch2 {
|
||||
# relax cython constraint
|
||||
name = "pystemmer-relax-cython.patch";
|
||||
url = "https://github.com/snowballstem/pystemmer/commit/d3d423dc877b4f49e0ab1776f7edaff37feb6799.patch";
|
||||
hash = "sha256-9K6gy/cLFPfW82XYHVVPXUbQhf8XyB4NUi4YqNtyWcw=";
|
||||
})
|
||||
];
|
||||
|
||||
build-system = [
|
||||
cython
|
||||
setuptools
|
||||
];
|
||||
|
||||
postConfigure = let a = ''
|
||||
export PYSTEMMER_SYSTEM_LIBSTEMMER="${lib.getDev libstemmer}/include"
|
||||
echo $PYSTEMMER_SYSTEM_LIBSTEMMER
|
||||
''; in builtins.trace a a;
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString [ "-I${lib.getDev libstemmer}/include" ];
|
||||
|
||||
NIX_CFLAGS_LINK = [ "-L${libstemmer}/lib" ];
|
||||
|
||||
pythonImportsCheck = [ "Stemmer" ];
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
${python.interpreter} runtests.py
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Snowball stemming algorithms, for information retrieval";
|
||||
downloadPage = "https://github.com/snowballstem/pystemmer";
|
||||
homepage = "http://snowball.tartarus.org/";
|
||||
license = with licenses; [
|
||||
bsd3
|
||||
mit
|
||||
];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue