2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, makeWrapper, wrapGAppsHook
|
2019-08-03 05:54:18 +01:00
|
|
|
|
|
|
|
# Buildtime dependencies.
|
2021-01-19 06:50:56 +00:00
|
|
|
, check, pkg-config, xxd
|
2019-08-03 05:54:18 +01:00
|
|
|
|
|
|
|
# Runtime dependencies.
|
|
|
|
, curl, expat, libXcursor, libXrandr, libidn, libjpeg, libpng, libwebp, libxml2
|
|
|
|
, openssl, perl, perlPackages
|
|
|
|
|
|
|
|
# uilib-specific dependencies
|
|
|
|
, gtk2 # GTK 2
|
2020-09-28 07:50:11 +01:00
|
|
|
, gtk3 # GTK 3
|
2019-08-03 05:54:18 +01:00
|
|
|
, SDL # Framebuffer
|
|
|
|
|
|
|
|
# Configuration
|
2020-09-28 07:50:11 +01:00
|
|
|
, uilib
|
2019-08-03 05:54:18 +01:00
|
|
|
|
|
|
|
# Netsurf-specific dependencies
|
|
|
|
, libcss, libdom, libhubbub, libnsbmp, libnsfb, libnsgif
|
|
|
|
, libnslog, libnspsl, libnsutils, libparserutils, libsvgtiny, libutf8proc
|
|
|
|
, libwapcaplet, nsgenbind
|
2016-06-22 06:38:36 +01:00
|
|
|
}:
|
|
|
|
|
2019-08-03 05:54:18 +01:00
|
|
|
let
|
2021-01-15 13:21:58 +00:00
|
|
|
inherit (lib) optional optionals;
|
2019-08-03 05:54:18 +01:00
|
|
|
in
|
2016-06-22 06:38:36 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "netsurf";
|
2020-09-28 07:50:11 +01:00
|
|
|
version = "3.10";
|
2016-06-22 06:38:36 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-09-28 07:50:11 +01:00
|
|
|
url = "http://download.netsurf-browser.org/netsurf/releases/source/${pname}-${version}-src.tar.gz";
|
|
|
|
sha256 = "sha256-NkhEKeGTYUaFwv8kb1W9Cm3d8xoBi+5F4NH3wohRmV4=";
|
2016-06-22 06:38:36 +01:00
|
|
|
};
|
|
|
|
|
2019-07-25 01:12:39 +01:00
|
|
|
nativeBuildInputs = [
|
2019-08-03 05:54:18 +01:00
|
|
|
makeWrapper
|
2019-08-03 05:27:36 +01:00
|
|
|
perl
|
|
|
|
perlPackages.HTMLParser
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2019-07-25 01:12:39 +01:00
|
|
|
xxd
|
2019-08-03 05:54:18 +01:00
|
|
|
]
|
2020-09-28 07:50:11 +01:00
|
|
|
++ optional (uilib == "gtk2" || uilib == "gtk3") wrapGAppsHook
|
2019-08-03 05:54:18 +01:00
|
|
|
;
|
2019-07-25 01:12:39 +01:00
|
|
|
|
2020-09-28 07:50:11 +01:00
|
|
|
buildInputs = [
|
2019-08-03 05:54:18 +01:00
|
|
|
check curl libXcursor libXrandr libidn libjpeg libpng libwebp libxml2 openssl
|
|
|
|
# Netsurf-specific libraries
|
|
|
|
nsgenbind libnsfb libwapcaplet libparserutils libnslog libcss
|
|
|
|
libhubbub libdom libnsbmp libnsgif libsvgtiny libnsutils libnspsl
|
2016-06-22 06:38:36 +01:00
|
|
|
libutf8proc
|
2019-08-03 05:54:18 +01:00
|
|
|
]
|
|
|
|
++ optionals (uilib == "framebuffer") [ expat SDL ]
|
2020-09-28 07:50:11 +01:00
|
|
|
++ optional (uilib == "gtk2") gtk2
|
|
|
|
++ optional (uilib == "gtk3") gtk3
|
2019-08-03 05:54:18 +01:00
|
|
|
;
|
2016-06-22 06:38:36 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cat <<EOF > Makefile.conf
|
2019-08-03 05:54:18 +01:00
|
|
|
override NETSURF_GTK_RES_PATH := $out/share/
|
2016-06-22 06:38:36 +01:00
|
|
|
override NETSURF_USE_GRESOURCE := YES
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
2019-08-03 05:54:18 +01:00
|
|
|
"PREFIX=${placeholder "out"}"
|
2016-06-29 22:10:35 +01:00
|
|
|
"TARGET=${uilib}"
|
2016-06-22 06:38:36 +01:00
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-09-28 07:50:11 +01:00
|
|
|
homepage = "https://www.netsurf-browser.org/";
|
|
|
|
description = "A free, open source, small web browser";
|
|
|
|
longDescription = ''
|
|
|
|
NetSurf is a free, open source web browser. It is written in C and
|
|
|
|
released under the GNU Public Licence version 2. NetSurf has its own
|
|
|
|
layout and rendering engine entirely written from scratch. It is small and
|
|
|
|
capable of handling many of the web standards in use today.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = [ maintainers.vrthra maintainers.AndersonTorres ];
|
2016-06-22 06:38:36 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|