the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: libtorrent15
Version: 0.12.9
Revision: 1
License: GPL
HomePage: http://libtorrent.rakshasa.no
Description: Bittorrent library
Maintainer: David Fang
Depends: %n-shlibs (=%v-%r)
BuildDepends: fink (>= 0.24.12), libsigc++2, system-openssl-dev, pkgconfig (>= 0.9-1)
BuildConflicts: openssl-dev, openssl097-dev, openssl098-dev
Conflicts: libtorrent, libtorrent11, libtorrent12
Replaces: libtorrent, libtorrent11, libtorrent12
Source: http://libtorrent.rakshasa.no/downloads/libtorrent-%v.tar.gz
Source-MD5: b128bbd324f03eb42ef5060080f87548
# Source-SHA1: bf7082f98bd6281493cba94a456697fb88c2c21b
PatchFile: %n.patch
PatchFile-MD5: 8465b02c2abf57b7b31cd30d74e25279
#PKG_CONFIG_PATH: %p/lib/system-openssl/lib/pkgconfig
BuildDependsOnly: true
GCC: 4.0
SetCPPFLAGS: -I%p/lib/system-openssl/include
SetLDFLAGS: -L%p/lib/system-openssl/lib
ConfigureParams: --enable-ipv6 --with-kqueue
CompileScript:<<
PKG_CONFIG_PATH=%p/lib/system-openssl/lib/pkgconfig ./configure %c
make
<<
InstallScript:
DocFiles: <<
AUTHORS
COPYING
ChangeLog
NEWS
README
<<
SplitOff: <<
Package: %N-shlibs
Depends: libsigc++2-shlibs
Files: lib/libtorrent.14.dylib
Shlibs: %p/lib/libtorrent.14.dylib 15.0.0 %n (>= 0.12.9-1)
DocFiles: <<
AUTHORS
COPYING
ChangeLog
NEWS
README
<<
<<
DescPackaging: <<
pkgconfig does not find the system openssl
Library version info and name change inconsistently between major versions.
Former maintainer: Michal Suchanek
<<
DescPort: <<
fangism:
Some C++ related patching was necessary to get the source to compile against
g++-4.0, even though upstream requires g++-4.2 or higher.
Also, some POSIX APIs that were expected for atomic operations were
mapped to darwin8 equivalents.
<<
--- libtorrent-0.12.9-orig/rak/allocators.h 2011-06-21 22:37:15.000000000 -0700
+++ libtorrent-0.12.9/rak/allocators.h 2011-06-21 22:42:44.000000000 -0700
@@ -77,8 +77,15 @@
static pointer alloc_size(size_type size) {
pointer ptr = NULL;
+#ifdef HAVE_POSIX_MEMALIGN
int __UNUSED result = posix_memalign((void**)&ptr, LT_SMP_CACHE_BYTES, size);
+#elif defined(__APPLE__)
+ // apple-darwin's malloc is already Altivec-aligned (16B)
+ ptr = static_cast
+#else
+#error "Missing equivalent of posix_memalign()."
+#endif
return ptr;
}
--- libtorrent-0.12.9-orig/src/torrent/thread_base.h 2011-06-21 23:12:25.000000000 -0700
+++ libtorrent-0.12.9/src/torrent/thread_base.h 2011-06-21 23:33:19.000000000 -0700
@@ -37,6 +37,19 @@
#ifndef LIBTORRENT_THREAD_BASE_H
#define LIBTORRENT_THREAD_BASE_H
+#if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
+#if defined(__APPLE__)
+#define USE_DARWIN_ATOMICS
+#endif
+#endif
+
+#ifdef USE_DARWIN_ATOMICS
+#include
+#define __sync_add_and_fetch(x, y) OSAtomicIncrement32Barrier(x)
+#define __sync_sub_and_fetch(x, y) OSAtomicDecrement32Barrier(x)
+#define __sync_lock_test_and_set(x, y) OSAtomicTestAndSetBarrier(y, x)
+#endif
+
#include
#include
#include
--- libtorrent-0.12.9-orig/src/net/socket_set.h 2011-06-26 21:28:11.000000000 -0700
+++ libtorrent-0.12.9/src/net/socket_set.h 2011-06-26 21:28:56.000000000 -0700
@@ -53,12 +53,12 @@
// Propably should rename to EventSet...
-class SocketSet : private std::vector
+class SocketSet : private std::vector
public:
typedef uint32_t size_type;
- typedef std::vector
- typedef std::vector
+ typedef std::vector
+ typedef std::vector
static const size_type npos = static_cast
--- libtorrent-0.12.9-orig/src/torrent/utils/extents.h 2011-07-16 17:26:37.000000000 -0700
+++ libtorrent-0.12.9/src/torrent/utils/extents.h 2011-07-17 00:28:48.000000000 -0700
@@ -39,6 +39,19 @@
#include
+#if (__GNUC__ == 4 && __GNUC_MINOR__ < 1 && __GNUC_PATCHLEVEL__ < 2)
+// apple-gcc-4.0.1 missing definition of std::tr1::array::assign
+namespace std {
+namespace tr1 {
+template
+void
+array<_Tp,_Nm>::assign(const value_type& v) {
+ std::fill_n(this->begin(), this->size(), v);
+}
+} // end namespace tr1
+} // end namespace std
+#endif
+
namespace torrent {
template