From 25b70085204e4324b7dc8e712735291cd6cf81ab Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Tue, 2 Jan 2018 12:15:20 +0000 Subject: [PATCH] qutebrowser: make gstreamer and pdfjs configurable (#33074) qutebrowser: make gstreamer and pdfjs configurable --- .../browsers/qutebrowser/default.nix | 47 ++++++++++--------- pkgs/top-level/all-packages.nix | 5 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix index f4beb70f40da..fb8c16abd532 100644 --- a/pkgs/applications/networking/browsers/qutebrowser/default.nix +++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix @@ -1,37 +1,36 @@ -{ stdenv, lib, fetchurl, unzip, buildPythonApplication, makeWrapper, wrapGAppsHook -, qtbase, pyqt5, jinja2, pygments, pyyaml, pypeg2, pyopengl, cssutils, glib_networking -, asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2, libxslt -, gst-plugins-base, gst-plugins-good, gst-plugins-bad, gst-plugins-ugly, gst-libav -, qtwebkit-plugins ? null -, attrs +{ 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 , withWebEngineDefault ? true }: -assert (! withWebEngineDefault) -> qtwebkit-plugins != null; +assert withMediaPlayback -> gst_all_1 != null; let pdfjs = stdenv.mkDerivation rec { name = "pdfjs-${version}"; version = "1.7.225"; - src = fetchurl { + src = fetchzip { url = "https://github.com/mozilla/pdf.js/releases/download/v${version}/${name}-dist.zip"; - sha256 = "1n8ylmv60r0qbw2vilp640a87l4lgnrsi15z3iihcs6dj1n1yy67"; + sha256 = "0bsmbz7bbh0zpd70dlhss4fjdw7zq356091wld9s7kxnb2rixqd8"; + stripRoot = false; }; - nativeBuildInputs = [ unzip ]; - buildCommand = '' mkdir $out - unzip -d $out $src + cp -r $src $out ''; }; -in buildPythonApplication rec { - name = "qutebrowser-${version}${fix_postfix}"; - fix_postfix = ""; - version = "1.0.4"; +in python3Packages.buildPythonApplication rec { + name = "qutebrowser-${version}${versionPostfix}"; namePrefix = ""; + version = "1.0.4"; + versionPostfix = ""; src = fetchurl { url = "https://github.com/qutebrowser/qutebrowser/releases/download/v${version}/${name}.tar.gz"; @@ -43,21 +42,25 @@ in buildPythonApplication rec { buildInputs = [ qtbase - gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav glib_networking - ] - ++ lib.optional (! withWebEngineDefault) qtwebkit-plugins; + ] ++ 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; nativeBuildInputs = [ - makeWrapper wrapGAppsHook asciidoc docbook_xml_dtd_45 docbook_xsl libxml2 libxslt + makeWrapper wrapGAppsHook asciidoc + docbook_xml_dtd_45 docbook_xsl libxml2 libxslt ]; - propagatedBuildInputs = [ - pyyaml pyqt5 jinja2 pygments pypeg2 cssutils pyopengl attrs + propagatedBuildInputs = with python3Packages; [ + pyyaml pyqt5 jinja2 pygments + pypeg2 cssutils pyopengl attrs ]; postPatch = '' sed -i "s,/usr/share/qutebrowser,$out/share/qutebrowser,g" qutebrowser/utils/standarddir.py + '' + lib.optionalString withPdfReader '' sed -i "s,/usr/share/pdf.js,${pdfjs},g" qutebrowser/browser/pdfjs.py ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 545481f07fac..2a1ddb49c288 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16660,10 +16660,7 @@ with pkgs; quodlibet-xine-full = quodlibet-full.override { xineBackend = true; tag = "-xine-full"; }; - qutebrowser = libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { - inherit (python3Packages) buildPythonApplication pyqt5 jinja2 pygments pyyaml pypeg2 cssutils pyopengl attrs; - inherit (gst_all_1) gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav; - }; + qutebrowser = libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { }; rabbitvcs = callPackage ../applications/version-management/rabbitvcs {};