From 0da53f8bc334764b579c264b495a0492f2aa4649 Mon Sep 17 00:00:00 2001 From: Rahul Gopinath Date: Wed, 29 Jun 2016 14:10:35 -0700 Subject: [PATCH] netsurf: enable sixel display --- .../misc/netsurf/browser/default.nix | 23 ++++++++----------- .../misc/netsurf/libnsfb/default.nix | 6 ++--- pkgs/top-level/all-packages.nix | 8 +++++++ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/misc/netsurf/browser/default.nix b/pkgs/applications/misc/netsurf/browser/default.nix index 2b9b254f20bf..2acb15b6a0b7 100644 --- a/pkgs/applications/misc/netsurf/browser/default.nix +++ b/pkgs/applications/misc/netsurf/browser/default.nix @@ -1,6 +1,7 @@ -{ stdenv, fetchurl, pkgconfig, libpng, openssl, curl, gtk2, check +{ stdenv, fetchurl, pkgconfig, libpng, openssl, curl, gtk2, check, SDL , libxml2, libidn, perl, nettools, perlPackages , libXcursor, libXrandr, makeWrapper +, uilib ? "framebuffer" , buildsystem , nsgenbind , libnsfb @@ -20,11 +21,7 @@ stdenv.mkDerivation rec { name = "netsurf-${version}"; version = "3.5"; - # UIS incldue Framebuffer, and gtk, but - # Framebuffer is buggy. To enable, make sure - # to also build netsurf-libnsfb with ui=framebuffer - # and switch the ui here to framebuffer - ui = "gtk"; + # UI libs incldue Framebuffer, and gtk src = fetchurl { url = "http://download.netsurf-browser.org/netsurf/releases/source/netsurf-${version}-src.tar.gz"; @@ -32,7 +29,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ pkgconfig libpng openssl curl gtk2 check libxml2 libidn perl - nettools perlPackages.HTMLParser libXcursor libXrandr makeWrapper + nettools perlPackages.HTMLParser libXcursor libXrandr makeWrapper SDL buildsystem nsgenbind libnsfb @@ -49,7 +46,7 @@ stdenv.mkDerivation rec { preConfigure = '' cat < Makefile.conf - override NETSURF_GTK_RESOURCES := $out/share/Netsurf/${ui}/res + override NETSURF_GTK_RESOURCES := $out/share/Netsurf/${uilib}/res override NETSURF_USE_GRESOURCE := YES EOF ''; @@ -57,15 +54,15 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" "NSSHARED=${buildsystem}/share/netsurf-buildsystem" - "TARGET=${ui}" + "TARGET=${uilib}" ]; installPhase = '' - mkdir -p $out/bin $out/share/Netsurf/${ui} - cmd=$(case "${ui}" in framebuffer) echo nsfb;; gtk) echo nsgtk;; esac) + mkdir -p $out/bin $out/share/Netsurf/${uilib} + cmd=$(case "${uilib}" in framebuffer) echo nsfb;; gtk) echo nsgtk;; esac) cp $cmd $out/bin/netsurf - wrapProgram $out/bin/netsurf --set NETSURFRES $out/share/Netsurf/${ui}/res - tar -hcf - ${ui}/res | (cd $out/share/Netsurf/ && tar -xvpf -) + wrapProgram $out/bin/netsurf --set NETSURFRES $out/share/Netsurf/${uilib}/res + tar -hcf - ${uilib}/res | (cd $out/share/Netsurf/ && tar -xvpf -) ''; meta = with stdenv.lib; { diff --git a/pkgs/applications/misc/netsurf/libnsfb/default.nix b/pkgs/applications/misc/netsurf/libnsfb/default.nix index 3e2346597fa4..234bb43798e6 100644 --- a/pkgs/applications/misc/netsurf/libnsfb/default.nix +++ b/pkgs/applications/misc/netsurf/libnsfb/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, ui? "gtk" +{ stdenv, fetchurl, pkgconfig, uilib? "framebuffer", SDL , buildsystem }: @@ -13,12 +13,12 @@ stdenv.mkDerivation rec { sha256 = "176f8why9gzbaca9nnxjqasl02qzc6g507z5w3dzkcjifnkz4mzl"; }; - buildInputs = [ pkgconfig buildsystem ]; + buildInputs = [ pkgconfig buildsystem SDL ]; makeFlags = [ "PREFIX=$(out)" "NSSHARED=${buildsystem}/share/netsurf-buildsystem" - "TARGET=${ui}" + "TARGET=${uilib}" ]; meta = with stdenv.lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b2cbe0fd03fc..960047b7b1cf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2207,6 +2207,14 @@ in netdata = callPackage ../tools/system/netdata { }; netsurf = recurseIntoAttrs (let callPackage = newScope pkgs.netsurf; in rec { + # ui could be gtk, sixel or framebuffer. Note that console display (sixel) + # requires a terminal that supports `sixel` capabilities such as mlterm + # or xterm -ti 340 + ui = "sixel"; + + uilib = if ui == "gtk" then "gtk" else "framebuffer"; + + SDL = if ui == "gtk" then null else if ui == "sixel" then SDL_sixel else SDL; buildsystem = callPackage ../applications/misc/netsurf/buildsystem { };