On Thu, Sep 15, 2016 at 12:36:20AM +0200, Frederic Cambus wrote:

> Here is a patch to remove the bzip2 dependency from Lynx. We were
> previously linking against bzlib so the library would be used instead
> of the bzip2 binary, in order to unpack bzip2 compressed HTML.
> 
> We now prevent lynx from appending 'bzip2' in the 'Accept-Encoding'
> header instead.
> 
> Here are a few sites to test the patch against:
> 
> http://www.lighttpd.net
> https://www.faimaison.net
> 
> Comments? OK?

Here is an improved patch using suggestions provided by sthen@. This
allows disabling bzip2 at the configure level which is much cleaner,
cover more #ifdefs within the program, and does not require any 
additional patches.

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/lynx/Makefile,v
retrieving revision 1.29
diff -u -p -r1.29 Makefile
--- Makefile    22 Sep 2016 12:57:18 -0000      1.29
+++ Makefile    23 Sep 2016 15:17:42 -0000
@@ -5,7 +5,7 @@ PL =            9
 COMMENT =      text web browser
 DISTNAME =     lynx${V}dev.${PL}
 PKGNAME =      lynx-${V}pl${PL}
-REVISION =     1
+REVISION =     2
 EXTRACT_SUFX = .tar.bz2
 CATEGORIES =   www net
 
@@ -17,13 +17,11 @@ MAINTAINER =        Frederic Cambus <fcambus@op
 PERMIT_PACKAGE_CDROM = Yes
 
 # uses pledge()
-WANTLIB += bz2 c crypto ncurses ssl z
+WANTLIB +=     c crypto ncurses ssl z
 
 MASTER_SITES = http://invisible-mirror.net/archives/lynx/tarballs/ \
                ftp://invisible-island.net/lynx/tarballs/
 
-LIB_DEPENDS =  archivers/bzip2
-
 CONFIGURE_STYLE =      gnu
 CONFIGURE_ARGS =       --datarootdir="${PREFIX}/share/doc/lynx" \
                        --disable-idna \
@@ -36,10 +34,13 @@ CONFIGURE_ARGS =    --datarootdir="${PREFIX
                        --enable-widec \
                        --with-ssl=/usr \
                        --with-zlib \
-                       --with-bzlib
+                       --without-bzlib
 
 # This disables most calls to getpw*(3) so we can avoid pledge "getpw".
-CONFIGURE_ENV =        CFLAGS="-DNOUSERS"
+CONFIGURE_ENV +=       CFLAGS="-DNOUSERS"
+
+# Prevent accepting bzip2 compressed HTML to avoid spawning processes.
+CONFIGURE_ENV +=       ac_cv_path_BZIP2=none
 
 MAKE_FILE =    makefile
 

Reply via email to