@@ -1,30 +1,50 @@
1−{ stdenv, fetchurl, libtorrent, ncurses, pkgconfig, libsigcxx, curl
1+{ stdenv, fetchurl, fetchFromGitHub, pkgconfig
2+, libtool, autoconf, automake, cppunit
3+, libtorrent, ncurses, libsigcxx, curl
24, zlib, openssl, xmlrpc_c
5+
6+# This no longer works
7+, colorSupport ? false
38}:
49
510stdenv.mkDerivation rec {
611 name = "rtorrent-${version}";
712 version = "0.9.6";
813
9− src = fetchurl {
10− url = "http://rtorrent.net/downloads/${name}.tar.gz";
11− sha256 = "03jvzw9pi2mhcm913h8qg0qw9gwjqc6lhwynb1yz1y163x7w4s8y";
14+ src = fetchFromGitHub {
15+ owner = "rakshasa";
16+ repo = "rtorrent";
17+ rev = "${version}";
18+ sha256 = "0iyxmjr1984vs7hrnxkfwgrgckacqml0kv4bhj185w9bhjqvgfnf";
1219 };
1320
14− buildInputs = [ libtorrent ncurses pkgconfig libsigcxx curl zlib openssl xmlrpc_c ];
21+ buildInputs = [
22+ pkgconfig libtool autoconf automake cppunit
23+ libtorrent ncurses libsigcxx curl zlib openssl xmlrpc_c
24+ ];
25+
26+ # Optional patch adds support for custom configurable colors
27+ # https://github.com/Chlorm/chlorm_overlay/blob/master/net-p2p/rtorrent/README.md
28+ patches = stdenv.lib.optional colorSupport (fetchurl {
29+ url = "https://gist.githubusercontent.com/codyopel/a816c2993f8013b5f4d6/raw/b952b32da1dcf14c61820dfcf7df00bc8918fec4/rtorrent-color.patch";
30+ sha256 = "00gcl7yq6261rrfzpz2k8bd7mffwya0ifji1xqcvhfw50syk8965";
31+ });
32+
33+ preConfigure = "./autogen.sh";
34+
1535 configureFlags = [ "--with-xmlrpc-c" "--with-posix-fallocate" ];
1636
17− # postInstall = ''
18− # mkdir -p $out/share/man/man1 $out/share/rtorrent
19− # mv doc/rtorrent.1 $out/share/man/man1/rtorrent.1
20− # mv doc/rtorrent.rc $out/share/rtorrent/rtorrent.rc
21− # '';
37+ postInstall = ''
38+ mkdir -p $out/share/man/man1 $out/share/doc/rtorrent
39+ mv doc/old/rtorrent.1 $out/share/man/man1/rtorrent.1
40+ mv doc/rtorrent.rc $out/share/doc/rtorrent/rtorrent.rc
41+ '';
2242
2343 meta = with stdenv.lib; {
24− homepage = https://github.com/rakshasa/rtorrent/;
44+ homepage = src.homepage;
2545 description = "An ncurses client for libtorrent, ideal for use with screen, tmux, or dtach";
2646
2747 platforms = platforms.unix;
28− maintainers = with maintainers; [ simons ebzzry ];
48+ maintainers = with maintainers; [ simons ebzzry codyopel ];
2949 };
3050}