Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.03 42 lines 1.2 kB view raw
1{ stdenv 2, buildPythonPackage 3, fetchPypi 4, enchant2 5}: 6 7buildPythonPackage rec { 8 pname = "pyenchant"; 9 version = "2.0.0"; 10 11 src = fetchPypi { 12 inherit pname version; 13 sha256 = "fc31cda72ace001da8fe5d42f11c26e514a91fa8c70468739216ddd8de64e2a0"; 14 }; 15 16 propagatedBuildInputs = [ enchant2 ]; 17 18 postPatch = let 19 libext = stdenv.hostPlatform.extensions.sharedLibrary; 20 in '' 21 # Use the $PYENCHANT_LIBRARY_PATH envvar lookup line to hard-code the 22 # location of the nix enchant-2 library into _enchant.py. 23 # 24 # Also, they hardcode a bad path for Darwin in their library search code; 25 # This code should never be hit, but in case it does, we don't want to have 26 # it "accidentally" work by pulling something from /opt. 27 substituteInPlace enchant/_enchant.py \ 28 --replace 'os.environ.get("PYENCHANT_LIBRARY_PATH")' \ 29 "'${enchant2}/lib/libenchant-2${libext}'" \ 30 --replace '/opt/local/lib/' "" 31 ''; 32 33 # dictionaries needed for tests 34 doCheck = false; 35 36 meta = with stdenv.lib; { 37 description = "pyenchant: Python bindings for the Enchant spellchecker"; 38 homepage = https://github.com/pyenchant/pyenchant; 39 license = licenses.lgpl21; 40 }; 41 42}