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