2019-08-03 02:48:07 +01:00
|
|
|
{ stdenv, fetchurl, fetchpatch, pkgconfig, libpng, openssl, curl, gtk2, check, SDL
|
2016-06-22 06:38:36 +01:00
|
|
|
, libXcursor, libXrandr, makeWrapper
|
2019-07-25 02:24:08 +01:00
|
|
|
, libwebp
|
2019-08-03 05:27:36 +01:00
|
|
|
, libxml2, libidn, perl, perlPackages, xxd
|
2016-06-29 22:10:35 +01:00
|
|
|
, uilib ? "framebuffer"
|
2016-06-22 06:38:36 +01:00
|
|
|
, nsgenbind
|
|
|
|
, libnsfb
|
|
|
|
, libwapcaplet
|
|
|
|
, libparserutils
|
2019-07-25 02:24:08 +01:00
|
|
|
, libnslog
|
2016-06-22 06:38:36 +01:00
|
|
|
, libcss
|
|
|
|
, libhubbub
|
|
|
|
, libdom
|
|
|
|
, libnsbmp
|
|
|
|
, libnsgif
|
2019-07-25 02:24:08 +01:00
|
|
|
, libsvgtiny
|
2016-06-22 06:38:36 +01:00
|
|
|
, libnsutils
|
2019-07-25 02:24:08 +01:00
|
|
|
, libnspsl
|
2016-06-22 06:38:36 +01:00
|
|
|
, libutf8proc
|
2019-07-25 01:12:39 +01:00
|
|
|
, wrapGAppsHook
|
2016-06-22 06:38:36 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
name = "netsurf-${version}";
|
2019-07-25 01:12:39 +01:00
|
|
|
version = "3.9";
|
2016-06-22 06:38:36 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://download.netsurf-browser.org/netsurf/releases/source/netsurf-${version}-src.tar.gz";
|
2019-07-25 01:12:39 +01:00
|
|
|
sha256 = "1hzcm2s2wh5sapgr000lg63hcdbj6hyajxl43xa1x80kc5piqbyp";
|
2016-06-22 06:38:36 +01:00
|
|
|
};
|
|
|
|
|
2019-08-03 02:48:07 +01:00
|
|
|
patches = [
|
|
|
|
# GTK: prefer using curl's intrinsic defaults for CURLOPT_CA*
|
|
|
|
(fetchpatch {
|
|
|
|
name = "0001-GTK-prefer-using-curl-s-intrinsic-defaults-for-CURLO.patch";
|
|
|
|
url = "http://source.netsurf-browser.org/netsurf.git/patch/?id=87177d8aa109206d131e0d80a2080ce55dab01c7";
|
|
|
|
sha256 = "08bc60pc5k5qpckqv21zgmgszj3rpwskfc84shs8vg92vkimv2ai";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-07-25 01:12:39 +01:00
|
|
|
nativeBuildInputs = [
|
2019-08-03 05:27:36 +01:00
|
|
|
perl
|
|
|
|
perlPackages.HTMLParser
|
2019-07-25 01:12:39 +01:00
|
|
|
pkgconfig
|
|
|
|
xxd
|
|
|
|
] ++ stdenv.lib.optionals (uilib == "gtk") [
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
2019-08-03 05:27:36 +01:00
|
|
|
buildInputs = [ libpng openssl curl gtk2 check libxml2 libidn
|
|
|
|
libXcursor libXrandr makeWrapper SDL
|
2019-07-25 02:24:08 +01:00
|
|
|
libwebp
|
2016-06-22 06:38:36 +01:00
|
|
|
nsgenbind
|
|
|
|
libnsfb
|
|
|
|
libwapcaplet
|
|
|
|
libparserutils
|
2019-07-25 02:24:08 +01:00
|
|
|
libnslog
|
2016-06-22 06:38:36 +01:00
|
|
|
libcss
|
|
|
|
libhubbub
|
|
|
|
libdom
|
|
|
|
libnsbmp
|
|
|
|
libnsgif
|
2019-07-25 02:24:08 +01:00
|
|
|
libsvgtiny
|
2016-06-22 06:38:36 +01:00
|
|
|
libnsutils
|
2019-07-25 02:24:08 +01:00
|
|
|
libnspsl
|
2016-06-22 06:38:36 +01:00
|
|
|
libutf8proc
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cat <<EOF > Makefile.conf
|
2016-06-29 22:10:35 +01:00
|
|
|
override NETSURF_GTK_RESOURCES := $out/share/Netsurf/${uilib}/res
|
2016-06-22 06:38:36 +01:00
|
|
|
override NETSURF_USE_GRESOURCE := YES
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
2016-06-29 22:10:35 +01:00
|
|
|
"TARGET=${uilib}"
|
2016-06-22 06:38:36 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
2016-06-29 22:10:35 +01:00
|
|
|
mkdir -p $out/bin $out/share/Netsurf/${uilib}
|
|
|
|
cmd=$(case "${uilib}" in framebuffer) echo nsfb;; gtk) echo nsgtk;; esac)
|
2016-06-22 06:38:36 +01:00
|
|
|
cp $cmd $out/bin/netsurf
|
2019-07-25 01:12:39 +01:00
|
|
|
tar -hcf - frontends/${uilib}/res | (cd $out/share/Netsurf/ && tar -xvpf -)
|
2016-06-22 06:38:36 +01:00
|
|
|
'';
|
|
|
|
|
2019-08-03 03:03:10 +01:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
--set NETSURFRES $out/share/Netsurf/${uilib}/res
|
|
|
|
)
|
|
|
|
'' + stdenv.lib.optionalString (uilib != "gtk") ''
|
|
|
|
wrapProgram $out/bin/netsurf "''${gappsWrapperArgs[@]}"
|
|
|
|
'';
|
|
|
|
|
2016-06-22 06:38:36 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.netsurf-browser.org/;
|
2016-06-22 06:38:36 +01:00
|
|
|
description = "Free opensource web browser";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.vrthra ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|