diff options
author | Andreas Grapentin <andreas@grapentin.org> | 2019-02-22 13:42:40 +0100 |
---|---|---|
committer | Andreas Grapentin <andreas@grapentin.org> | 2019-02-22 13:42:40 +0100 |
commit | caa583b30fdaff8f851e416614ec0e1b21f718d4 (patch) | |
tree | d1cc22c14f27ae7c9447039d26bf136c0af8d599 | |
parent | c0e9003cee237ea0cdef59f4359d79cdab36bdf6 (diff) | |
download | abslibre-caa583b30fdaff8f851e416614ec0e1b21f718d4.tar.gz abslibre-caa583b30fdaff8f851e416614ec0e1b21f718d4.tar.bz2 abslibre-caa583b30fdaff8f851e416614ec0e1b21f718d4.zip |
pcr/rtorrent-color: updated to 0.9.7
-rw-r--r-- | pcr/rtorrent-color/PKGBUILD | 72 | ||||
-rw-r--r-- | pcr/rtorrent-color/rtorrent-0.9.7_color.patch (renamed from pcr/rtorrent-color/rtorrent-0.9.6_color.patch) | 161 |
2 files changed, 116 insertions, 117 deletions
diff --git a/pcr/rtorrent-color/PKGBUILD b/pcr/rtorrent-color/PKGBUILD index c911cbf85..70ec13b87 100644 --- a/pcr/rtorrent-color/PKGBUILD +++ b/pcr/rtorrent-color/PKGBUILD @@ -1,45 +1,49 @@ -# Maintainer (Arch): KopfKrieg <archlinux [at] absolem [dot] cc> -# Contributor (Arch): Ashren <edgar [at] archlinux [dot] us> -# Contributors (Arch): Lucky <archlinux@builds.lucky.li> and Hleem -# Based on rtorrent-color from AUR +# Maintainer (Arch): Gaetan Bisson <bisson@archlinux.org> +# Maintainer (Arch): Jaroslav Lichtblau <svetlemodry@archlinux.org> +# Contributor (Arch): Daenyth <Daenyth [at] gmail [dot] com> +# Contributor (Arch): Jeff Mickey <jeff@archlinux.org> +# Contributor (Arch): sh__ +# Based on rtorrent in [community] # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> -pkgname=rtorrent-color -_pkgname="rtorrent" -pkgver=0.9.6 -pkgrel=3 -pkgdesc="Ncurses BitTorrent client based on libTorrent with color patch." -url="http://rakshasa.github.io/rtorrent/" -arch=("i686" "x86_64") -license=("GPL") -depends=("curl" "libtorrent>=0.13.6" "xmlrpc-c" "libsigc++") +_pkgname=rtorrent +pkgname=$_pkgname-color +pkgver=0.9.7 +pkgrel=2 +pkgdesc='Ncurses BitTorrent client based on libTorrent' +pkgdesc+=' with color patch.' +url='http://rakshasa.github.io/rtorrent/' +license=('GPL') +arch=('x86_64') +arch+=('i686') +depends=("libtorrent=0.13.${pkgver##*.}" 'curl' 'xmlrpc-c') conflicts=("${_pkgname}") provides=("${_pkgname}") -install="${pkgname}.install" -source=("${pkgname}-${pkgver}.tar.gz::https://github.com/rakshasa/${_pkgname}/archive/${pkgver}.tar.gz" - "${_pkgname}-${pkgver}_color.patch") -sha1sums=('27505081254618077c291eb1ee36bfb41f974834' - '78429b5cf5976270dc1a55d8dc0ef4644675512b') +source=("https://github.com/rakshasa/rtorrent/releases/download/v${pkgver}/${_pkgname}-${pkgver}.tar.gz") +source+=("${_pkgname}-${pkgver}_color.patch") +sha256sums=('5d9842fe48c9582fbea2c7bf9f51412c1ccbba07d059b257039ad53b863fe8bb' + 'd694fb2a1c0a60580fcc74ace5c7bbcaf667ce2fbd7968b209460e5deb79e4ed') -build() { - cd "${srcdir}/${_pkgname}-${pkgver}" +prepare() { + cd "${srcdir}/${_pkgname}-${pkgver}" + ./autogen.sh patch -uNp1 -i "${srcdir}/${_pkgname}-${pkgver}_color.patch" - - sed '/AM_PATH_CPPUNIT/d' -i configure.ac - ./autogen.sh - - export CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" - ./configure \ - --prefix=/usr \ - --enable-debug \ - --with-xmlrpc-c \ - - make +} + +build() { + cd "${srcdir}/${_pkgname}-${pkgver}" + export CXXFLAGS+=' -fno-strict-aliasing' + ./configure \ + --prefix=/usr \ + --disable-debug \ + --with-xmlrpc-c \ + + make } package() { - cd "${srcdir}/${_pkgname}-${pkgver}" - make DESTDIR="${pkgdir}" install - install -Dm644 doc/rtorrent.rc "${pkgdir}/usr/share/doc/rtorrent/rtorrent.rc" + cd "${srcdir}/${_pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -D doc/rtorrent.rc "${pkgdir}"/usr/share/doc/rtorrent/rtorrent.rc } diff --git a/pcr/rtorrent-color/rtorrent-0.9.6_color.patch b/pcr/rtorrent-color/rtorrent-0.9.7_color.patch index 9595b83fa..3bc1cdfb4 100644 --- a/pcr/rtorrent-color/rtorrent-0.9.6_color.patch +++ b/pcr/rtorrent-color/rtorrent-0.9.7_color.patch @@ -2,50 +2,50 @@ diff --git a/src/command_network.cc b/src/command_network.cc index c445c38..24ad5c0 100644 --- a/src/command_network.cc +++ b/src/command_network.cc -@@ -241,6 +241,26 @@ initialize_command_network() { - CMD2_ANY ("strings.connection_type", tr1::bind(&torrent::option_list_strings, torrent::OPTION_CONNECTION_TYPE)); - CMD2_ANY ("strings.encryption", tr1::bind(&torrent::option_list_strings, torrent::OPTION_ENCRYPTION)); +@@ -237,6 +237,26 @@ initialize_command_network() { + torrent::FileManager* fileManager = torrent::file_manager(); + core::CurlStack* httpStack = control->core()->http_stack(); -+ CMD2_ANY ("colors.color_inactive_fg", tr1::bind(&ui::Root::get_color_inactive_fg, control->ui())); -+ CMD2_ANY_VALUE_V ("colors.color_inactive_fg.set", tr1::bind(&ui::Root::set_color_inactive_fg, control->ui(), tr1::placeholders::_2)); -+ CMD2_ANY ("colors.color_inactive_bg", tr1::bind(&ui::Root::get_color_inactive_bg, control->ui())); -+ CMD2_ANY_VALUE_V ("colors.color_inactive_bg.set", tr1::bind(&ui::Root::set_color_inactive_bg, control->ui(), tr1::placeholders::_2)); -+ -+ CMD2_ANY ("colors.color_dead_fg", tr1::bind(&ui::Root::get_color_dead_fg, control->ui())); -+ CMD2_ANY_VALUE_V ("colors.color_dead_fg.set", tr1::bind(&ui::Root::set_color_dead_fg, control->ui(), tr1::placeholders::_2)); -+ CMD2_ANY ("colors.color_dead_bg", tr1::bind(&ui::Root::get_color_dead_bg, control->ui())); -+ CMD2_ANY_VALUE_V ("colors.color_dead_bg.set", tr1::bind(&ui::Root::set_color_dead_bg, control->ui(), tr1::placeholders::_2)); -+ -+ CMD2_ANY ("colors.color_active_fg", tr1::bind(&ui::Root::get_color_active_fg, control->ui())); -+ CMD2_ANY_VALUE_V ("colors.color_active_fg.set", tr1::bind(&ui::Root::set_color_active_fg, control->ui(), tr1::placeholders::_2)); -+ CMD2_ANY ("colors.color_active_bg", tr1::bind(&ui::Root::get_color_active_bg, control->ui())); -+ CMD2_ANY_VALUE_V ("colors.color_active_bg.set", tr1::bind(&ui::Root::set_color_active_bg, control->ui(), tr1::placeholders::_2)); -+ -+ CMD2_ANY ("colors.color_finished_fg", tr1::bind(&ui::Root::get_color_finished_fg, control->ui())); -+ CMD2_ANY_VALUE_V ("colors.color_finished_fg.set", tr1::bind(&ui::Root::set_color_finished_fg, control->ui(), tr1::placeholders::_2)); -+ CMD2_ANY ("colors.color_finished_bg", tr1::bind(&ui::Root::get_color_finished_bg, control->ui())); -+ CMD2_ANY_VALUE_V ("colors.color_finished_bg.set", tr1::bind(&ui::Root::set_color_finished_bg, control->ui(), tr1::placeholders::_2)); -+ - // CMD2_ANY_STRING ("encoding_list", tr1::bind(&apply_encoding_list, tr1::placeholders::_2)); - CMD2_ANY_STRING ("encoding.add", tr1::bind(&apply_encoding_list, tr1::placeholders::_2)); ++ CMD2_ANY ("colors.color_inactive_fg", std::bind(&ui::Root::get_color_inactive_fg, control->ui())); ++ CMD2_ANY_VALUE_V ("colors.color_inactive_fg.set", std::bind(&ui::Root::set_color_inactive_fg, control->ui(), std::placeholders::_2)); ++ CMD2_ANY ("colors.color_inactive_bg", std::bind(&ui::Root::get_color_inactive_bg, control->ui())); ++ CMD2_ANY_VALUE_V ("colors.color_inactive_bg.set", std::bind(&ui::Root::set_color_inactive_bg, control->ui(), std::placeholders::_2)); ++ ++ CMD2_ANY ("colors.color_dead_fg", std::bind(&ui::Root::get_color_dead_fg, control->ui())); ++ CMD2_ANY_VALUE_V ("colors.color_dead_fg.set", std::bind(&ui::Root::set_color_dead_fg, control->ui(), std::placeholders::_2)); ++ CMD2_ANY ("colors.color_dead_bg", std::bind(&ui::Root::get_color_dead_bg, control->ui())); ++ CMD2_ANY_VALUE_V ("colors.color_dead_bg.set", std::bind(&ui::Root::set_color_dead_bg, control->ui(), std::placeholders::_2)); ++ ++ CMD2_ANY ("colors.color_active_fg", std::bind(&ui::Root::get_color_active_fg, control->ui())); ++ CMD2_ANY_VALUE_V ("colors.color_active_fg.set", std::bind(&ui::Root::set_color_active_fg, control->ui(), std::placeholders::_2)); ++ CMD2_ANY ("colors.color_active_bg", std::bind(&ui::Root::get_color_active_bg, control->ui())); ++ CMD2_ANY_VALUE_V ("colors.color_active_bg.set", std::bind(&ui::Root::set_color_active_bg, control->ui(), std::placeholders::_2)); ++ ++ CMD2_ANY ("colors.color_finished_fg", std::bind(&ui::Root::get_color_finished_fg, control->ui())); ++ CMD2_ANY_VALUE_V ("colors.color_finished_fg.set", std::bind(&ui::Root::set_color_finished_fg, control->ui(), std::placeholders::_2)); ++ CMD2_ANY ("colors.color_finished_bg", std::bind(&ui::Root::get_color_finished_bg, control->ui())); ++ CMD2_ANY_VALUE_V ("colors.color_finished_bg.set", std::bind(&ui::Root::set_color_finished_bg, control->ui(), std::placeholders::_2)); ++ + CMD2_ANY_STRING ("encoding.add", std::bind(&apply_encoding_list, std::placeholders::_2)); + // Isn't port_open used? diff --git a/src/display/canvas.cc b/src/display/canvas.cc index 31db4ad..255e7c3 100644 --- a/src/display/canvas.cc +++ b/src/display/canvas.cc -@@ -99,6 +99,12 @@ Canvas::initialize() { - m_isInitialized = true; +@@ -111,6 +111,12 @@ Canvas::initialize() { - initscr(); -+ start_color(); -+ use_default_colors(); -+ init_pair(4, -1, -1); -+ init_pair(3, -1, -1); -+ init_pair(2, -1, -1); -+ init_pair(1, -1, -1); - raw(); - noecho(); - nodelay(stdscr, TRUE); + if (!m_isDaemon) { + initscr(); ++ start_color(); ++ use_default_colors(); ++ init_pair(4, -1, -1); ++ init_pair(3, -1, -1); ++ init_pair(2, -1, -1); ++ init_pair(1, -1, -1); + raw(); + noecho(); + nodelay(stdscr, TRUE); diff --git a/src/display/window_download_list.cc b/src/display/window_download_list.cc index ead4ddd..ffd79c9 100644 --- a/src/display/window_download_list.cc @@ -58,58 +58,53 @@ index ead4ddd..ffd79c9 100644 #include "core/download.h" #include "core/view.h" -@@ -104,9 +105,41 @@ WindowDownloadList::redraw() { - char buffer[m_canvas->width() + 1]; - char* last = buffer + m_canvas->width() - 2 + 1; +@@ -125,8 +126,41 @@ WindowDownloadList::redraw() { -+ /* -+ There are four states where colors are applied: -+ 1 inactive # If inactive, e.g. user stopped down/upload -+ 2 dead # If active but no down/upload -+ 3 active # If active and download -+ 4 finished # If finished -+ */ -+ - print_download_title(buffer, last, *range.first); -- m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); -- -+ m_canvas->print(0, pos, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); -+ if( (*range.first)->is_done() ) { -+ if( (*range.first)->download()->info()->up_rate()->rate() != 0 ) { -+ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 4); // Finished and uploading -+ } else { -+ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 4); // Finished -+ } -+ } else if( (*range.first)->is_active() ) { -+ if( (*range.first)->download()->info()->down_rate()->rate() != 0 ) { + if (layout_name == "full") { + while (range.first != range.second) { ++ /* ++ There are four states where colors are applied: ++ 1 inactive # If inactive, e.g. user stopped down/upload ++ 2 dead # If active but no down/upload ++ 3 active # If active and download ++ 4 finished # If finished ++ */ ++ + print_download_title(buffer, last, *range.first); +- m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); ++ m_canvas->print(0, pos, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); ++ if( (*range.first)->is_done() ) { + if( (*range.first)->download()->info()->up_rate()->rate() != 0 ) { -+ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 3); // Active and uploading ++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 4); // Finished and uploading + } else { -+ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 3); // Active ++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 4); // Finished + } -+ } else { -+ if( (*range.first)->download()->info()->up_rate()->rate() != 0 ) { -+ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 2); // Dead but still uploading ++ } else if( (*range.first)->is_active() ) { ++ if( (*range.first)->download()->info()->down_rate()->rate() != 0 ) { ++ if( (*range.first)->download()->info()->up_rate()->rate() != 0 ) { ++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 3); // Active and uploading ++ } else { ++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 3); // Active ++ } + } else { -+ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 2); // Dead ++ if( (*range.first)->download()->info()->up_rate()->rate() != 0 ) { ++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 2); // Dead but still uploading ++ } else { ++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 2); // Dead ++ } + } ++ } else { ++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 1); // Inactive + } -+ } else { -+ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 1); // Inactive -+ } -+ pos++; ++ pos++; + - print_download_info(buffer, last, *range.first); - m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); - -@@ -114,7 +147,83 @@ WindowDownloadList::redraw() { - m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); + print_download_info_full(buffer, last, *range.first); + m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); + print_download_status(buffer, last, *range.first); +@@ -146,4 +180,80 @@ WindowDownloadList::redraw() { + } + } - ++range.first; -- } -+ } -+} -+ +// Inactive +void +WindowDownloadList::set_color_inactive_fg(int64_t color) { @@ -184,8 +179,8 @@ index ead4ddd..ffd79c9 100644 + if( color < 0 ) color = -1; + color = color % 8; + init_pair(4, fg, (short)color); - } - ++} ++ } diff --git a/src/display/window_download_list.h b/src/display/window_download_list.h index 8e15cac..4551a47 100644 @@ -232,7 +227,7 @@ index e3abc9a..7dc7469 100644 --- a/src/ui/download_list.cc +++ b/src/ui/download_list.cc @@ -136,6 +136,11 @@ DownloadList::unfocus_download(core::Download* d) { - current_view()->next_focus(); + current_view()->next_focus(); } +display::WindowDownloadList* |