15 pipewireSupport ? stdenv.hostPlatform.isLinux,
20 enableWideVine ? false,
22 # can cause issues on some graphics chips
28 isQt6 = lib.versions.major qtbase.version == "6";
34 url = "https://github.com/mozilla/pdf.js/releases/download/v${version}/pdfjs-${version}-dist.zip";
35 hash = "sha256-7kfT3+ZwoGqZ5OwkO9h3DIuBFd0v8fRlcufxoBdcy8c=";
42 python3.pkgs.buildPythonApplication {
43 pname = "qutebrowser" + lib.optionalString (!isQt6) "-qt5";
48 url = "https://github.com/qutebrowser/qutebrowser/releases/download/v${version}/qutebrowser-${version}.tar.gz";
49 hash = "sha256-gUEkwO0zdDDmE6HaNm1eOJBMsgSa+xUFlxRWylymIj4=";
60 ++ lib.optionals stdenv.hostPlatform.isLinux [
64 build-system = with python3.pkgs; [
77 dependencies = with python3.pkgs; [
80 (if isQt6 then pyqt6-webengine else pyqtwebengine)
83 # scripts and userscripts libs
90 # extensive ad blocking
92 # for the qute-bitwarden user script to be able to copy the TOTP token to clipboard
100 dontWrapQtApps = true;
104 substituteInPlace qutebrowser/misc/quitter.py --subst-var-by qutebrowser "$out/bin/qutebrowser"
106 sed -i "s,/usr,$out,g" qutebrowser/utils/standarddir.py
108 + lib.optionalString withPdfReader ''
109 sed -i "s,/usr/share/pdf.js,${pdfjs},g" qutebrowser/browser/pdfjs.py
115 make -f misc/Makefile \
116 PYTHON=${(python3.pythonOnBuildForHost.withPackages (ps: with ps; [ setuptools ])).interpreter} \
126 # Patch python scripts
127 buildPythonPath "$out $propagatedBuildInputs"
128 scripts=$(grep -rl python "$out"/share/qutebrowser/{user,}scripts/)
129 for i in $scripts; do
130 patchPythonScript "$i"
136 libPath = lib.makeLibraryPath [ pipewire ];
140 # Force the app to use QT_PLUGIN_PATH values from wrapper
141 --unset QT_PLUGIN_PATH
142 "''${qtWrapperArgs[@]}"
143 # avoid persistant warning on starup
144 --set QT_STYLE_OVERRIDE Fusion
145 ${lib.optionalString pipewireSupport ''--prefix LD_LIBRARY_PATH : ${libPath}''}
146 ${lib.optionalString (enableVulkan) ''
147 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}
148 --set-default QSG_RHI_BACKEND vulkan
150 ${lib.optionalString enableWideVine ''--add-flags "--qt-flag widevine-path=${widevine-cdm}/share/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so"''}
151 --set QTWEBENGINE_RESOURCES_PATH "${qtwebengine}/resources"
156 homepage = "https://github.com/qutebrowser/qutebrowser";
157 changelog = "https://github.com/qutebrowser/qutebrowser/blob/v${version}/doc/changelog.asciidoc";
158 description = "Keyboard-focused browser with a minimal GUI";
159 license = licenses.gpl3Plus;
160 mainProgram = "qutebrowser";
161 platforms = if enableWideVine then [ "x86_64-linux" ] else qtwebengine.meta.platforms;
162 maintainers = with maintainers; [