2013-10-04 19:31:02 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, intltool, file, makeWrapper
|
2015-09-07 20:28:33 +01:00
|
|
|
, openssl, curl, libevent, inotify-tools, systemd, zlib
|
2013-10-04 19:31:02 +01:00
|
|
|
, enableGTK3 ? false, gtk3
|
2017-01-05 23:24:08 +00:00
|
|
|
, enableSystemd ? stdenv.isLinux
|
2017-01-05 23:27:16 +00:00
|
|
|
, enableDaemon ? true
|
2017-01-05 23:26:51 +00:00
|
|
|
, enableCli ? true
|
2013-10-04 19:31:02 +01:00
|
|
|
}:
|
2013-03-17 21:27:55 +00:00
|
|
|
|
2013-10-04 19:31:02 +01:00
|
|
|
let
|
2016-03-08 14:40:17 +00:00
|
|
|
version = "2.92";
|
2013-10-04 19:31:02 +01:00
|
|
|
in
|
|
|
|
|
2017-02-09 01:52:13 +00:00
|
|
|
let inherit (stdenv.lib) optional optionals optionalString; in
|
2010-05-20 14:39:16 +01:00
|
|
|
|
2010-03-28 00:06:30 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2013-10-04 19:31:02 +01:00
|
|
|
name = "transmission-" + optionalString enableGTK3 "gtk-" + version;
|
2012-06-18 16:18:45 +01:00
|
|
|
|
2010-03-28 00:06:30 +00:00
|
|
|
src = fetchurl {
|
2015-02-02 21:05:51 +00:00
|
|
|
url = "https://transmission.cachefly.net/transmission-${version}.tar.xz";
|
2016-03-08 14:40:17 +00:00
|
|
|
sha256 = "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s";
|
2010-03-28 00:06:30 +00:00
|
|
|
};
|
2012-06-18 16:18:45 +01:00
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ intltool file openssl curl libevent zlib ]
|
2014-05-22 10:34:47 +01:00
|
|
|
++ optionals enableGTK3 [ gtk3 makeWrapper ]
|
2017-01-05 23:24:08 +00:00
|
|
|
++ optionals enableSystemd [ systemd ]
|
2017-01-05 23:28:13 +00:00
|
|
|
++ optionals stdenv.isLinux [ inotify-tools ];
|
2012-06-18 16:18:45 +01:00
|
|
|
|
2016-05-28 13:23:47 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ./configure \
|
|
|
|
--replace "libsystemd-daemon" "libsystemd" \
|
2017-01-05 23:28:13 +00:00
|
|
|
--replace "/usr/bin/file" "${file}/bin/file" \
|
|
|
|
--replace "test ! -d /Developer/SDKs/MacOSX10.5.sdk" "false"
|
2013-02-27 12:05:21 +00:00
|
|
|
'';
|
2011-06-13 15:15:15 +01:00
|
|
|
|
2017-01-05 23:24:08 +00:00
|
|
|
configureFlags = [
|
2017-01-05 23:26:51 +00:00
|
|
|
("--enable-cli=" + (if enableCli then "yes" else "no"))
|
2017-01-05 23:27:16 +00:00
|
|
|
("--enable-daemon=" + (if enableDaemon then "yes" else "no"))
|
2017-01-05 23:28:13 +00:00
|
|
|
"--disable-mac" # requires xcodebuild
|
2017-01-05 23:24:08 +00:00
|
|
|
]
|
|
|
|
++ optional enableSystemd "--with-systemd-daemon"
|
2013-10-04 19:31:02 +01:00
|
|
|
++ optional enableGTK3 "--with-gtk";
|
2013-03-17 21:27:55 +00:00
|
|
|
|
2014-04-17 09:11:15 +01:00
|
|
|
preFixup = optionalString enableGTK3 /* gsettings schemas for file dialogues */ ''
|
2013-10-04 19:31:02 +01:00
|
|
|
rm "$out/share/icons/hicolor/icon-theme.cache"
|
|
|
|
wrapProgram "$out/bin/transmission-gtk" \
|
2014-04-17 09:11:15 +01:00
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
|
2011-06-13 15:15:15 +01:00
|
|
|
'';
|
2012-06-18 16:18:45 +01:00
|
|
|
|
2017-01-05 23:28:13 +00:00
|
|
|
NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation";
|
|
|
|
|
2013-10-04 19:31:02 +01:00
|
|
|
meta = with stdenv.lib; {
|
2010-05-20 14:39:16 +01:00
|
|
|
description = "A fast, easy and free BitTorrent client";
|
2010-03-28 00:06:30 +00:00
|
|
|
longDescription = ''
|
|
|
|
Transmission is a BitTorrent client which features a simple interface
|
|
|
|
on top of a cross-platform back-end.
|
|
|
|
Feature spotlight:
|
|
|
|
* Uses fewer resources than other clients
|
|
|
|
* Native Mac, GTK+ and Qt GUI clients
|
|
|
|
* Daemon ideal for servers, embedded systems, and headless use
|
|
|
|
* All these can be remote controlled by Web and Terminal clients
|
|
|
|
* Bluetack (PeerGuardian) blocklists with automatic updates
|
|
|
|
* Full encryption, DHT, and PEX support
|
|
|
|
'';
|
|
|
|
homepage = http://www.transmissionbt.com/;
|
2013-10-04 19:31:02 +01:00
|
|
|
license = licenses.gpl2; # parts are under MIT
|
2014-03-14 20:18:16 +00:00
|
|
|
maintainers = with maintainers; [ astsmtl vcunat wizeman ];
|
2017-01-05 23:28:13 +00:00
|
|
|
platforms = platforms.unix;
|
2010-03-28 00:06:30 +00:00
|
|
|
};
|
|
|
|
}
|
2013-10-04 19:31:02 +01:00
|
|
|
|