@@ -0,0 +1,63 @@
1+{ stdenv, autoconf, automake, cppunit, curl, fetchFromGitHub
2+, fetchurl, libsigcxx, libtool, libtorrent-git, ncurses, openssl
3+, pkgconfig, zlib, xmlrpc_c
4+, colorSupport ? false
5+}:
6+
7+# NOTICE: changes since 0.9.4 break the current configuration syntax, an
8+# example configuration file using the latest changes can be found at
9+# https://github.com/codyopel/dotfiles/blob/master/dotfiles/rtorrent.rc
10+
11+stdenv.mkDerivation {
12+ name = "rtorrent-git";
13+
14+ src = fetchFromGitHub {
15+ owner = "rakshasa";
16+ repo = "rtorrent";
17+ rev = "7537a3c2a91d0915f1c4c89b01cd583629dc5fd4";
18+ sha256 = "1xnyjjff575jfq9c542yq3rr9q03z5x6xbg84d000wkjphbq7h7q";
19+ };
20+
21+ buildInputs = [
22+ autoconf
23+ automake
24+ cppunit
25+ libtorrent-git
26+ ncurses
27+ pkgconfig
28+ libsigcxx
29+ libtool
30+ curl
31+ zlib
32+ openssl
33+ xmlrpc_c
34+ ];
35+
36+ configureFlags = "--with-xmlrpc-c";
37+
38+ # Optional patch adds support for custom configurable colors
39+ # https://github.com/Chlorm/chlorm_overlay/blob/master/net-p2p/rtorrent/README.md
40+
41+ patches = stdenv.lib.optional colorSupport (fetchurl {
42+ url = "https://gist.githubusercontent.com/codyopel/a816c2993f8013b5f4d6/raw/b952b32da1dcf14c61820dfcf7df00bc8918fec4/rtorrent-color.patch";
43+ sha256 = "00gcl7yq6261rrfzpz2k8bd7mffwya0ifji1xqcvhfw50syk8965";
44+ });
45+
46+ preConfigure = ''
47+ ./autogen.sh
48+ '';
49+
50+ # postInstall = ''
51+ # mkdir -p $out/share/man/man1 $out/share/rtorrent
52+ # mv doc/rtorrent.1 $out/share/man/man1/rtorrent.1
53+ # mv doc/rtorrent.rc $out/share/rtorrent/rtorrent.rc
54+ # '';
55+
56+ meta = with stdenv.lib; {
57+ homepage = "http://libtorrent.rakshasa.no/";
58+ description = "An ncurses client for libtorrent, ideal for use with screen or dtach";
59+ license = licenses.gpl2;
60+ platforms = platforms.linux;
61+ maintainers = with maintainers; [ codyopel ];
62+ };
63+}