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]. |