Changes between Initial Version and Version 1 of rTorrentOnWindows


Ignore:
Timestamp:
05/17/09 22:30:27 (16 years ago)
Author:
Gabor Hudiczius
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • rTorrentOnWindows

    v1 v1  
     1= rTorrent on Windows =
     2
     3 * [#cygwin Installing Cygwin]
     4 * [#libsigc Installing libsigc++]
     5 * [#libtorrent Installing libTorrent]
     6 * [#xmlrpc Installing XMLRPC-C (optional)]
     7 * [#rtorrent Installing rTorrent]
     8 * [#screenshots Screenshots]
     9
     10To be able to run [http://libtorrent.rakshasa.no/ rTorrent] on Windows, you are going to need [http://www.cygwin.com/ Cygwin].
     11
     12== Installing Cygwin == #cygwin
     13
     14Download Cygwin 1.7 from the [http://www.cygwin.com/ Cygwin page]. Please keep in mind, that version 1.7 is in beta status at the time of writing this manual ([http://cygwin.com/setup-1.7.exe direct link]).
     15
     16Start the installer, choose "Install from internet", select a directory to install cygwin, and one for the packages to be downloaded to, then set up your connection and pick a mirror. You're going to need the following packages in order to compile and run [http://libtorrent.rakshasa.no/ rTorrent]: curl-devel, gcc, libncurses-devel, libtool, make, openssl-devel, pkg-config, subversion, wget. These might require some other packages, let them be installed. Wait, till the installer downloads and installs the neccessary packages, check wherever you want shortcuts, and close the installer. When you're done, start Cygwin (if you choose not create any shortcuts, you can start Cygwin with the cygwin.bat in your installation directory).
     17
     18Now we can proceed with [http://libtorrent.rakshasa.no/ rTorrent].
     19
     20== Installing libsigc++ == #libsigc
     21
     22Since there is no [http://libsigc.sourceforge.net/ libsigc++] package for [http://www.cygwin.com/ Cygwin], we're going to need to compile this one first. By default, [http://www.cygwin.com/ Cygwin] has no /usr/localr/src, so create one.
     23
     24{{{
     25mkdir /usr/local/src
     26cd /usr/local/src
     27}}}
     28
     29Download, compile and install the latest [http://libsigc.sourceforge.net/ libsigc++] source from the [http://ftp.gnome.org/pub/GNOME/sources/libsigc++/ Gnome ftp site] - for me, it was 2.2.3.
     30
     31{{{
     32wget http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.3.tar.bz2
     33tar xjvf libsigc++-2.2.3.tar.bz2
     34cd libsigc++-2.2.3
     35./configure
     36make
     37make install
     38cd ..
     39}}}
     40
     41== Installing libTorrent == #libtorrent
     42
     43Now download the latest [http://libtorrent.rakshasa.no/ libTorrent] source from the [http://libtorrent.rakshasa.no/browser/trunk svn repository], compile, and install it.
     44
     45{{{
     46svn co svn://rakshasa.no/libtorrent/trunk/libtorrent libtorrent-svn
     47cd libtorrent-svn
     48./autogen.sh
     49./configure --disable-mincore
     50make
     51make install
     52cd ..
     53}}}
     54
     55== Installing XMLRPC-C (optional) == #xmlrpc
     56
     57Of course, we want to be able to control [http://libtorrent.rakshasa.no/ rTorrent] via [http://xmlrpc-c.sourceforge.net/ XMLRPC-C], let's say by [wiki:WikiStart rTWi]. For that, we need to install [http://xmlrpc-c.sourceforge.net/ XMLRPC-C], preferably something over version 1.07.
     58
     59{{{
     60svn co https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/ xmlrpc-c-svn
     61cd xmlrpc-c-svn
     62./configure --disable-cplusplus
     63make
     64make install
     65cd ..
     66}}}
     67
     68Unfortunately the 'make install' has failed for me with every version of [http://xmlrpc-c.sourceforge.net/ XMLRPC-C] I've tried, so I decided to copy the neccessary files by myself.
     69
     70{{{
     71mkdir /usr/local/include/xmlrpc-c
     72cp /usr/local/src/xmlrpc-c-svn/include/xmlrpc-c/*.h /usr/local/include/xmlrpc-c/
     73
     74ln -s /usr/local/include/xmlrpc-c/oldxmlrpc.h /usr/local/include/xmlrpc.h
     75ln -s /usr/local/include/xmlrpc-c/server.h /usr/local/include/xmlrpc_server.h
     76ln -s /usr/local/include/xmlrpc-c/server_abyss.h /usr/local/include/xmlrpc_abyss.h
     77ln -s /usr/local/include/xmlrpc-c/server_w32httpsys.h /usr/local/include/xmlrpc_server_w32httpsys.h
     78ln -s /usr/local/include/xmlrpc-c/client.h /usr/local/include/xmlrpc_client.h
     79ln -s /usr/local/include/xmlrpc-c/server_cgi.h /usr/local/include/xmlrpc_cgi.h;
     80
     81cp /usr/local/src/xmlrpc-c-svn/xmlrpc-c-config /usr/local/bin/
     82
     83cp /usr/local/src/xmlrpc-c-svn/lib/abyss/src/*.a /usr/local/lib/
     84cp /usr/local/src/xmlrpc-c-svn/lib/abyss/src/*.dll /usr/local/lib/
     85cp /usr/local/src/xmlrpc-c-svn/lib/expat/xmlparse/*.a /usr/local/lib/
     86cp /usr/local/src/xmlrpc-c-svn/lib/expat/xmlparse/*.dll /usr/local/lib/
     87cp /usr/local/src/xmlrpc-c-svn/lib/expat/xmltok/*.a /usr/local/lib/
     88cp /usr/local/src/xmlrpc-c-svn/lib/expat/xmltok/*.dll /usr/local/lib/
     89cp /usr/local/src/xmlrpc-c-svn/lib/libutil/*.a /usr/local/lib/
     90cp /usr/local/src/xmlrpc-c-svn/lib/libutil/*.dll /usr/local/lib/
     91cp /usr/local/src/xmlrpc-c-svn/src/*.a /usr/local/lib/
     92cp /usr/local/src/xmlrpc-c-svn/src/*.dll /usr/local/lib/
     93}}}
     94
     95== Installing rTorrent == #rtorrent
     96
     97Now download the latest [http://libtorrent.rakshasa.no/ rTorrent] source from the [http://libtorrent.rakshasa.no/browser/trunk svn repository].
     98
     99{{{
     100svn co svn://rakshasa.no/libtorrent/trunk/rtorrent rtorrent-svn
     101cd rtorrent-svn
     102./autogen.sh
     103./configure --with-xmlrpc-c
     104}}}
     105
     106We are going to need to do some modification on the source code, to be able to compile [http://libtorrent.rakshasa.no/ rTorrent].
     107First add some extra lines to src/display/window_file_list.cc ([http://libtorrent.rakshasa.no/ rTorrent] trac, [http://libtorrent.rakshasa.no/ticket/1495 ticket #1495]).
     108
     109in src/display/window_file_list.cc:
     110{{{
     111#include <string>
     112namespace std { typedef std::basic_string <wchar_t> wstring; };
     113}}}
     114
     115The remaining modifications are described in the [http://libtorrent.rakshasa.no/ rTorrent] trac, [http://libtorrent.rakshasa.no/ticket/1184 ticket #1184].
     116
     117in src/input/path_input.cc:
     118{{{
     119#include <sys/types.h>
     120#include <sys/stat.h>
     121#include <unistd.h>
     122#include <sys/dirent.h>
     123
     124struct _transform_filename {
     125  void operator () (utils::directory_entry& entry) {
     126    if (S_ISDIR(entry.d_type))
     127      entry.d_name += '/';
     128  }
     129};
     130}}}
     131
     132in src/utils/directory.cc:
     133{{{
     134#include <fcntl.h>
     135#include <sys/types.h>
     136#include <sys/stat.h>
     137#include <dirent.h>
     138
     139
     140bool
     141Directory::update(int flags) {
     142  if (m_path.empty())
     143    throw torrent::input_error("Directory::update() tried to open an empty path.");
     144
     145  std::string path=rak::path_expand(m_path);
     146 
     147  DIR* d = opendir(path.c_str());
     148 
     149  if (d == NULL)
     150    return false;
     151
     152  struct dirent* entry;
     153
     154  while ((entry = readdir(d)) != NULL) {
     155    if ((flags & update_hide_dot) && entry->d_name[0] == '.')
     156      continue;
     157   
     158    std::string full_path=path+'/';
     159    full_path+=entry->d_name;
     160   
     161    struct stat sb;
     162    if(stat(full_path.c_str(),&sb))
     163      continue;
     164
     165    iterator itr = base_type::insert(end(),value_type());
     166   
     167    itr->d_fileno = sb.st_ino;
     168    itr->d_reclen = 0; // doesn't seem to get used anywhere.
     169    itr->d_type   = sb.st_mode;
     170   
     171   
     172#ifdef DIRENT_NAMLEN_EXISTS_FOOBAR
     173    itr->d_name   = std::string(entry->d_name, entry->d_name + entry->d_namlen);
     174#else
     175    itr->d_name   = std::string(entry->d_name);
     176#endif
     177  }
     178
     179  closedir(d);
     180
     181  if (flags & update_sort)
     182    std::sort(begin(), end());
     183
     184  return true;
     185}
     186}}}
     187
     188in src/rpc/scgi.cc: change AF_LOCAL to AF_UNIX
     189
     190in src/signal_handler.h: use signal.h instead off sys/signal.h
     191
     192Modify the files, save them, compile and install [http://libtorrent.rakshasa.no/ rTorrent].
     193
     194== Screenshots == #screenshots
     195
     196[[myImage(/rtwi/screenshots/rtorrent_on_windows/rtorrent_on_windows_startup.th.png, /rtwi/screenshots/rtorrent_on_windows/rtorrent_on_windows_startup.png, rTorrent on Windows (startup))]]
     197[[myImage(/rtwi/screenshots/rtorrent_on_windows/rtorrent_on_windows.th.png, /rtwi/screenshots/rtorrent_on_windows/rtorrent_on_windows.png, rTorrent on Windows)]]