3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/p2p/qbittorrent/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

55 lines
1.7 KiB
Nix

{ mkDerivation, lib, fetchFromGitHub, makeWrapper, 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.3.1";
src = fetchFromGitHub {
owner = "qbittorrent";
repo = "qbittorrent";
rev = "release-${version}";
sha256 = "17ih00q7idrpl3b2vgh4smva6lazs5jw06pblriscn1lrwdvrc38";
};
# NOTE: 2018-05-31: CMake is working but it is not officially supported
nativeBuildInputs = [ makeWrapper 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";
postInstall = "wrapProgram $out/bin/${
if guiSupport
then "qbittorrent"
else "qbittorrent-nox"
} --prefix PATH : ${makeBinPath [ python3 ]}";
meta = {
description = "Featureful free software BitTorrent client";
homepage = "https://www.qbittorrent.org/";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ Anton-Latukha ];
};
}