2006-04-28 20:02:52 +01:00
|
|
|
{ stdenv, fetchurl
|
2015-08-18 21:37:49 +01:00
|
|
|
, ncurses, boehmgc, gettext, zlib
|
|
|
|
, sslSupport ? true, openssl ? null
|
|
|
|
, graphicsSupport ? true, imlib2 ? null
|
|
|
|
, x11Support ? graphicsSupport, libX11 ? null
|
2015-12-06 20:40:38 +00:00
|
|
|
, mouseSupport ? !stdenv.isDarwin, gpm-ncurses ? null
|
2005-09-14 17:23:02 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert sslSupport -> openssl != null;
|
2015-08-18 21:37:49 +01:00
|
|
|
assert graphicsSupport -> imlib2 != null;
|
|
|
|
assert x11Support -> graphicsSupport && libX11 != null;
|
2015-09-14 16:46:48 +01:00
|
|
|
assert mouseSupport -> gpm-ncurses != null;
|
2005-09-14 17:23:02 +01:00
|
|
|
|
2015-08-18 21:37:49 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2011-04-30 10:20:59 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "w3m-0.5.3";
|
2008-11-14 11:16:54 +00:00
|
|
|
|
2005-09-14 17:23:02 +01:00
|
|
|
src = fetchurl {
|
2011-04-30 10:20:59 +01:00
|
|
|
url = "mirror://sourceforge/w3m/${name}.tar.gz";
|
|
|
|
sha256 = "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579";
|
2005-09-14 17:23:02 +01:00
|
|
|
};
|
2008-11-14 11:16:54 +00:00
|
|
|
|
2015-11-17 10:20:33 +00:00
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lsocket -lnsl";
|
2013-12-21 12:48:11 +00:00
|
|
|
|
2015-11-26 12:49:01 +00:00
|
|
|
patches = [ ./glibc214.patch ./RAND_egd.libressl.patch ]
|
2012-10-16 19:33:08 +01:00
|
|
|
# Patch for the newer unstable boehm-gc 7.2alpha. Not all platforms use that
|
|
|
|
# alpha. At the time of writing this, boehm-gc-7.1 is the last stable.
|
2015-08-18 21:37:49 +01:00
|
|
|
++ optional (boehmgc.name != "boehm-gc-7.1") [ ./newgc.patch ]
|
|
|
|
++ optional stdenv.isCygwin ./cygwin.patch
|
|
|
|
# for frame buffer only version
|
|
|
|
++ optional (graphicsSupport && !x11Support) [ ./no-x11.patch ];
|
2010-08-21 18:07:03 +01:00
|
|
|
|
2008-11-14 11:16:54 +00:00
|
|
|
buildInputs = [ncurses boehmgc gettext zlib]
|
2015-08-18 21:37:49 +01:00
|
|
|
++ optional sslSupport openssl
|
|
|
|
++ optional mouseSupport gpm-ncurses
|
|
|
|
++ optional graphicsSupport imlib2
|
|
|
|
++ optional x11Support libX11;
|
2008-11-14 11:16:54 +00:00
|
|
|
|
2012-09-05 01:55:35 +01:00
|
|
|
configureFlags = "--with-ssl=${openssl} --with-gc=${boehmgc}"
|
2015-08-18 21:37:49 +01:00
|
|
|
+ optionalString graphicsSupport " --enable-image=${optionalString x11Support "x11,"}fb";
|
2008-11-14 11:16:54 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
2012-07-31 22:34:52 +01:00
|
|
|
substituteInPlace ./configure --replace "/lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib /lib64 /usr/lib64" /no-such-path
|
2008-11-14 11:16:54 +00:00
|
|
|
substituteInPlace ./configure --replace /usr /no-such-path
|
|
|
|
'';
|
2008-01-30 19:49:42 +00:00
|
|
|
|
2013-01-17 13:34:58 +00:00
|
|
|
enableParallelBuilding = false;
|
2012-10-16 19:33:08 +01:00
|
|
|
|
2015-08-18 21:37:49 +01:00
|
|
|
# for w3mimgdisplay
|
|
|
|
LIBS = optionalString x11Support "-lX11";
|
|
|
|
|
|
|
|
meta = {
|
2008-11-14 11:16:54 +00:00
|
|
|
homepage = http://w3m.sourceforge.net/;
|
|
|
|
description = "A text-mode web browser";
|
2014-09-13 12:51:39 +01:00
|
|
|
maintainers = [ maintainers.mornfall ];
|
2008-01-30 19:49:42 +00:00
|
|
|
};
|
2005-09-14 17:23:02 +01:00
|
|
|
}
|