2016-11-24 00:35:19 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch
|
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
|
2016-01-09 04:05:13 +00:00
|
|
|
, perl, man, pkgconfig
|
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 {
|
2017-01-21 13:02:02 +00:00
|
|
|
name = "w3m-0.5.3+git20161120";
|
2008-11-14 11:16:54 +00:00
|
|
|
|
2016-11-24 00:35:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tats";
|
|
|
|
repo = "w3m";
|
|
|
|
rev = "v0.5.3+git20161120";
|
|
|
|
sha256 = "06n5a9jdyihkd4xdjmyci32dpqp1k2l5awia5g9ng0bn256bacdc";
|
2005-09-14 17:23:02 +01:00
|
|
|
};
|
2008-11-14 11:16:54 +00:00
|
|
|
|
2015-12-25 20:14:20 +00:00
|
|
|
NIX_LDFLAGS = optionalString stdenv.isSunOS "-lsocket -lnsl";
|
2013-12-21 12:48:11 +00:00
|
|
|
|
2015-12-25 20:14:20 +00:00
|
|
|
# we must set these so that the generated files (e.g. w3mhelp.cgi) contain
|
|
|
|
# the correct paths.
|
|
|
|
PERL = "${perl}/bin/perl";
|
|
|
|
MAN = "${man}/bin/man";
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./RAND_egd.libressl.patch
|
|
|
|
(fetchpatch {
|
|
|
|
name = "https.patch";
|
|
|
|
url = "https://aur.archlinux.org/cgit/aur.git/plain/https.patch?h=w3m-mouse&id=5b5f0fbb59f674575e87dd368fed834641c35f03";
|
|
|
|
sha256 = "08skvaha1hjyapsh8zw5dgfy433mw2hk7qy9yy9avn8rjqj7kjxk";
|
|
|
|
})
|
|
|
|
] ++ optional (graphicsSupport && !x11Support) [ ./no-x11.patch ]
|
|
|
|
++ optional stdenv.isCygwin ./cygwin.patch;
|
2010-08-21 18:07:03 +01:00
|
|
|
|
2016-01-09 04:05:13 +00:00
|
|
|
buildInputs = [ pkgconfig 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
|
|
|
|
2015-12-25 20:14:20 +00:00
|
|
|
postInstall = optionalString graphicsSupport ''
|
|
|
|
ln -s $out/libexec/w3m/w3mimgdisplay $out/bin
|
|
|
|
'';
|
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2016-04-16 18:44:32 +01:00
|
|
|
configureFlags = "--with-ssl=${openssl.dev} --with-gc=${boehmgc.dev}"
|
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
|
2015-12-25 20:14:20 +00:00
|
|
|
# see: https://bbs.archlinux.org/viewtopic.php?id=196093
|
2015-08-18 21:37:49 +01:00
|
|
|
LIBS = optionalString x11Support "-lX11";
|
|
|
|
|
|
|
|
meta = {
|
2008-11-14 11:16:54 +00:00
|
|
|
homepage = http://w3m.sourceforge.net/;
|
|
|
|
description = "A text-mode web browser";
|
2015-12-25 20:14:20 +00:00
|
|
|
maintainers = [ maintainers.mornfall maintainers.cstrahan ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2008-01-30 19:49:42 +00:00
|
|
|
};
|
2005-09-14 17:23:02 +01:00
|
|
|
}
|