3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/p2p/qbittorrent/default.nix

58 lines
1.8 KiB
Nix
Raw Normal View History

{ mkDerivation, lib, fetchFromGitHub, makeWrapper, pkg-config
, boost, libtorrent-rasterbar, qtbase, qttools, qtsvg
2020-12-12 11:10:31 +00:00
, debugSupport ? false
, guiSupport ? true, dbus ? null # GUI (disable to run headless)
2015-02-15 22:43:39 +00:00
, webuiSupport ? true # WebUI
, trackerSearch ? true, python3 ? null
2015-02-15 22:43:39 +00:00
}:
2013-11-08 08:59:28 +00:00
2018-06-01 07:02:28 +01:00
assert guiSupport -> (dbus != null);
assert trackerSearch -> (python3 != null);
2020-12-12 11:10:31 +00:00
with lib;
mkDerivation rec {
pname = "qbittorrent";
2022-01-07 13:54:44 +00:00
version = "4.4.0";
2013-11-08 08:59:28 +00:00
2018-06-01 07:02:28 +01:00
src = fetchFromGitHub {
owner = "qbittorrent";
repo = "qBittorrent";
2018-06-01 07:02:28 +01:00
rev = "release-${version}";
2022-01-07 13:54:44 +00:00
sha256 = "sha256-xxQ6NGRSwRP+7kTxUsDB00VItHRHuaFopEroETtnGSs=";
2013-11-08 08:59:28 +00:00
};
enableParallelBuilding = true;
# NOTE: 2018-05-31: CMake is working but it is not officially supported
nativeBuildInputs = [ makeWrapper pkg-config ];
2015-02-15 22:43:39 +00:00
buildInputs = [ boost libtorrent-rasterbar qtbase qttools qtsvg ]
++ optional guiSupport dbus # D(esktop)-Bus depends on GUI support
++ optional trackerSearch python3;
2014-11-01 02:30:37 +00:00
# Otherwise qm_gen.pri assumes lrelease-qt5, which does not exist.
QMAKE_LRELEASE = "lrelease";
2014-11-01 02:30:37 +00:00
configureFlags = [
"--with-boost-libdir=${boost.out}/lib"
2018-06-01 07:02:28 +01:00
"--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";
2013-11-08 08:59:28 +00:00
postInstall = "wrapProgram $out/bin/${
if guiSupport
then "qbittorrent"
else "qbittorrent-nox"
} --prefix PATH : ${makeBinPath [ python3 ]}";
2015-02-15 22:43:39 +00:00
meta = {
2018-06-01 07:02:28 +01:00
description = "Featureful free software BitTorrent client";
homepage = "https://www.qbittorrent.org/";
changelog = "https://github.com/qbittorrent/qBittorrent/blob/release-${version}/Changelog";
license = licenses.gpl2Plus;
2015-02-15 22:43:39 +00:00
platforms = platforms.linux;
maintainers = with maintainers; [ Anton-Latukha ];
2013-11-08 08:59:28 +00:00
};
}