1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 fetchpatch, 6 argostranslate, 7 beautifulsoup4, 8}: 9 10buildPythonPackage rec { 11 pname = "translatehtml"; 12 version = "1.5.2"; 13 14 format = "setuptools"; 15 16 src = fetchPypi { 17 inherit pname version; 18 sha256 = "6b30ceb8b6f174917e2660caf2d2ccbaa71d8d24c815316edf56b061d678820d"; 19 }; 20 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 ]; 28 29 propagatedBuildInputs = [ 30 argostranslate 31 beautifulsoup4 32 ]; 33 34 postPatch = '' 35 ln -s */requires.txt requirements.txt 36 37 substituteInPlace requirements.txt \ 38 --replace "==" ">=" 39 ''; 40 41 # required for import check to work (argostranslate) 42 env.HOME = "/tmp"; 43 44 pythonImportsCheck = [ "translatehtml" ]; 45 46 doCheck = false; # no tests 47 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 }; 54}