nixpkgs/pkgs/applications/networking/p2p/transmission/default.nix

71 lines
2.3 KiB
Nix
Raw Normal View History

2017-11-30 08:04:57 +01:00
{ stdenv, fetchurl, pkgconfig, intltool, file, wrapGAppsHook
, openssl, curl, libevent, inotify-tools, systemd, zlib
, enableGTK3 ? false, gtk3
, enableSystemd ? stdenv.isLinux
2017-01-06 00:27:16 +01:00
, enableDaemon ? true
2017-01-06 00:26:51 +01:00
, enableCli ? true
}:
let
2016-03-08 15:40:17 +01:00
version = "2.92";
in
let inherit (stdenv.lib) optional optionals optionalString; in
stdenv.mkDerivation rec {
name = "transmission-" + optionalString enableGTK3 "gtk-" + version;
src = fetchurl {
2015-02-02 22:05:51 +01:00
url = "https://transmission.cachefly.net/transmission-${version}.tar.xz";
2016-03-08 15:40:17 +01:00
sha256 = "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s";
};
2017-11-30 08:04:57 +01:00
nativeBuildInputs = [ pkgconfig ]
++ optionals enableGTK3 [ wrapGAppsHook ];
buildInputs = [ intltool file openssl curl libevent zlib ]
2017-11-30 08:04:57 +01:00
++ optionals enableGTK3 [ gtk3 ]
++ optionals enableSystemd [ systemd ]
++ optionals stdenv.isLinux [ inotify-tools ];
postPatch = ''
substituteInPlace ./configure \
--replace "libsystemd-daemon" "libsystemd" \
--replace "/usr/bin/file" "${file}/bin/file" \
--replace "test ! -d /Developer/SDKs/MacOSX10.5.sdk" "false"
'';
configureFlags = [
2017-01-06 00:26:51 +01:00
("--enable-cli=" + (if enableCli then "yes" else "no"))
2017-01-06 00:27:16 +01:00
("--enable-daemon=" + (if enableDaemon then "yes" else "no"))
"--disable-mac" # requires xcodebuild
]
++ optional enableSystemd "--with-systemd-daemon"
++ optional enableGTK3 "--with-gtk";
2017-11-30 08:04:57 +01:00
preFixup = optionalString enableGTK3 ''
rm "$out/share/icons/hicolor/icon-theme.cache"
'';
NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation";
meta = with stdenv.lib; {
description = "A fast, easy and free BitTorrent client";
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/;
license = licenses.gpl2; # parts are under MIT
maintainers = with maintainers; [ astsmtl vcunat wizeman ];
platforms = platforms.unix;
};
}