about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonah Langlieb <JZL@users.noreply.github.com>2024-05-18 23:08:10 -0400
committerJZL <jonahmail1@gmail.com>2024-05-29 13:39:58 -0400
commit5943b6d374dfa0f58b7a724457b742dee608146d (patch)
treed3726571e2d2913e319d51eebdcd6f8d947734f1
parent68ead29211bb9890f494af3a8b5643a831d9d4c4 (diff)
html2text: 1.3.2a -> 2.2.3
https://github.com/grobian/html2text/releases/tag/v2.2.3

As noted in old homepage https://www.mbayer.de/html2text/
> html2text is now maintained by Fabian Groffen.

Which points to github https://github.com/grobian/html2text  where it says
> the official home of html2text is at https://gitlab.com/grobian/html2text.
-rw-r--r--pkgs/tools/text/html2text/default.nix31
1 files changed, 10 insertions, 21 deletions
diff --git a/pkgs/tools/text/html2text/default.nix b/pkgs/tools/text/html2text/default.nix
index 4bcf02b5c8485..247ee8e814df7 100644
--- a/pkgs/tools/text/html2text/default.nix
+++ b/pkgs/tools/text/html2text/default.nix
@@ -1,35 +1,24 @@
-{ lib, stdenv, fetchurl }:
+{ lib, stdenv, fetchFromGitLab, autoreconfHook, libiconv }:
 
 stdenv.mkDerivation rec {
   pname = "html2text";
-  version = "1.3.2a";
+  version = "2.2.3";
 
-  src = fetchurl {
-    url = "http://www.mbayer.de/html2text/downloads/html2text-${version}.tar.gz";
-    sha256 = "000b39d5d910b867ff7e087177b470a1e26e2819920dcffd5991c33f6d480392";
+  src = fetchFromGitLab {
+    owner = "grobian";
+    repo = "html2text";
+    rev = "v${version}";
+    hash = "sha256-7Ch51nJ5BeRqs4PEIPnjCGk+Nm2ydgJQCtkcpihXun8=";
   };
 
-  preConfigure = ''
-    substituteInPlace configure \
-        --replace /bin/echo echo \
-        --replace CXX=unknown ':'
-  '' + lib.optionalString stdenv.cc.isClang ''
-    substituteInPlace HTMLParser.C \
-      --replace "register " ""
-  '';
+  nativeBuildInputs = [ autoreconfHook ];
 
-  # the --prefix has no effect
-  installPhase = ''
-    mkdir -p $out/bin $out/man/man{1,5}
-    cp html2text $out/bin
-    cp html2text.1.gz $out/man/man1
-    cp html2textrc.5.gz $out/man/man5
-  '';
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
 
   meta = {
     description = "Convert HTML to plain text";
     mainProgram = "html2text";
-    homepage = "http://www.mbayer.de/html2text/";
+    homepage = "https://gitlab.com/grobian/html2text";
     license = lib.licenses.gpl2Plus;
     platforms = lib.platforms.unix;
     maintainers = [ lib.maintainers.eikek ];