@@ -1,31 +1,42 @@
1−{ stdenv, fetchurl, qt4, which, dbus_libs, boost, libtorrentRasterbar
2−, pkgconfig }:
1+{ stdenv, fetchurl, pkgconfig, which
2+, boost, libtorrentRasterbar, qt4
3+, debugSupport ? false # Debugging
4+, guiSupport ? true, dbus_libs ? null # GUI (disable to run headless)
5+, webuiSupport ? true # WebUI
6+}:
37
8+assert guiSupport -> (dbus_libs != null);
9+
10+with stdenv.lib;
411stdenv.mkDerivation rec {
5− name = "qbittorrent-3.1.11";
12+ name = "qbittorrent-${version}";
13+ version = "3.1.11";
614
715 src = fetchurl {
816 url = "mirror://sourceforge/qbittorrent/${name}.tar.xz";
917 sha256 = "0qvz8ifk01b9sw9x5yh3b5kmssx5yi026zvgvabdvfaqkvcmw43i";
1018 };
1119
12− buildInputs = [
13− qt4 which dbus_libs boost libtorrentRasterbar pkgconfig
14− ];
20+ nativeBuildInputs = [ pkgconfig which ];
21+
22+ buildInputs = [ boost libtorrentRasterbar qt4 ]
23+ ++ optional guiSupport dbus_libs;
1524
1625 configureFlags = [
1726 "--with-libboost-lib=${boost.lib}/lib"
1827 "--with-libboost-inc=${boost.dev}/include"
19− ];
28+ (if guiSupport then "" else "--disable-gui")
29+ (if webuiSupport then "" else "--disable-webui")
30+ ] ++ optional debugSupport "--enable-debug";
2031
2132 # https://github.com/qbittorrent/qBittorrent/issues/1992
22− #enableParallelBuilding = true;
33+ enableParallelBuilding = false;
2334
24− meta = with stdenv.lib; {
35+ meta = {
2536 description = "Free Software alternative to µtorrent";
26− homepage = http://www.qbittorrent.org/;
27− license = licenses.gpl2;
37+ homepage = http://www.qbittorrent.org/;
38+ license = licenses.gpl2;
2839 maintainers = with maintainers; [ viric ];
29− platforms = platforms.linux;
40+ platforms = platforms.linux;
3041 };
3142}