From ea912b53ca400a893e93f9f14024b081bee845b3 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 26 Oct 2018 09:30:06 -0400 Subject: [PATCH] pythonPackages.pyenchant: refactor move to python-modules --- .../python-modules/pyenchant/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 29 +-------------- 2 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 pkgs/development/python-modules/pyenchant/default.nix diff --git a/pkgs/development/python-modules/pyenchant/default.nix b/pkgs/development/python-modules/pyenchant/default.nix new file mode 100644 index 000000000000..f775612d90ff --- /dev/null +++ b/pkgs/development/python-modules/pyenchant/default.nix @@ -0,0 +1,36 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, pkgs +}: + +buildPythonPackage rec { + pname = "pyenchant"; + version = "1.6.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "25c9d2667d512f8fc4410465fdd2e868377ca07eb3d56e2b6e534a86281d64d3"; + }; + + propagatedBuildInputs = [ pkgs.enchant ]; + + patchPhase = let + path_hack_script = "s|LoadLibrary(e_path)|LoadLibrary('${pkgs.enchant}/lib/' + e_path)|"; + 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; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6b364f6fb91d..845dfdba59b3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3303,34 +3303,7 @@ in { pyelftools = callPackage ../development/python-modules/pyelftools { }; - pyenchant = buildPythonPackage rec { - name = "pyenchant-1.6.6"; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pyenchant/pyenchant-1.6.6.tar.gz"; - sha256 = "25c9d2667d512f8fc4410465fdd2e868377ca07eb3d56e2b6e534a86281d64d3"; - }; - - propagatedBuildInputs = [ pkgs.enchant ]; - - patchPhase = let - path_hack_script = "s|LoadLibrary(e_path)|LoadLibrary('${pkgs.enchant}/lib/' + e_path)|"; - 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 = { - description = "pyenchant: Python bindings for the Enchant spellchecker"; - homepage = https://pythonhosted.org/pyenchant/; - license = licenses.lgpl21; - }; - }; + pyenchant = callPackage ../development/python-modules/pyenchant { }; pyev = callPackage ../development/python-modules/pyev { };