2018-10-26 14:30:06 +01:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pkgs
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyenchant";
|
2018-11-04 10:35:11 +00:00
|
|
|
version = "2.0.0";
|
2018-10-26 14:30:06 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-11-04 10:35:11 +00:00
|
|
|
sha256 = "fc31cda72ace001da8fe5d42f11c26e514a91fa8c70468739216ddd8de64e2a0";
|
2018-10-26 14:30:06 +01:00
|
|
|
};
|
|
|
|
|
2019-04-28 00:36:52 +01:00
|
|
|
propagatedBuildInputs = [ pkgs.enchant1 ];
|
2018-10-26 14:30:06 +01:00
|
|
|
|
|
|
|
patchPhase = let
|
2019-04-28 00:36:52 +01:00
|
|
|
path_hack_script = "s|LoadLibrary(e_path)|LoadLibrary('${pkgs.enchant1}/lib/' + e_path)|";
|
2018-10-26 14:30:06 +01:00
|
|
|
in ''
|
|
|
|
sed -i "${path_hack_script}" enchant/_enchant.py
|
|
|
|
|
|
|
|
# They hardcode a bad path for Darwin in their library search code
|
|
|
|
substituteInPlace enchant/_enchant.py --replace '/opt/local/lib/' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
# dictionaries needed for tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "pyenchant: Python bindings for the Enchant spellchecker";
|
|
|
|
homepage = https://pythonhosted.org/pyenchant/;
|
|
|
|
license = licenses.lgpl21;
|
2019-04-28 00:31:20 +01:00
|
|
|
badPlatforms = [ "x86_64-darwin" ];
|
2018-10-26 14:30:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|