about summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/elinks
diff options
context:
space:
mode:
authorIngo Blechschmidt <iblech@speicherleck.de>2020-06-16 11:04:10 +0200
committerIngo Blechschmidt <iblech@web.de>2020-06-29 00:35:29 +0200
commit71cfbba0724302a979e03044e5b0df18e2a2a282 (patch)
treea27b66fc58cbd9bb7e941192cf90341ab1b79da2 /pkgs/applications/networking/browsers/elinks
parent0f436ea35845b60ab0eadb3831150f4e1129fa75 (diff)
elinks: 0.12pre6 -> 0.13.2 (felinks fork)
Diffstat (limited to 'pkgs/applications/networking/browsers/elinks')
-rw-r--r--pkgs/applications/networking/browsers/elinks/debian-patches.nix34
-rw-r--r--pkgs/applications/networking/browsers/elinks/debian-patches.txt8
-rw-r--r--pkgs/applications/networking/browsers/elinks/default.nix34
-rw-r--r--pkgs/applications/networking/browsers/elinks/gc-init.patch17
-rw-r--r--pkgs/applications/networking/browsers/elinks/openssl-1.1.patch51
5 files changed, 62 insertions, 82 deletions
diff --git a/pkgs/applications/networking/browsers/elinks/debian-patches.nix b/pkgs/applications/networking/browsers/elinks/debian-patches.nix
new file mode 100644
index 0000000000000..07df14767aa64
--- /dev/null
+++ b/pkgs/applications/networking/browsers/elinks/debian-patches.nix
@@ -0,0 +1,34 @@
+# Generated by debian-patches.sh from debian-patches.txt
+let
+  prefix = "https://sources.debian.org/data/main/e/elinks/0.13.2-1/debian/patches";
+in
+[
+  {
+    url = "${prefix}/03_459467_ui.leds.enable_0.diff";
+    sha256 = "0l35lglmnvyzz3xyy18nksra14gsp7yc67rskbzmr61szg8b9jqr";
+  }
+  {
+    url = "${prefix}/04_436817_nostrip.diff";
+    sha256 = "0ixvxaba1ww375gpdh7r67srp3xsfb5vyz2sfv1pgj6mczwg8v24";
+  }
+  {
+    url = "${prefix}/07_617713_cache_control.diff";
+    sha256 = "0drn4r33ywvmihr0drsp2jwz7mlf5z5fv8ra7fpkdavx45xqaf15";
+  }
+  {
+    url = "${prefix}/10-reproducible-build.diff";
+    sha256 = "024yp3xsh0hw29l1wikfmk9j3mqval6pdr4xi7rzffrlaknh58h5";
+  }
+  {
+    url = "${prefix}/14_debug_disable_Werror.diff";
+    sha256 = "0s620r88ikfljflb5nd133cww2wc0i85ag8lzpvrsmg0q00hfmax";
+  }
+  {
+    url = "${prefix}/16_POST_BUFFER_SIZE.diff";
+    sha256 = "17vkvy0d0rabmgk8iqwgdsrgjn6dbb9cf6760qbz82zlb37s09nh";
+  }
+  {
+    url = "${prefix}/11-reproducible-build.diff";
+    sha256 = "1z17g9z68lh12fs6fkralfghh8bs1bs5mlq83d15l4bn3za3s0sl";
+  }
+]
diff --git a/pkgs/applications/networking/browsers/elinks/debian-patches.txt b/pkgs/applications/networking/browsers/elinks/debian-patches.txt
new file mode 100644
index 0000000000000..29efcf2d7a809
--- /dev/null
+++ b/pkgs/applications/networking/browsers/elinks/debian-patches.txt
@@ -0,0 +1,8 @@
+elinks/0.13.2-1
+03_459467_ui.leds.enable_0.diff
+04_436817_nostrip.diff
+07_617713_cache_control.diff
+10-reproducible-build.diff
+14_debug_disable_Werror.diff
+16_POST_BUFFER_SIZE.diff
+11-reproducible-build.diff
diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix
index 79cb5437b3cb6..ccdd591cdb17b 100644
--- a/pkgs/applications/networking/browsers/elinks/default.nix
+++ b/pkgs/applications/networking/browsers/elinks/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, ncurses, xlibsWrapper, bzip2, zlib, openssl
+{ stdenv, fetchurl, fetchpatch, ncurses, xlibsWrapper, bzip2, zlib, brotli, openssl, autoconf, automake, gettext, pkgconfig, libev
 , gpm
 , # Incompatible licenses, LGPLv3 - GPLv2
   enableGuile        ? false,                                         guile ? null
@@ -11,18 +11,15 @@ assert enableGuile -> guile != null;
 assert enablePython -> python != null;
 
 stdenv.mkDerivation rec {
-  pname = "elinks";
-  version = "0.12pre6";
+  pname = "elinks-0.13.2";
+  version = "0.13.2";
 
   src = fetchurl {
-    url = "http://elinks.or.cz/download/${pname}-${version}.tar.bz2";
-    sha256 = "1nnakbi01g7yd3zqwprchh5yp45br8086b0kbbpmnclabcvlcdiq";
+    url = "https://deb.debian.org/debian/pool/main/e/elinks/elinks_${version}.orig.tar.gz";
+    sha256 = "0xkpqnqy0x8sizx4snca0pw3q98gkhnw5a05yf144j1x1y2nb14c";
   };
 
-  patches = [
-    ./gc-init.patch
-    ./openssl-1.1.patch
-  ];
+  patches = map fetchurl (import ./debian-patches.nix);
 
   postPatch = (stdenv.lib.optional stdenv.isDarwin) ''
     patch -p0 < ${fetchpatch {
@@ -31,12 +28,15 @@ stdenv.mkDerivation rec {
     }}
   '';
 
-  buildInputs = [ ncurses xlibsWrapper bzip2 zlib openssl spidermonkey ]
+  buildInputs = [ ncurses xlibsWrapper bzip2 zlib brotli openssl libev ]
     ++ stdenv.lib.optional stdenv.isLinux gpm
     ++ stdenv.lib.optional enableGuile guile
     ++ stdenv.lib.optional enablePython python
     ++ stdenv.lib.optional enablePerl perl
+    ++ stdenv.lib.optional enableSpidermonkey spidermonkey
     ;
+  
+  nativeBuildInputs = [ autoconf automake gettext pkgconfig ];
 
   configureFlags = [
     "--enable-finger"
@@ -45,18 +45,24 @@ stdenv.mkDerivation rec {
     "--enable-cgi"
     "--enable-bittorrent"
     "--enable-nntp"
-    "--with-openssl=${openssl.dev}"
-    "--with-bzip2=${bzip2.dev}"
+    "--enable-256-colors"
+    "--with-libev"
   ] ++ stdenv.lib.optional enableGuile        "--with-guile"
     ++ stdenv.lib.optional enablePython       "--with-python"
     ++ stdenv.lib.optional enablePerl         "--with-perl"
     ++ stdenv.lib.optional enableSpidermonkey "--with-spidermonkey=${spidermonkey}"
     ;
+  
+  preConfigure = ''
+    patchShebangs ./autogen.sh
+    ./autogen.sh
+  '';
 
   meta = with stdenv.lib; {
-    description = "Full-featured text-mode web browser";
-    homepage = "http://elinks.or.cz";
+    description = "Full-featured text-mode web browser (package based on the fork felinks)";
+    homepage = "https://github.com/rkd77/felinks";
     license = licenses.gpl2;
     platforms = with platforms; linux ++ darwin;
+    maintainers = with maintainers; [ iblech ];
   };
 }
diff --git a/pkgs/applications/networking/browsers/elinks/gc-init.patch b/pkgs/applications/networking/browsers/elinks/gc-init.patch
deleted file mode 100644
index de06f563d6e6a..0000000000000
--- a/pkgs/applications/networking/browsers/elinks/gc-init.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Fix libgc initialization in the presence of Guile 2.0.
-
---- elinks-0.12pre5/src/main/main.c	2009-07-07 14:23:17.000000000 +0200
-+++ elinks-0.12pre5/src/main/main.c	2011-04-28 23:20:15.000000000 +0200
-@@ -339,6 +339,11 @@ int
- main(int argc, char *argv[])
- {
- #ifdef CONFIG_GC
-+	/* Guile 2.x uses libgc too and it initializes it this way, so we
-+	 * must make sure to initialize it the same way, or it will just
-+	 * segfault.  */
-+	GC_all_interior_pointers = 0;
-+
- 	GC_INIT();
- 	GC_set_warn_proc(gc_warning);
- #endif
-
diff --git a/pkgs/applications/networking/browsers/elinks/openssl-1.1.patch b/pkgs/applications/networking/browsers/elinks/openssl-1.1.patch
deleted file mode 100644
index 22792b6c0790a..0000000000000
--- a/pkgs/applications/networking/browsers/elinks/openssl-1.1.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/src/network/ssl/socket.c b/src/network/ssl/socket.c
-index 45b4b4a8..0385a431 100644
---- a/src/network/ssl/socket.c
-+++ b/src/network/ssl/socket.c
-@@ -67,7 +67,9 @@ static void
- ssl_set_no_tls(struct socket *socket)
- {
- #ifdef CONFIG_OPENSSL
--	((ssl_t *) socket->ssl)->options |= SSL_OP_NO_TLSv1;
-+#ifdef SSL_OP_NO_TLSv1
-+	SSL_set_options((ssl_t *)socket->ssl, SSL_OP_NO_TLSv1);
-+#endif
- #elif defined(CONFIG_GNUTLS)
- 	{
- 		/* GnuTLS does not support SSLv2 because it is "insecure".
-@@ -145,9 +147,11 @@ ssl_connect(struct socket *socket)
- 		}
- 
- 		if (client_cert) {
--			SSL_CTX *ctx = ((SSL *) socket->ssl)->ctx;
-+			SSL_CTX *ctx = SSL_get_SSL_CTX((SSL *) socket->ssl);
- 
--			SSL_CTX_use_certificate_chain_file(ctx, client_cert);
-+			SSL_CTX_use_certificate_chain_file(
-+					(SSL *) socket->ssl,
-+					client_cert);
- 			SSL_CTX_use_PrivateKey_file(ctx, client_cert,
- 						    SSL_FILETYPE_PEM);
- 		}
-diff --git a/src/network/ssl/ssl.c b/src/network/ssl/ssl.c
-index c008121d..c06a80a7 100644
---- a/src/network/ssl/ssl.c
-+++ b/src/network/ssl/ssl.c
-@@ -50,11 +50,16 @@ init_openssl(struct module *module)
- 	 * cannot initialize the PRNG and so every attempt to use SSL fails.
- 	 * It's actually an OpenSSL FAQ, and according to them, it's up to the
- 	 * application coders to seed the RNG. -- William Yodlowsky */
--	if (RAND_egd(RAND_file_name(f_randfile, sizeof(f_randfile))) < 0) {
-+	RAND_file_name(f_randfile, sizeof(f_randfile));
-+#ifdef HAVE_RAND_EGD
-+	if (RAND_egd(f_randfile) < 0) {
- 		/* Not an EGD, so read and write to it */
-+#endif
- 		if (RAND_load_file(f_randfile, -1))
- 			RAND_write_file(f_randfile);
-+#ifdef HAVE_RAND_EGD
- 	}
-+#endif
- 
- 	SSLeay_add_ssl_algorithms();
- 	context = SSL_CTX_new(SSLv23_client_method());