2018-01-02 13:15:20 +01:00
|
|
|
{ stdenv, lib, fetchurl, fetchzip, python3Packages
|
|
|
|
, makeWrapper, wrapGAppsHook, qtbase, glib_networking
|
|
|
|
, asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2
|
|
|
|
, libxslt, gst_all_1 ? null
|
|
|
|
, withPdfReader ? true
|
|
|
|
, withMediaPlayback ? true
|
2017-10-13 19:15:19 +02:00
|
|
|
, withWebEngineDefault ? true
|
2017-04-04 18:21:27 +02:00
|
|
|
}:
|
2015-06-23 03:25:25 +02:00
|
|
|
|
2018-01-02 13:15:20 +01:00
|
|
|
assert withMediaPlayback -> gst_all_1 != null;
|
2017-10-13 19:15:19 +02:00
|
|
|
|
2016-08-23 18:18:22 +02:00
|
|
|
let
|
|
|
|
pdfjs = stdenv.mkDerivation rec {
|
|
|
|
name = "pdfjs-${version}";
|
2017-02-13 23:57:50 +01:00
|
|
|
version = "1.7.225";
|
2015-06-23 03:25:25 +02:00
|
|
|
|
2018-01-02 13:15:20 +01:00
|
|
|
src = fetchzip {
|
2016-08-23 18:18:22 +02:00
|
|
|
url = "https://github.com/mozilla/pdf.js/releases/download/v${version}/${name}-dist.zip";
|
2018-01-02 13:15:20 +01:00
|
|
|
sha256 = "0bsmbz7bbh0zpd70dlhss4fjdw7zq356091wld9s7kxnb2rixqd8";
|
|
|
|
stripRoot = false;
|
2016-08-23 18:18:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir $out
|
2018-01-02 13:15:20 +01:00
|
|
|
cp -r $src $out
|
2016-08-23 18:18:22 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2018-01-02 13:15:20 +01:00
|
|
|
in python3Packages.buildPythonApplication rec {
|
|
|
|
name = "qutebrowser-${version}${versionPostfix}";
|
2015-06-23 03:25:25 +02:00
|
|
|
namePrefix = "";
|
2018-01-29 04:00:12 +01:00
|
|
|
version = "1.1.1";
|
2018-01-02 13:15:20 +01:00
|
|
|
versionPostfix = "";
|
2015-06-23 03:25:25 +02:00
|
|
|
|
2018-01-18 11:17:13 +01:00
|
|
|
# the release tarballs are different from the git checkout!
|
2016-01-10 12:04:16 +01:00
|
|
|
src = fetchurl {
|
2017-11-06 01:16:48 +01:00
|
|
|
url = "https://github.com/qutebrowser/qutebrowser/releases/download/v${version}/${name}.tar.gz";
|
2018-01-29 04:00:12 +01:00
|
|
|
sha256 = "09fa77rg1yrl8cksavxmgm9z2246s4d8wjbkl5jm1gsam345f7mz";
|
2015-06-28 01:22:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# Needs tox
|
|
|
|
doCheck = false;
|
|
|
|
|
2016-08-15 10:36:12 +02:00
|
|
|
buildInputs = [
|
2017-10-13 19:15:19 +02:00
|
|
|
qtbase
|
2016-08-15 10:36:12 +02:00
|
|
|
glib_networking
|
2018-01-02 13:15:20 +01:00
|
|
|
] ++ lib.optionals withMediaPlayback (with gst_all_1; [
|
|
|
|
gst-plugins-base gst-plugins-good
|
|
|
|
gst-plugins-bad gst-plugins-ugly gst-libav
|
|
|
|
]) ++ lib.optional (!withWebEngineDefault) python3Packages.qtwebkit-plugins;
|
2016-08-15 10:36:12 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2018-01-02 13:15:20 +01:00
|
|
|
makeWrapper wrapGAppsHook asciidoc
|
|
|
|
docbook_xml_dtd_45 docbook_xsl libxml2 libxslt
|
2016-08-15 10:36:12 +02:00
|
|
|
];
|
2016-01-10 11:07:15 +01:00
|
|
|
|
2018-01-02 13:15:20 +01:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
pyyaml pyqt5 jinja2 pygments
|
|
|
|
pypeg2 cssutils pyopengl attrs
|
2015-06-28 01:22:48 +02:00
|
|
|
];
|
|
|
|
|
2016-08-15 10:36:12 +02:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "s,/usr/share/qutebrowser,$out/share/qutebrowser,g" qutebrowser/utils/standarddir.py
|
2018-01-02 13:15:20 +01:00
|
|
|
'' + lib.optionalString withPdfReader ''
|
2016-08-23 18:18:22 +02:00
|
|
|
sed -i "s,/usr/share/pdf.js,${pdfjs},g" qutebrowser/browser/pdfjs.py
|
2016-08-15 10:36:12 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
a2x -f manpage doc/qutebrowser.1.asciidoc
|
|
|
|
'';
|
|
|
|
|
2016-06-19 14:42:13 +02:00
|
|
|
postInstall = ''
|
2016-08-15 10:36:12 +02:00
|
|
|
install -Dm644 doc/qutebrowser.1 "$out/share/man/man1/qutebrowser.1"
|
2017-10-13 19:15:19 +02:00
|
|
|
install -Dm644 misc/qutebrowser.desktop \
|
2016-08-15 10:36:12 +02:00
|
|
|
"$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/*
|
2018-01-18 11:17:13 +01:00
|
|
|
install -Dm755 -t "$out/share/qutebrowser/scripts/" \
|
|
|
|
scripts/{importer.py,dictcli.py,keytester.py,open_url_in_instance.sh,utils.py}
|
2015-09-22 19:33:52 +02:00
|
|
|
'';
|
|
|
|
|
2017-10-13 19:15:19 +02:00
|
|
|
postFixup = lib.optionalString (! withWebEngineDefault) ''
|
|
|
|
wrapProgram $out/bin/qutebrowser --add-flags "--backend webkit"
|
2016-08-22 19:07:24 +02:00
|
|
|
'';
|
|
|
|
|
2015-06-28 01:22:48 +02:00
|
|
|
meta = {
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://github.com/The-Compiler/qutebrowser;
|
2015-06-28 01:22:48 +02:00
|
|
|
description = "Keyboard-focused browser with a minimal GUI";
|
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
2015-06-28 01:38:01 +02:00
|
|
|
maintainers = [ stdenv.lib.maintainers.jagajaga ];
|
2015-06-23 03:25:25 +02:00
|
|
|
};
|
|
|
|
}
|