about summary refs log tree commit diff
path: root/pkgs/applications/networking/p2p/qbittorrent/default.nix
diff options
context:
space:
mode:
authorKlemens Nanni <klemens@posteo.de>2022-05-28 10:27:24 +0200
committerKlemens Nanni <klemens@posteo.de>2022-05-30 01:31:03 +0200
commit670cb2103a4d41705ce33ceff39c1636073d9dce (patch)
treef41d5e0d6ce81679afdf5b43d2a5b9d903ebf3ea /pkgs/applications/networking/p2p/qbittorrent/default.nix
parent558da46289a8fc302a5fd7b1fac2467aadd1b132 (diff)
qbittorrent: Wrap once, python is optional
qbittorrent is wrapped twice which must be generally be avoided as it
breaks the program's basename, e.g. `argv[0]` ends up with
".qbittorrent-wrapped" rather than "qbittorrent" as basename.

This becomes relevant when matching for (exact) program names: pgrep(1),
earlyoom(1)'s `--avoid`, etc.

Furthermore, Python is only required by the (default enabled) tracker
search feature.

Since the "qbittorrent" ELF executable is wrapped automatically as a Qt
app, replace the unconditional `postInstall` hook with an optional
addition to `makeWrapperArgs` with is used by `wrapQtApp` eventually.

This merges two wrappers and thus fixes the basename.
Diffstat (limited to 'pkgs/applications/networking/p2p/qbittorrent/default.nix')
-rw-r--r--pkgs/applications/networking/p2p/qbittorrent/default.nix10
1 files changed, 3 insertions, 7 deletions
diff --git a/pkgs/applications/networking/p2p/qbittorrent/default.nix b/pkgs/applications/networking/p2p/qbittorrent/default.nix
index 61a20ffb8ad26..3fb48dd6a53f6 100644
--- a/pkgs/applications/networking/p2p/qbittorrent/default.nix
+++ b/pkgs/applications/networking/p2p/qbittorrent/default.nix
@@ -1,4 +1,4 @@
-{ mkDerivation, lib, fetchFromGitHub, makeWrapper, pkg-config
+{ mkDerivation, lib, fetchFromGitHub, pkg-config
 , boost, libtorrent-rasterbar, qtbase, qttools, qtsvg
 , debugSupport ? false
 , guiSupport ? true, dbus ? null # GUI (disable to run headless)
@@ -24,7 +24,7 @@ mkDerivation rec {
   enableParallelBuilding = true;
 
   # NOTE: 2018-05-31: CMake is working but it is not officially supported
-  nativeBuildInputs = [ makeWrapper pkg-config ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ boost libtorrent-rasterbar qtbase qttools qtsvg ]
     ++ optional guiSupport dbus # D(esktop)-Bus depends on GUI support
@@ -40,11 +40,7 @@ mkDerivation rec {
     ++ optional (!webuiSupport) "--disable-webui"
     ++ optional debugSupport "--enable-debug";
 
-  postInstall = "wrapProgram $out/bin/${
-    if guiSupport
-    then "qbittorrent"
-    else "qbittorrent-nox"
-  } --prefix PATH : ${makeBinPath [ python3 ]}";
+  qtWrapperArgs = optional trackerSearch "--prefix PATH : ${makeBinPath [ python3 ]}";
 
   meta = {
     description = "Featureful free software BitTorrent client";