2017-05-17 19:26:11 +00:00
|
|
|
{ stdenv, lib, fetchurl, unzip, buildPythonApplication, makeWrapper, wrapGAppsHook
|
2017-07-06 02:12:42 +00:00
|
|
|
, qtbase, pyqt5, jinja2, pygments, pyyaml, pypeg2, pyopengl, cssutils, glib_networking
|
2016-08-15 08:36:12 +00:00
|
|
|
, asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2, libxslt
|
2016-08-17 14:58:41 +00:00
|
|
|
, gst-plugins-base, gst-plugins-good, gst-plugins-bad, gst-plugins-ugly, gst-libav
|
2017-04-04 16:21:27 +00:00
|
|
|
, qtwebkit-plugins
|
|
|
|
, withWebEngineDefault ? false
|
|
|
|
}:
|
2015-06-23 01:25:25 +00:00
|
|
|
|
2016-08-23 16:18:22 +00:00
|
|
|
let
|
|
|
|
pdfjs = stdenv.mkDerivation rec {
|
|
|
|
name = "pdfjs-${version}";
|
2017-02-13 22:57:50 +00:00
|
|
|
version = "1.7.225";
|
2015-06-23 01:25:25 +00:00
|
|
|
|
2016-08-23 16:18:22 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/mozilla/pdf.js/releases/download/v${version}/${name}-dist.zip";
|
2017-02-13 22:57:50 +00:00
|
|
|
sha256 = "1n8ylmv60r0qbw2vilp640a87l4lgnrsi15z3iihcs6dj1n1yy67";
|
2016-08-23 16:18:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir $out
|
|
|
|
unzip -d $out $src
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in buildPythonApplication rec {
|
2015-06-23 01:25:25 +00:00
|
|
|
name = "qutebrowser-${version}";
|
2017-07-06 02:12:42 +00:00
|
|
|
version = "0.11.0";
|
2015-06-23 01:25:25 +00:00
|
|
|
namePrefix = "";
|
|
|
|
|
2016-01-10 11:04:16 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/The-Compiler/qutebrowser/releases/download/v${version}/${name}.tar.gz";
|
2017-07-06 02:12:42 +00:00
|
|
|
sha256 = "13ihx66jm1dd6vx8px7pm0kbzf2sf9x43hhivc1rp17kahnxxdyv";
|
2015-06-27 23:22:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Needs tox
|
|
|
|
doCheck = false;
|
|
|
|
|
2016-08-15 08:36:12 +00:00
|
|
|
buildInputs = [
|
2016-08-17 16:33:55 +00:00
|
|
|
qtbase qtwebkit-plugins
|
2016-08-15 08:36:12 +00:00
|
|
|
gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav
|
|
|
|
glib_networking
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2017-05-17 19:26:11 +00:00
|
|
|
makeWrapper wrapGAppsHook asciidoc docbook_xml_dtd_45 docbook_xsl libxml2 libxslt
|
2016-08-15 08:36:12 +00:00
|
|
|
];
|
2016-01-10 10:07:15 +00:00
|
|
|
|
2015-06-27 23:22:48 +00:00
|
|
|
propagatedBuildInputs = [
|
2017-07-06 02:12:42 +00:00
|
|
|
pyyaml pyqt5 jinja2 pygments pypeg2 cssutils pyopengl
|
2015-06-27 23:22:48 +00:00
|
|
|
];
|
|
|
|
|
2016-08-15 08:36:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "s,/usr/share/qutebrowser,$out/share/qutebrowser,g" qutebrowser/utils/standarddir.py
|
2016-08-23 16:18:22 +00:00
|
|
|
sed -i "s,/usr/share/pdf.js,${pdfjs},g" qutebrowser/browser/pdfjs.py
|
2016-08-15 08:36:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
a2x -f manpage doc/qutebrowser.1.asciidoc
|
|
|
|
'';
|
|
|
|
|
2016-06-19 12:42:13 +00:00
|
|
|
postInstall = ''
|
2016-08-15 08:36:12 +00:00
|
|
|
install -Dm644 doc/qutebrowser.1 "$out/share/man/man1/qutebrowser.1"
|
|
|
|
install -Dm644 qutebrowser.desktop \
|
|
|
|
"$out/share/applications/qutebrowser.desktop"
|
|
|
|
for i in 16 24 32 48 64 128 256 512; do
|
|
|
|
install -Dm644 "icons/qutebrowser-''${i}x''${i}.png" \
|
|
|
|
"$out/share/icons/hicolor/''${i}x''${i}/apps/qutebrowser.png"
|
|
|
|
done
|
|
|
|
install -Dm644 icons/qutebrowser.svg \
|
|
|
|
"$out/share/icons/hicolor/scalable/apps/qutebrowser.svg"
|
|
|
|
install -Dm755 -t "$out/share/qutebrowser/userscripts/" misc/userscripts/*
|
2015-09-22 17:33:52 +00:00
|
|
|
'';
|
|
|
|
|
2017-05-17 19:26:11 +00:00
|
|
|
postFixup = lib.optionalString withWebEngineDefault ''
|
|
|
|
wrapProgram $out/bin/qutebrowser --add-flags "--backend webengine"
|
2016-08-22 17:07:24 +00:00
|
|
|
'';
|
|
|
|
|
2015-06-27 23:22:48 +00:00
|
|
|
meta = {
|
2017-01-02 16:05:12 +00:00
|
|
|
homepage = "https://github.com/The-Compiler/qutebrowser";
|
2015-06-27 23:22:48 +00:00
|
|
|
description = "Keyboard-focused browser with a minimal GUI";
|
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
2015-06-27 23:38:01 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.jagajaga ];
|
2015-06-23 01:25:25 +00:00
|
|
|
};
|
|
|
|
}
|