writers: add writeGuile[Bin] (#364531)
[NixPkgs.git] / pkgs / development / python-modules / translatehtml / default.nix
blobda93e4d8484bba7ec4657480ed859ba2c95d9412
2   lib,
3   buildPythonPackage,
4   fetchPypi,
5   fetchpatch,
6   argostranslate,
7   beautifulsoup4,
8 }:
10 buildPythonPackage rec {
11   pname = "translatehtml";
12   version = "1.5.2";
14   format = "setuptools";
16   src = fetchPypi {
17     inherit pname version;
18     sha256 = "6b30ceb8b6f174917e2660caf2d2ccbaa71d8d24c815316edf56b061d678820d";
19   };
21   patches = [
22     # https://github.com/argosopentech/translate-html/pull/15
23     (fetchpatch {
24       url = "https://github.com/argosopentech/translate-html/commit/b1c2d210ec1b5fcd0eb79f578bdb5d3ed5c9963a.patch";
25       hash = "sha256-U65vVuRodMS32Aw6PZlLwaCos51P5B88n5hDgJNMZXU=";
26     })
27   ];
29   propagatedBuildInputs = [
30     argostranslate
31     beautifulsoup4
32   ];
34   postPatch = ''
35     ln -s */requires.txt requirements.txt
37     substituteInPlace requirements.txt  \
38       --replace "==" ">="
39   '';
41   # required for import check to work (argostranslate)
42   env.HOME = "/tmp";
44   pythonImportsCheck = [ "translatehtml" ];
46   doCheck = false; # no tests
48   meta = with lib; {
49     description = "Translate HTML using Beautiful Soup and Argos Translate";
50     homepage = "https://www.argosopentech.com";
51     license = licenses.mit;
52     maintainers = with maintainers; [ misuzu ];
53   };