Skip to content

Commit

Permalink
update *.yml support bionic build thanks Ivan's help
Browse files Browse the repository at this point in the history
refine checkpoint code, and add block header check when load from disk
  • Loading branch information
Tyler committed Nov 13, 2018
1 parent ad1c796 commit 5b4cb77
Show file tree
Hide file tree
Showing 24 changed files with 510 additions and 123 deletions.
24 changes: 18 additions & 6 deletions bitcoin-qt.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = primecoin-qt
macx:TARGET = "Primecoin-Qt"
VERSION = 0.1.2
VERSION = 0.1.4
INCLUDEPATH += src src/json src/qt
QT += network
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
Expand Down Expand Up @@ -44,17 +44,29 @@ contains(RELEASE, 1) {
}
# for extra security (see: https://wiki.debian.org/Hardening): this flag is GCC compiler-specific
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
# on Windows: enable GCC large address aware linker flag
win32:QMAKE_LFLAGS *= -Wl,--large-address-aware

win32 {
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat -static
contains(WIN64, 1) {
message(Building for Windows 64-bit)
} else {
# on Windows 32-bit: enable GCC large address aware linker flag
message(Building for Windows 32-bit)
win32:QMAKE_LFLAGS *= -Wl,--large-address-aware
}
} else {
SOURCES += glibc_compat.cpp
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
}

# use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
contains(USE_QRCODE, 1) {
message(Building with QRCode support)
DEFINES += USE_QRCODE
LIBS += -lqrencode
win32:QMAKE_LFLAGS += -pthread
}

# use: qmake "USE_UPNP=1" ( enabled by default; default)
Expand Down Expand Up @@ -419,7 +431,7 @@ macx:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
contains(RELEASE, 1) {
!win32:!macx {
# Linux: turn dynamic linking back on for c/c++ runtime libraries
LIBS += -Wl,-Bdynamic
LIBS += -Wl,-Bdynamic -ldl -lrt
}
}

Expand Down
8 changes: 7 additions & 1 deletion changlist.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2018.09.28 0.8.7
2018.09.28 primecoin 0.1.3
fix missing bignum field when spv wallet sync data.
modify bitcoin to primecoin someplace

2018.11.11 primecoin 0.1.4
modify *.yml for gitian release, thanks to Ivan's help
add dns seed
Refine checkpoint operation
Add header check when load from disk
40 changes: 23 additions & 17 deletions contrib/gitian-descriptors/boost-win32.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
---
name: "boost"
suites:
- "lucid"
- "bionic"
architectures:
- "i386"
packages:
- "mingw32"
packages:
- "gcc-mingw-w64-i686"
- "g++-mingw-w64-i686"
- "faketime"
- "zip"
reference_datetime: "2011-01-30 00:00:00"
reference_datetime: "2015-01-30 00:00:00"
remotes: []
files:
- "boost_1_50_0.tar.bz2"
- "boost_1_52_0.tar.bz2"
script: |
TMPDIR="$HOME/tmpdir"
LIBRARIES="chrono,filesystem,program_options,system,thread,test"
OPTIONS="variant=release --layout=tagged --build-type=complete --user-config=user-config.jam threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 target-os=windows threadapi=win32 runtime-link=static address-model=32 toolset=gcc"
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++
tar xjf boost_1_52_0.tar.bz2
cd boost_1_52_0
echo "using gcc : 7.3 : i686-w64-mingw32-g++
:
<rc>i586-mingw32msvc-windres
<archiver>i586-mingw32msvc-ar
<cxxflags>-frandom-seed=boost1
<archiver>i686-w64-mingw32-ar
<striper>i686-w64-mingw32-strip
<ranlib>i686-w64-mingw32-ranlib
<rc>i686-w64-mingw32-windres
<cxxflags>-frandom-seed=boost1 -fvisibility=hidden
;" > 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
./bootstrap.sh --without-icu --with-libraries=$LIBRARIES
./b2 -d2 -j2 -d1 --prefix=$TMPDIR $OPTIONS stage
for lib in chrono filesystem program_options system thread_win32 unit_test_framework; 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 LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
zip -r boost-win32-1.50.0-gitian.zip *
cp boost-win32-1.50.0-gitian.zip $OUTDIR
zip -r boost-win32-1.52.0-gitian.zip *
cp boost-win32-1.52.0-gitian.zip $OUTDIR
86 changes: 86 additions & 0 deletions contrib/gitian-descriptors/boost-win64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
name: "boost"
suites:
- "bionic"
architectures:
- "amd64"
packages:
- "gcc-mingw-w64-x86-64"
- "g++-mingw-w64-x86-64"
- "faketime"
- "zip"
reference_datetime: "2015-01-30 00:00:00"
remotes: []
files:
- "boost_1_52_0.tar.bz2"
script: |
TMPDIR="$HOME/tmpdir"
LIBRARIES="chrono,filesystem,program_options,system,thread,test"
OPTIONS="variant=release --layout=tagged --build-type=complete --user-config=user-config.jam threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 target-os=windows threadapi=win32 runtime-link=static address-model=64 toolset=gcc"
mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include
tar xjf boost_1_52_0.tar.bz2
cd boost_1_52_0
# Make patch
echo "--- a/boost/detail/interlocked.hpp" > interlocked.patch
echo "+++ b/boost/detail/interlocked.hpp" >> interlocked.patch
echo "@@ -125,13 +125,30 @@" >> interlocked.patch
echo " # define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange" >> interlocked.patch
echo " # define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd" >> interlocked.patch
echo "" >> interlocked.patch
echo "+// Unlike __MINGW64__, __MINGW64_VERSION_MAJOR is defined by MinGW-w64 for both 32 and 64-bit targets." >> interlocked.patch
echo "+#elif defined(__MINGW64_VERSION_MAJOR)" >> interlocked.patch
echo "+" >> interlocked.patch
echo "+// MinGW-w64 provides intrin.h for both 32 and 64-bit targets." >> interlocked.patch
echo "+#include <intrin.h>" >> interlocked.patch
echo "+" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd" >> interlocked.patch
echo "+# if defined(__x86_64__) || defined(__x86_64)" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer" >> interlocked.patch
echo "+# else" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \\" >> interlocked.patch
echo "+((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))" >> interlocked.patch
echo "+# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \\" >> interlocked.patch
echo "+((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))" >> interlocked.patch
echo "+# endif" >> interlocked.patch
echo "+" >> interlocked.patch
echo " #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )" >> interlocked.patch
echo "" >> interlocked.patch
echo "-#if defined(__MINGW64__)" >> interlocked.patch
echo "-#define BOOST_INTERLOCKED_IMPORT" >> interlocked.patch
echo "-#else" >> interlocked.patch
echo " #define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)" >> interlocked.patch
echo "-#endif" >> interlocked.patch
echo "" >> interlocked.patch
echo "" >> interlocked.patch
echo " namespace boost" >> interlocked.patch
# Apply patch
patch -p1 < interlocked.patch
echo "using gcc : 7.3 : x86_64-w64-mingw32-g++
:
<archiver>x86_64-w64-mingw32-ar
<striper>x86_64-w64-mingw32-strip
<ranlib>x86_64-w64-mingw32-ranlib
<rc>x86_64-w64-mingw32-windres
<cxxflags>-frandom-seed=boost1 -fvisibility=hidden
;" > user-config.jam
./bootstrap.sh --without-icu --with-libraries=$LIBRARIES
./b2 -d2 -j2 -d1 --prefix=$TMPDIR $OPTIONS stage
for lib in chrono filesystem program_options system thread_win32 unit_test_framework; 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/x86_64-linux-gnu/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
zip -r boost-win64-1.52.0-gitian.zip *
cp boost-win64-1.52.0-gitian.zip $OUTDIR
38 changes: 21 additions & 17 deletions contrib/gitian-descriptors/deps-win32.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
name: "primecoin-deps"
suites:
- "lucid"
- "bionic"
architectures:
- "i386"
packages:
- "mingw32"
- "gcc-mingw-w64-i686"
- "g++-mingw-w64-i686"
- "git-core"
- "zip"
- "faketime"
- "wine"
- "psmisc"
reference_datetime: "2011-01-30 00:00:00"
reference_datetime: "2015-01-30 00:00:00"
remotes: []
files:
- "openssl-1.0.1g.tar.gz"
Expand All @@ -22,44 +21,51 @@ files:
- "qrencode-3.2.0.tar.bz2"
script: |
#
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC
#
tar xzf openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
./Configure --cross-compile-prefix=i586-mingw32msvc- mingw
./Configure --cross-compile-prefix=i686-w64-mingw32- mingw no-camellia no-capieng no-cast no-comp no-dso no-dtls1 no-ec_nistp_64_gcc_128 no-gost no-gmp no-heartbeats no-idea no-jpake no-krb5 no-libunbound no-md2 no-mdc2 no-rc4 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-shared no-ssl-trace no-ssl2 no-ssl3 no-static_engine no-store no-unit-test no-weak-ssl-ciphers no-whirlpool no-zlib no-zlib-dynamic
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"
cd db-4.8.30.NC
sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h
sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c
cd build_unix
../dist/configure --disable-shared --disable-replication --enable-cxx --enable-mingw --host=i686-w64-mingw32
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
mkdir dll
sed -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"1.6\"|' -e 's|OS/version|i686-w64-mingw32|' miniupnpcstrings.h.in > miniupnpcstrings.h
sed -i.old "s|miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings|miniupnpcstrings.h: miniupnpcstrings.h.in|" Makefile.mingw
sed 's/CC = gcc/CC ?= gcc/' -i Makefile.mingw
CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar make libminiupnpc.a -f Makefile.mingw
cd ..
mv miniupnpc-1.6 miniupnpc
#
tar xzf zlib-1.2.7.tar.gz
cd zlib-1.2.7
make -f win32/Makefile.gcc PREFIX=i586-mingw32msvc- $MAKEOPTS
make -f win32/Makefile.gcc PREFIX=i686-w64-mingw32- $MAKEOPTS
cd ..
#
tar xzf libpng-1.5.12.tar.gz
cd libpng-1.5.12
./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.7/" CFLAGS="-I../zlib-1.2.7/"
sed -i 's/as_fn_error $? "newly created file is older than distributed files!/echo $? "newly created file is older than distributed files!/' configure
./configure --disable-shared --host=i686-w64-mingw32 LDFLAGS="-L../zlib-1.2.7/" CFLAGS="-I../zlib-1.2.7/"
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.12/.libs/libpng15.a ../zlib-1.2.7/libz.a" png_CFLAGS="-I../libpng-1.5.12"
sed -i 's/as_fn_error $? "newly created file is older than distributed files!/echo $? "newly created file is older than distributed files!/' configure
./configure --disable-shared -without-tools --disable-sdltest --host=i686-w64-mingw32 png_LIBS="../libpng-1.5.12/.libs/libpng15.a ../zlib-1.2.7/libz.a" png_CFLAGS="-I../libpng-1.5.12"
make $MAKEOPTS
cd ..
#
Expand All @@ -68,5 +74,3 @@ script: |
$(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
76 changes: 76 additions & 0 deletions contrib/gitian-descriptors/deps-win64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
name: "primecoin-deps"
suites:
- "bionic"
architectures:
- "amd64"
packages:
- "gcc-mingw-w64-x86-64"
- "g++-mingw-w64-x86-64"
- "git-core"
- "zip"
- "faketime"
reference_datetime: "2015-01-30 00:00:00"
remotes: []
files:
- "openssl-1.0.1g.tar.gz"
- "db-4.8.30.NC.tar.gz"
- "miniupnpc-1.6.tar.gz"
- "zlib-1.2.7.tar.gz"
- "libpng-1.5.12.tar.gz"
- "qrencode-3.2.0.tar.bz2"
script: |
#
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC
#
tar xzf openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
./Configure --cross-compile-prefix=x86_64-w64-mingw32- mingw64 no-camellia no-capieng no-cast no-comp no-dso no-dtls1 no-ec_nistp_64_gcc_128 no-gost no-gmp no-heartbeats no-idea no-jpake no-krb5 no-libunbound no-md2 no-mdc2 no-rc4 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-shared no-ssl-trace no-ssl2 no-ssl3 no-static_engine no-store no-unit-test no-weak-ssl-ciphers no-whirlpool no-zlib no-zlib-dynamic
make
cd ..
#
tar xzf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC
sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h
sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c
cd build_unix
../dist/configure --disable-shared --disable-replication --enable-cxx --enable-mingw --host=x86_64-w64-mingw32
make $MAKEOPTS
cd ../..
#
tar xzf miniupnpc-1.6.tar.gz
cd miniupnpc-1.6
mkdir dll
sed -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"1.6\"|' -e 's|OS/version|x86_64-w64-mingw32|' miniupnpcstrings.h.in > miniupnpcstrings.h
sed -i.old "s|miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings|miniupnpcstrings.h: miniupnpcstrings.h.in|" Makefile.mingw
sed 's/CC = gcc/CC ?= gcc/' -i Makefile.mingw
CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar make libminiupnpc.a -f Makefile.mingw
cd ..
mv miniupnpc-1.6 miniupnpc
#
tar xzf zlib-1.2.7.tar.gz
cd zlib-1.2.7
make -f win32/Makefile.gcc PREFIX=x86_64-w64-mingw32- $MAKEOPTS
cd ..
#
tar xzf libpng-1.5.12.tar.gz
cd libpng-1.5.12
sed -i 's/as_fn_error $? "newly created file is older than distributed files!/echo $? "newly created file is older than distributed files!/' configure
./configure --disable-shared --host=x86_64-w64-mingw32 LDFLAGS="-L../zlib-1.2.7/" CFLAGS="-I../zlib-1.2.7/"
make $MAKEOPTS
cd ..
#
tar xjf qrencode-3.2.0.tar.bz2
cd qrencode-3.2.0
sed -i 's/as_fn_error $? "newly created file is older than distributed files!/echo $? "newly created file is older than distributed files!/' configure
./configure --disable-shared -without-tools --disable-sdltest --host=x86_64-w64-mingw32 png_LIBS="../libpng-1.5.12/.libs/libpng15.a ../zlib-1.2.7/libz.a" png_CFLAGS="-I../libpng-1.5.12"
make $MAKEOPTS
cd ..
#
zip -r $OUTDIR/primecoin-deps-win64-0.0.2.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)
Loading

0 comments on commit 5b4cb77

Please sign in to comment.