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