| 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 | |
| 10 | To 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 | |
| 14 | Download 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 | |
| 16 | Start 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 | |
| 18 | Now we can proceed with [http://libtorrent.rakshasa.no/ rTorrent]. |
| 19 | |
| 20 | == Installing libsigc++ == #libsigc |
| 21 | |
| 22 | Since 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 | {{{ |
| 25 | mkdir /usr/local/src |
| 26 | cd /usr/local/src |
| 27 | }}} |
| 28 | |
| 29 | Download, 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 | {{{ |
| 32 | wget http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.3.tar.bz2 |
| 33 | tar xjvf libsigc++-2.2.3.tar.bz2 |
| 34 | cd libsigc++-2.2.3 |
| 35 | ./configure |
| 36 | make |
| 37 | make install |
| 38 | cd .. |
| 39 | }}} |
| 40 | |
| 41 | == Installing libTorrent == #libtorrent |
| 42 | |
| 43 | Now 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 | {{{ |
| 46 | svn co svn://rakshasa.no/libtorrent/trunk/libtorrent libtorrent-svn |
| 47 | cd libtorrent-svn |
| 48 | ./autogen.sh |
| 49 | ./configure --disable-mincore |
| 50 | make |
| 51 | make install |
| 52 | cd .. |
| 53 | }}} |
| 54 | |
| 55 | == Installing XMLRPC-C (optional) == #xmlrpc |
| 56 | |
| 57 | Of 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 | {{{ |
| 60 | svn co https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/ xmlrpc-c-svn |
| 61 | cd xmlrpc-c-svn |
| 62 | ./configure --disable-cplusplus |
| 63 | make |
| 64 | make install |
| 65 | cd .. |
| 66 | }}} |
| 67 | |
| 68 | Unfortunately 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 | {{{ |
| 71 | mkdir /usr/local/include/xmlrpc-c |
| 72 | cp /usr/local/src/xmlrpc-c-svn/include/xmlrpc-c/*.h /usr/local/include/xmlrpc-c/ |
| 73 | |
| 74 | ln -s /usr/local/include/xmlrpc-c/oldxmlrpc.h /usr/local/include/xmlrpc.h |
| 75 | ln -s /usr/local/include/xmlrpc-c/server.h /usr/local/include/xmlrpc_server.h |
| 76 | ln -s /usr/local/include/xmlrpc-c/server_abyss.h /usr/local/include/xmlrpc_abyss.h |
| 77 | ln -s /usr/local/include/xmlrpc-c/server_w32httpsys.h /usr/local/include/xmlrpc_server_w32httpsys.h |
| 78 | ln -s /usr/local/include/xmlrpc-c/client.h /usr/local/include/xmlrpc_client.h |
| 79 | ln -s /usr/local/include/xmlrpc-c/server_cgi.h /usr/local/include/xmlrpc_cgi.h; |
| 80 | |
| 81 | cp /usr/local/src/xmlrpc-c-svn/xmlrpc-c-config /usr/local/bin/ |
| 82 | |
| 83 | cp /usr/local/src/xmlrpc-c-svn/lib/abyss/src/*.a /usr/local/lib/ |
| 84 | cp /usr/local/src/xmlrpc-c-svn/lib/abyss/src/*.dll /usr/local/lib/ |
| 85 | cp /usr/local/src/xmlrpc-c-svn/lib/expat/xmlparse/*.a /usr/local/lib/ |
| 86 | cp /usr/local/src/xmlrpc-c-svn/lib/expat/xmlparse/*.dll /usr/local/lib/ |
| 87 | cp /usr/local/src/xmlrpc-c-svn/lib/expat/xmltok/*.a /usr/local/lib/ |
| 88 | cp /usr/local/src/xmlrpc-c-svn/lib/expat/xmltok/*.dll /usr/local/lib/ |
| 89 | cp /usr/local/src/xmlrpc-c-svn/lib/libutil/*.a /usr/local/lib/ |
| 90 | cp /usr/local/src/xmlrpc-c-svn/lib/libutil/*.dll /usr/local/lib/ |
| 91 | cp /usr/local/src/xmlrpc-c-svn/src/*.a /usr/local/lib/ |
| 92 | cp /usr/local/src/xmlrpc-c-svn/src/*.dll /usr/local/lib/ |
| 93 | }}} |
| 94 | |
| 95 | == Installing rTorrent == #rtorrent |
| 96 | |
| 97 | Now download the latest [http://libtorrent.rakshasa.no/ rTorrent] source from the [http://libtorrent.rakshasa.no/browser/trunk svn repository]. |
| 98 | |
| 99 | {{{ |
| 100 | svn co svn://rakshasa.no/libtorrent/trunk/rtorrent rtorrent-svn |
| 101 | cd rtorrent-svn |
| 102 | ./autogen.sh |
| 103 | ./configure --with-xmlrpc-c |
| 104 | }}} |
| 105 | |
| 106 | We are going to need to do some modification on the source code, to be able to compile [http://libtorrent.rakshasa.no/ rTorrent]. |
| 107 | First 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 | |
| 109 | in src/display/window_file_list.cc: |
| 110 | {{{ |
| 111 | #include <string> |
| 112 | namespace std { typedef std::basic_string <wchar_t> wstring; }; |
| 113 | }}} |
| 114 | |
| 115 | The remaining modifications are described in the [http://libtorrent.rakshasa.no/ rTorrent] trac, [http://libtorrent.rakshasa.no/ticket/1184 ticket #1184]. |
| 116 | |
| 117 | in 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 | |
| 124 | struct _transform_filename { |
| 125 | void operator () (utils::directory_entry& entry) { |
| 126 | if (S_ISDIR(entry.d_type)) |
| 127 | entry.d_name += '/'; |
| 128 | } |
| 129 | }; |
| 130 | }}} |
| 131 | |
| 132 | in 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 | |
| 140 | bool |
| 141 | Directory::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 | |
| 188 | in src/rpc/scgi.cc: change AF_LOCAL to AF_UNIX |
| 189 | |
| 190 | in src/signal_handler.h: use signal.h instead off sys/signal.h |
| 191 | |
| 192 | Modify 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)]] |