mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-19 20:23:02 +00:00
670cb2103a
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.
54 lines
1.8 KiB
Nix
54 lines
1.8 KiB
Nix
{ mkDerivation, lib, fetchFromGitHub, pkg-config
|
|
, boost, libtorrent-rasterbar, qtbase, qttools, qtsvg
|
|
, debugSupport ? false
|
|
, guiSupport ? true, dbus ? null # GUI (disable to run headless)
|
|
, webuiSupport ? true # WebUI
|
|
, trackerSearch ? true, python3 ? null
|
|
}:
|
|
|
|
assert guiSupport -> (dbus != null);
|
|
assert trackerSearch -> (python3 != null);
|
|
|
|
with lib;
|
|
mkDerivation rec {
|
|
pname = "qbittorrent";
|
|
version = "4.4.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "qbittorrent";
|
|
repo = "qBittorrent";
|
|
rev = "release-${version}";
|
|
sha256 = "sha256-Gcjs7Yueuw76/4is4ZyvlVr6xZ8D+So1+PjZGg6Curk=";
|
|
};
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
# NOTE: 2018-05-31: CMake is working but it is not officially supported
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [ boost libtorrent-rasterbar qtbase qttools qtsvg ]
|
|
++ optional guiSupport dbus # D(esktop)-Bus depends on GUI support
|
|
++ optional trackerSearch python3;
|
|
|
|
# Otherwise qm_gen.pri assumes lrelease-qt5, which does not exist.
|
|
QMAKE_LRELEASE = "lrelease";
|
|
|
|
configureFlags = [
|
|
"--with-boost-libdir=${boost.out}/lib"
|
|
"--with-boost=${boost.dev}" ]
|
|
++ optionals (!guiSupport) [ "--disable-gui" "--enable-systemd" ] # Also place qbittorrent-nox systemd service files
|
|
++ optional (!webuiSupport) "--disable-webui"
|
|
++ optional debugSupport "--enable-debug";
|
|
|
|
qtWrapperArgs = optional trackerSearch "--prefix PATH : ${makeBinPath [ python3 ]}";
|
|
|
|
meta = {
|
|
description = "Featureful free software BitTorrent client";
|
|
homepage = "https://www.qbittorrent.org/";
|
|
changelog = "https://github.com/qbittorrent/qBittorrent/blob/release-${version}/Changelog";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ Anton-Latukha ];
|
|
};
|
|
}
|