diff --git a/pkgs/development/python-modules/rarfile/default.nix b/pkgs/development/python-modules/rarfile/default.nix new file mode 100644 index 00000000000..7231da9d3d0 --- /dev/null +++ b/pkgs/development/python-modules/rarfile/default.nix @@ -0,0 +1,29 @@ +{ stdenv, buildPythonPackage, fetchFromGitHub, pytest, nose, unrar, glibcLocales }: + +buildPythonPackage rec { + name = "rarfile-${version}"; + version = "3.0"; + + src = fetchFromGitHub { + owner = "markokr"; + repo = "rarfile"; + rev = "rarfile_3_0"; + sha256 = "07yliz6p1bxzhipnrgz133gl8laic35gl4rqfay7f1vc384ch7sn"; + }; + buildInputs = [ pytest nose glibcLocales ]; + + prePatch = '' + substituteInPlace rarfile.py \ + --replace 'UNRAR_TOOL = "unrar"' "UNRAR_TOOL = \"${unrar}/bin/unrar\"" + ''; + LC_ALL = "en_US.UTF-8"; + checkPhase = '' + py.test test -k "not test_printdir" + ''; + + meta = with stdenv.lib; { + description = "RAR archive reader for Python"; + homepage = https://github.com/markokr/rarfile; + license = licenses.isc; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 96b5db7ee04..50587c0004c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2619,19 +2619,7 @@ in { }; - rarfile = self.buildPythonPackage rec { - name = "rarfile-2.6"; - - src = pkgs.fetchurl { - url = "mirror://pypi/r/rarfile/rarfile-2.6.tar.gz"; - sha256 = "326700c5450cfb367f612e918866ea27551bac02f4656f340003c88873fa1a56"; - }; - - meta = { - description = "rarfile - RAR archive reader for Python"; - homepage = https://github.com/markokr/rarfile; - }; - }; + rarfile = callPackage ../development/python-modules/rarfile {}; proboscis = buildPythonPackage rec { name = "proboscis-1.2.6.0";