Skip to content

Instantly share code, notes, and snippets.

@steeve
Created March 18, 2014 15:31
Show Gist options
  • Save steeve/9622435 to your computer and use it in GitHub Desktop.
Save steeve/9622435 to your computer and use it in GitHub Desktop.
rm -rf build/darwin_x64
true
/Library/Developer/CommandLineTools/usr/bin/make -C /Users/steeve/projects/go/src/github.com/steeve/libtorrent-go clean all
rm -rf libtorrent_wrap.o libtorrent_wrap.cxx libtorrent_gc.c libtorrent.go *.o build/darwin_x64
swig -go -c++ -D__GNUC__ -soname dummy -intgosize 64 -DTORRENT_USE_OPENSSL -DWITH_SHIPPED_GEOIP_H -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -DTORRENT_LINKING_SHARED -I/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include -I/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent -I/usr/local/include -D__APPLE__ -D__MACH__ -o libtorrent_wrap.cxx -outdir . libtorrent.i
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/config.hpp:301: Warning 204: CPP #warning, "unknown platform, assuming the longest path is 255".
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/size_type.hpp:48: Warning 302: Identifier 'size_type' redefined (ignored),
libtorrent.i:14: Warning 302: previous definition of 'size_type'.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:109: Warning 314: 'type' is a Go keyword, renaming to 'Xtype'
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:94: Warning 314: 'type' is a Go keyword, renaming to 'Xtype'
alert.i:50: Warning 314: 'type' is a Go keyword, renaming to 'Xtype'
session_settings.i:48: Warning 314: 'type' is a Go keyword, renaming to 'Xtype'
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/session_status.hpp:47: Warning 314: 'type' is a Go keyword, renaming to 'Xtype'
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/session.hpp:135: Warning 319: No access specifier given for base class 'aux::eh_initializer' (ignored).
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/bitfield.hpp:186: Warning 325: Nested struct not currently supported (const_iterator ignored)
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:81: Warning 401: Nothing known about base class 'std::runtime_error'. Ignored.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/session.hpp:135: Warning 401: Nothing known about base class 'boost::noncopyable'. Ignored.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:121: Warning 503: Can't wrap 'operator ==' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:123: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:124: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:125: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:126: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:127: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:128: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:131: Warning 516: Overloaded method libtorrent::entry::integer() const ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:130: Warning 516: using libtorrent::entry::integer() instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:133: Warning 516: Overloaded method libtorrent::entry::string() const ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:132: Warning 516: using libtorrent::entry::string() instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:135: Warning 516: Overloaded method libtorrent::entry::list() const ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:134: Warning 516: using libtorrent::entry::list() instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:137: Warning 516: Overloaded method libtorrent::entry::dict() const ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:136: Warning 516: using libtorrent::entry::dict() instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:143: Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:144: Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:146: Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:147: Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:150: Warning 516: Overloaded method libtorrent::entry::find_key(char const *) const ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:149: Warning 516: using libtorrent::entry::find_key(char const *) instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:152: Warning 516: Overloaded method libtorrent::entry::find_key(std::string const &) const ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:151: Warning 516: using libtorrent::entry::find_key(std::string const &) instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:149: Warning 516: Overloaded method libtorrent::entry::find_key(char const *) ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/entry.hpp:150: Warning 516: using libtorrent::entry::find_key(char const *) const instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:74: Warning 451: Setting a const char * variable may leak memory.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:79: Warning 503: Can't wrap 'operator <' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:162: Warning 516: Overloaded method libtorrent::lazy_entry::dict_find(char const *) const ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:160: Warning 516: using libtorrent::lazy_entry::dict_find(char const *) instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:200: Warning 516: Overloaded method libtorrent::lazy_entry::list_at(int) const ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:198: Warning 516: using libtorrent::lazy_entry::list_at(int) instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:282: Warning 451: Setting a const char * variable may leak memory.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/lazy_entry.hpp:289: Warning 503: Can't wrap 'operator <<' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:140: Warning 503: Can't wrap 'operator <<=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:167: Warning 503: Can't wrap 'operator >>=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:172: Warning 503: Can't wrap 'operator ==' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:177: Warning 503: Can't wrap 'operator !=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:187: Warning 503: Can't wrap 'operator <' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:195: Warning 503: Can't wrap 'operator ~' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:202: Warning 503: Can't wrap 'operator ^' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:209: Warning 503: Can't wrap 'operator &' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:216: Warning 503: Can't wrap 'operator &=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:223: Warning 503: Can't wrap 'operator |=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:230: Warning 503: Can't wrap 'operator ^=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:233: Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:236: Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:244: Warning 516: Overloaded method libtorrent::big_number::begin() ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:241: Warning 516: using libtorrent::big_number::begin() const instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:245: Warning 516: Overloaded method libtorrent::big_number::end() ignored,
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:242: Warning 516: using libtorrent::big_number::end() const instead.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:265: Warning 503: Can't wrap 'operator <<' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/peer_id.hpp:274: Warning 503: Can't wrap 'operator >>' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/file_storage.hpp:112: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
torrent_info.i:210: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
torrent_info.i:243: Warning 451: Setting a const char * variable may leak memory.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:61: Warning 503: Can't wrap 'operator /' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:63: Warning 503: Can't wrap 'operator -=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:64: Warning 503: Can't wrap 'operator +=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:65: Warning 503: Can't wrap 'operator *=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:66: Warning 503: Can't wrap 'operator +' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:67: Warning 503: Can't wrap 'operator -' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:76: Warning 503: Can't wrap 'operator +=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:77: Warning 503: Can't wrap 'operator -=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:82: Warning 503: Can't wrap 'operator >' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:84: Warning 503: Can't wrap 'operator >=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:86: Warning 503: Can't wrap 'operator <=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:88: Warning 503: Can't wrap 'operator <' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:90: Warning 503: Can't wrap 'operator !=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:92: Warning 503: Can't wrap 'operator ==' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:96: Warning 503: Can't wrap 'operator ==' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:98: Warning 503: Can't wrap 'operator <' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:100: Warning 503: Can't wrap 'operator <=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:102: Warning 503: Can't wrap 'operator >' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:104: Warning 503: Can't wrap 'operator >=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:106: Warning 503: Can't wrap 'operator *' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:108: Warning 503: Can't wrap 'operator *' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:111: Warning 503: Can't wrap 'operator -' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:113: Warning 503: Can't wrap 'operator +' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:115: Warning 503: Can't wrap 'operator +' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/ptime.hpp:117: Warning 503: Can't wrap 'operator -' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/add_torrent_params.hpp:119: Warning 451: Setting a const char * variable may leak memory.
alert_types.i:288: Warning 451: Setting a const char * variable may leak memory.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/session_status.hpp:47: Warning 451: Setting a const char * variable may leak memory.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/bitfield.hpp:69: Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/bitfield.hpp:101: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/torrent_handle.hpp:161: Warning 503: Can't wrap 'libtorrent::hash_value' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/torrent_handle.hpp:420: Warning 503: Can't wrap 'operator ==' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/torrent_handle.hpp:423: Warning 503: Can't wrap 'operator !=' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/torrent_handle.hpp:426: Warning 503: Can't wrap 'operator <' unless renamed to a valid identifier.
/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent/torrent_handle.hpp:450: Warning 503: Can't wrap 'operator ==' unless renamed to a valid identifier.
sed -i '' 's/} \*swig_a/} __attribute__((__packed__)) \*swig_a/g' libtorrent_wrap.cxx
sed -i '' 's/} a/} __attribute__((__packed__)) a/g' libtorrent_wrap.cxx
sed -i '' 's/#pragma dynimport _ _ ".*"//g' libtorrent_gc.c
sed -i '' 's/#pragma dynimport \(.*\) .* ""/#pragma cgo_import_static \1/g' libtorrent_gc.c
echo "#pragma cgo_ldflag \"/Users/steeve/projects/go/src/github.com/steeve/libtorrent-go/libtorrent_wrap.o\"" > libtorrent_gc.cgo
for flag in -O2 -Wno-deprecated -Wno-deprecated-declarations -DTORRENT_USE_OPENSSL -DWITH_SHIPPED_GEOIP_H -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -DTORRENT_LINKING_SHARED -I/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include -I/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent -fPIC -mmacosx-version-min=10.6 -L/usr/local/Cellar/libtorrent-rasterbar/0.16.13/lib -ltorrent-rasterbar -lboost_system-mt -lssl -lcrypto -lz -lm -lssl -lcrypto -lstdc++; do\
echo "#pragma cgo_ldflag \"$flag\"" >> libtorrent_gc.cgo ;\
done
cat libtorrent_gc.c >> libtorrent_gc.cgo
mv libtorrent_gc.cgo libtorrent_gc.c
clang++ -O2 -Wno-deprecated -Wno-deprecated-declarations -DTORRENT_USE_OPENSSL -DWITH_SHIPPED_GEOIP_H -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -DTORRENT_LINKING_SHARED -I/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include -I/usr/local/Cellar/libtorrent-rasterbar/0.16.13/include/libtorrent -fPIC -mmacosx-version-min=10.6 -c libtorrent_wrap.cxx -o libtorrent_wrap.o
rm -rf libtorrent_wrap.cxx
mkdir -p build/darwin_x64
CC=clang GOOS=darwin GOARCH= GOARM= CGO_ENABLED=1 go build -v -o build/darwin_x64/torrent2http -ldflags="-linkmode=external -extld=clang"
github.com/steeve/libtorrent-go
github.com/steeve/torrent2http
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment