mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-09 14:28:22 +00:00
Merge branch 'master' of git://github.com/miguelfreitas/twister-core into dht_refresh_1
Conflicts: libtorrent/include/libtorrent/ptime.hpp
This commit is contained in:
commit
2e17020e46
26
Makefile.am
26
Makefile.am
@ -3,8 +3,16 @@ ACLOCAL_AMFLAGS = -I m4
|
|||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
COPYING
|
COPYING
|
||||||
|
|
||||||
SUBDIRS = src/leveldb
|
LIBLEVELDB = src/leveldb/libleveldb.a
|
||||||
LEVELDB_LIB = src/leveldb/libleveldb.a src/leveldb/libmemenv.a
|
LIBMEMENV = src/leveldb/libmemenv.a
|
||||||
|
|
||||||
|
# NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race
|
||||||
|
$(LIBLEVELDB): $(LIBMEMENV)
|
||||||
|
|
||||||
|
$(LIBLEVELDB) $(LIBMEMENV):
|
||||||
|
@echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \
|
||||||
|
CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \
|
||||||
|
OPT="$(CXXFLAGS) $(CPPFLAGS)"
|
||||||
|
|
||||||
bin_PROGRAMS = twisterd
|
bin_PROGRAMS = twisterd
|
||||||
|
|
||||||
@ -162,17 +170,13 @@ BITCOIN_TWISTER_SOURCES = \
|
|||||||
src/twister_utils.cpp \
|
src/twister_utils.cpp \
|
||||||
$(SSE2_SOURCES)
|
$(SSE2_SOURCES)
|
||||||
|
|
||||||
if USE_UPNP
|
|
||||||
UPNP_LIB = -lminiupnpc
|
|
||||||
endif
|
|
||||||
|
|
||||||
twisterd_SOURCES = $(LIBTORRENT_SOURCES) $(BITCOIN_TWISTER_SOURCES)
|
twisterd_SOURCES = $(LIBTORRENT_SOURCES) $(BITCOIN_TWISTER_SOURCES)
|
||||||
|
|
||||||
twisterd_LDFLAGS = @OPENSSL_LDFLAGS@ @DB_CXX_LDFLAGS@
|
twisterd_LDFLAGS = @OPENSSL_LDFLAGS@ @DB_CXX_LDFLAGS@
|
||||||
|
|
||||||
twisterd_DEPENDENCIES = $(LEVELDB_LIB)
|
twisterd_DEPENDENCIES = $(LIBLEVELDB) $(LIBMEMENV)
|
||||||
|
|
||||||
twisterd_LDADD = $(LEVELDB_LIB) $(UPNP_LIB) \
|
twisterd_LDADD = $(LIBLEVELDB) $(LIBMEMENV) \
|
||||||
@BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_PROGRAM_OPTIONS_LIB@ @BOOST_THREAD_LIB@ @BOOST_CHRONO_LIB@ @BOOST_LOCALE_LIB@ \
|
@BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_PROGRAM_OPTIONS_LIB@ @BOOST_THREAD_LIB@ @BOOST_CHRONO_LIB@ @BOOST_LOCALE_LIB@ \
|
||||||
@BOOST_REGEX_LIB@ @DB_CXX_LIBS@ @OPENSSL_LIBS@
|
@BOOST_REGEX_LIB@ @DB_CXX_LIBS@ @OPENSSL_LIBS@
|
||||||
|
|
||||||
@ -183,3 +187,9 @@ AM_CPPFLAGS = -ftemplate-depth-100 -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS
|
|||||||
@DEBUGFLAGS@ @OPENSSL_INCLUDES@ @DB_CXX_CPPFLAGS@
|
@DEBUGFLAGS@ @OPENSSL_INCLUDES@ @DB_CXX_CPPFLAGS@
|
||||||
|
|
||||||
AM_LDFLAGS = @OPENSSL_LDFLAGS@
|
AM_LDFLAGS = @OPENSSL_LDFLAGS@
|
||||||
|
|
||||||
|
CLEANFILES = $(LIBLEVELDB) $(LIBMEMENV)
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
-$(MAKE) -C src/leveldb clean
|
||||||
|
rm -f src/leveldb/*/*.gcno src/leveldb/helpers/memenv/*.gcno
|
||||||
|
20
README.md
20
README.md
@ -28,18 +28,18 @@ Please follow the instructions for your platform:
|
|||||||
- [Mac OS X](https://github.com/miguelfreitas/twister-core/blob/master/doc/build-osx.md)
|
- [Mac OS X](https://github.com/miguelfreitas/twister-core/blob/master/doc/build-osx.md)
|
||||||
- [Windows (untested)](https://github.com/miguelfreitas/twister-core/wiki/Compiling-for-Windows)
|
- [Windows (untested)](https://github.com/miguelfreitas/twister-core/wiki/Compiling-for-Windows)
|
||||||
|
|
||||||
Or, alternatively, you can run Twister on an isolated Linux container, using [docker](http://docker.io/). Quickstart:
|
|
||||||
|
|
||||||
# Prepend "sudo -E" if you are not logged in as root
|
|
||||||
./twister-on-docker run --remote
|
|
||||||
|
|
||||||
The above command downloads and runs a [pre-built image](https://index.docker.io/u/mazzolino/twister/) from the Docker index. You can also build and run your own container:
|
|
||||||
|
|
||||||
./twister-on-docker build
|
|
||||||
./twister-on-docker run
|
|
||||||
|
|
||||||
> According to our tests, at least 1GB of RAM is needed to compile Twister.
|
> According to our tests, at least 1GB of RAM is needed to compile Twister.
|
||||||
|
|
||||||
|
Alternatively, you can run Twister on an isolated Linux container, using [Docker](http://docker.io/). First, [install Docker on your system](https://docs.docker.com/installation/#installation). Then run:
|
||||||
|
|
||||||
|
# Leave out the "sudo -E" if you added yourself to the "docker" group
|
||||||
|
sudo -E ./twister-on-docker run --remote
|
||||||
|
|
||||||
|
The above command downloads and runs a [pre-built image](https://registry.hub.docker.com/u/miguelfreitas/twister) from the Docker index. You can also build and run your own container:
|
||||||
|
|
||||||
|
sudo -E ./twister-on-docker build
|
||||||
|
sudo -E ./twister-on-docker run
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Bitcoin is released under the terms of the MIT license. See `COPYING` for more
|
Bitcoin is released under the terms of the MIT license. See `COPYING` for more
|
||||||
|
108
configure.ac
108
configure.ac
@ -51,6 +51,82 @@ AS_ECHO "Initializing Libtool:"
|
|||||||
LT_PREREQ([2.2.6])
|
LT_PREREQ([2.2.6])
|
||||||
LT_INIT
|
LT_INIT
|
||||||
|
|
||||||
|
# host checks from bitcoin's configure.ac
|
||||||
|
case $host in
|
||||||
|
*mingw*)
|
||||||
|
TARGET_OS=windows
|
||||||
|
AC_CHECK_LIB([mingwthrd], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([kernel32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([winspool], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([shell32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([ole32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([rpcrt4], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([advapi32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([ws2_32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([mswsock], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([shlwapi], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing))
|
||||||
|
|
||||||
|
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
|
||||||
|
LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE"
|
||||||
|
if test "x$CXXFLAGS_overridden" = "xno"; then
|
||||||
|
CXXFLAGS="$CXXFLAGS -w"
|
||||||
|
fi
|
||||||
|
case $host in
|
||||||
|
i?86-*) WINDOWS_BITS=32 ;;
|
||||||
|
x86_64-*) WINDOWS_BITS=64 ;;
|
||||||
|
*) AC_MSG_ERROR("Could not determine win32/win64 for installer") ;;
|
||||||
|
esac
|
||||||
|
AC_SUBST(WINDOWS_BITS)
|
||||||
|
;;
|
||||||
|
*darwin*)
|
||||||
|
TARGET_OS=darwin
|
||||||
|
LEVELDB_TARGET_FLAGS="TARGET_OS=Darwin"
|
||||||
|
if test x$cross_compiling != xyes; then
|
||||||
|
BUILD_OS=darwin
|
||||||
|
AC_CHECK_PROG([PORT],port, port)
|
||||||
|
if test x$PORT = xport; then
|
||||||
|
dnl add default macports paths
|
||||||
|
CPPFLAGS="$CPPFLAGS -isystem /opt/local/include -I/opt/local/include/db48"
|
||||||
|
LIBS="$LIBS -L/opt/local/lib -L/opt/local/lib/db48"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_PROG([BREW],brew, brew)
|
||||||
|
if test x$BREW = xbrew; then
|
||||||
|
dnl add default homebrew paths
|
||||||
|
openssl_prefix=`$BREW --prefix openssl`
|
||||||
|
bdb_prefix=`$BREW --prefix berkeley-db4`
|
||||||
|
export PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
|
||||||
|
LIBS="$LIBS -L$bdb_prefix/lib"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
case $build_os in
|
||||||
|
*darwin*)
|
||||||
|
BUILD_OS=darwin
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
|
||||||
|
AC_PATH_TOOL([OTOOL], [otool], otool)
|
||||||
|
AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
CPPFLAGS="$CPPFLAGS -DMAC_OSX"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Checking for needed base libraries
|
# Checking for needed base libraries
|
||||||
@ -127,7 +203,7 @@ AC_CHECK_FUNCS([gethostbyname], [],
|
|||||||
[AC_CHECK_LIB([socket], [gethostbyname], [],
|
[AC_CHECK_LIB([socket], [gethostbyname], [],
|
||||||
[AC_CHECK_LIB([ws2_32], [main],
|
[AC_CHECK_LIB([ws2_32], [main],
|
||||||
[AC_CHECK_LIB([wsock32], [main],
|
[AC_CHECK_LIB([wsock32], [main],
|
||||||
[LIBS="-lws2_32 -lwsock32 $LIBS"],
|
[LIBS="-lws2_32 -lwsock32 -lgdi32 -lcrypt32 $LIBS"],
|
||||||
[AC_MSG_ERROR([wsock32 function not found.])])],
|
[AC_MSG_ERROR([wsock32 function not found.])])],
|
||||||
[AC_MSG_ERROR([gethostbyname function not found.])])])])])]
|
[AC_MSG_ERROR([gethostbyname function not found.])])])])])]
|
||||||
)
|
)
|
||||||
@ -205,16 +281,6 @@ AC_ARG_ENABLE(
|
|||||||
[[ARG_ENABLE_SSE2=yes]]
|
[[ARG_ENABLE_SSE2=yes]]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_ARG_ENABLE(
|
|
||||||
[upnp],
|
|
||||||
[AS_HELP_STRING(
|
|
||||||
[--enable-upnp],
|
|
||||||
[enable miniupnp support [default=yes]])],
|
|
||||||
[[ARG_ENABLE_UPNP=$enableval]],
|
|
||||||
[[ARG_ENABLE_UPNP=yes]]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(
|
AC_ARG_ENABLE(
|
||||||
[pool-allocators],
|
[pool-allocators],
|
||||||
[AS_HELP_STRING(
|
[AS_HELP_STRING(
|
||||||
@ -465,7 +531,7 @@ AS_CASE(["$ARG_ENABLE_SSE2"],
|
|||||||
["yes"|"on"], [
|
["yes"|"on"], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE([USE_SSE2],[1],[Enable SSE2])
|
AC_DEFINE([USE_SSE2],[1],[Enable SSE2])
|
||||||
CXXFLAGS="$CXXFLAGS -DUSE_SSE2 -msse2 "
|
CXXFLAGS="$CXXFLAGS -DUSE_SSE2 -msse2 -mstackrealign "
|
||||||
],
|
],
|
||||||
["no"|"off"], [
|
["no"|"off"], [
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
@ -474,21 +540,6 @@ AS_CASE(["$ARG_ENABLE_SSE2"],
|
|||||||
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_SSE2". Use either "yes" or "no".])]
|
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_SSE2". Use either "yes" or "no".])]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether miniupnp should be enabled])
|
|
||||||
AS_CASE(["$ARG_ENABLE_UPNP"],
|
|
||||||
["yes"|"on"], [
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
AC_DEFINE([USE_UPNP],[1],[Enable miniupnp])
|
|
||||||
COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -DUSE_UPNP=1 "
|
|
||||||
],
|
|
||||||
["no"|"off"], [
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
],
|
|
||||||
[AC_MSG_RESULT([$ARG_ENABLE_UPNP])
|
|
||||||
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_UPNP". Use either "yes" or "no".])]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether geoip support should be enabled])
|
AC_MSG_CHECKING([whether geoip support should be enabled])
|
||||||
AS_CASE(["$ARG_ENABLE_GEOIP"],
|
AS_CASE(["$ARG_ENABLE_GEOIP"],
|
||||||
["yes"], [
|
["yes"], [
|
||||||
@ -652,7 +703,6 @@ AM_CONDITIONAL([ENABLE_PYTHON_BINDING], [test "x$ARG_ENABLE_PYTHON_BINDING" = "x
|
|||||||
AM_CONDITIONAL([WITH_SHIPPED_GEOIP], [test "x$ARG_WITH_LIBGEOIP" = "xno" ])
|
AM_CONDITIONAL([WITH_SHIPPED_GEOIP], [test "x$ARG_WITH_LIBGEOIP" = "xno" ])
|
||||||
AM_CONDITIONAL([WITH_OPENSSL], [test "x$ARG_ENABLE_ENCRYPTION" = "xyes" -o "x$ARG_ENABLE_ENCRYPTION" = "xon" ])
|
AM_CONDITIONAL([WITH_OPENSSL], [test "x$ARG_ENABLE_ENCRYPTION" = "xyes" -o "x$ARG_ENABLE_ENCRYPTION" = "xon" ])
|
||||||
AM_CONDITIONAL([USE_SSE2], [test "x$ARG_ENABLE_SSE2" = "xyes" -o "x$ARG_ENABLE_SSE2" = "xon" ])
|
AM_CONDITIONAL([USE_SSE2], [test "x$ARG_ENABLE_SSE2" = "xyes" -o "x$ARG_ENABLE_SSE2" = "xon" ])
|
||||||
AM_CONDITIONAL([USE_UPNP], [test "x$ARG_ENABLE_UPNP" = "xyes" -o "x$ARG_ENABLE_UPNP" = "xon" ])
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Other useful stuff
|
# Other useful stuff
|
||||||
@ -685,6 +735,7 @@ AS_IF([test "x$enable_shared" = "xyes"],
|
|||||||
AC_SUBST(DEBUGFLAGS)
|
AC_SUBST(DEBUGFLAGS)
|
||||||
AC_SUBST(PYTHON_INSTALL_PARAMS)
|
AC_SUBST(PYTHON_INSTALL_PARAMS)
|
||||||
AC_SUBST(COMPILETIME_OPTIONS)
|
AC_SUBST(COMPILETIME_OPTIONS)
|
||||||
|
AC_SUBST(LEVELDB_TARGET_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
# Try to guess real svn revision if any, fallback to hardcoded otherwise
|
# Try to guess real svn revision if any, fallback to hardcoded otherwise
|
||||||
@ -751,7 +802,6 @@ Build options:
|
|||||||
Features:
|
Features:
|
||||||
encryption support: ${ARG_ENABLE_ENCRYPTION:-yes}
|
encryption support: ${ARG_ENABLE_ENCRYPTION:-yes}
|
||||||
SSE2 Scrypt: ${ARG_ENABLE_SSE2:-yes}
|
SSE2 Scrypt: ${ARG_ENABLE_SSE2:-yes}
|
||||||
miniupnp support: ${ARG_ENABLE_UPNP:-yes}
|
|
||||||
geoip support: ${ARG_ENABLE_GEOIP:-yes}
|
geoip support: ${ARG_ENABLE_GEOIP:-yes}
|
||||||
dht support: ${ARG_ENABLE_DHT:-yes}
|
dht support: ${ARG_ENABLE_DHT:-yes}
|
||||||
pool allocators: ${ARG_ENABLE_POOL_ALLOC:-yes}
|
pool allocators: ${ARG_ENABLE_POOL_ALLOC:-yes}
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
Gavin's notes on getting gitian builds up and running using KVM:
|
|
||||||
|
|
||||||
These instructions distilled from:
|
|
||||||
https://help.ubuntu.com/community/KVM/Installation
|
|
||||||
... see there for complete details.
|
|
||||||
|
|
||||||
You need the right hardware: you need a 64-bit-capable CPU with hardware virtualization support (Intel VT-x or AMD-V). Not all modern CPUs support hardware virtualization.
|
|
||||||
|
|
||||||
You probably need to enable hardware virtualization in your machine's BIOS.
|
|
||||||
|
|
||||||
You need to be running a recent version of 64-bit-Ubuntu, and you need to install several prerequisites:
|
|
||||||
sudo apt-get install ruby apache2 git apt-cacher-ng python-vm-builder qemu-kvm
|
|
||||||
|
|
||||||
Sanity checks:
|
|
||||||
sudo service apt-cacher-ng status # Should return apt-cacher-ng is running
|
|
||||||
ls -l /dev/kvm # Should show a /dev/kvm device
|
|
||||||
|
|
||||||
|
|
||||||
Once you've got the right hardware and software:
|
|
||||||
|
|
||||||
git clone git://github.com/bitcoin/bitcoin.git
|
|
||||||
git clone git://github.com/devrandom/gitian-builder.git
|
|
||||||
mkdir gitian-builder/inputs
|
|
||||||
cd gitian-builder/inputs
|
|
||||||
# Inputs for Linux and Win32:
|
|
||||||
wget -O miniupnpc-1.6.tar.gz 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.tar.gz'
|
|
||||||
wget 'http://fukuchi.org/works/qrencode/qrencode-3.2.0.tar.bz2'
|
|
||||||
# Inputs for Win32: (Linux has packages for these)
|
|
||||||
wget 'https://downloads.sourceforge.net/project/boost/boost/1.50.0/boost_1_50_0.tar.bz2'
|
|
||||||
wget 'http://www.openssl.org/source/openssl-1.0.1c.tar.gz'
|
|
||||||
wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
|
|
||||||
wget 'https://downloads.sourceforge.net/project/libpng/zlib/1.2.6/zlib-1.2.6.tar.gz'
|
|
||||||
wget 'https://downloads.sourceforge.net/project/libpng/libpng15/older-releases/1.5.9/libpng-1.5.9.tar.gz'
|
|
||||||
wget 'http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.3.tar.gz'
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
cd gitian-builder
|
|
||||||
bin/make-base-vm --arch i386
|
|
||||||
bin/make-base-vm --arch amd64
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Build Linux release:
|
|
||||||
cd bitcoin
|
|
||||||
git pull
|
|
||||||
cd ../gitian-builder
|
|
||||||
git pull
|
|
||||||
./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/gitian.yml
|
|
||||||
|
|
||||||
# Build Win32 dependencies: (only needs to be done once, or when dependency versions change)
|
|
||||||
./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/boost-win32.yml
|
|
||||||
./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/deps-win32.yml
|
|
||||||
./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/qt-win32.yml
|
|
||||||
|
|
||||||
# Build Win32 release:
|
|
||||||
./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/gitian-win32.yml
|
|
||||||
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
gitian-builder now also supports building using LXC. See
|
|
||||||
https://help.ubuntu.com/12.04/serverguide/lxc.html
|
|
||||||
... for how to get LXC up and running under Ubuntu.
|
|
||||||
|
|
||||||
If your main machine is a 64-bit Mac or PC with a few gigabytes of memory
|
|
||||||
and at least 10 gigabytes of free disk space, you can gitian-build using
|
|
||||||
LXC running inside a virtual machine.
|
|
||||||
|
|
||||||
Here's a description of Gavin's setup on OSX 10.6:
|
|
||||||
|
|
||||||
1. Download and install VirtualBox from https://www.virtualbox.org/
|
|
||||||
|
|
||||||
2. Download the 64-bit Ubuntu Desktop 12.04 LTS .iso CD image from
|
|
||||||
http://www.ubuntu.com/
|
|
||||||
|
|
||||||
3. Run VirtualBox and create a new virtual machine, using the
|
|
||||||
Ubuntu .iso (see the VirtualBox documentation for details).
|
|
||||||
Create it with at least 2 gigabytes of memory and a disk
|
|
||||||
that is at least 20 gigabytes big.
|
|
||||||
|
|
||||||
4. Inside the running Ubuntu desktop, install:
|
|
||||||
sudo apt-get install debootstrap lxc ruby apache2 git apt-cacher-ng python-vm-builder
|
|
||||||
|
|
||||||
5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right
|
|
||||||
hardware and software" instructions above:
|
|
||||||
export USE_LXC=1
|
|
||||||
git clone git://github.com/bitcoin/bitcoin.git
|
|
||||||
... etc
|
|
67
contrib/gitian-descriptors/README.md
Normal file
67
contrib/gitian-descriptors/README.md
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
### Gavin's notes on getting gitian builds up and running using KVM:###
|
||||||
|
|
||||||
|
These instructions distilled from:
|
||||||
|
[ https://help.ubuntu.com/community/KVM/Installation]( https://help.ubuntu.com/community/KVM/Installation)
|
||||||
|
... see there for complete details.
|
||||||
|
|
||||||
|
You need the right hardware: you need a 64-bit-capable CPU with hardware virtualization support (Intel VT-x or AMD-V). Not all modern CPUs support hardware virtualization.
|
||||||
|
|
||||||
|
You probably need to enable hardware virtualization in your machine's BIOS.
|
||||||
|
|
||||||
|
You need to be running a recent version of 64-bit-Ubuntu, and you need to install several prerequisites:
|
||||||
|
|
||||||
|
sudo apt-get install ruby apache2 git apt-cacher-ng python-vm-builder qemu-kvm
|
||||||
|
|
||||||
|
Sanity checks:
|
||||||
|
|
||||||
|
sudo service apt-cacher-ng status # Should return apt-cacher-ng is running
|
||||||
|
ls -l /dev/kvm # Should show a /dev/kvm device
|
||||||
|
|
||||||
|
|
||||||
|
Once you've got the right hardware and software:
|
||||||
|
|
||||||
|
git clone git://github.com/bitcoin/bitcoin.git
|
||||||
|
git clone git://github.com/devrandom/gitian-builder.git
|
||||||
|
mkdir gitian-builder/inputs
|
||||||
|
cd gitian-builder/inputs
|
||||||
|
|
||||||
|
# Create base images
|
||||||
|
cd gitian-builder
|
||||||
|
bin/make-base-vm --suite precise --arch i386
|
||||||
|
bin/make-base-vm --suite precise --arch amd64
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Get inputs (see doc/release-process.md for exact inputs needed and where to get them)
|
||||||
|
...
|
||||||
|
|
||||||
|
# For further build instructions see doc/release-notes.md
|
||||||
|
...
|
||||||
|
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
`gitian-builder` now also supports building using LXC. See
|
||||||
|
[ https://help.ubuntu.com/12.04/serverguide/lxc.html]( https://help.ubuntu.com/12.04/serverguide/lxc.html)
|
||||||
|
... for how to get LXC up and running under Ubuntu.
|
||||||
|
|
||||||
|
If your main machine is a 64-bit Mac or PC with a few gigabytes of memory
|
||||||
|
and at least 10 gigabytes of free disk space, you can `gitian-build` using
|
||||||
|
LXC running inside a virtual machine.
|
||||||
|
|
||||||
|
Here's a description of Gavin's setup on OSX 10.6:
|
||||||
|
|
||||||
|
1. Download and install VirtualBox from [https://www.virtualbox.org/](https://www.virtualbox.org/)
|
||||||
|
|
||||||
|
2. Download the 64-bit Ubuntu Desktop 12.04 LTS .iso CD image from
|
||||||
|
[http://www.ubuntu.com/](http://www.ubuntu.com/)
|
||||||
|
|
||||||
|
3. Run VirtualBox and create a new virtual machine, using the Ubuntu .iso (see the [VirtualBox documentation](https://www.virtualbox.org/wiki/Documentation) for details). Create it with at least 2 gigabytes of memory and a disk that is at least 20 gigabytes big.
|
||||||
|
|
||||||
|
4. Inside the running Ubuntu desktop, install:
|
||||||
|
|
||||||
|
sudo apt-get install debootstrap lxc ruby apache2 git apt-cacher-ng python-vm-builder
|
||||||
|
|
||||||
|
5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right hardware and software" instructions above:
|
||||||
|
|
||||||
|
export USE_LXC=1
|
||||||
|
git clone git://github.com/bitcoin/bitcoin.git
|
||||||
|
... etc
|
55
contrib/gitian-descriptors/boost-linux.yml
Normal file
55
contrib/gitian-descriptors/boost-linux.yml
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
name: "boost"
|
||||||
|
suites:
|
||||||
|
- "precise"
|
||||||
|
architectures:
|
||||||
|
- "i386"
|
||||||
|
- "amd64"
|
||||||
|
packages:
|
||||||
|
- "g++"
|
||||||
|
- "unzip"
|
||||||
|
- "pkg-config"
|
||||||
|
- "libtool"
|
||||||
|
- "faketime"
|
||||||
|
- "bsdmainutils"
|
||||||
|
- "zip"
|
||||||
|
- "libz-dev"
|
||||||
|
reference_datetime: "2011-01-30 00:00:00"
|
||||||
|
remotes: []
|
||||||
|
files:
|
||||||
|
- "boost_1_55_0.tar.bz2"
|
||||||
|
script: |
|
||||||
|
STAGING="$HOME/install"
|
||||||
|
TEMPDIR="$HOME/tmp"
|
||||||
|
export LIBRARY_PATH="$STAGING/lib"
|
||||||
|
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
||||||
|
export FAKETIME=$REFERENCE_DATETIME
|
||||||
|
export TZ=UTC
|
||||||
|
# Input Integrity Check
|
||||||
|
echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c
|
||||||
|
|
||||||
|
mkdir -p "$STAGING"
|
||||||
|
tar --warning=no-timestamp -xjf boost_1_55_0.tar.bz2
|
||||||
|
cd boost_1_55_0
|
||||||
|
GCCVERSION=$(g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2)
|
||||||
|
# note: bjam with -d+2 reveals that -O3 is implied by default, no need to provide it in cxxflags
|
||||||
|
echo "using gcc : $GCCVERSION : g++
|
||||||
|
:
|
||||||
|
<cxxflags>\"-frandom-seed=boost1 -fPIC\"
|
||||||
|
;" > user-config.jam
|
||||||
|
|
||||||
|
./bootstrap.sh --without-icu
|
||||||
|
|
||||||
|
./bjam toolset=gcc threadapi=pthread threading=multi variant=release link=static runtime-link=shared --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 --layout=tagged --build-type=complete --prefix="$STAGING" $MAKEOPTS -d+2 install
|
||||||
|
|
||||||
|
# post-process all generated libraries to be deterministic
|
||||||
|
# extract them to a temporary directory then re-build them deterministically
|
||||||
|
for LIB in $(find $STAGING -name \*.a); do
|
||||||
|
rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR
|
||||||
|
ar xv $LIB | cut -b5- > /tmp/list.txt
|
||||||
|
rm $LIB
|
||||||
|
ar crsD $LIB $(cat /tmp/list.txt)
|
||||||
|
done
|
||||||
|
#
|
||||||
|
cd "$STAGING"
|
||||||
|
find | sort | zip -X@ $OUTDIR/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip
|
86
contrib/gitian-descriptors/boost-win.yml
Normal file
86
contrib/gitian-descriptors/boost-win.yml
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
---
|
||||||
|
name: "boost"
|
||||||
|
suites:
|
||||||
|
- "precise"
|
||||||
|
architectures:
|
||||||
|
- "amd64"
|
||||||
|
packages:
|
||||||
|
- "mingw-w64"
|
||||||
|
- "g++-mingw-w64"
|
||||||
|
- "faketime"
|
||||||
|
- "zip"
|
||||||
|
reference_datetime: "2011-01-30 00:00:00"
|
||||||
|
remotes: []
|
||||||
|
files:
|
||||||
|
- "boost_1_55_0.tar.bz2"
|
||||||
|
- "boost-mingw-gas-cross-compile-2013-03-03.patch"
|
||||||
|
script: |
|
||||||
|
# Defines
|
||||||
|
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
||||||
|
export FAKETIME=$REFERENCE_DATETIME
|
||||||
|
export TZ=UTC
|
||||||
|
INDIR=$HOME/build
|
||||||
|
TEMPDIR=$HOME/tmp
|
||||||
|
# Input Integrity Check
|
||||||
|
echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c
|
||||||
|
echo "d2b7f6a1d7051faef3c9cf41a92fa3671d905ef1e1da920d07651a43299f6268 boost-mingw-gas-cross-compile-2013-03-03.patch" | shasum -c
|
||||||
|
|
||||||
|
for BITS in 32 64; do # for architectures
|
||||||
|
#
|
||||||
|
INSTALLPREFIX=$HOME/staging${BITS}
|
||||||
|
BUILDDIR=$HOME/build${BITS}
|
||||||
|
if [ "$BITS" == "32" ]; then
|
||||||
|
HOST=i686-w64-mingw32
|
||||||
|
else
|
||||||
|
HOST=x86_64-w64-mingw32
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
mkdir -p $INSTALLPREFIX $BUILDDIR
|
||||||
|
cd $BUILDDIR
|
||||||
|
#
|
||||||
|
tar --warning=no-timestamp -xjf $INDIR/boost_1_55_0.tar.bz2
|
||||||
|
cd boost_1_55_0
|
||||||
|
GCCVERSION=$($HOST-g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2)
|
||||||
|
echo "using gcc : $GCCVERSION : $HOST-g++
|
||||||
|
:
|
||||||
|
<rc>$HOST-windres
|
||||||
|
<archiver>$HOST-ar
|
||||||
|
<cxxflags>-frandom-seed=boost1
|
||||||
|
<ranlib>$HOST-ranlib
|
||||||
|
;" > user-config.jam
|
||||||
|
./bootstrap.sh --without-icu
|
||||||
|
|
||||||
|
# Workaround: Upstream boost dev refuses to include patch that would allow Free Software cross-compile toolchain to work
|
||||||
|
# This patch was authored by the Fedora package developer and ships in Fedora's mingw32-boost.
|
||||||
|
# Please obtain the exact patch that matches the above sha256sum from one of the following mirrors.
|
||||||
|
#
|
||||||
|
# Read History: https://svn.boost.org/trac/boost/ticket/7262
|
||||||
|
# History Mirror: http://rose.makesad.us/~paulproteus/mirrors/7262%20Boost.Context%20fails%20to%20build%20using%20MinGW.html
|
||||||
|
#
|
||||||
|
# Patch: https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch
|
||||||
|
# Patch Mirror: http://wtogami.fedorapeople.org/boost-mingw-gas-cross-compile-2013-03-03.patch
|
||||||
|
# Patch Mirror: http://mindstalk.net/host/boost-mingw-gas-cross-compile-2013-03-03.patch
|
||||||
|
# Patch Mirror: http://rose.makesad.us/~paulproteus/mirrors/boost-mingw-gas-cross-compile-2013-03-03.patch
|
||||||
|
patch -p0 < $INDIR/boost-mingw-gas-cross-compile-2013-03-03.patch
|
||||||
|
|
||||||
|
# Bug Workaround: boost-1.54.0 broke the ability to disable zlib, still broken in 1.55
|
||||||
|
# https://svn.boost.org/trac/boost/ticket/9156
|
||||||
|
sed -i 's^\[ ac.check-library /zlib//zlib : <library>/zlib//zlib^^' libs/iostreams/build/Jamfile.v2
|
||||||
|
sed -i 's^<source>zlib.cpp <source>gzip.cpp \]^^' libs/iostreams/build/Jamfile.v2
|
||||||
|
|
||||||
|
# http://statmt.org/~s0565741/software/boost_1_52_0/libs/context/doc/html/context/requirements.html
|
||||||
|
# "For cross-compiling the lib you must specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model."
|
||||||
|
./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 address-model=$BITS threading=multi variant=release link=static runtime-link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install
|
||||||
|
# post-process all generated libraries to be deterministic
|
||||||
|
# extract them to a temporary directory then re-build them deterministically
|
||||||
|
for LIB in $(find $INSTALLPREFIX -name \*.a); do
|
||||||
|
rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR
|
||||||
|
$HOST-ar xv $LIB | cut -b5- > /tmp/list.txt
|
||||||
|
rm $LIB
|
||||||
|
$HOST-ar crsD $LIB $(cat /tmp/list.txt)
|
||||||
|
done
|
||||||
|
#
|
||||||
|
cd "$INSTALLPREFIX"
|
||||||
|
find | sort | zip -X@ $OUTDIR/boost-win$BITS-1.55.0-gitian-r6.zip
|
||||||
|
done # for BITS in
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
name: "boost"
|
|
||||||
suites:
|
|
||||||
- "lucid"
|
|
||||||
architectures:
|
|
||||||
- "i386"
|
|
||||||
packages:
|
|
||||||
- "mingw32"
|
|
||||||
- "faketime"
|
|
||||||
- "zip"
|
|
||||||
reference_datetime: "2011-01-30 00:00:00"
|
|
||||||
remotes: []
|
|
||||||
files:
|
|
||||||
- "boost_1_50_0.tar.bz2"
|
|
||||||
script: |
|
|
||||||
TMPDIR="$HOME/tmpdir"
|
|
||||||
mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include
|
|
||||||
tar xjf boost_1_50_0.tar.bz2
|
|
||||||
cd boost_1_50_0
|
|
||||||
echo "using gcc : 4.4 : i586-mingw32msvc-g++
|
|
||||||
:
|
|
||||||
<rc>i586-mingw32msvc-windres
|
|
||||||
<archiver>i586-mingw32msvc-ar
|
|
||||||
<cxxflags>-frandom-seed=boost1
|
|
||||||
;" > user-config.jam
|
|
||||||
./bootstrap.sh --without-icu
|
|
||||||
./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage
|
|
||||||
for lib in chrono date_time exception filesystem graph iostreams math_c99f math_c99l math_c99 math_tr1f math_tr1l math_tr1 prg_exec_monitor program_options random regex serialization signals system test_exec_monitor thread_win32 unit_test_framework wave wserialization; do
|
|
||||||
mkdir $lib
|
|
||||||
(cd $lib ; ar xf ../stage/lib/libboost_${lib}-mt-s.a)
|
|
||||||
mv $lib $TMPDIR/bin/$GBUILD_BITS
|
|
||||||
done
|
|
||||||
cp -a boost $TMPDIR/include
|
|
||||||
cd $TMPDIR
|
|
||||||
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
|
||||||
export FAKETIME=$REFERENCE_DATETIME
|
|
||||||
zip -r boost-win32-1.50.0-gitian2.zip *
|
|
||||||
cp boost-win32-1.50.0-gitian2.zip $OUTDIR
|
|
62
contrib/gitian-descriptors/deps-linux.yml
Normal file
62
contrib/gitian-descriptors/deps-linux.yml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
name: "twister"
|
||||||
|
suites:
|
||||||
|
- "precise"
|
||||||
|
architectures:
|
||||||
|
- "i386"
|
||||||
|
- "amd64"
|
||||||
|
packages:
|
||||||
|
- "g++"
|
||||||
|
- "unzip"
|
||||||
|
- "zip"
|
||||||
|
- "pkg-config"
|
||||||
|
- "libtool"
|
||||||
|
- "faketime"
|
||||||
|
- "bsdmainutils"
|
||||||
|
reference_datetime: "2013-06-01 00:00:00"
|
||||||
|
remotes: []
|
||||||
|
files:
|
||||||
|
- "openssl-1.0.1h.tar.gz"
|
||||||
|
- "db-4.8.30.NC.tar.gz"
|
||||||
|
script: |
|
||||||
|
STAGING="$HOME/install"
|
||||||
|
TEMPDIR="$HOME/tmp"
|
||||||
|
OPTFLAGS='-O2'
|
||||||
|
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
||||||
|
export FAKETIME=$REFERENCE_DATETIME
|
||||||
|
export TZ=UTC
|
||||||
|
export LIBRARY_PATH="$STAGING/lib"
|
||||||
|
# Integrity Check
|
||||||
|
echo "9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 openssl-1.0.1h.tar.gz" | sha256sum -c
|
||||||
|
echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c
|
||||||
|
|
||||||
|
#
|
||||||
|
tar xzf openssl-1.0.1h.tar.gz
|
||||||
|
cd openssl-1.0.1h
|
||||||
|
# need -fPIC to avoid relocation error in 64 bit builds
|
||||||
|
./config no-shared no-zlib no-dso no-krb5 --openssldir=$STAGING -fPIC
|
||||||
|
# need to build OpenSSL with faketime because a timestamp is embedded into cversion.o
|
||||||
|
make
|
||||||
|
make install_sw
|
||||||
|
cd ..
|
||||||
|
#
|
||||||
|
tar xzf db-4.8.30.NC.tar.gz
|
||||||
|
cd db-4.8.30.NC/build_unix
|
||||||
|
# need --with-pic to avoid relocation error in 64 bit builds
|
||||||
|
../dist/configure --prefix=$STAGING --enable-cxx --disable-shared --with-pic
|
||||||
|
# Workaround to prevent re-configuring by make; make all files have a date in the past
|
||||||
|
find . -print0 | xargs -r0 touch -t 200001010000
|
||||||
|
make $MAKEOPTS library_build
|
||||||
|
make install_lib install_include
|
||||||
|
cd ../..
|
||||||
|
# post-process all generated libraries to be deterministic
|
||||||
|
# extract them to a temporary directory then re-build them deterministically
|
||||||
|
for LIB in $(find $STAGING -name \*.a); do
|
||||||
|
rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR
|
||||||
|
ar xv $LIB | cut -b5- > /tmp/list.txt
|
||||||
|
rm $LIB
|
||||||
|
ar crsD $LIB $(cat /tmp/list.txt)
|
||||||
|
done
|
||||||
|
#
|
||||||
|
cd $STAGING
|
||||||
|
find include lib bin host | sort | zip -X@ $OUTDIR/twister-deps-linux${GBUILD_BITS}-gitian-r6.zip
|
81
contrib/gitian-descriptors/deps-win.yml
Normal file
81
contrib/gitian-descriptors/deps-win.yml
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
---
|
||||||
|
name: "twister-deps"
|
||||||
|
suites:
|
||||||
|
- "precise"
|
||||||
|
architectures:
|
||||||
|
- "amd64"
|
||||||
|
packages:
|
||||||
|
- "mingw-w64"
|
||||||
|
- "g++-mingw-w64"
|
||||||
|
- "git-core"
|
||||||
|
- "zip"
|
||||||
|
- "faketime"
|
||||||
|
- "psmisc"
|
||||||
|
reference_datetime: "2011-01-30 00:00:00"
|
||||||
|
remotes: []
|
||||||
|
files:
|
||||||
|
- "openssl-1.0.1h.tar.gz"
|
||||||
|
- "db-4.8.30.NC.tar.gz"
|
||||||
|
- "zlib-1.2.8.tar.gz"
|
||||||
|
script: |
|
||||||
|
#
|
||||||
|
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
||||||
|
export FAKETIME=$REFERENCE_DATETIME
|
||||||
|
export TZ=UTC
|
||||||
|
INDIR=$HOME/build
|
||||||
|
TEMPDIR=$HOME/tmp
|
||||||
|
# Input Integrity Check
|
||||||
|
echo "9d1c8a9836aa63e2c6adb684186cbd4371c9e9dcc01d6e3bb447abf2d4d3d093 openssl-1.0.1h.tar.gz" | sha256sum -c
|
||||||
|
echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c
|
||||||
|
echo "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d zlib-1.2.8.tar.gz" | sha256sum -c
|
||||||
|
|
||||||
|
for BITS in 32 64; do # for architectures
|
||||||
|
#
|
||||||
|
INSTALLPREFIX=$HOME/staging${BITS}
|
||||||
|
BUILDDIR=$HOME/build${BITS}
|
||||||
|
if [ "$BITS" == "32" ]; then
|
||||||
|
HOST=i686-w64-mingw32
|
||||||
|
else
|
||||||
|
HOST=x86_64-w64-mingw32
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
mkdir -p $INSTALLPREFIX $BUILDDIR
|
||||||
|
cd $BUILDDIR
|
||||||
|
#
|
||||||
|
tar xzf $INDIR/openssl-1.0.1h.tar.gz
|
||||||
|
cd openssl-1.0.1h
|
||||||
|
if [ "$BITS" == "32" ]; then
|
||||||
|
OPENSSL_TGT=mingw
|
||||||
|
else
|
||||||
|
OPENSSL_TGT=mingw64
|
||||||
|
fi
|
||||||
|
./Configure --cross-compile-prefix=$HOST- ${OPENSSL_TGT} no-shared no-dso --openssldir=$INSTALLPREFIX
|
||||||
|
make
|
||||||
|
make install_sw
|
||||||
|
cd ..
|
||||||
|
#
|
||||||
|
tar xzf $INDIR/db-4.8.30.NC.tar.gz
|
||||||
|
cd db-4.8.30.NC/build_unix
|
||||||
|
../dist/configure --prefix=$INSTALLPREFIX --enable-mingw --enable-cxx --host=$HOST --disable-shared
|
||||||
|
make $MAKEOPTS library_build
|
||||||
|
make install_lib install_include
|
||||||
|
cd ../..
|
||||||
|
#
|
||||||
|
tar xzf $INDIR/zlib-1.2.8.tar.gz
|
||||||
|
cd zlib-1.2.8
|
||||||
|
CROSS_PREFIX=$HOST- ./configure --prefix=$INSTALLPREFIX --static
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
cd ..
|
||||||
|
# post-process all generated libraries to be deterministic
|
||||||
|
# extract them to a temporary directory then re-build them deterministically
|
||||||
|
for LIB in $(find $INSTALLPREFIX -name \*.a); do
|
||||||
|
rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR
|
||||||
|
$HOST-ar xv $LIB | cut -b5- > /tmp/list.txt
|
||||||
|
rm $LIB
|
||||||
|
$HOST-ar crsD $LIB $(cat /tmp/list.txt)
|
||||||
|
done
|
||||||
|
#
|
||||||
|
cd $INSTALLPREFIX
|
||||||
|
find include lib | sort | zip -X@ $OUTDIR/twister-deps-win$BITS-gitian-r13.zip
|
||||||
|
done # for BITS in
|
@ -1,72 +0,0 @@
|
|||||||
---
|
|
||||||
name: "bitcoin-deps"
|
|
||||||
suites:
|
|
||||||
- "lucid"
|
|
||||||
architectures:
|
|
||||||
- "i386"
|
|
||||||
packages:
|
|
||||||
- "mingw32"
|
|
||||||
- "git-core"
|
|
||||||
- "zip"
|
|
||||||
- "faketime"
|
|
||||||
- "wine"
|
|
||||||
- "psmisc"
|
|
||||||
reference_datetime: "2011-01-30 00:00:00"
|
|
||||||
remotes: []
|
|
||||||
files:
|
|
||||||
- "openssl-1.0.1c.tar.gz"
|
|
||||||
- "db-4.8.30.NC.tar.gz"
|
|
||||||
- "miniupnpc-1.6.tar.gz"
|
|
||||||
- "zlib-1.2.6.tar.gz"
|
|
||||||
- "libpng-1.5.9.tar.gz"
|
|
||||||
- "qrencode-3.2.0.tar.bz2"
|
|
||||||
script: |
|
|
||||||
#
|
|
||||||
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
|
||||||
export FAKETIME=$REFERENCE_DATETIME
|
|
||||||
export TZ=UTC
|
|
||||||
#
|
|
||||||
tar xzf openssl-1.0.1c.tar.gz
|
|
||||||
cd openssl-1.0.1c
|
|
||||||
./Configure --cross-compile-prefix=i586-mingw32msvc- mingw
|
|
||||||
make
|
|
||||||
cd ..
|
|
||||||
#
|
|
||||||
tar xzf db-4.8.30.NC.tar.gz
|
|
||||||
cd db-4.8.30.NC/build_unix
|
|
||||||
../dist/configure --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include"
|
|
||||||
make $MAKEOPTS
|
|
||||||
cd ../..
|
|
||||||
#
|
|
||||||
tar xzf miniupnpc-1.6.tar.gz
|
|
||||||
cd miniupnpc-1.6
|
|
||||||
sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw
|
|
||||||
sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw
|
|
||||||
make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar
|
|
||||||
cd ..
|
|
||||||
mv miniupnpc-1.6 miniupnpc
|
|
||||||
#
|
|
||||||
tar xzf zlib-1.2.6.tar.gz
|
|
||||||
cd zlib-1.2.6
|
|
||||||
make -f win32/Makefile.gcc PREFIX=i586-mingw32msvc- $MAKEOPTS
|
|
||||||
cd ..
|
|
||||||
#
|
|
||||||
tar xzf libpng-1.5.9.tar.gz
|
|
||||||
cd libpng-1.5.9
|
|
||||||
./configure -disable-shared CC=i586-mingw32msvc-cc AR=i586-mingw32msvc-ar STRIP=i586-mingw32msvc-strip RANLIB=i586-mingw32msvc-ranlib OBJDUMP=i586-mingw32msvc-objdump LD=i586-mingw32msvc-ld LDFLAGS="-L../zlib-1.2.6/" CFLAGS="-I../zlib-1.2.6/"
|
|
||||||
make $MAKEOPTS
|
|
||||||
cd ..
|
|
||||||
#
|
|
||||||
tar xjf qrencode-3.2.0.tar.bz2
|
|
||||||
cd qrencode-3.2.0
|
|
||||||
./configure CC=i586-mingw32msvc-cc AR=i586-mingw32msvc-ar STRIP=i586-mingw32msvc-strip RANLIB=i586-mingw32msvc-ranlib OBJDUMP=i586-mingw32msvc-objdump LD=i586-mingw32msvc-ld png_LIBS="../libpng-1.5.9/.libs/libpng15.a ../zlib-1.2.6/libz.a" png_CFLAGS="-I../libpng-1.5.9"
|
|
||||||
make $MAKEOPTS
|
|
||||||
cd ..
|
|
||||||
#
|
|
||||||
zip -r $OUTDIR/bitcoin-deps-0.0.5.zip \
|
|
||||||
$(ls qrencode-*/{qrencode.h,.libs/libqrencode.{,l}a} | sort) \
|
|
||||||
$(ls db-*/build_unix/{libdb_cxx.a,db.h,db_cxx.h,libdb.a,.libs/libdb_cxx-?.?.a} | sort) \
|
|
||||||
$(find openssl-* -name '*.a' -o -name '*.h' | sort) \
|
|
||||||
$(find miniupnpc -name '*.h' -o -name 'libminiupnpc.a' | sort)
|
|
||||||
# Kill wine processes as gitian won't figure out we are done otherwise
|
|
||||||
killall wineserver services.exe explorer.exe winedevice.exe
|
|
65
contrib/gitian-descriptors/gitian-linux.yml
Normal file
65
contrib/gitian-descriptors/gitian-linux.yml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
name: "twister"
|
||||||
|
suites:
|
||||||
|
- "precise"
|
||||||
|
architectures:
|
||||||
|
- "i386"
|
||||||
|
- "amd64"
|
||||||
|
packages:
|
||||||
|
- "g++"
|
||||||
|
- "git-core"
|
||||||
|
- "zip"
|
||||||
|
- "unzip"
|
||||||
|
- "pkg-config"
|
||||||
|
- "autoconf2.13"
|
||||||
|
- "libtool"
|
||||||
|
- "automake"
|
||||||
|
- "faketime"
|
||||||
|
- "bsdmainutils"
|
||||||
|
reference_datetime: "2013-06-01 00:00:00"
|
||||||
|
remotes:
|
||||||
|
- "url": "https://github.com/miguelfreitas/twister-core.git"
|
||||||
|
"dir": "twister-core"
|
||||||
|
files:
|
||||||
|
- "twister-deps-linux32-gitian-r6.zip"
|
||||||
|
- "twister-deps-linux64-gitian-r6.zip"
|
||||||
|
- "boost-linux32-1.55.0-gitian-r1.zip"
|
||||||
|
- "boost-linux64-1.55.0-gitian-r1.zip"
|
||||||
|
script: |
|
||||||
|
STAGING="$HOME/install"
|
||||||
|
OPTFLAGS='-O2' #-static -static-libgcc -static-libstdc++'
|
||||||
|
BINDIR="${OUTDIR}/bin/${GBUILD_BITS}" # 32/64 bit build specific output directory
|
||||||
|
TEMPDIR="$HOME/tempdir"
|
||||||
|
export TZ=UTC
|
||||||
|
export LIBRARY_PATH="$STAGING/lib"
|
||||||
|
export PATH="$STAGING/bin:$PATH"
|
||||||
|
mkdir -p ${BINDIR}
|
||||||
|
#
|
||||||
|
mkdir -p $STAGING
|
||||||
|
cd $STAGING
|
||||||
|
unzip ../build/twister-deps-linux${GBUILD_BITS}-gitian-r6.zip
|
||||||
|
unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip
|
||||||
|
cd ../build
|
||||||
|
|
||||||
|
#
|
||||||
|
cd $HOME/build/
|
||||||
|
rm -rf distsrc
|
||||||
|
cp -a $HOME/build/twister-core distsrc
|
||||||
|
|
||||||
|
cd distsrc
|
||||||
|
./autotool.sh
|
||||||
|
./configure --bindir=$BINDIR --prefix=$STAGING --with-boost=$STAGING --with-openssl=$STAGING PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" --with-libdb=$STAGING CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" --without-boost-locale
|
||||||
|
make $MAKEOPTS
|
||||||
|
strip twisterd
|
||||||
|
cp -f twisterd $BINDIR/
|
||||||
|
|
||||||
|
# sort distribution tar file and normalize user/group/mtime information for deterministic output
|
||||||
|
mkdir -p $OUTDIR/src
|
||||||
|
rm -rf $TEMPDIR
|
||||||
|
mkdir -p $TEMPDIR
|
||||||
|
cd $TEMPDIR
|
||||||
|
#tar -xvf $HOME/build/twister/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME
|
||||||
|
cd $OUTDIR
|
||||||
|
find . | sort | zip -X@ $OUTDIR/twister-linux${GBUILD_BITS}.zip
|
||||||
|
|
||||||
|
|
78
contrib/gitian-descriptors/gitian-win.yml
Normal file
78
contrib/gitian-descriptors/gitian-win.yml
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
---
|
||||||
|
name: "twister"
|
||||||
|
suites:
|
||||||
|
- "precise"
|
||||||
|
architectures:
|
||||||
|
- "amd64"
|
||||||
|
packages:
|
||||||
|
- "mingw-w64"
|
||||||
|
- "g++-mingw-w64"
|
||||||
|
- "git-core"
|
||||||
|
- "unzip"
|
||||||
|
- "zip"
|
||||||
|
- "nsis"
|
||||||
|
- "faketime"
|
||||||
|
- "autoconf2.13"
|
||||||
|
- "libtool"
|
||||||
|
- "automake"
|
||||||
|
- "pkg-config"
|
||||||
|
- "bsdmainutils"
|
||||||
|
|
||||||
|
reference_datetime: "2013-06-01 00:00:00"
|
||||||
|
remotes:
|
||||||
|
- "url": "https://github.com/miguelfreitas/twister-core.git"
|
||||||
|
"dir": "twister-core"
|
||||||
|
files:
|
||||||
|
- "boost-win32-1.55.0-gitian-r6.zip"
|
||||||
|
- "boost-win64-1.55.0-gitian-r6.zip"
|
||||||
|
- "twister-deps-win32-gitian-r13.zip"
|
||||||
|
- "twister-deps-win64-gitian-r13.zip"
|
||||||
|
script: |
|
||||||
|
# Defines
|
||||||
|
export TZ=UTC
|
||||||
|
INDIR=$HOME/build
|
||||||
|
OPTFLAGS='-O2 -static -static-libgcc -static-libstdc++'
|
||||||
|
TEMPDIR="$HOME/tempdir"
|
||||||
|
for BITS in 32 64; do # for architectures
|
||||||
|
#
|
||||||
|
STAGING=$HOME/staging${BITS}
|
||||||
|
BUILDDIR=$HOME/build${BITS}
|
||||||
|
BINDIR=$OUTDIR/$BITS
|
||||||
|
if [ "$BITS" == "32" ]; then
|
||||||
|
HOST=i686-w64-mingw32
|
||||||
|
else
|
||||||
|
HOST=x86_64-w64-mingw32
|
||||||
|
fi
|
||||||
|
export PATH=$STAGING/host/bin:$PATH
|
||||||
|
mkdir -p $STAGING $BUILDDIR $BINDIR
|
||||||
|
#
|
||||||
|
cd $STAGING
|
||||||
|
unzip $INDIR/boost-win${BITS}-1.55.0-gitian-r6.zip
|
||||||
|
unzip $INDIR/twister-deps-win${BITS}-gitian-r13.zip
|
||||||
|
# Build platform-dependent executables from source archive
|
||||||
|
cd $BUILDDIR
|
||||||
|
rm -rf distsrc
|
||||||
|
cp -a $HOME/build/twister-core distsrc
|
||||||
|
mkdir -p distsrc
|
||||||
|
cd distsrc
|
||||||
|
./autotool.sh
|
||||||
|
./configure --bindir=$BINDIR --prefix=$STAGING --host=$HOST --with-boost=$STAGING --with-openssl=$STAGING CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="${OPTFLAGS}" --without-boost-locale
|
||||||
|
#export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
||||||
|
#export FAKETIME=$REFERENCE_DATETIME
|
||||||
|
make $MAKEOPTS
|
||||||
|
strip twisterd.exe
|
||||||
|
cp -f twisterd.exe $BINDIR/
|
||||||
|
unset LD_PRELOAD
|
||||||
|
unset FAKETIME
|
||||||
|
done # for BITS in
|
||||||
|
|
||||||
|
# sort distribution tar file and normalize user/group/mtime information for deterministic output
|
||||||
|
mkdir -p $OUTDIR/src
|
||||||
|
rm -rf $TEMPDIR
|
||||||
|
mkdir -p $TEMPDIR
|
||||||
|
cd $TEMPDIR
|
||||||
|
#tar -xvf $HOME/build/twister/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME
|
||||||
|
cd $OUTDIR
|
||||||
|
find $OUTDIR | sort | zip -X@ /home/ubuntu/out/twister-win-gitian.zip
|
||||||
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
|||||||
---
|
|
||||||
name: "bitcoin"
|
|
||||||
suites:
|
|
||||||
- "lucid"
|
|
||||||
architectures:
|
|
||||||
- "i386"
|
|
||||||
packages:
|
|
||||||
- "mingw32"
|
|
||||||
- "git-core"
|
|
||||||
- "unzip"
|
|
||||||
- "nsis"
|
|
||||||
- "faketime"
|
|
||||||
reference_datetime: "2011-01-30 00:00:00"
|
|
||||||
remotes:
|
|
||||||
- "url": "https://github.com/bitcoin/bitcoin.git"
|
|
||||||
"dir": "bitcoin"
|
|
||||||
files:
|
|
||||||
- "qt-win32-4.8.3-gitian-r1.zip"
|
|
||||||
- "boost-win32-1.50.0-gitian2.zip"
|
|
||||||
- "bitcoin-deps-0.0.5.zip"
|
|
||||||
script: |
|
|
||||||
#
|
|
||||||
mkdir $HOME/qt
|
|
||||||
cd $HOME/qt
|
|
||||||
unzip ../build/qt-win32-4.8.3-gitian-r1.zip
|
|
||||||
cd $HOME/build/
|
|
||||||
export PATH=$HOME/qt/bin/:$PATH
|
|
||||||
#
|
|
||||||
mkdir boost_1_50_0
|
|
||||||
cd boost_1_50_0
|
|
||||||
mkdir -p stage/lib
|
|
||||||
unzip ../boost-win32-1.50.0-gitian2.zip
|
|
||||||
cd bin/$GBUILD_BITS
|
|
||||||
for lib in *; do
|
|
||||||
i586-mingw32msvc-ar rc ../../stage/lib/libboost_${lib}-mt-s.a $lib/*.o
|
|
||||||
i586-mingw32msvc-ranlib ../../stage/lib/libboost_${lib}-mt-s.a
|
|
||||||
done
|
|
||||||
cd ../..
|
|
||||||
mv include/boost .
|
|
||||||
cd ..
|
|
||||||
#
|
|
||||||
unzip bitcoin-deps-0.0.5.zip
|
|
||||||
#
|
|
||||||
find -type f | xargs touch --date="$REFERENCE_DATETIME"
|
|
||||||
#
|
|
||||||
cd bitcoin
|
|
||||||
mkdir -p $OUTDIR/src
|
|
||||||
git archive HEAD | tar -x -C $OUTDIR/src
|
|
||||||
cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt
|
|
||||||
cp $OUTDIR/src/COPYING $OUTDIR/COPYING.txt
|
|
||||||
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
|
||||||
export FAKETIME=$REFERENCE_DATETIME
|
|
||||||
export TZ=UTC
|
|
||||||
$HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_50_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_50_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1c OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1c/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1
|
|
||||||
make $MAKEOPTS
|
|
||||||
cp release/bitcoin-qt.exe $OUTDIR/
|
|
||||||
#
|
|
||||||
cd src
|
|
||||||
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
|
||||||
export FAKETIME=$REFERENCE_DATETIME
|
|
||||||
export TZ=UTC
|
|
||||||
make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoind.exe USE_UPNP=0 DEBUGFLAGS="-frandom-seed=bitcoin"
|
|
||||||
i586-mingw32msvc-strip bitcoind.exe
|
|
||||||
mkdir $OUTDIR/daemon
|
|
||||||
cp bitcoind.exe $OUTDIR/daemon
|
|
||||||
cd ..
|
|
||||||
mkdir nsis
|
|
||||||
git archive HEAD | tar -x -C nsis
|
|
||||||
cd nsis/src
|
|
||||||
mkdir ../release
|
|
||||||
cp ../../release/* ../release/
|
|
||||||
cp ../../src/*.exe .
|
|
||||||
makensis ../share/setup.nsi
|
|
||||||
cp ../share/bitcoin-*-win32-setup.exe $OUTDIR/
|
|
@ -1,55 +0,0 @@
|
|||||||
---
|
|
||||||
name: "bitcoin"
|
|
||||||
suites:
|
|
||||||
- "lucid"
|
|
||||||
architectures:
|
|
||||||
- "i386"
|
|
||||||
- "amd64"
|
|
||||||
packages:
|
|
||||||
- "libdb4.8++-dev"
|
|
||||||
- "qt4-qmake"
|
|
||||||
- "libqt4-dev"
|
|
||||||
- "libboost-system-dev"
|
|
||||||
- "libboost-filesystem-dev"
|
|
||||||
- "libboost-program-options-dev"
|
|
||||||
- "libboost-thread-dev"
|
|
||||||
- "libssl-dev"
|
|
||||||
- "git-core"
|
|
||||||
- "unzip"
|
|
||||||
- "pkg-config"
|
|
||||||
- "libpng12-dev"
|
|
||||||
reference_datetime: "2011-01-30 00:00:00"
|
|
||||||
remotes:
|
|
||||||
- "url": "https://github.com/bitcoin/bitcoin.git"
|
|
||||||
"dir": "bitcoin"
|
|
||||||
files:
|
|
||||||
- "miniupnpc-1.6.tar.gz"
|
|
||||||
- "qrencode-3.2.0.tar.bz2"
|
|
||||||
script: |
|
|
||||||
INSTDIR="$HOME/install"
|
|
||||||
export LIBRARY_PATH="$INSTDIR/lib"
|
|
||||||
#
|
|
||||||
tar xzf miniupnpc-1.6.tar.gz
|
|
||||||
cd miniupnpc-1.6
|
|
||||||
INSTALLPREFIX=$INSTDIR make $MAKEOPTS install
|
|
||||||
cd ..
|
|
||||||
#
|
|
||||||
tar xjf qrencode-3.2.0.tar.bz2
|
|
||||||
cd qrencode-3.2.0
|
|
||||||
./configure --prefix=$INSTDIR --enable-static --disable-shared
|
|
||||||
make $MAKEOPTS install
|
|
||||||
cd ..
|
|
||||||
#
|
|
||||||
cd bitcoin
|
|
||||||
mkdir -p $OUTDIR/src
|
|
||||||
git archive HEAD | tar -x -C $OUTDIR/src
|
|
||||||
cp $OUTDIR/src/doc/README.md $OUTDIR
|
|
||||||
cp $OUTDIR/src/COPYING $OUTDIR
|
|
||||||
cd src
|
|
||||||
make -f makefile.unix STATIC=1 OPENSSL_INCLUDE_PATH="$INSTDIR/include" OPENSSL_LIB_PATH="$INSTDIR/lib" $MAKEOPTS bitcoind USE_UPNP=0 DEBUGFLAGS=
|
|
||||||
mkdir -p $OUTDIR/bin/$GBUILD_BITS
|
|
||||||
install -s bitcoind $OUTDIR/bin/$GBUILD_BITS
|
|
||||||
cd ..
|
|
||||||
qmake INCLUDEPATH="$INSTDIR/include" LIBS="-L$INSTDIR/lib" RELEASE=1 USE_QRCODE=1
|
|
||||||
make $MAKEOPTS
|
|
||||||
install bitcoin-qt $OUTDIR/bin/$GBUILD_BITS
|
|
@ -1,54 +0,0 @@
|
|||||||
---
|
|
||||||
name: "qt"
|
|
||||||
suites:
|
|
||||||
- "lucid"
|
|
||||||
architectures:
|
|
||||||
- "i386"
|
|
||||||
packages:
|
|
||||||
- "mingw32"
|
|
||||||
- "zip"
|
|
||||||
- "faketime"
|
|
||||||
reference_datetime: "2011-01-30 00:00:00"
|
|
||||||
remotes: []
|
|
||||||
files:
|
|
||||||
- "qt-everywhere-opensource-src-4.8.3.tar.gz"
|
|
||||||
script: |
|
|
||||||
INSTDIR="$HOME/qt/"
|
|
||||||
mkdir $INSTDIR
|
|
||||||
SRCDIR="$INSTDIR/src/"
|
|
||||||
mkdir $SRCDIR
|
|
||||||
#
|
|
||||||
tar xzf qt-everywhere-opensource-src-4.8.3.tar.gz
|
|
||||||
cd qt-everywhere-opensource-src-4.8.3
|
|
||||||
sed 's/$TODAY/2011-01-30/' -i configure
|
|
||||||
sed 's/i686-pc-mingw32-/i586-mingw32msvc-/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
|
||||||
sed --posix 's|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/i586-mingw32msvc/include/ -frandom-seed=qtbuild|' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
|
||||||
sed 's/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
|
||||||
sed 's/QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads/QMAKE_LFLAGS_EXCEPTIONS_ON = -lmingwthrd/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
|
||||||
sed --posix 's/QMAKE_MOC\t\t= i586-mingw32msvc-moc/QMAKE_MOC\t\t= moc/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
|
||||||
sed --posix 's/QMAKE_RCC\t\t= i586-mingw32msvc-rcc/QMAKE_RCC\t\t= rcc/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
|
||||||
sed --posix 's/QMAKE_UIC\t\t= i586-mingw32msvc-uic/QMAKE_UIC\t\t= uic/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
|
||||||
# ar adds timestamps to every object file included in the static library
|
|
||||||
# providing -D as ar argument is supposed to solve it, but doesn't work as qmake strips off the arguments and adds -M to pass a script...
|
|
||||||
# which somehow cannot be combined with other flags.
|
|
||||||
# use faketime only for ar, as it confuses make/qmake into hanging sometimes
|
|
||||||
sed --posix "s|QMAKE_LIB\t\t= i586-mingw32msvc-ar -ru|QMAKE_LIB\t\t= $HOME/ar -Dr|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
|
||||||
echo '#!/bin/bash' > $HOME/ar
|
|
||||||
echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar
|
|
||||||
echo 'i586-mingw32msvc-ar "$@"' >> $HOME/ar
|
|
||||||
chmod +x $HOME/ar
|
|
||||||
#export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
|
||||||
export FAKETIME=$REFERENCE_DATETIME
|
|
||||||
export TZ=UTC
|
|
||||||
./configure -prefix $INSTDIR -confirm-license -release -opensource -static -no-qt3support -xplatform unsupported/win32-g++-cross -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs -no-feature-style-plastique -no-feature-style-cleanlooks -no-feature-style-motif -no-feature-style-cde -no-feature-style-windowsce -no-feature-style-windowsmobile -no-feature-style-s60
|
|
||||||
find . -name *.prl | xargs -l sed 's|/\.||' -i
|
|
||||||
find . -name *.prl | xargs -l sed 's|/$||' -i
|
|
||||||
make $MAKEOPTS install
|
|
||||||
cp -a bin $SRCDIR/
|
|
||||||
cd $INSTDIR
|
|
||||||
find . -name *.prl | xargs -l sed 's|/$||' -i
|
|
||||||
#sed 's|QMAKE_PRL_LIBS.*|QMAKE_PRL_LIBS = -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtNetwork -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32|' -i imports/Qt/labs/particles/qmlparticlesplugin.prl
|
|
||||||
|
|
||||||
# as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date
|
|
||||||
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
|
|
||||||
zip -r $OUTDIR/qt-win32-4.8.3-gitian-r1.zip *
|
|
@ -18,15 +18,6 @@ Dependencies
|
|||||||
libssl SSL Support Secure communications
|
libssl SSL Support Secure communications
|
||||||
libdb4.8 Berkeley DB Blockchain & wallet storage
|
libdb4.8 Berkeley DB Blockchain & wallet storage
|
||||||
libboost Boost C++ Library
|
libboost Boost C++ Library
|
||||||
miniupnpc UPnP Support Optional firewall-jumping support
|
|
||||||
|
|
||||||
[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here](
|
|
||||||
http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and
|
|
||||||
turned off by default. Set USE_UPNP to a different value to control this:
|
|
||||||
|
|
||||||
USE_UPNP= No UPnP support miniupnp not required
|
|
||||||
USE_UPNP=0 (the default) UPnP support turned off by default at runtime
|
|
||||||
USE_UPNP=1 UPnP support turned on by default at runtime
|
|
||||||
|
|
||||||
IPv6 support may be disabled by setting:
|
IPv6 support may be disabled by setting:
|
||||||
|
|
||||||
@ -36,14 +27,12 @@ Licenses of statically linked libraries:
|
|||||||
Berkeley DB New BSD license with additional requirement that linked
|
Berkeley DB New BSD license with additional requirement that linked
|
||||||
software must be free open source
|
software must be free open source
|
||||||
Boost MIT-like license
|
Boost MIT-like license
|
||||||
miniupnpc New (3-clause) BSD license
|
|
||||||
|
|
||||||
- Versions used in this release:
|
- Versions used in this release:
|
||||||
- GCC 4.3.3
|
- GCC 4.3.3
|
||||||
- OpenSSL 1.0.1c
|
- OpenSSL 1.0.1c
|
||||||
- Berkeley DB 4.8.30.NC
|
- Berkeley DB 4.8.30.NC
|
||||||
- Boost 1.37
|
- Boost 1.37
|
||||||
- miniupnpc 1.6
|
|
||||||
|
|
||||||
Dependency Build Instructions: Ubuntu & Debian
|
Dependency Build Instructions: Ubuntu & Debian
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
@ -69,10 +58,6 @@ for other Ubuntu & Debian:
|
|||||||
|
|
||||||
(If using Boost 1.37, append -mt to the boost libraries in the makefile)
|
(If using Boost 1.37, append -mt to the boost libraries in the makefile)
|
||||||
|
|
||||||
Optional:
|
|
||||||
|
|
||||||
sudo apt-get install libminiupnpc-dev (see USE_UPNP compile flag)
|
|
||||||
|
|
||||||
|
|
||||||
Dependency Build Instructions: Gentoo
|
Dependency Build Instructions: Gentoo
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
@ -85,7 +70,7 @@ Note: If you just want to install bitcoind on Gentoo, you can add the Bitcoin ov
|
|||||||
Take the following steps to build (no UPnP support):
|
Take the following steps to build (no UPnP support):
|
||||||
|
|
||||||
cd ${BITCOIN_DIR}/src
|
cd ${BITCOIN_DIR}/src
|
||||||
make -f makefile.unix USE_UPNP= USE_IPV6=1 BDB_INCLUDE_PATH='/usr/include/db4.8'
|
make -f makefile.unix USE_IPV6=1 BDB_INCLUDE_PATH='/usr/include/db4.8'
|
||||||
strip bitcoind
|
strip bitcoind
|
||||||
|
|
||||||
|
|
||||||
@ -95,15 +80,6 @@ The release is built with GCC and then "strip bitcoind" to strip the debug
|
|||||||
symbols, which reduces the executable size by about 90%.
|
symbols, which reduces the executable size by about 90%.
|
||||||
|
|
||||||
|
|
||||||
miniupnpc
|
|
||||||
---------
|
|
||||||
tar -xzvf miniupnpc-1.6.tar.gz
|
|
||||||
cd miniupnpc-1.6
|
|
||||||
make
|
|
||||||
sudo su
|
|
||||||
make install
|
|
||||||
|
|
||||||
|
|
||||||
Berkeley DB
|
Berkeley DB
|
||||||
-----------
|
-----------
|
||||||
You need Berkeley DB 4.8. If you have to build Berkeley DB yourself:
|
You need Berkeley DB 4.8. If you have to build Berkeley DB yourself:
|
||||||
|
110
doc/release-process.md
Normal file
110
doc/release-process.md
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
Release Process
|
||||||
|
====================
|
||||||
|
|
||||||
|
* update translations (ping wumpus, Diapolo or tcatm on IRC)
|
||||||
|
* see https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md#syncing-with-transifex
|
||||||
|
|
||||||
|
* * *
|
||||||
|
|
||||||
|
###update (commit) version in sources
|
||||||
|
|
||||||
|
doc/README*
|
||||||
|
src/clientversion.h (change CLIENT_VERSION_IS_RELEASE to true)
|
||||||
|
|
||||||
|
###tag version in git
|
||||||
|
|
||||||
|
git tag -s v(new version, e.g. 0.8.0)
|
||||||
|
|
||||||
|
###write release notes. git shortlog helps a lot, for example:
|
||||||
|
|
||||||
|
git shortlog --no-merges v(current version, e.g. 0.7.2)..v(new version, e.g. 0.8.0)
|
||||||
|
|
||||||
|
* * *
|
||||||
|
|
||||||
|
###perform gitian builds
|
||||||
|
|
||||||
|
From a directory containing the twister source, gitian-builder and gitian.sigs
|
||||||
|
|
||||||
|
# export SIGNER=(your gitian key, ie bluematt, sipa, etc)
|
||||||
|
export VERSION=(new version, e.g. 0.8.0)
|
||||||
|
pushd ./twister-core
|
||||||
|
git checkout v${VERSION}
|
||||||
|
popd
|
||||||
|
pushd ./gitian-builder
|
||||||
|
|
||||||
|
###fetch and build inputs: (first time, or when dependency versions change)
|
||||||
|
|
||||||
|
mkdir -p inputs; cd inputs/
|
||||||
|
|
||||||
|
Register and download the Apple SDK: (see OSX Readme for details)
|
||||||
|
|
||||||
|
https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.6.3/xcode4630916281a.dmg
|
||||||
|
|
||||||
|
Using a Mac, create a tarball for the 10.7 SDK and copy it to the inputs directory:
|
||||||
|
|
||||||
|
tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.7.sdk.tar.gz MacOSX10.7.sdk
|
||||||
|
|
||||||
|
Download remaining inputs, and build everything:
|
||||||
|
|
||||||
|
wget 'https://www.openssl.org/source/openssl-1.0.1h.tar.gz'
|
||||||
|
wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
|
||||||
|
wget 'http://zlib.net/zlib-1.2.8.tar.gz'
|
||||||
|
wget 'https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2'
|
||||||
|
wget 'https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch' -O boost-mingw-gas-cross-compile-2013-03-03.patch
|
||||||
|
wget 'https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2'
|
||||||
|
wget 'https://github.com/mingwandroid/toolchain4/archive/10cc648683617cca8bcbeae507888099b41b530c.tar.gz'
|
||||||
|
wget 'http://www.opensource.apple.com/tarballs/cctools/cctools-809.tar.gz'
|
||||||
|
wget 'http://www.opensource.apple.com/tarballs/dyld/dyld-195.5.tar.gz'
|
||||||
|
wget 'http://www.opensource.apple.com/tarballs/ld64/ld64-127.2.tar.gz'
|
||||||
|
wget 'https://github.com/theuni/libdmg-hfsplus/archive/libdmg-hfsplus-v0.1.tar.gz'
|
||||||
|
wget 'http://llvm.org/releases/3.2/clang+llvm-3.2-x86-linux-ubuntu-12.04.tar.gz' -O clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz
|
||||||
|
cd ..
|
||||||
|
./bin/gbuild ../twister-core/contrib/gitian-descriptors/boost-linux.yml
|
||||||
|
mv build/out/boost-*.zip inputs/
|
||||||
|
./bin/gbuild ../twister-core/contrib/gitian-descriptors/deps-linux.yml
|
||||||
|
mv build/out/twister-deps-*.zip inputs/
|
||||||
|
./bin/gbuild ../twister-core/contrib/gitian-descriptors/boost-win.yml
|
||||||
|
mv build/out/boost-*.zip inputs/
|
||||||
|
./bin/gbuild ../twister-core/contrib/gitian-descriptors/deps-win.yml
|
||||||
|
mv build/out/twister-deps-*.zip inputs/
|
||||||
|
./bin/gbuild ../twister-core/contrib/gitian-descriptors/protobuf-win.yml
|
||||||
|
mv build/out/protobuf-*.zip inputs/
|
||||||
|
./bin/gbuild ../twister-core/contrib/gitian-descriptors/gitian-osx-native.yml
|
||||||
|
mv build/out/osx-*.tar.gz inputs/
|
||||||
|
./bin/gbuild ../twister-core/contrib/gitian-descriptors/gitian-osx-depends.yml
|
||||||
|
mv build/out/osx-*.tar.gz inputs/
|
||||||
|
./bin/gbuild ../twister-core/contrib/gitian-descriptors/gitian-osx-qt.yml
|
||||||
|
mv build/out/osx-*.tar.gz inputs/
|
||||||
|
|
||||||
|
The expected SHA256 hashes of the intermediate inputs are:
|
||||||
|
|
||||||
|
f29b7d9577417333fb56e023c2977f5726a7c297f320b175a4108cf7cd4c2d29 boost-linux32-1.55.0-gitian-r1.zip
|
||||||
|
88232451c4104f7eb16e469ac6474fd1231bd485687253f7b2bdf46c0781d535 boost-linux64-1.55.0-gitian-r1.zip
|
||||||
|
60dc2d3b61e9c7d5dbe2f90d5955772ad748a47918ff2d8b74e8db9b1b91c909 boost-win32-1.55.0-gitian-r6.zip
|
||||||
|
f65fcaf346bc7b73bc8db3a8614f4f6bee2f61fcbe495e9881133a7c2612a167 boost-win64-1.55.0-gitian-r6.zip
|
||||||
|
e2e403e1a08869c7eed4d4293bce13d51ec6a63592918b90ae215a0eceb44cb4 protobuf-win32-2.5.0-gitian-r4.zip
|
||||||
|
a0999037e8b0ef9ade13efd88fee261ba401f5ca910068b7e0cd3262ba667db0 protobuf-win64-2.5.0-gitian-r4.zip
|
||||||
|
|
||||||
|
|
||||||
|
Build twister-core for Linux, Windows, and OS X:
|
||||||
|
|
||||||
|
# ./bin/gbuild --commit twister-core=v${VERSION} ../twister-core/contrib/gitian-descriptors/gitian-win.yml
|
||||||
|
./bin/gbuild --commit twister-core=HEAD ../twister-core/contrib/gitian-descriptors/gitian-win.yml
|
||||||
|
# ./bin/gsign --signer $SIGNER --release ${VERSION}-win --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
|
||||||
|
pushd build/out
|
||||||
|
zip -r bitcoin-${VERSION}-win-gitian.zip *
|
||||||
|
mv bitcoin-${VERSION}-win-gitian.zip ../../../
|
||||||
|
popd
|
||||||
|
|
||||||
|
Build output expected:
|
||||||
|
|
||||||
|
# 1. linux 32-bit and 64-bit binaries + source (bitcoin-${VERSION}-linux-gitian.zip)
|
||||||
|
2. windows 32-bit and 64-bit binaries + installer + source (bitcoin-${VERSION}-win-gitian.zip)
|
||||||
|
# 3. OSX installer (Bitcoin-Qt.dmg)
|
||||||
|
# 4. Gitian signatures (in gitian.sigs/${VERSION}-<linux|win|osx>/(your gitian key)/
|
||||||
|
|
||||||
|
repackage gitian builds for release as stand-alone zip/tar/installer exe
|
||||||
|
|
||||||
|
###Next steps:
|
||||||
|
|
||||||
|
|
@ -957,6 +957,7 @@ namespace libtorrent
|
|||||||
|
|
||||||
// 0 is natpmp 1 is upnp
|
// 0 is natpmp 1 is upnp
|
||||||
int m_tcp_mapping[2];
|
int m_tcp_mapping[2];
|
||||||
|
int m_twister_tcp_mapping[2];
|
||||||
int m_udp_mapping[2];
|
int m_udp_mapping[2];
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
int m_ssl_mapping[2];
|
int m_ssl_mapping[2];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2009-2012, Arvid Norberg
|
Copyright (c) 2009-2014, Arvid Norberg
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
@ -57,14 +57,21 @@ namespace libtorrent
|
|||||||
// libtorrent time_duration type
|
// libtorrent time_duration type
|
||||||
struct TORRENT_EXPORT time_duration
|
struct TORRENT_EXPORT time_duration
|
||||||
{
|
{
|
||||||
|
// hidden
|
||||||
time_duration() {}
|
time_duration() {}
|
||||||
|
|
||||||
|
// all operators have the same semantics as a 64 bit signed integer
|
||||||
time_duration operator/(int rhs) const { return time_duration(diff / rhs); }
|
time_duration operator/(int rhs) const { return time_duration(diff / rhs); }
|
||||||
explicit time_duration(boost::int64_t d) : diff(d) {}
|
explicit time_duration(boost::int64_t d) : diff(d) {}
|
||||||
time_duration& operator-=(time_duration const& c) { diff -= c.diff; return *this; }
|
time_duration& operator-=(time_duration const& c)
|
||||||
time_duration& operator+=(time_duration const& c) { diff += c.diff; return *this; }
|
{ diff -= c.diff; return *this; }
|
||||||
|
time_duration& operator+=(time_duration const& c)
|
||||||
|
{ diff += c.diff; return *this; }
|
||||||
time_duration& operator*=(int v) { diff *= v; return *this; }
|
time_duration& operator*=(int v) { diff *= v; return *this; }
|
||||||
time_duration operator+(time_duration const& c) { return time_duration(diff + c.diff); }
|
time_duration operator+(time_duration const& c)
|
||||||
time_duration operator-(time_duration const& c) { return time_duration(diff - c.diff); }
|
{ return time_duration(diff + c.diff); }
|
||||||
|
time_duration operator-(time_duration const& c)
|
||||||
|
{ return time_duration(diff - c.diff); }
|
||||||
time_duration operator*(double rhs) const { return time_duration( boost::int64_t (diff * rhs) ); }
|
time_duration operator*(double rhs) const { return time_duration( boost::int64_t (diff * rhs) ); }
|
||||||
|
|
||||||
// internal
|
// internal
|
||||||
@ -74,8 +81,11 @@ namespace libtorrent
|
|||||||
// This type represents a point in time.
|
// This type represents a point in time.
|
||||||
struct TORRENT_EXPORT ptime
|
struct TORRENT_EXPORT ptime
|
||||||
{
|
{
|
||||||
|
// hidden
|
||||||
ptime() {}
|
ptime() {}
|
||||||
explicit ptime(boost::uint64_t t): time(t) {}
|
explicit ptime(boost::uint64_t t): time(t) {}
|
||||||
|
|
||||||
|
// these operators have the same semantics as signed 64 bit integers
|
||||||
ptime& operator+=(time_duration rhs) { time += rhs.diff; return *this; }
|
ptime& operator+=(time_duration rhs) { time += rhs.diff; return *this; }
|
||||||
ptime& operator-=(time_duration rhs) { time -= rhs.diff; return *this; }
|
ptime& operator-=(time_duration rhs) { time -= rhs.diff; return *this; }
|
||||||
|
|
||||||
@ -83,8 +93,10 @@ namespace libtorrent
|
|||||||
boost::uint64_t time;
|
boost::uint64_t time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// returns true of the time duration is less than 0
|
||||||
inline bool is_negative(time_duration dt) { return dt.diff < 0; }
|
inline bool is_negative(time_duration dt) { return dt.diff < 0; }
|
||||||
|
|
||||||
|
// all operators have the same semantics as signed 64 bit integers
|
||||||
inline bool operator>(ptime lhs, ptime rhs)
|
inline bool operator>(ptime lhs, ptime rhs)
|
||||||
{ return lhs.time > rhs.time; }
|
{ return lhs.time > rhs.time; }
|
||||||
inline bool operator>=(ptime lhs, ptime rhs)
|
inline bool operator>=(ptime lhs, ptime rhs)
|
||||||
@ -111,7 +123,6 @@ namespace libtorrent
|
|||||||
{ return time_duration(boost::int64_t(lhs.diff * rhs)); }
|
{ return time_duration(boost::int64_t(lhs.diff * rhs)); }
|
||||||
inline time_duration operator*(int lhs, time_duration rhs)
|
inline time_duration operator*(int lhs, time_duration rhs)
|
||||||
{ return time_duration(boost::int64_t(lhs * rhs.diff)); }
|
{ return time_duration(boost::int64_t(lhs * rhs.diff)); }
|
||||||
|
|
||||||
inline time_duration operator-(ptime lhs, ptime rhs)
|
inline time_duration operator-(ptime lhs, ptime rhs)
|
||||||
{ return time_duration(lhs.time - rhs.time); }
|
{ return time_duration(lhs.time - rhs.time); }
|
||||||
inline ptime operator+(ptime lhs, time_duration rhs)
|
inline ptime operator+(ptime lhs, time_duration rhs)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2007-2012, Arvid Norberg
|
Copyright (c) 2007-2014, Arvid Norberg
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
@ -41,7 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
// OVERVIEW
|
// OVERVIEW
|
||||||
//
|
//
|
||||||
// This section contains fundamental time types used internall by
|
// This section contains fundamental time types used internally by
|
||||||
// libtorrent and exposed through various places in the API. The two
|
// libtorrent and exposed through various places in the API. The two
|
||||||
// basic types are ``ptime`` and ``time_duration``. The first represents
|
// basic types are ``ptime`` and ``time_duration``. The first represents
|
||||||
// a point in time and the second the difference between two points
|
// a point in time and the second the difference between two points
|
||||||
@ -56,28 +56,41 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
// .. note::
|
// .. note::
|
||||||
// In a future version of libtorrent, these types will be replaced
|
// In a future version of libtorrent, these types will be replaced
|
||||||
// by the standard timer types from ``std::chrono``.
|
// by the standard timer types from ``std::chrono``.
|
||||||
|
//
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
TORRENT_EXTRA_EXPORT char const* time_now_string();
|
TORRENT_EXTRA_EXPORT char const* time_now_string();
|
||||||
std::string log_time();
|
std::string log_time();
|
||||||
|
|
||||||
|
// returns the current time, as represented by ptime. The
|
||||||
|
// resolution of this timer is about 100 ms.
|
||||||
TORRENT_EXPORT ptime const& time_now();
|
TORRENT_EXPORT ptime const& time_now();
|
||||||
|
|
||||||
|
// returns the current time as represented by ptime. This is
|
||||||
|
// more expensive than time_now(), but provides as high resolution
|
||||||
|
// as the operating system can provide.
|
||||||
TORRENT_EXPORT ptime time_now_hires();
|
TORRENT_EXPORT ptime time_now_hires();
|
||||||
|
|
||||||
|
// the earliest and latest possible time points
|
||||||
|
// representable by ptime.
|
||||||
TORRENT_EXPORT ptime min_time();
|
TORRENT_EXPORT ptime min_time();
|
||||||
TORRENT_EXPORT ptime max_time();
|
TORRENT_EXPORT ptime max_time();
|
||||||
|
|
||||||
#if defined TORRENT_USE_BOOST_DATE_TIME || defined TORRENT_USE_QUERY_PERFORMANCE_TIMER
|
#if defined TORRENT_USE_BOOST_DATE_TIME || defined TORRENT_USE_QUERY_PERFORMANCE_TIMER
|
||||||
|
|
||||||
TORRENT_EXPORT time_duration seconds(int s);
|
// returns a time_duration representing the specified number of seconds, milliseconds
|
||||||
TORRENT_EXPORT time_duration milliseconds(int s);
|
// microseconds, minutes and hours.
|
||||||
TORRENT_EXPORT time_duration microsec(int s);
|
TORRENT_EXPORT time_duration seconds(boost::int64_t s);
|
||||||
TORRENT_EXPORT time_duration minutes(int s);
|
TORRENT_EXPORT time_duration milliseconds(boost::int64_t s);
|
||||||
TORRENT_EXPORT time_duration hours(int s);
|
TORRENT_EXPORT time_duration microsec(boost::int64_t s);
|
||||||
|
TORRENT_EXPORT time_duration minutes(boost::int64_t s);
|
||||||
|
TORRENT_EXPORT time_duration hours(boost::int64_t s);
|
||||||
|
|
||||||
TORRENT_EXPORT int total_seconds(time_duration td);
|
// returns the number of seconds, milliseconds and microseconds
|
||||||
TORRENT_EXPORT int total_milliseconds(time_duration td);
|
// a time_duration represents.
|
||||||
|
TORRENT_EXPORT boost::int64_t total_seconds(time_duration td);
|
||||||
|
TORRENT_EXPORT boost::int64_t total_milliseconds(time_duration td);
|
||||||
TORRENT_EXPORT boost::int64_t total_microseconds(time_duration td);
|
TORRENT_EXPORT boost::int64_t total_microseconds(time_duration td);
|
||||||
|
|
||||||
#elif TORRENT_USE_CLOCK_GETTIME || TORRENT_USE_SYSTEM_TIME || TORRENT_USE_ABSOLUTE_TIME
|
#elif TORRENT_USE_CLOCK_GETTIME || TORRENT_USE_SYSTEM_TIME || TORRENT_USE_ABSOLUTE_TIME
|
||||||
|
@ -34,18 +34,27 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "libtorrent/config.hpp"
|
#include "libtorrent/config.hpp"
|
||||||
#include "libtorrent/assert.hpp"
|
#include "libtorrent/assert.hpp"
|
||||||
|
|
||||||
#ifdef TORRENT_WINDOWS
|
#if defined TORRENT_BEOS
|
||||||
#include <windows.h>
|
|
||||||
#elif defined TORRENT_BEOS
|
|
||||||
#include <kernel/OS.h>
|
#include <kernel/OS.h>
|
||||||
#include <stdlib.h> // malloc/free
|
#include <stdlib.h> // malloc/free
|
||||||
#else
|
#elif !defined TORRENT_WINDOWS
|
||||||
#include <stdlib.h> // valloc/free
|
#include <stdlib.h> // valloc/free
|
||||||
#include <unistd.h> // _SC_PAGESIZE
|
#include <unistd.h> // _SC_PAGESIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TORRENT_USE_MEMALIGN || TORRENT_USE_POSIX_MEMALIGN
|
#if TORRENT_USE_MEMALIGN || TORRENT_USE_POSIX_MEMALIGN
|
||||||
#include <malloc.h> // memalign
|
#include <malloc.h> // memalign
|
||||||
|
#include <stdlib.h> // _aligned_malloc on mingw
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef TORRENT_WINDOWS
|
||||||
|
// windows.h must be included after stdlib.h under mingw
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef TORRENT_MINGW
|
||||||
|
#define _aligned_malloc __mingw_aligned_malloc
|
||||||
|
#define _aligned_free __mingw_aligned_free
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TORRENT_DEBUG_BUFFERS
|
#ifdef TORRENT_DEBUG_BUFFERS
|
||||||
|
@ -2392,7 +2392,7 @@ namespace libtorrent
|
|||||||
for (int processed = 0; processed < 4 * 1024 * 1024; processed += piece_size)
|
for (int processed = 0; processed < 4 * 1024 * 1024; processed += piece_size)
|
||||||
{
|
{
|
||||||
ptime now = time_now_hires();
|
ptime now = time_now_hires();
|
||||||
TORRENT_ASSERT(now >= m_last_file_check);
|
//TORRENT_ASSERT(now >= m_last_file_check);
|
||||||
// this happens sometimes on windows for some reason
|
// this happens sometimes on windows for some reason
|
||||||
if (now < m_last_file_check) now = m_last_file_check;
|
if (now < m_last_file_check) now = m_last_file_check;
|
||||||
|
|
||||||
|
@ -1986,22 +1986,30 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
|
|||||||
|
|
||||||
if ((m_open_mode & sparse) == 0)
|
if ((m_open_mode & sparse) == 0)
|
||||||
{
|
{
|
||||||
typedef DWORD (WINAPI *GetCompressedFileSizeW_t)(LPCWSTR lpFileName, LPDWORD lpFileSizeHigh);
|
#if TORRENT_USE_WSTRING
|
||||||
|
typedef DWORD (WINAPI *GetCompressedFileSize_t)(LPCWSTR lpFileName, LPDWORD lpFileSizeHigh);
|
||||||
|
#else
|
||||||
|
typedef DWORD (WINAPI *GetCompressedFileSize_t)(LPCSTR lpFileName, LPDWORD lpFileSizeHigh);
|
||||||
|
#endif
|
||||||
typedef BOOL (WINAPI *SetFileValidData_t)(HANDLE hFile, LONGLONG ValidDataLength);
|
typedef BOOL (WINAPI *SetFileValidData_t)(HANDLE hFile, LONGLONG ValidDataLength);
|
||||||
|
|
||||||
static GetCompressedFileSizeW_t GetCompressedFileSizeW = NULL;
|
static GetCompressedFileSize_t GetCompressedFileSize_ = NULL;
|
||||||
static SetFileValidData_t SetFileValidData = NULL;
|
static SetFileValidData_t SetFileValidData = NULL;
|
||||||
|
|
||||||
static bool failed_kernel32 = false;
|
static bool failed_kernel32 = false;
|
||||||
|
|
||||||
if ((GetCompressedFileSizeW == NULL) && !failed_kernel32)
|
if ((GetCompressedFileSize_ == NULL) && !failed_kernel32)
|
||||||
{
|
{
|
||||||
HMODULE kernel32 = LoadLibraryA("kernel32.dll");
|
HMODULE kernel32 = LoadLibraryA("kernel32.dll");
|
||||||
if (kernel32)
|
if (kernel32)
|
||||||
{
|
{
|
||||||
GetCompressedFileSizeW = (GetCompressedFileSizeW_t)GetProcAddress(kernel32, "GetCompressedFileSizeW");
|
#if TORRENT_USE_WSTRING
|
||||||
|
GetCompressedFileSize_ = (GetCompressedFileSize_t)GetProcAddress(kernel32, "GetCompressedFileSizeW");
|
||||||
|
#else
|
||||||
|
GetCompressedFileSize_ = (GetCompressedFileSize_t)GetProcAddress(kernel32, "GetCompressedFileSizeA");
|
||||||
|
#endif
|
||||||
SetFileValidData = (SetFileValidData_t)GetProcAddress(kernel32, "SetFileValidData");
|
SetFileValidData = (SetFileValidData_t)GetProcAddress(kernel32, "SetFileValidData");
|
||||||
if ((GetCompressedFileSizeW == NULL) || (SetFileValidData == NULL))
|
if ((GetCompressedFileSize_ == NULL) || (SetFileValidData == NULL))
|
||||||
{
|
{
|
||||||
failed_kernel32 = true;
|
failed_kernel32 = true;
|
||||||
}
|
}
|
||||||
@ -2012,12 +2020,12 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!failed_kernel32 && GetCompressedFileSizeW && SetFileValidData)
|
if (!failed_kernel32 && GetCompressedFileSize_ && SetFileValidData)
|
||||||
{
|
{
|
||||||
// only allocate the space if the file
|
// only allocate the space if the file
|
||||||
// is not fully allocated
|
// is not fully allocated
|
||||||
DWORD high_dword = 0;
|
DWORD high_dword = 0;
|
||||||
offs.LowPart = GetCompressedFileSize(m_path.c_str(), &high_dword);
|
offs.LowPart = GetCompressedFileSize_(m_path.c_str(), &high_dword);
|
||||||
offs.HighPart = high_dword;
|
offs.HighPart = high_dword;
|
||||||
ec.assign(GetLastError(), get_system_category());
|
ec.assign(GetLastError(), get_system_category());
|
||||||
if (ec) return false;
|
if (ec) return false;
|
||||||
|
@ -449,7 +449,7 @@ void traversal_algorithm::status(dht_lookup& l)
|
|||||||
observer& o = **i;
|
observer& o = **i;
|
||||||
if (o.flags & observer::flag_queried)
|
if (o.flags & observer::flag_queried)
|
||||||
{
|
{
|
||||||
last_sent = (std::min)(last_sent, total_seconds(now - o.sent()));
|
last_sent = (std::min)(last_sent, int(total_seconds(now - o.sent())));
|
||||||
if (o.has_short_timeout()) ++l.first_timeout;
|
if (o.has_short_timeout()) ++l.first_timeout;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "libtorrent/random.hpp"
|
#include "libtorrent/random.hpp"
|
||||||
#include "libtorrent/magnet_uri.hpp"
|
#include "libtorrent/magnet_uri.hpp"
|
||||||
|
|
||||||
|
#include "twister.h" // for LIBTORRENT_PORT_OFFSET
|
||||||
|
|
||||||
#if defined TORRENT_STATS && defined __MACH__
|
#if defined TORRENT_STATS && defined __MACH__
|
||||||
#include <mach/task.h>
|
#include <mach/task.h>
|
||||||
#endif
|
#endif
|
||||||
@ -766,6 +768,8 @@ namespace aux {
|
|||||||
|
|
||||||
m_tcp_mapping[0] = -1;
|
m_tcp_mapping[0] = -1;
|
||||||
m_tcp_mapping[1] = -1;
|
m_tcp_mapping[1] = -1;
|
||||||
|
m_twister_tcp_mapping[0] = -1;
|
||||||
|
m_twister_tcp_mapping[1] = -1;
|
||||||
m_udp_mapping[0] = -1;
|
m_udp_mapping[0] = -1;
|
||||||
m_udp_mapping[1] = -1;
|
m_udp_mapping[1] = -1;
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
@ -2463,6 +2467,9 @@ retry:
|
|||||||
{
|
{
|
||||||
if (m_tcp_mapping[0] != -1) m_natpmp->delete_mapping(m_tcp_mapping[0]);
|
if (m_tcp_mapping[0] != -1) m_natpmp->delete_mapping(m_tcp_mapping[0]);
|
||||||
m_tcp_mapping[0] = m_natpmp->add_mapping(natpmp::tcp, tcp_port, tcp_port);
|
m_tcp_mapping[0] = m_natpmp->add_mapping(natpmp::tcp, tcp_port, tcp_port);
|
||||||
|
if (m_twister_tcp_mapping[0] != -1) m_natpmp->delete_mapping(m_twister_tcp_mapping[0]);
|
||||||
|
m_twister_tcp_mapping[0] = m_natpmp->add_mapping(natpmp::tcp,
|
||||||
|
tcp_port-LIBTORRENT_PORT_OFFSET, tcp_port-LIBTORRENT_PORT_OFFSET);
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
if (m_ssl_mapping[0] != -1) m_natpmp->delete_mapping(m_ssl_mapping[0]);
|
if (m_ssl_mapping[0] != -1) m_natpmp->delete_mapping(m_ssl_mapping[0]);
|
||||||
m_ssl_mapping[0] = m_natpmp->add_mapping(natpmp::tcp, ssl_port, ssl_port);
|
m_ssl_mapping[0] = m_natpmp->add_mapping(natpmp::tcp, ssl_port, ssl_port);
|
||||||
@ -2472,6 +2479,9 @@ retry:
|
|||||||
{
|
{
|
||||||
if (m_tcp_mapping[1] != -1) m_upnp->delete_mapping(m_tcp_mapping[1]);
|
if (m_tcp_mapping[1] != -1) m_upnp->delete_mapping(m_tcp_mapping[1]);
|
||||||
m_tcp_mapping[1] = m_upnp->add_mapping(upnp::tcp, tcp_port, tcp_port);
|
m_tcp_mapping[1] = m_upnp->add_mapping(upnp::tcp, tcp_port, tcp_port);
|
||||||
|
if (m_twister_tcp_mapping[1] != -1) m_upnp->delete_mapping(m_twister_tcp_mapping[1]);
|
||||||
|
m_twister_tcp_mapping[1] = m_upnp->add_mapping(upnp::tcp,
|
||||||
|
tcp_port-LIBTORRENT_PORT_OFFSET, tcp_port-LIBTORRENT_PORT_OFFSET);
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
if (m_ssl_mapping[1] != -1) m_upnp->delete_mapping(m_ssl_mapping[1]);
|
if (m_ssl_mapping[1] != -1) m_upnp->delete_mapping(m_ssl_mapping[1]);
|
||||||
m_ssl_mapping[1] = m_upnp->add_mapping(upnp::tcp, ssl_port, ssl_port);
|
m_ssl_mapping[1] = m_upnp->add_mapping(upnp::tcp, ssl_port, ssl_port);
|
||||||
@ -6249,6 +6259,7 @@ retry:
|
|||||||
m_upnp->close();
|
m_upnp->close();
|
||||||
m_udp_mapping[1] = -1;
|
m_udp_mapping[1] = -1;
|
||||||
m_tcp_mapping[1] = -1;
|
m_tcp_mapping[1] = -1;
|
||||||
|
m_twister_tcp_mapping[1] = -1;
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
m_ssl_mapping[1] = -1;
|
m_ssl_mapping[1] = -1;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2009-2012, Arvid Norberg
|
Copyright (c) 2009-2014, Arvid Norberg
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
@ -58,12 +58,6 @@ namespace libtorrent
|
|||||||
|
|
||||||
char const* time_now_string()
|
char const* time_now_string()
|
||||||
{
|
{
|
||||||
// time_t t = std::time(0);
|
|
||||||
// tm* timeinfo = std::localtime(&t);
|
|
||||||
// static char str[200];
|
|
||||||
// std::strftime(str, 200, "%b %d %X", timeinfo);
|
|
||||||
// return str;
|
|
||||||
|
|
||||||
static const ptime start = time_now_hires();
|
static const ptime start = time_now_hires();
|
||||||
static char ret[200];
|
static char ret[200];
|
||||||
int t = total_milliseconds(time_now_hires() - start);
|
int t = total_milliseconds(time_now_hires() - start);
|
||||||
@ -82,7 +76,7 @@ namespace libtorrent
|
|||||||
{
|
{
|
||||||
static const ptime start = time_now_hires();
|
static const ptime start = time_now_hires();
|
||||||
char ret[200];
|
char ret[200];
|
||||||
snprintf(ret, sizeof(ret), "%"PRId64, total_microseconds(time_now_hires() - start));
|
snprintf(ret, sizeof(ret), "%" PRId64, total_microseconds(time_now_hires() - start));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,15 +93,15 @@ namespace libtorrent
|
|||||||
{ return boost::posix_time::ptime(boost::posix_time::min_date_time); }
|
{ return boost::posix_time::ptime(boost::posix_time::min_date_time); }
|
||||||
ptime max_time()
|
ptime max_time()
|
||||||
{ return boost::posix_time::ptime(boost::posix_time::max_date_time); }
|
{ return boost::posix_time::ptime(boost::posix_time::max_date_time); }
|
||||||
time_duration seconds(int s) { return boost::posix_time::seconds(s); }
|
time_duration seconds(boost::int64_t s) { return boost::posix_time::seconds(s); }
|
||||||
time_duration milliseconds(int s) { return boost::posix_time::milliseconds(s); }
|
time_duration milliseconds(boost::int64_t s) { return boost::posix_time::milliseconds(s); }
|
||||||
time_duration microsec(int s) { return boost::posix_time::microsec(s); }
|
time_duration microsec(boost::int64_t s) { return boost::posix_time::microsec(s); }
|
||||||
time_duration minutes(int s) { return boost::posix_time::minutes(s); }
|
time_duration minutes(boost::int64_t s) { return boost::posix_time::minutes(s); }
|
||||||
time_duration hours(int s) { return boost::posix_time::hours(s); }
|
time_duration hours(boost::int64_t s) { return boost::posix_time::hours(s); }
|
||||||
|
|
||||||
int total_seconds(time_duration td)
|
boost::int64_t total_seconds(time_duration td)
|
||||||
{ return td.total_seconds(); }
|
{ return td.total_seconds(); }
|
||||||
int total_milliseconds(time_duration td)
|
boost::int64_t total_milliseconds(time_duration td)
|
||||||
{ return td.total_milliseconds(); }
|
{ return td.total_milliseconds(); }
|
||||||
boost::int64_t total_microseconds(time_duration td)
|
boost::int64_t total_microseconds(time_duration td)
|
||||||
{ return td.total_microseconds(); }
|
{ return td.total_microseconds(); }
|
||||||
@ -188,14 +182,14 @@ namespace libtorrent
|
|||||||
return ptime(now.QuadPart);
|
return ptime(now.QuadPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
int total_seconds(time_duration td)
|
boost::int64_t total_seconds(time_duration td)
|
||||||
{
|
{
|
||||||
return int(performance_counter_to_microseconds(td.diff)
|
return boost::int64_t(performance_counter_to_microseconds(td.diff)
|
||||||
/ 1000000);
|
/ 1000000);
|
||||||
}
|
}
|
||||||
int total_milliseconds(time_duration td)
|
boost::int64_t total_milliseconds(time_duration td)
|
||||||
{
|
{
|
||||||
return int(performance_counter_to_microseconds(td.diff)
|
return boost::uint64_t(performance_counter_to_microseconds(td.diff)
|
||||||
/ 1000);
|
/ 1000);
|
||||||
}
|
}
|
||||||
boost::int64_t total_microseconds(time_duration td)
|
boost::int64_t total_microseconds(time_duration td)
|
||||||
@ -203,26 +197,26 @@ namespace libtorrent
|
|||||||
return performance_counter_to_microseconds(td.diff);
|
return performance_counter_to_microseconds(td.diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
time_duration microsec(int s)
|
time_duration microsec(boost::int64_t s)
|
||||||
{
|
{
|
||||||
return time_duration(microseconds_to_performance_counter(s));
|
return time_duration(microseconds_to_performance_counter(s));
|
||||||
}
|
}
|
||||||
time_duration milliseconds(int s)
|
time_duration milliseconds(boost::int64_t s)
|
||||||
{
|
{
|
||||||
return time_duration(microseconds_to_performance_counter(
|
return time_duration(microseconds_to_performance_counter(
|
||||||
s * 1000));
|
s * 1000));
|
||||||
}
|
}
|
||||||
time_duration seconds(int s)
|
time_duration seconds(boost::int64_t s)
|
||||||
{
|
{
|
||||||
return time_duration(microseconds_to_performance_counter(
|
return time_duration(microseconds_to_performance_counter(
|
||||||
s * 1000000));
|
s * 1000000));
|
||||||
}
|
}
|
||||||
time_duration minutes(int s)
|
time_duration minutes(boost::int64_t s)
|
||||||
{
|
{
|
||||||
return time_duration(microseconds_to_performance_counter(
|
return time_duration(microseconds_to_performance_counter(
|
||||||
s * 1000000 * 60));
|
s * 1000000 * 60));
|
||||||
}
|
}
|
||||||
time_duration hours(int s)
|
time_duration hours(boost::int64_t s)
|
||||||
{
|
{
|
||||||
return time_duration(microseconds_to_performance_counter(
|
return time_duration(microseconds_to_performance_counter(
|
||||||
s * 1000000 * 60 * 60));
|
s * 1000000 * 60 * 60));
|
||||||
|
@ -133,8 +133,8 @@ namespace libtorrent
|
|||||||
if (m_completion_timeout > 0)
|
if (m_completion_timeout > 0)
|
||||||
{
|
{
|
||||||
timeout = timeout == 0
|
timeout = timeout == 0
|
||||||
? m_completion_timeout - total_seconds(m_read_time - m_start_time)
|
? int(m_completion_timeout - total_seconds(m_read_time - m_start_time))
|
||||||
: (std::min)(m_completion_timeout - total_seconds(m_read_time - m_start_time), timeout);
|
: (std::min)(int(m_completion_timeout - total_seconds(m_read_time - m_start_time)), timeout);
|
||||||
}
|
}
|
||||||
#if defined TORRENT_ASIO_DEBUGGING
|
#if defined TORRENT_ASIO_DEBUGGING
|
||||||
add_outstanding_async("timeout_handler::timeout_callback");
|
add_outstanding_async("timeout_handler::timeout_callback");
|
||||||
|
@ -2161,7 +2161,7 @@ void utp_socket_impl::ack_packet(packet* p, ptime const& receive_time
|
|||||||
rtt = 100000;
|
rtt = 100000;
|
||||||
|
|
||||||
// the clock for this plaform is not monotonic!
|
// the clock for this plaform is not monotonic!
|
||||||
TORRENT_ASSERT(false);
|
//TORRENT_ASSERT(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
UTP_LOGV("%8p: acked packet %d (%d bytes) (rtt:%u)\n"
|
UTP_LOGV("%8p: acked packet %d (%d bytes) (rtt:%u)\n"
|
||||||
|
@ -100,7 +100,7 @@ AC_DEFUN([AX_BERKELEY_DB_CXX],
|
|||||||
try_headers="db$version/db_cxx.h db`echo $version | sed -e 's,\..*,,g'`/db_cxx.h"
|
try_headers="db$version/db_cxx.h db`echo $version | sed -e 's,\..*,,g'`/db_cxx.h"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBS="$old_LIBS $db_cxx_lib"
|
LIBS="$db_cxx_lib $old_LIBS"
|
||||||
|
|
||||||
for db_cxx_hdr in $try_headers ; do
|
for db_cxx_hdr in $try_headers ; do
|
||||||
if test -z $DB_CXX_HEADER ; then
|
if test -z $DB_CXX_HEADER ; then
|
||||||
|
@ -28,12 +28,12 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef u_int SOCKET;
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define MSG_NOSIGNAL 0
|
#define MSG_NOSIGNAL 0
|
||||||
#define MSG_DONTWAIT 0
|
#define MSG_DONTWAIT 0
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#else
|
#else
|
||||||
|
typedef u_int SOCKET;
|
||||||
#include "errno.h"
|
#include "errno.h"
|
||||||
#define WSAGetLastError() errno
|
#define WSAGetLastError() errno
|
||||||
#define WSAEINVAL EINVAL
|
#define WSAEINVAL EINVAL
|
||||||
|
@ -74,7 +74,7 @@ namespace DhtProxy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<CNode*> getRandomDhtProxies()
|
vector<CNode*> getRandomDhtProxies(int *totalProxyNodes)
|
||||||
{
|
{
|
||||||
// (cs_vNodes) lock must be held!
|
// (cs_vNodes) lock must be held!
|
||||||
vector<CNode*> vNodesProxy;
|
vector<CNode*> vNodesProxy;
|
||||||
@ -83,6 +83,8 @@ namespace DhtProxy
|
|||||||
vNodesProxy.push_back(pnode);
|
vNodesProxy.push_back(pnode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( totalProxyNodes )
|
||||||
|
*totalProxyNodes = (int) vNodesProxy.size();
|
||||||
std::random_shuffle(vNodesProxy.begin(),vNodesProxy.end());
|
std::random_shuffle(vNodesProxy.begin(),vNodesProxy.end());
|
||||||
if(vNodesProxy.size() > numProxiesToUse) {
|
if(vNodesProxy.size() > numProxiesToUse) {
|
||||||
vNodesProxy.resize(numProxiesToUse);
|
vNodesProxy.resize(numProxiesToUse);
|
||||||
|
@ -86,6 +86,8 @@ namespace DhtProxy
|
|||||||
// Handle a dhtput request received from TCP. send request to UDP. (server side)
|
// Handle a dhtput request received from TCP. send request to UDP. (server side)
|
||||||
// return true if accepted.
|
// return true if accepted.
|
||||||
bool dhtputRequestReceived(const CDHTPutRequest& req, CNode* pfrom);
|
bool dhtputRequestReceived(const CDHTPutRequest& req, CNode* pfrom);
|
||||||
|
|
||||||
|
vector<CNode*> getRandomDhtProxies(int *totalProxyNodes = NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CDHTTarget
|
class CDHTTarget
|
||||||
|
@ -211,13 +211,7 @@ std::string HelpMessage()
|
|||||||
strUsage += " -bantime=<n> " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)") + "\n";
|
strUsage += " -bantime=<n> " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)") + "\n";
|
||||||
strUsage += " -maxreceivebuffer=<n> " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)") + "\n";
|
strUsage += " -maxreceivebuffer=<n> " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)") + "\n";
|
||||||
strUsage += " -maxsendbuffer=<n> " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)") + "\n";
|
strUsage += " -maxsendbuffer=<n> " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)") + "\n";
|
||||||
#ifdef USE_UPNP
|
|
||||||
#if USE_UPNP
|
|
||||||
strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n";
|
strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n";
|
||||||
#else
|
|
||||||
strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 0)") + "\n";
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
strUsage += " -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n";
|
strUsage += " -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n";
|
||||||
if (fHaveGUI)
|
if (fHaveGUI)
|
||||||
strUsage += " -server " + _("Accept command line and JSON-RPC commands") + "\n";
|
strUsage += " -server " + _("Accept command line and JSON-RPC commands") + "\n";
|
||||||
|
@ -54,11 +54,6 @@ static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20
|
|||||||
static const int MAX_SCRIPTCHECK_THREADS = 16;
|
static const int MAX_SCRIPTCHECK_THREADS = 16;
|
||||||
/** Default amount of block size reserved for high-priority transactions (in bytes) */
|
/** Default amount of block size reserved for high-priority transactions (in bytes) */
|
||||||
static const int DEFAULT_BLOCK_PRIORITY_SIZE = 27000;
|
static const int DEFAULT_BLOCK_PRIORITY_SIZE = 27000;
|
||||||
#ifdef USE_UPNP
|
|
||||||
static const int fHaveUPnP = true;
|
|
||||||
#else
|
|
||||||
static const int fHaveUPnP = false;
|
|
||||||
#endif
|
|
||||||
/** The maximum size for spam messages */
|
/** The maximum size for spam messages */
|
||||||
static const int MAX_SPAM_MSG_SIZE = 140;
|
static const int MAX_SPAM_MSG_SIZE = 140;
|
||||||
/** The maximum size for username */
|
/** The maximum size for username */
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
# Distributed under the MIT/X11 software license, see the accompanying
|
# Distributed under the MIT/X11 software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
# :=0 --> UPnP support turned off by default at runtime
|
|
||||||
# :=1 --> UPnP support turned on by default at runtime
|
|
||||||
# :=- --> No UPnP support - miniupnp not required
|
|
||||||
USE_UPNP:=-
|
|
||||||
|
|
||||||
# :=1 --> Enable IPv6 support
|
# :=1 --> Enable IPv6 support
|
||||||
# :=0 --> Disable IPv6 support
|
# :=0 --> Disable IPv6 support
|
||||||
USE_IPV6:=0
|
USE_IPV6:=0
|
||||||
@ -36,14 +31,6 @@ TESTLIBS += \
|
|||||||
-Wl,-B$(LMODE) \
|
-Wl,-B$(LMODE) \
|
||||||
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
|
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
|
||||||
|
|
||||||
ifndef USE_UPNP
|
|
||||||
override USE_UPNP = -
|
|
||||||
endif
|
|
||||||
ifneq (${USE_UPNP}, -)
|
|
||||||
LIBS += -l miniupnpc
|
|
||||||
DEFS += -DUSE_UPNP=$(USE_UPNP)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (${USE_IPV6}, -)
|
ifneq (${USE_IPV6}, -)
|
||||||
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
||||||
endif
|
endif
|
||||||
@ -176,7 +163,6 @@ LIBS += \
|
|||||||
-l boost_filesystem$(BOOST_LIB_SUFFIX) \
|
-l boost_filesystem$(BOOST_LIB_SUFFIX) \
|
||||||
-l boost_program_options$(BOOST_LIB_SUFFIX) \
|
-l boost_program_options$(BOOST_LIB_SUFFIX) \
|
||||||
-l boost_thread$(BOOST_LIB_SUFFIX) \
|
-l boost_thread$(BOOST_LIB_SUFFIX) \
|
||||||
-l boost_locale$(BOOST_LIB_SUFFIX) \
|
|
||||||
-l db_cxx$(BDB_LIB_SUFFIX) \
|
-l db_cxx$(BDB_LIB_SUFFIX) \
|
||||||
-L$(NDK_BASE)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/ -lgnustl_static
|
-L$(NDK_BASE)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/ -lgnustl_static
|
||||||
#-l ssl_static -l crypto_static
|
#-l ssl_static -l crypto_static
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
# Distributed under the MIT/X11 software license, see the accompanying
|
# Distributed under the MIT/X11 software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
# :=0 --> UPnP support turned off by default at runtime
|
|
||||||
# :=1 --> UPnP support turned on by default at runtime
|
|
||||||
# :=- --> No UPnP support - miniupnp not required
|
|
||||||
USE_UPNP:=1
|
|
||||||
|
|
||||||
# :=1 --> Enable IPv6 support
|
# :=1 --> Enable IPv6 support
|
||||||
# :=0 --> Disable IPv6 support
|
# :=0 --> Disable IPv6 support
|
||||||
USE_IPV6:=1
|
USE_IPV6:=1
|
||||||
@ -48,13 +43,6 @@ TESTLIBS += \
|
|||||||
-Wl,-B$(LMODE) \
|
-Wl,-B$(LMODE) \
|
||||||
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
|
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
|
||||||
|
|
||||||
ifndef USE_UPNP
|
|
||||||
override USE_UPNP = -
|
|
||||||
endif
|
|
||||||
ifneq (${USE_UPNP}, -)
|
|
||||||
LIBS += -l miniupnpc
|
|
||||||
DEFS += -DUSE_UPNP=$(USE_UPNP)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (${USE_IPV6}, -)
|
ifneq (${USE_IPV6}, -)
|
||||||
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
|
|
||||||
USE_UPNP:=-
|
|
||||||
USE_IPV6:=1
|
USE_IPV6:=1
|
||||||
|
|
||||||
DEPSDIR?=/usr/local
|
DEPSDIR?=/usr/local
|
||||||
@ -52,13 +51,6 @@ LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware
|
|||||||
|
|
||||||
TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
|
TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
|
||||||
|
|
||||||
ifndef USE_UPNP
|
|
||||||
override USE_UPNP = -
|
|
||||||
endif
|
|
||||||
ifneq (${USE_UPNP}, -)
|
|
||||||
LIBS += -l miniupnpc -l iphlpapi
|
|
||||||
DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (${USE_IPV6}, -)
|
ifneq (${USE_IPV6}, -)
|
||||||
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
# Distributed under the MIT/X11 software license, see the accompanying
|
# Distributed under the MIT/X11 software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
# :=0 --> UPnP support turned off by default at runtime
|
|
||||||
# :=1 --> UPnP support turned on by default at runtime
|
|
||||||
# :=- --> No UPnP support - miniupnp not required
|
|
||||||
USE_UPNP:=1
|
|
||||||
|
|
||||||
# :=1 --> Enable IPv6 support
|
# :=1 --> Enable IPv6 support
|
||||||
# :=0 --> Disable IPv6 support
|
# :=0 --> Disable IPv6 support
|
||||||
USE_IPV6:=1
|
USE_IPV6:=1
|
||||||
@ -48,13 +43,6 @@ TESTLIBS += \
|
|||||||
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
|
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
|
||||||
# -Wl,-B$(LMODE) // does not work on OSX
|
# -Wl,-B$(LMODE) // does not work on OSX
|
||||||
|
|
||||||
ifndef USE_UPNP
|
|
||||||
override USE_UPNP = -
|
|
||||||
endif
|
|
||||||
ifneq (${USE_UPNP}, -)
|
|
||||||
LIBS += -l miniupnpc
|
|
||||||
DEFS += -DUSE_UPNP=$(USE_UPNP)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (${USE_IPV6}, -)
|
ifneq (${USE_IPV6}, -)
|
||||||
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
# Distributed under the MIT/X11 software license, see the accompanying
|
# Distributed under the MIT/X11 software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
# :=0 --> UPnP support turned off by default at runtime
|
|
||||||
# :=1 --> UPnP support turned on by default at runtime
|
|
||||||
# :=- --> No UPnP support - miniupnp not required
|
|
||||||
USE_UPNP:=1
|
|
||||||
|
|
||||||
# :=1 --> Enable IPv6 support
|
# :=1 --> Enable IPv6 support
|
||||||
# :=0 --> Disable IPv6 support
|
# :=0 --> Disable IPv6 support
|
||||||
USE_IPV6:=1
|
USE_IPV6:=1
|
||||||
@ -48,14 +43,6 @@ TESTLIBS += \
|
|||||||
-Wl,-B$(LMODE) \
|
-Wl,-B$(LMODE) \
|
||||||
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
|
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
|
||||||
|
|
||||||
ifndef USE_UPNP
|
|
||||||
override USE_UPNP = -
|
|
||||||
endif
|
|
||||||
ifneq (${USE_UPNP}, -)
|
|
||||||
LIBS += -l miniupnpc
|
|
||||||
DEFS += -DUSE_UPNP=$(USE_UPNP)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (${USE_IPV6}, -)
|
ifneq (${USE_IPV6}, -)
|
||||||
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
DEFS += -DUSE_IPV6=$(USE_IPV6)
|
||||||
endif
|
endif
|
||||||
|
13
src/net.cpp
13
src/net.cpp
@ -375,20 +375,29 @@ bool GetMyExternalIP(CNetAddr& ipRet)
|
|||||||
}
|
}
|
||||||
else if (nHost == 2)
|
else if (nHost == 2)
|
||||||
{
|
{
|
||||||
addrConnect = CService("74.208.43.192", 80); // www.showmyip.com
|
//addrConnect = CService("74.208.43.192", 80); // www.showmyip.com
|
||||||
|
addrConnect = CService("54.200.182.206", 80); // wtfismyip.com
|
||||||
|
|
||||||
if (nLookup == 1)
|
if (nLookup == 1)
|
||||||
{
|
{
|
||||||
CService addrIP("www.showmyip.com", 80, true);
|
//CService addrIP("www.showmyip.com", 80, true);
|
||||||
|
CService addrIP("wtfismyip.com", 80, true);
|
||||||
if (addrIP.IsValid())
|
if (addrIP.IsValid())
|
||||||
addrConnect = addrIP;
|
addrConnect = addrIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
pszGet = "GET /simple/ HTTP/1.1\r\n"
|
pszGet = "GET /simple/ HTTP/1.1\r\n"
|
||||||
"Host: www.showmyip.com\r\n"
|
"Host: www.showmyip.com\r\n"
|
||||||
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n"
|
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n"
|
||||||
"Connection: close\r\n"
|
"Connection: close\r\n"
|
||||||
"\r\n";
|
"\r\n";
|
||||||
|
*/
|
||||||
|
pszGet = "GET /text HTTP/1.1\r\n"
|
||||||
|
"Host: wtfismyip.com\r\n"
|
||||||
|
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n"
|
||||||
|
"Connection: close\r\n"
|
||||||
|
"\r\n";
|
||||||
|
|
||||||
pszKeyword = NULL; // Returns just IP address
|
pszKeyword = NULL; // Returns just IP address
|
||||||
}
|
}
|
||||||
|
@ -254,8 +254,8 @@ void ThreadWaitExtIP()
|
|||||||
|
|
||||||
std::string ipStr;
|
std::string ipStr;
|
||||||
|
|
||||||
// wait up to 5 seconds for bitcoin to get the external IP
|
// wait up to 10 seconds for bitcoin to get the external IP
|
||||||
for( int i = 0; i < 10; i++ ) {
|
for( int i = 0; i < 20; i++ ) {
|
||||||
const CNetAddr paddrPeer("8.8.8.8");
|
const CNetAddr paddrPeer("8.8.8.8");
|
||||||
CAddress addr( GetLocalAddress(&paddrPeer) );
|
CAddress addr( GetLocalAddress(&paddrPeer) );
|
||||||
if( addr.IsValid() ) {
|
if( addr.IsValid() ) {
|
||||||
@ -309,8 +309,10 @@ void ThreadWaitExtIP()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !m_usingProxy ) {
|
if( !m_usingProxy ) {
|
||||||
ses->start_upnp();
|
if( GetBoolArg("-upnp", true) ) {
|
||||||
ses->start_natpmp();
|
ses->start_upnp();
|
||||||
|
ses->start_natpmp();
|
||||||
|
}
|
||||||
|
|
||||||
ses->listen_on(std::make_pair(listen_port, listen_port)
|
ses->listen_on(std::make_pair(listen_port, listen_port)
|
||||||
, ec, bind_to_interface.c_str());
|
, ec, bind_to_interface.c_str());
|
||||||
@ -334,7 +336,7 @@ void ThreadWaitExtIP()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
session_settings settings;
|
session_settings settings("twisterd/"+FormatFullVersion());
|
||||||
// settings to test local connections
|
// settings to test local connections
|
||||||
settings.allow_multiple_connections_per_ip = true;
|
settings.allow_multiple_connections_per_ip = true;
|
||||||
//settings.enable_outgoing_utp = false; // (false to see connections in netstat)
|
//settings.enable_outgoing_utp = false; // (false to see connections in netstat)
|
||||||
@ -457,13 +459,24 @@ void lockAndSaveUserData()
|
|||||||
|
|
||||||
int getDhtNodes(boost::int64_t *dht_global_nodes)
|
int getDhtNodes(boost::int64_t *dht_global_nodes)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<session> ses(m_ses);
|
int dhtNodes = 0;
|
||||||
if( !ses )
|
|
||||||
return 0;
|
|
||||||
session_status ss = ses->status();
|
|
||||||
if( dht_global_nodes )
|
if( dht_global_nodes )
|
||||||
*dht_global_nodes = ss.dht_global_nodes;
|
*dht_global_nodes = 0;
|
||||||
return ss.dht_nodes;
|
|
||||||
|
if( !DhtProxy::fEnabled ) {
|
||||||
|
boost::shared_ptr<session> ses(m_ses);
|
||||||
|
if( ses ) {
|
||||||
|
session_status ss = ses->status();
|
||||||
|
if( dht_global_nodes )
|
||||||
|
*dht_global_nodes = ss.dht_global_nodes;
|
||||||
|
dhtNodes = ss.dht_nodes;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LOCK(cs_vNodes);
|
||||||
|
DhtProxy::getRandomDhtProxies(&dhtNodes);
|
||||||
|
}
|
||||||
|
return dhtNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentManualTrackerUpdate(const std::string &username)
|
void torrentManualTrackerUpdate(const std::string &username)
|
||||||
|
@ -98,7 +98,11 @@ void locking_callback(int mode, int i, const char* file, int line)
|
|||||||
|
|
||||||
static unsigned long id_callback(void)
|
static unsigned long id_callback(void)
|
||||||
{
|
{
|
||||||
|
#if defined(WIN32)
|
||||||
|
return ((unsigned long)GetCurrentThreadId());
|
||||||
|
#else
|
||||||
return ((unsigned long)pthread_self());
|
return ((unsigned long)pthread_self());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
LockedPageManager LockedPageManager::instance;
|
LockedPageManager LockedPageManager::instance;
|
||||||
@ -1147,6 +1151,7 @@ boost::filesystem::path GetPidFile()
|
|||||||
return pathPidFile;
|
return pathPidFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
|
void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
|
||||||
{
|
{
|
||||||
FILE* file = fopen(path.string().c_str(), "w");
|
FILE* file = fopen(path.string().c_str(), "w");
|
||||||
@ -1156,6 +1161,7 @@ void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
|
|||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
|
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
|
||||||
{
|
{
|
||||||
|
@ -209,7 +209,9 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific = true);
|
|||||||
boost::filesystem::path GetHTMLDir();
|
boost::filesystem::path GetHTMLDir();
|
||||||
boost::filesystem::path GetConfigFile();
|
boost::filesystem::path GetConfigFile();
|
||||||
boost::filesystem::path GetPidFile();
|
boost::filesystem::path GetPidFile();
|
||||||
|
#ifndef WIN32
|
||||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
||||||
|
#endif
|
||||||
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
||||||
|
@ -7,7 +7,7 @@ ACTION=${1:-run}
|
|||||||
MODE=${2:---local}
|
MODE=${2:---local}
|
||||||
|
|
||||||
IMAGE_NAME=twister
|
IMAGE_NAME=twister
|
||||||
REMOTE_IMAGE_NAME=mazzolino/twister
|
REMOTE_IMAGE_NAME=miguelfreitas/twister
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ build)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
run)
|
run)
|
||||||
if [ $MODE == "--remote" ]; then
|
if [ "$MODE" = "--remote" ]; then
|
||||||
shift
|
shift
|
||||||
IMAGE_NAME=$REMOTE_IMAGE_NAME
|
IMAGE_NAME=$REMOTE_IMAGE_NAME
|
||||||
echo Pulling new version of $IMAGE_NAME
|
echo Pulling new version of $IMAGE_NAME
|
||||||
@ -29,7 +29,7 @@ run)
|
|||||||
fi
|
fi
|
||||||
echo Running $IMAGE_NAME
|
echo Running $IMAGE_NAME
|
||||||
docker run -d -p 28332:28332 -v $HOME/.twister:/root/.twister $IMAGE_NAME "$@"
|
docker run -d -p 28332:28332 -v $HOME/.twister:/root/.twister $IMAGE_NAME "$@"
|
||||||
echo Twister should now be running at http://localhost:28332
|
echo "Twister should now be running at http://localhost:28332 (access with \"user\" / \"pwd\")"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
|
@ -58,23 +58,6 @@ contains(USE_QRCODE, 1) {
|
|||||||
LIBS += -lqrencode
|
LIBS += -lqrencode
|
||||||
}
|
}
|
||||||
|
|
||||||
# use: qmake "USE_UPNP=1" ( enabled by default; default)
|
|
||||||
# or: qmake "USE_UPNP=0" (disabled by default)
|
|
||||||
# or: qmake "USE_UPNP=-" (not supported)
|
|
||||||
# miniupnpc (http://miniupnp.free.fr/files/) must be installed for support
|
|
||||||
contains(USE_UPNP, -) {
|
|
||||||
message(Building without UPNP support)
|
|
||||||
} else {
|
|
||||||
message(Building with UPNP support)
|
|
||||||
count(USE_UPNP, 0) {
|
|
||||||
USE_UPNP=1
|
|
||||||
}
|
|
||||||
DEFINES += USE_UPNP=$$USE_UPNP STATICLIB
|
|
||||||
INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH
|
|
||||||
LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc
|
|
||||||
win32:LIBS += -liphlpapi
|
|
||||||
}
|
|
||||||
|
|
||||||
# use: qmake "USE_DBUS=1"
|
# use: qmake "USE_DBUS=1"
|
||||||
contains(USE_DBUS, 1) {
|
contains(USE_DBUS, 1) {
|
||||||
message(Building with DBUS (Freedesktop notifications) support)
|
message(Building with DBUS (Freedesktop notifications) support)
|
||||||
|
Loading…
Reference in New Issue
Block a user