qbittorrent: add gui & webui optionals

This commit is contained in:
codyopel 2015-02-15 17:43:39 -05:00
parent f114979de7
commit e9c0bdb93e
1 changed files with 23 additions and 12 deletions

View File

@ -1,27 +1,38 @@
{ stdenv, fetchurl, qt4, which, dbus_libs, boost, libtorrentRasterbar { stdenv, fetchurl, pkgconfig, which
, pkgconfig }: , boost, libtorrentRasterbar, qt4
, debugSupport ? false # Debugging
, guiSupport ? true, dbus_libs ? null # GUI (disable to run headless)
, webuiSupport ? true # WebUI
}:
assert guiSupport -> (dbus_libs != null);
with stdenv.lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "qbittorrent-3.1.11"; name = "qbittorrent-${version}";
version = "3.1.11";
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/qbittorrent/${name}.tar.xz"; url = "mirror://sourceforge/qbittorrent/${name}.tar.xz";
sha256 = "0qvz8ifk01b9sw9x5yh3b5kmssx5yi026zvgvabdvfaqkvcmw43i"; sha256 = "0qvz8ifk01b9sw9x5yh3b5kmssx5yi026zvgvabdvfaqkvcmw43i";
}; };
buildInputs = [ nativeBuildInputs = [ pkgconfig which ];
qt4 which dbus_libs boost libtorrentRasterbar pkgconfig
]; buildInputs = [ boost libtorrentRasterbar qt4 ]
++ optional guiSupport dbus_libs;
configureFlags = [ configureFlags = [
"--with-libboost-lib=${boost.lib}/lib" "--with-libboost-lib=${boost.lib}/lib"
"--with-libboost-inc=${boost.dev}/include" "--with-libboost-inc=${boost.dev}/include"
]; (if guiSupport then "" else "--disable-gui")
(if webuiSupport then "" else "--disable-webui")
] ++ optional debugSupport "--enable-debug";
# https://github.com/qbittorrent/qBittorrent/issues/1992 # https://github.com/qbittorrent/qBittorrent/issues/1992
#enableParallelBuilding = true; enableParallelBuilding = false;
meta = with stdenv.lib; { meta = {
description = "Free Software alternative to µtorrent"; description = "Free Software alternative to µtorrent";
homepage = http://www.qbittorrent.org/; homepage = http://www.qbittorrent.org/;
license = licenses.gpl2; license = licenses.gpl2;