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