diff --git a/contrib/gitian-descriptors/README.md b/contrib/gitian-descriptors/README.md index 161852b41..babb28b08 100644 --- a/contrib/gitian-descriptors/README.md +++ b/contrib/gitian-descriptors/README.md @@ -27,6 +27,7 @@ Once you've got the right hardware and software: # Create base images cd gitian-builder + bin/make-base-vm --suite precise --arch i386 bin/make-base-vm --suite precise --arch amd64 cd .. diff --git a/contrib/gitian-descriptors/boost-linux.yml b/contrib/gitian-descriptors/boost-linux.yml new file mode 100644 index 000000000..bd3534633 --- /dev/null +++ b/contrib/gitian-descriptors/boost-linux.yml @@ -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++ + : + \"-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 diff --git a/contrib/gitian-descriptors/boost-win.yml b/contrib/gitian-descriptors/boost-win.yml new file mode 100644 index 000000000..db5d6bab1 --- /dev/null +++ b/contrib/gitian-descriptors/boost-win.yml @@ -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++ + : + $HOST-windres + $HOST-ar + -frandom-seed=boost1 + $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 : /zlib//zlib^^' libs/iostreams/build/Jamfile.v2 + sed -i 's^zlib.cpp 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 + diff --git a/contrib/gitian-descriptors/deps-linux.yml b/contrib/gitian-descriptors/deps-linux.yml new file mode 100644 index 000000000..72fc3c4ae --- /dev/null +++ b/contrib/gitian-descriptors/deps-linux.yml @@ -0,0 +1,98 @@ +--- +name: "darkcoin" +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.1i.tar.gz" +- "miniupnpc-1.9.20140701.tar.gz" +- "qrencode-3.4.3.tar.bz2" +- "protobuf-2.5.0.tar.bz2" +- "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 "3c179f46ca77069a6a0bac70212a9b3b838b2f66129cb52d568837fc79d8fcc7 openssl-1.0.1i.tar.gz" | sha256sum -c + echo "26f3985bad7768b8483b793448ae49414cdc4451d0ec83e7c1944367e15f9f07 miniupnpc-1.9.20140701.tar.gz" | sha256sum -c + echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c + echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c + echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c + + # + tar xzf openssl-1.0.1i.tar.gz + cd openssl-1.0.1i + # 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 xzfm miniupnpc-1.9.20140701.tar.gz + cd miniupnpc-1.9.20140701 + # miniupnpc is always built with -fPIC + INSTALLPREFIX=$STAGING make $MAKEOPTS install + rm -f $STAGING/lib/libminiupnpc.so* # no way to skip shared lib build + cd .. + # + tar xjf qrencode-3.4.3.tar.bz2 + cd qrencode-3.4.3 + unset FAKETIME # unset fake time during configure, as it does some clock sanity tests + # need --with-pic to avoid relocation error in 64 bit builds + ./configure --prefix=$STAGING --enable-static --disable-shared --with-pic --without-tools --disable-dependency-tracking + # Workaround to prevent re-configuring by make; make all files have a date in the past + find . -print0 | xargs -r0 touch -t 200001010000 + export FAKETIME=$REFERENCE_DATETIME + make $MAKEOPTS install + cd .. + # + tar xjf protobuf-2.5.0.tar.bz2 + cd protobuf-2.5.0 + mkdir -p $STAGING/host/bin + unset FAKETIME # unset fake time during configure, as it does some clock sanity tests + # need --with-pic to avoid relocation error in 64 bit builds + ./configure --prefix=$STAGING --bindir=$STAGING/host/bin --enable-static --disable-shared --with-pic --without-zlib + # Workaround to prevent re-configuring by make; make all files have a date in the past + find . -print0 | xargs -r0 touch -t 200001010000 + export FAKETIME=$REFERENCE_DATETIME + make $MAKEOPTS install + 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/darkcoin-deps-linux${GBUILD_BITS}-gitian-r8.zip diff --git a/contrib/gitian-descriptors/deps-win.yml b/contrib/gitian-descriptors/deps-win.yml new file mode 100644 index 000000000..58931f8c1 --- /dev/null +++ b/contrib/gitian-descriptors/deps-win.yml @@ -0,0 +1,128 @@ +--- +name: "darkcoin-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.1i.tar.gz" +- "db-4.8.30.NC.tar.gz" +- "miniupnpc-1.9.20140701.tar.gz" +- "zlib-1.2.8.tar.gz" +- "libpng-1.6.8.tar.gz" +- "qrencode-3.4.3.tar.bz2" +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 "3c179f46ca77069a6a0bac70212a9b3b838b2f66129cb52d568837fc79d8fcc7 openssl-1.0.1i.tar.gz" | sha256sum -c + echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c + echo "26f3985bad7768b8483b793448ae49414cdc4451d0ec83e7c1944367e15f9f07 miniupnpc-1.9.20140701.tar.gz" | sha256sum -c + echo "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d zlib-1.2.8.tar.gz" | sha256sum -c + echo "32c7acf1608b9c8b71b743b9780adb7a7b347563dbfb4a5263761056da44cc96 libpng-1.6.8.tar.gz" | sha256sum -c + echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | 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.1i.tar.gz + cd openssl-1.0.1i + 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/miniupnpc-1.9.20140701.tar.gz + cd miniupnpc-1.9.20140701 + echo " + --- miniupnpc-1.9/Makefile.mingw.orig 2013-09-29 18:52:51.014087958 -1000 + +++ miniupnpc-1.9/Makefile.mingw 2013-09-29 19:09:29.663318691 -1000 + @@ -67,8 +67,8 @@ + + wingenminiupnpcstrings.o: wingenminiupnpcstrings.c + + -miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings + - wingenminiupnpcstrings \$< \$@ + +miniupnpcstrings.h: miniupnpcstrings.h.in + + sed -e 's|OS/version|MSWindows/5.1.2600|' -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"VERSIONHERE\"|' \$< > \$@ + + minixml.o: minixml.c minixml.h miniupnpcstrings.h + + " | sed "s/VERSIONHERE/$(cat VERSION)/" | patch -p1 + mkdir -p dll + make -f Makefile.mingw CC=$HOST-gcc AR=$HOST-ar libminiupnpc.a + install -d $INSTALLPREFIX/include/miniupnpc + install *.h $INSTALLPREFIX/include/miniupnpc + install libminiupnpc.a $INSTALLPREFIX/lib + 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 .. + # + tar xzf $INDIR/libpng-1.6.8.tar.gz + cd libpng-1.6.8 + OPT="-O2" + CPPFLAGS="${OPT} -I$INSTALLPREFIX/include" CFLAGS="${OPT} -I$INSTALLPREFIX/include" LDFLAGS="${OPT} -L$INSTALLPREFIX/lib" ./configure --disable-shared --prefix=$INSTALLPREFIX --host=$HOST + make $MAKEOPTS + make install + cd .. + # + tar xjf $INDIR/qrencode-3.4.3.tar.bz2 + cd qrencode-3.4.3 + png_CFLAGS="-I$INSTALLPREFIX/include" png_LIBS="-L$INSTALLPREFIX/lib -lpng" ./configure --prefix=$INSTALLPREFIX --host=$HOST --enable-static --disable-shared --without-tools --disable-dependency-tracking + # Workaround to prevent re-configuring by make (resulting in missing m4 error); make all files have a date in the past + find . -print0 | xargs -r0 touch -t 200001010000 + 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/darkcoin-deps-win$BITS-gitian-r15.zip + done # for BITS in diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 71ba9a901..b23fc6b78 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -1,109 +1,86 @@ --- -name: "darkcoin-linux-0.11" -enable_cache: true +name: "darkcoin" suites: - "precise" architectures: +- "i386" - "amd64" packages: -- "g++-multilib" +- "g++" - "git-core" +- "unzip" - "pkg-config" - "autoconf2.13" - "libtool" - "automake" - "faketime" - "bsdmainutils" -- "binutils-gold" +- "libqt4-core" +- "libqt4-gui" +- "libqt4-dbus" +- "libqt4-network" +- "libqt4-test" reference_datetime: "2013-06-01 00:00:00" remotes: - "url": "https://github.com/darkcoin/darkcoin.git" "dir": "darkcoin" -files: [] +files: +- "darkcoin-deps-linux32-gitian-r8.zip" +- "darkcoin-deps-linux64-gitian-r8.zip" +- "boost-linux32-1.55.0-gitian-r1.zip" +- "boost-linux64-1.55.0-gitian-r1.zip" +- "qt-linux32-4.6.4-gitian-r1.tar.gz" +- "qt-linux64-4.6.4-gitian-r1.tar.gz" script: | - WRAP_DIR=$HOME/wrapped - HOSTS="i686-pc-linux-gnu x86_64-unknown-linux-gnu" - CONFIGFLAGS="--enable-upnp-default --enable-glibc-back-compat" - FAKETIME_HOST_PROGS="" - FAKETIME_PROGS="date ar ranlib nm strip" - - export QT_RCC_TEST=1 - export GZIP="-9n" - export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - export TZ="UTC" - export BUILD_DIR=`pwd` - mkdir -p ${WRAP_DIR} - if test -n "$GBUILD_CACHE_ENABLED"; then - export SOURCES_PATH=${GBUILD_COMMON_CACHE} - export BASE_CACHE=${GBUILD_PACKAGE_CACHE} - mkdir -p ${BASE_CACHE} ${SOURCES_PATH} - fi - - # Create global faketime wrappers - for prog in ${FAKETIME_PROGS}; do - echo '#!/bin/bash' > ${WRAP_DIR}/${prog} - echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} - echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} - echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} - echo "\$REAL \$@" >> $WRAP_DIR/${prog} - chmod +x ${WRAP_DIR}/${prog} - done - - # Create per-host faketime wrappers - for i in $HOSTS; do - for prog in ${FAKETIME_HOST_PROGS}; do - echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} - echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} - echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} - echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} - echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} - chmod +x ${WRAP_DIR}/${i}-${prog} - done - done - export PATH=${WRAP_DIR}:${PATH} + STAGING="$HOME/install" + OPTFLAGS='-O2' + 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/darkcoin-deps-linux${GBUILD_BITS}-gitian-r8.zip + unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip + tar -zxf ../build/qt-linux${GBUILD_BITS}-4.6.4-gitian-r1.tar.gz + cd ../build + # Avoid exporting *any* symbols from the executable + # This avoids conflicts between the libraries statically linked into darkcoin and any + # libraries we may link dynamically (such as Qt and OpenSSL, see issue #4094). + # It also avoids start-up overhead to not export any unnecessary symbols. + # To do this, build a linker script that marks all symbols as local. + LINKER_SCRIPT=$HOME/build/linker_version_script + echo ' + { + local: *; + };' > $LINKER_SCRIPT + function do_configure { + ./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=darkcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" --enable-glibc-back-compat + } + # cd darkcoin - BASEPREFIX=`pwd`/depends - # Build dependencies for each host - for i in $HOSTS; do - make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" - done - - # Create the release tarball using (arbitrarily) the first host ./autogen.sh - ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` + do_configure make dist - SOURCEDIST=`echo darkcoin-*.tar.gz` - DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` - # Correct tar file order - mkdir -p temp - pushd temp - tar xf ../$SOURCEDIST - find darkcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$SOURCEDIST - popd + DISTNAME=`echo darkcoin-*.tar.gz` - ORIGPATH="$PATH" - # Extract the release tarball into a dir for each host and build - for i in ${HOSTS}; do - export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} - mkdir -p distsrc-${i} - cd distsrc-${i} - INSTALLPATH=`pwd`/installed/${DISTNAME} - mkdir -p ${INSTALLPATH} - tar --strip-components=1 -xf ../$SOURCEDIST + # Build dynamic versions of everything + # (with static linking to boost and openssl as well a some non-OS deps) + mkdir -p distsrc + cd distsrc + tar --strip-components=1 -xf ../$DISTNAME + do_configure --bindir=$BINDIR + make $MAKEOPTS + make $MAKEOPTS install-strip + make $MAKEOPTS clean - ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} - make ${MAKEOPTS} - make install-strip - cd installed - find . -name "lib*.la" -delete - find . -name "lib*.a" -delete - rm -rf ${DISTNAME}/lib/pkgconfig - find . | sort | tar --no-recursion -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz - cd ../../ - done + # sort distribution tar file and normalize user/group/mtime information for deterministic output mkdir -p $OUTDIR/src - mv $SOURCEDIST $OUTDIR/src - mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-linux64.tar.gz - mv ${OUTDIR}/${DISTNAME}-i686-*.tar.gz ${OUTDIR}/${DISTNAME}-linux32.tar.gz - + rm -rf $TEMPDIR + mkdir -p $TEMPDIR + cd $TEMPDIR + tar -xvf $HOME/build/darkcoin/$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 diff --git a/contrib/gitian-descriptors/gitian-osx-bitcoin.yml b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml new file mode 100644 index 000000000..a5e6a0d0b --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-bitcoin.yml @@ -0,0 +1,60 @@ +--- +name: "darkcoin" +suites: +- "precise" +architectures: +- "i386" +packages: +- "git-core" +- "automake" +- "faketime" +- "bsdmainutils" +- "pkg-config" +- "p7zip-full" + +reference_datetime: "2013-06-01 00:00:00" +remotes: +- "url": "https://github.com/darkcoin/darkcoin.git" + "dir": "darkcoin" +files: +- "osx-native-depends-r3.tar.gz" +- "osx-depends-r6.tar.gz" +- "osx-depends-qt-5.2.1-r5.tar.gz" +- "MacOSX10.7.sdk.tar.gz" + +script: | + + HOST=x86_64-apple-darwin11 + PREFIX=`pwd`/osx-cross-depends/prefix + SDK=`pwd`/osx-cross-depends/SDKs/MacOSX10.7.sdk + NATIVEPREFIX=`pwd`/osx-cross-depends/native-prefix + export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + + export SOURCES_PATH=`pwd` + + mkdir -p osx-cross-depends/SDKs + + tar -C osx-cross-depends/SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz + + tar -C osx-cross-depends -xf osx-native-depends-r3.tar.gz + tar -C osx-cross-depends -xf osx-depends-r6.tar.gz + tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r5.tar.gz + export PATH=`pwd`/osx-cross-depends/native-prefix/bin:$PATH + + cd darkcoin + + export ZERO_AR_DATE=1 + export QT_RCC_TEST=1 + ./autogen.sh + ./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode + make dist + mkdir -p distsrc + cd distsrc + tar --strip-components=1 -xf ../darkcoin-*.tar* + ./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode + make $MAKEOPTS + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + export TZ=UTC + make deploy + dmg dmg Darkcoin-Qt.dmg $OUTDIR/Darkcoin-Qt.dmg diff --git a/contrib/gitian-descriptors/gitian-osx-depends.yml b/contrib/gitian-descriptors/gitian-osx-depends.yml new file mode 100644 index 000000000..3e760939c --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-depends.yml @@ -0,0 +1,159 @@ +--- +name: "osx-depends" +suites: +- "precise" +architectures: +- "i386" +packages: +- "git-core" +- "automake" +- "p7zip-full" + +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "boost_1_55_0.tar.bz2" +- "db-4.8.30.NC.tar.gz" +- "miniupnpc-1.9.20140701.tar.gz" +- "openssl-1.0.1i.tar.gz" +- "protobuf-2.5.0.tar.bz2" +- "qrencode-3.4.3.tar.bz2" +- "MacOSX10.7.sdk.tar.gz" +- "osx-native-depends-r3.tar.gz" + +script: | + + echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | sha256sum -c + echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c + echo "26f3985bad7768b8483b793448ae49414cdc4451d0ec83e7c1944367e15f9f07 miniupnpc-1.9.20140701.tar.gz" | sha256sum -c + echo "3c179f46ca77069a6a0bac70212a9b3b838b2f66129cb52d568837fc79d8fcc7 openssl-1.0.1i.tar.gz" | sha256sum -c + echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c + echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c + + REVISION=r6 + export SOURCES_PATH=`pwd` + export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export PATH=$HOME:$PATH + export SOURCES_PATH=`pwd` + export ZERO_AR_DATE=1 + + mkdir -p osx-cross-depends/build + cd osx-cross-depends + + PREFIX=`pwd`/prefix + NATIVEPREFIX=`pwd`/native-prefix + BUILD_BASE=`pwd`/build + SDK=`pwd`/SDKs/MacOSX10.7.sdk + HOST=x86_64-apple-darwin11 + MIN_VERSION=10.6 + + INT_CFLAGS="-target ${HOST} -mmacosx-version-min=${MIN_VERSION} --sysroot ${SDK} -msse2 -Qunused-arguments" + INT_CXXFLAGS="${INT_CFLAGS}" + INT_LDFLAGS="-L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" + INT_LDFLAGS_CLANG="-B${NATIVEPREFIX}/bin" + INT_CPPFLAGS="-I${PREFIX}/include" + INT_CC=clang + INT_CXX=clang++ + INT_OBJC=clang + INT_OBJCXX=clang++ + INT_AR=${HOST}-ar + INT_RANLIB=${HOST}-ranlib + INT_LIBTOOL=${HOST}-libtool + INT_INSTALL_NAME_TOOL=${HOST}-install_name_tool + + export PATH=${NATIVEPREFIX}/bin:${PATH} + + mkdir -p ${NATIVEPREFIX}/bin + mkdir -p ${NATIVEPREFIX}/lib + mkdir -p ${PREFIX}/bin + mkdir -p ${PREFIX}/lib + mkdir -p ${BUILD_BASE} + + mkdir -p SDKs + tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz + + tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz + + # bdb + SOURCE_FILE=${SOURCES_PATH}/db-4.8.30.NC.tar.gz + BUILD_DIR=${BUILD_BASE}/db-4.8.30.NC + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' ${BUILD_DIR}/dbinc/atomic.h + pushd ${BUILD_DIR} + cd build_unix; + ../dist/configure --host=${HOST} --prefix="${PREFIX}" --disable-shared --enable-cxx CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" + make $MAKEOPTS libdb.a libdb_cxx.a + make install_lib install_include + popd + + # openssl + SOURCE_FILE=${SOURCES_PATH}/openssl-1.0.1i.tar.gz + BUILD_DIR=${BUILD_BASE}/openssl-1.0.1i + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + sed -ie "s|cc:|${INT_CC}:|" ${BUILD_DIR}/Configure + sed -ie "s|\(-arch [_a-zA-Z0-9]*\)|\1 --sysroot ${SDK} -target ${HOST} -msse2|" ${BUILD_DIR}/Configure + AR="${INT_AR}" RANLIB="${INT_RANLIB}" ./Configure --prefix=${PREFIX} --openssldir=${PREFIX}/etc/openssl zlib shared no-krb5 darwin64-x86_64-cc ${INT_LDFLAGS} ${INT_CLANG_LDFLAGS} ${INT_CPPFLAGS} + sed -i "s|engines apps test|engines|" ${BUILD_DIR}/Makefile + sed -i "/define DATE/d" ${BUILD_DIR}/crypto/Makefile + make -j1 build_libs libcrypto.pc libssl.pc openssl.pc + make -j1 install_sw + popd + + #libminiupnpc + SOURCE_FILE=${SOURCES_PATH}/miniupnpc-1.9.20140701.tar.gz + BUILD_DIR=${BUILD_BASE}/miniupnpc-1.9.20140701 + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + CFLAGS="${INT_CFLAGS} ${INT_CPPFLAGS}" make $MAKEOPTS OS=Darwin CC="${INT_CC}" AR="${INT_AR}" libminiupnpc.a + install -d ${PREFIX}/include/miniupnpc + install *.h ${PREFIX}/include/miniupnpc + install libminiupnpc.a ${PREFIX}/lib + popd + + # qrencode + SOURCE_FILE=${SOURCES_PATH}/qrencode-3.4.3.tar.bz2 + BUILD_DIR=${BUILD_BASE}/qrencode-3.4.3 + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + + # m4 folder is not included in the stable release, which can confuse aclocal + # if its timestamp ends up being earlier than configure.ac when extracted + touch aclocal.m4 + ./configure --host=${HOST} --prefix="${PREFIX}" --disable-shared CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" --disable-shared -without-tools --disable-sdltest --disable-dependency-tracking + make $MAKEOPTS + make install + popd + + # libprotobuf + SOURCE_FILE=${SOURCES_PATH}/protobuf-2.5.0.tar.bz2 + BUILD_DIR=${BUILD_BASE}/protobuf-2.5.0 + + tar -C ${BUILD_BASE} -xjf ${SOURCE_FILE} + pushd ${BUILD_DIR} + ./configure --host=${HOST} --prefix="${PREFIX}" --disable-shared --enable-cxx CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" --enable-shared=no --disable-dependency-tracking --with-protoc=${NATIVEPREFIX}/bin/protoc + cd src + make $MAKEOPTS libprotobuf.la + make install-libLTLIBRARIES install-nobase_includeHEADERS + cd .. + make install-pkgconfigDATA + popd + + # boost + SOURCE_FILE=${SOURCES_PATH}/boost_1_55_0.tar.bz2 + BUILD_DIR=${BUILD_BASE}/boost_1_55_0 + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + ./bootstrap.sh --with-libraries=chrono,filesystem,program_options,system,thread,test + echo "using darwin : : ${INT_CXX} : \"${INT_CFLAGS} ${INT_CPPFLAGS}\" \"${INT_LDFLAGS} ${INT_CLANG_LDFLAGS}\" \"${INT_LIBTOOL}\" \"${INT_STRIP}\" : ;" > "user-config.jam" + ./b2 -d2 --layout=tagged --build-type=complete --prefix="${PREFIX}" --toolset=darwin-4.2.1 --user-config=user-config.jam variant=release threading=multi link=static install + popd + + export GZIP="-9n" + find prefix | sort | tar --no-recursion -czf osx-depends-${REVISION}.tar.gz -T - + + mv osx-depends-${REVISION}.tar.gz $OUTDIR diff --git a/contrib/gitian-descriptors/gitian-osx-native.yml b/contrib/gitian-descriptors/gitian-osx-native.yml new file mode 100644 index 000000000..a753ad704 --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-native.yml @@ -0,0 +1,178 @@ +--- +name: "osx-native" +suites: +- "precise" +architectures: +- "i386" +packages: +- "git-core" +- "automake" +- "faketime" +- "libssl-dev" +- "libbz2-dev" +- "libz-dev" +- "cmake" +- "libcap-dev" +- "p7zip-full" +- "uuid-dev" + +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "10cc648683617cca8bcbeae507888099b41b530c.tar.gz" +- "cctools-809.tar.gz" +- "dyld-195.5.tar.gz" +- "ld64-127.2.tar.gz" +- "protobuf-2.5.0.tar.bz2" +- "MacOSX10.7.sdk.tar.gz" +- "cdrkit-1.1.11.tar.gz" +- "libdmg-hfsplus-v0.1.tar.gz" +- "clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" +- "cdrkit-deterministic.patch" + + +script: | + + echo "18406961fd4a1ec5c7ea35c91d6a80a2f8bb797a2bd243a610bd75e13eff9aca 10cc648683617cca8bcbeae507888099b41b530c.tar.gz" | sha256sum -c + echo "03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad cctools-809.tar.gz" | sha256sum -c + echo "2cf0484c87cf79b606b351a7055a247dae84093ae92c747a74e0cde2c8c8f83c dyld-195.5.tar.gz" | sha256sum -c + echo "97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142 ld64-127.2.tar.gz" | sha256sum -c + echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c + echo "d1c030756ecc182defee9fe885638c1785d35a2c2a297b4604c0e0dcc78e47da cdrkit-1.1.11.tar.gz" | sha256sum -c + echo "6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3 libdmg-hfsplus-v0.1.tar.gz" | sha256sum -c + echo "b9d57a88f9514fa1f327a1a703756d0c1c960f4c58494a5bd80313245d13ffff clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" | sha256sum -c + echo "cc12bdbd7a09f71cb2a6a3e6ec3e0abe885ca7111c2b47857f5095e5980caf4f cdrkit-deterministic.patch" | sha256sum -c + + + REVISION=r3 + export REFERENCE_DATETIME + export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export FAKETIME=$REFERENCE_DATETIME + export TZ=UTC + + REAL_AR=`which ar` + REAL_RANLIB=`which ranlib` + REAL_DATE=`which date` + + echo '#!/bin/bash' > $HOME/ar + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar + echo "$REAL_AR \"\$@\"" >> $HOME/ar + + echo '#!/bin/bash' > $HOME/ranlib + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ranlib + echo "$REAL_RANLIB \"\$@\"" >> $HOME/ranlib + + echo '#!/bin/bash' > $HOME/date + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/date + echo "$REAL_DATE \"\$@\"" >> $HOME/date + + chmod +x $HOME/ar $HOME/ranlib $HOME/date + + + export PATH=$HOME:$PATH + export SOURCES_PATH=`pwd` + + mkdir -p osx-cross-depends/build + cd osx-cross-depends + + NATIVEPREFIX=`pwd`/native-prefix + BUILD_BASE=`pwd`/build + SDK=`pwd`/SDKs/MacOSX10.7.sdk + HOST=x86_64-apple-darwin11 + MIN_VERSION=10.6 + + CFLAGS="" + CXXFLAGS="${CFLAGS}" + LDFLAGS="-L${NATIVEPREFIX}/lib" + + export PATH=${NATIVEPREFIX}/bin:${PATH} + + mkdir -p ${NATIVEPREFIX}/bin + mkdir -p ${NATIVEPREFIX}/lib + + mkdir -p SDKs + tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz + + # Clang + SOURCE_FILE=${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz + BUILD_DIR=${BUILD_BASE}/clang+llvm-3.2-x86-linux-ubuntu-12.04 + + mkdir -p ${NATIVEPREFIX}/lib/clang/3.2/include + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + cp ${BUILD_DIR}/bin/clang ${NATIVEPREFIX}/bin/ + cp ${BUILD_DIR}/bin/clang++ ${NATIVEPREFIX}/bin/ + cp ${BUILD_DIR}/lib/libLTO.so ${NATIVEPREFIX}/lib/ + cp ${BUILD_DIR}/lib/clang/3.2/include/* ${NATIVEPREFIX}/lib/clang/3.2/include + + # cctools + SOURCE_FILE=${SOURCES_PATH}/10cc648683617cca8bcbeae507888099b41b530c.tar.gz + BUILD_DIR=${BUILD_BASE}/toolchain4-10cc648683617cca8bcbeae507888099b41b530c + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + mkdir -p ${BUILD_DIR}/sdks + pushd ${BUILD_DIR}/sdks; + ln -sf ${SDK} MacOSX10.7.sdk + ln -sf ${SOURCES_PATH}/cctools-809.tar.gz ${BUILD_DIR}/cctools2odcctools/cctools-809.tar.gz + ln -sf ${SOURCES_PATH}/ld64-127.2.tar.gz ${BUILD_DIR}/cctools2odcctools/ld64-127.2.tar.gz + ln -sf ${SOURCES_PATH}/dyld-195.5.tar.gz ${BUILD_DIR}/cctools2odcctools/dyld-195.5.tar.gz + + tar -C ${BUILD_DIR} -xf ${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz + # Hack in the use of our llvm headers rather than grabbing the old llvm-gcc. + sed -i "s|GCC_DIR|LLVM_CLANG_DIR|g" ${BUILD_DIR}/cctools2odcctools/extract.sh + sed -i "s|llvmgcc42-2336.1|clang+llvm-3.2-x86-linux-ubuntu-12.04|g" ${BUILD_DIR}/cctools2odcctools/extract.sh + sed -i "s|\${LLVM_CLANG_DIR}/llvmCore/include/llvm-c|\${LLVM_CLANG_DIR}/include/llvm-c \${LLVM_CLANG_DIR}/include/llvm |" ${BUILD_DIR}/cctools2odcctools/extract.sh + + sed -i "s|fAC_INIT|AC_INIT|" ${BUILD_DIR}/cctools2odcctools/files/configure.ac + sed -i 's/\# Dynamically linked LTO/\t ;\&\n\t linux*)\n# Dynamically linked LTO/' ${BUILD_DIR}/cctools2odcctools/files/configure.ac + + cd ${BUILD_DIR}/cctools2odcctools + ./extract.sh --osxver 10.7 + cd odcctools-809 + ./configure --prefix=${NATIVEPREFIX} --target=${HOST} CFLAGS="${CFLAGS} -I${NATIVEPREFIX}/include -D__DARWIN_UNIX03 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" LDFLAGS="${LDFLAGS} -Wl,-rpath=\\\$\$ORIGIN/../lib" --with-sysroot=${SDK} + + # The 'PC' define in sparc/reg.h conflicts but doesn't get used anyway. Just rename it. + sed -i "s|define\tPC|define\tPC_|" ${BUILD_DIR}/cctools2odcctools/odcctools-809/include/architecture/sparc/reg.h + make $MAKEOPTS + make install + popd + + # protoc + SOURCE_FILE=${SOURCES_PATH}/protobuf-2.5.0.tar.bz2 + BUILD_DIR=${BUILD_BASE}/protobuf-2.5.0 + + tar -C ${BUILD_BASE} -xjf ${SOURCE_FILE} + pushd ${BUILD_DIR}; + ./configure --enable-shared=no --disable-dependency-tracking --prefix=${NATIVEPREFIX} + make $MAKEOPTS + cp ${BUILD_DIR}/src/protoc ${NATIVEPREFIX}/bin/ + popd + + # cdrkit + SOURCE_FILE=${SOURCES_PATH}/cdrkit-1.1.11.tar.gz + BUILD_DIR=${BUILD_BASE}/cdrkit-1.1.11 + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + pushd ${BUILD_DIR} + patch -p1 < ${SOURCES_PATH}/cdrkit-deterministic.patch + cmake -DCMAKE_INSTALL_PREFIX=${NATIVEPREFIX} + make $MAKEOPTS genisoimage + make -C genisoimage install + popd + + # libdmg-hfsplus + SOURCE_FILE=${SOURCES_PATH}/libdmg-hfsplus-v0.1.tar.gz + BUILD_DIR=${BUILD_BASE}/libdmg-hfsplus-libdmg-hfsplus-v0.1 + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + mkdir -p ${BUILD_DIR}/build + pushd ${BUILD_DIR}/build + cmake -DCMAKE_INSTALL_PREFIX:PATH=${NATIVEPREFIX}/bin .. + make $MAKEOPTS + make install + popd + + rm -rf native-prefix/docs + + export GZIP="-9n" + find native-prefix | sort | tar --no-recursion -czf osx-native-depends-$REVISION.tar.gz -T - + mv osx-native-depends-$REVISION.tar.gz $OUTDIR diff --git a/contrib/gitian-descriptors/gitian-osx-qt.yml b/contrib/gitian-descriptors/gitian-osx-qt.yml new file mode 100644 index 000000000..164d7be0b --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-qt.yml @@ -0,0 +1,186 @@ +--- +name: "osx-qt" +suites: +- "precise" +architectures: +- "i386" +packages: +- "git-core" +- "automake" +- "p7zip-full" + +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "qt-everywhere-opensource-src-5.2.1.tar.gz" +- "osx-native-depends-r3.tar.gz" +- "osx-depends-r6.tar.gz" +- "MacOSX10.7.sdk.tar.gz" + +script: | + + echo "84e924181d4ad6db00239d87250cc89868484a14841f77fb85ab1f1dbdcd7da1 qt-everywhere-opensource-src-5.2.1.tar.gz" | sha256sum -c + + REVISION=r5 + export SOURCES_PATH=`pwd` + export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export ZERO_AR_DATE=1 + + export TZ=UTC + + REAL_DATE=`which date` + echo '#!/bin/bash' > $HOME/date + echo "$REAL_DATE -d \"${REFERENCE_DATETIME}\" \"\$@\"" >> $HOME/date + + chmod +x $HOME/date + export PATH=$HOME:$PATH + + mkdir -p osx-cross-depends/build + cd osx-cross-depends + + PREFIX=`pwd`/prefix + NATIVEPREFIX=`pwd`/native-prefix + BUILD_BASE=`pwd`/build + SDK=`pwd`/SDKs/MacOSX10.7.sdk + HOST=x86_64-apple-darwin11 + MIN_VERSION=10.6 + + INT_CFLAGS="-target ${HOST} -mmacosx-version-min=${MIN_VERSION} --sysroot ${SDK} -msse2 -Qunused-arguments" + INT_CXXFLAGS="${INT_CFLAGS}" + INT_LDFLAGS="-L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" + INT_LDFLAGS_CLANG="-B${NATIVEPREFIX}/bin" + INT_CPPFLAGS="-I${PREFIX}/include" + INT_CC=clang + INT_CXX=clang++ + INT_OBJC=clang + INT_OBJCXX=clang++ + INT_AR=${HOST}-ar + INT_RANLIB=${HOST}-ranlib + INT_LIBTOOL=${HOST}-libtool + INT_INSTALL_NAME_TOOL=${HOST}-install_name_tool + + export PATH=${NATIVEPREFIX}/bin:${PATH} + + mkdir -p ${NATIVEPREFIX}/bin + mkdir -p ${NATIVEPREFIX}/lib + mkdir -p ${PREFIX}/bin + mkdir -p ${PREFIX}/lib + mkdir -p ${BUILD_BASE} + + mkdir -p SDKs + tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz + + tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz + + export PATH=`pwd`/native-prefix/bin:$PATH + tar xf /home/ubuntu/build/osx-depends-r6.tar.gz + + SOURCE_FILE=${SOURCES_PATH}/qt-everywhere-opensource-src-5.2.1.tar.gz + BUILD_DIR=${BUILD_BASE}/qt-everywhere-opensource-src-5.2.1 + + + tar -C ${BUILD_BASE} -xf ${SOURCE_FILE} + + # Install our mkspec. All files are pulled from the macx-clang spec, except for + # our custom qmake.conf + SPECFILE=${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/qmake.conf + + mkdir -p ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux + cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/Info.plist.lib ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ + cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/Info.plist.app ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ + cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/qplatformdefs.h ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/ + + cat > ${SPECFILE} < ${WRAP_DIR}/${prog} - echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} - echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} - echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} - echo "\$REAL \$@" >> $WRAP_DIR/${prog} - chmod +x ${WRAP_DIR}/${prog} - done - - # Create per-host faketime wrappers - for i in $HOSTS; do - for prog in ${FAKETIME_HOST_PROGS}; do - echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} - echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} - echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} - echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} - echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} - chmod +x ${WRAP_DIR}/${i}-${prog} - done - done - export PATH=${WRAP_DIR}:${PATH} - - cd darkcoin - BASEPREFIX=`pwd`/depends - # Build dependencies for each host - for i in $HOSTS; do - make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" - done - - # Create the release tarball using (arbitrarily) the first host - ./autogen.sh - ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` - make dist - SOURCEDIST=`echo darkcoin-*.tar.gz` - DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` - - # Correct tar file order - mkdir -p temp - pushd temp - tar xf ../$SOURCEDIST - find darkcoin-* | sort | tar --no-recursion -c -T - | gzip -9n > ../$SOURCEDIST - popd - - ORIGPATH="$PATH" - # Extract the release tarball into a dir for each host and build - for i in ${HOSTS}; do - export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} - mkdir -p distsrc-${i} - cd distsrc-${i} - INSTALLPATH=`pwd`/installed/${DISTNAME} - mkdir -p ${INSTALLPATH} - tar --strip-components=1 -xf ../$SOURCEDIST - - ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} - make ${MAKEOPTS} + 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/qt-win${BITS}-5.2.0-gitian-r3.zip + unzip $INDIR/boost-win${BITS}-1.55.0-gitian-r6.zip + unzip $INDIR/darkcoin-deps-win${BITS}-gitian-r15.zip + unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip + if [ "$NEEDDIST" == "1" ]; then + # Make source code archive which is architecture independent so it only needs to be done once + cd $HOME/build/darkcoin + ./autogen.sh + ./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=darkcoin ${OPTFLAGS}" + make dist + DISTNAME=`echo darkcoin-*.tar.gz` + NEEDDIST=0 + fi + # Build platform-dependent executables from source archive + cd $BUILDDIR + mkdir -p distsrc + cd distsrc + tar --strip-components=1 -xf $HOME/build/darkcoin/$DISTNAME + ./configure --enable-upnp-default --bindir=$BINDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=darkcoin ${OPTFLAGS}" + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + make $MAKEOPTS make deploy make install-strip - cp -f darkcoin-*setup*.exe $OUTDIR/ - cd installed - mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/ - find . -name "lib*.la" -delete - find . -name "lib*.a" -delete - rm -rf ${DISTNAME}/lib/pkgconfig - find . -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip - cd ../.. - done + cp -f darkcoin-*setup*.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 - mv $SOURCEDIST $OUTDIR/src - mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip - mv ${OUTDIR}/${DISTNAME}-i686-*.zip ${OUTDIR}/${DISTNAME}-win32.zip + rm -rf $TEMPDIR + mkdir -p $TEMPDIR + cd $TEMPDIR + tar -xvf $HOME/build/darkcoin/$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 + diff --git a/contrib/gitian-descriptors/protobuf-win.yml b/contrib/gitian-descriptors/protobuf-win.yml new file mode 100644 index 000000000..d2fdcaa7f --- /dev/null +++ b/contrib/gitian-descriptors/protobuf-win.yml @@ -0,0 +1,65 @@ +--- +name: "protobuf-win32" +suites: +- "precise" +architectures: +- "amd64" +packages: +- "mingw-w64" +- "g++-mingw-w64" +- "zip" +- "faketime" +reference_datetime: "2013-04-15 00:00:00" +remotes: [] +files: +- "protobuf-2.5.0.tar.bz2" +script: | + # + export TZ=UTC + INDIR=$HOME/build + TEMPDIR=$HOME/tmp + OPTFLAGS="-O2" + # Integrity Check + echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | 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 xjf $INDIR/protobuf-2.5.0.tar.bz2 + cd protobuf-2.5.0 + # First: build a native (linux) protoc + ./configure --enable-shared=no --disable-dependency-tracking --without-zlib CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}" + make + mkdir -p $INSTALLPREFIX/host/bin + cp src/protoc $INSTALLPREFIX/host/bin + # Now recompile with the mingw cross-compiler: + make distclean + ./configure --prefix=$INSTALLPREFIX --enable-shared=no --disable-dependency-tracking --without-zlib --with-protoc=$INSTALLPREFIX/host/bin/protoc --host=$HOST CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}" + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + make + make 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 include lib host | sort | zip -X@ $OUTDIR/protobuf-win$BITS-2.5.0-gitian-r4.zip + unset LD_PRELOAD + unset FAKETIME + done # for BITS in diff --git a/contrib/gitian-descriptors/qt-linux.yml b/contrib/gitian-descriptors/qt-linux.yml new file mode 100644 index 000000000..b163b4bb8 --- /dev/null +++ b/contrib/gitian-descriptors/qt-linux.yml @@ -0,0 +1,264 @@ +--- +name: "qt-linux" +suites: +- "precise" +architectures: +- "i386" +- "amd64" +packages: +- "zip" +- "unzip" +- "faketime" +- "unzip" +- "libxext-dev" +reference_datetime: "2011-01-30 00:00:00" +remotes: [] +files: +- "qt-everywhere-opensource-src-4.6.4.tar.gz" +script: | + export FAKETIME=$REFERENCE_DATETIME + export TZ=UTC + if [ "$GBUILD_BITS" == "32" ]; then + ARCH='i386-linux-gnu' + else + ARCH='x86_64-linux-gnu' + fi + # The purpose of this gitian build is not to actually build Qt, but to export + # the headers as well as pkgconfig files in a useable format so that we can + # pretend to link against an older version. The goal is to link to the + # system version of Qt 4. + # Also build development tools. + INSTALLPREFIX="$HOME/install" + # Integrity Check + echo "9ad4d46c721b53a429ed5a2eecfd3c239a9ab566562f183f99d3125f1a234250 qt-everywhere-opensource-src-4.6.4.tar.gz" | sha256sum -c + # Make install directories + mkdir -p $INSTALLPREFIX + mkdir -p $INSTALLPREFIX/include + PKGCONFIGDIR=$INSTALLPREFIX/lib/pkgconfig + mkdir -p $PKGCONFIGDIR + # + tar xzf qt-everywhere-opensource-src-4.6.4.tar.gz + cd qt-everywhere-opensource-src-4.6.4 + QTBUILDDIR=$(pwd) + sed 's/TODAY=`date +%Y-%m-%d`/TODAY=2011-01-30/' -i configure + + # Need to build 4.6-versioned host utilities as well (lrelease/qrc/lupdate/...) + ./configure -prefix $INSTALLPREFIX -confirm-license -release -opensource -no-qt3support -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 + # + make $MAKEOPTS -C src/tools install # (rcc, uic, moc) + make $MAKEOPTS -C tools/linguist/lrelease install # (lrelease) + # install includes and pkgconfig files + for DIR in src/corelib src/gui src/testlib src/dbus src/network; do + ( + cd $DIR + # extract module (QtCore/QtNetwork/...) from Makefile + MODULE=$(grep "QMAKE_TARGET *=" Makefile | cut -d = -f 2 | xargs) + # patch makefile so that not everything is build first + sed -i 's/first: all/first:/g' Makefile + make install_flat_headers install_class_headers install_targ_headers + # create and install pkgconfig descriptor + make ../../lib/pkgconfig/$MODULE.pc + sed -e "s,$QTBUILDDIR,$INSTALLPREFIX,g" ../../lib/pkgconfig/$MODULE.pc > $PKGCONFIGDIR/$MODULE.pc + # create links to existing Qt libraries + ln -sf /usr/lib/${ARCH}/lib${MODULE}.so.4 ${INSTALLPREFIX}/lib/lib${MODULE}.so + ) + done + + # Write our own configuration header, same as Ubuntu + # When we don't do this, the configuration will be without STL support (the QString from/to stdString methods) + QCONFIG=$INSTALLPREFIX/include/Qt/qconfig.h + echo ' + /* Qt Edition */ + #ifndef QT_EDITION + # define QT_EDITION QT_EDITION_OPENSOURCE + #endif + ' > $QCONFIG + + if [ "$GBUILD_BITS" == "32" ]; then + echo ' + /* Machine byte-order */ + #define Q_BIG_ENDIAN 4321 + #define Q_LITTLE_ENDIAN 1234 + #define QT_BUILD_KEY "i386 linux g++-4 full-config" + #define QT_BUILD_KEY_COMPAT "i686 Linux g++-4 full-config" + + #ifdef QT_BOOTSTRAPPED + #define Q_BYTE_ORDER Q_LITTLE_ENDIAN + #else + #define Q_BYTE_ORDER Q_LITTLE_ENDIAN + #endif + /* Machine Architecture */ + #ifndef QT_BOOTSTRAPPED + # define QT_ARCH_I386 + #else + # define QT_ARCH_I386 + #endif + /* Compile time features */ + #define QT_LARGEFILE_SUPPORT 64 + #define QT_POINTER_SIZE 4 + ' >> $QCONFIG + else + echo ' + /* Machine byte-order */ + #define Q_BIG_ENDIAN 4321 + #define Q_LITTLE_ENDIAN 1234 + #define QT_BUILD_KEY "x86_64 linux g++-4 full-config" + #define QT_BUILD_KEY_COMPAT "x86_64 Linux g++-4 full-config" + + #ifdef QT_BOOTSTRAPPED + #define Q_BYTE_ORDER Q_LITTLE_ENDIAN + #else + #define Q_BYTE_ORDER Q_LITTLE_ENDIAN + #endif + /* Machine Architecture */ + #ifndef QT_BOOTSTRAPPED + # define QT_ARCH_X86_64 + #else + # define QT_ARCH_X86_64 + #endif + /* Compile time features */ + #define QT_LARGEFILE_SUPPORT 64 + #define QT_POINTER_SIZE 8 + ' >> $QCONFIG + fi + + echo ' + #ifndef QT_BOOTSTRAPPED + + #if defined(QT_NO_EGL) && defined(QT_EGL) + # undef QT_NO_EGL + #elif !defined(QT_NO_EGL) && !defined(QT_EGL) + # define QT_NO_EGL + #endif + + #if defined(QT_NO_GSTREAMER) && defined(QT_GSTREAMER) + # undef QT_NO_GSTREAMER + #elif !defined(QT_NO_GSTREAMER) && !defined(QT_GSTREAMER) + # define QT_NO_GSTREAMER + #endif + + #if defined(QT_NO_ICD) && defined(QT_ICD) + # undef QT_NO_ICD + #elif !defined(QT_NO_ICD) && !defined(QT_ICD) + # define QT_NO_ICD + #endif + + #if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG) + # undef QT_NO_IMAGEFORMAT_JPEG + #elif !defined(QT_NO_IMAGEFORMAT_JPEG) && !defined(QT_IMAGEFORMAT_JPEG) + # define QT_NO_IMAGEFORMAT_JPEG + #endif + + #if defined(QT_NO_IMAGEFORMAT_MNG) && defined(QT_IMAGEFORMAT_MNG) + # undef QT_NO_IMAGEFORMAT_MNG + #elif !defined(QT_NO_IMAGEFORMAT_MNG) && !defined(QT_IMAGEFORMAT_MNG) + # define QT_NO_IMAGEFORMAT_MNG + #endif + + #if defined(QT_NO_IMAGEFORMAT_TIFF) && defined(QT_IMAGEFORMAT_TIFF) + # undef QT_NO_IMAGEFORMAT_TIFF + #elif !defined(QT_NO_IMAGEFORMAT_TIFF) && !defined(QT_IMAGEFORMAT_TIFF) + # define QT_NO_IMAGEFORMAT_TIFF + #endif + + #if defined(QT_NO_MULTIMEDIA) && defined(QT_MULTIMEDIA) + # undef QT_NO_MULTIMEDIA + #elif !defined(QT_NO_MULTIMEDIA) && !defined(QT_MULTIMEDIA) + # define QT_NO_MULTIMEDIA + #endif + + #if defined(QT_NO_OPENVG) && defined(QT_OPENVG) + # undef QT_NO_OPENVG + #elif !defined(QT_NO_OPENVG) && !defined(QT_OPENVG) + # define QT_NO_OPENVG + #endif + + #if defined(QT_NO_PHONON) && defined(QT_PHONON) + # undef QT_NO_PHONON + #elif !defined(QT_NO_PHONON) && !defined(QT_PHONON) + # define QT_NO_PHONON + #endif + + #if defined(QT_NO_PULSEAUDIO) && defined(QT_PULSEAUDIO) + # undef QT_NO_PULSEAUDIO + #elif !defined(QT_NO_PULSEAUDIO) && !defined(QT_PULSEAUDIO) + # define QT_NO_PULSEAUDIO + #endif + + #if defined(QT_NO_S60) && defined(QT_S60) + # undef QT_NO_S60 + #elif !defined(QT_NO_S60) && !defined(QT_S60) + # define QT_NO_S60 + #endif + + #if defined(QT_NO_STYLE_S60) && defined(QT_STYLE_S60) + # undef QT_NO_STYLE_S60 + #elif !defined(QT_NO_STYLE_S60) && !defined(QT_STYLE_S60) + # define QT_NO_STYLE_S60 + #endif + + #if defined(QT_NO_SXE) && defined(QT_SXE) + # undef QT_NO_SXE + #elif !defined(QT_NO_SXE) && !defined(QT_SXE) + # define QT_NO_SXE + #endif + + #if defined(QT_NO_WEBKIT) && defined(QT_WEBKIT) + # undef QT_NO_WEBKIT + #elif !defined(QT_NO_WEBKIT) && !defined(QT_WEBKIT) + # define QT_NO_WEBKIT + #endif + + #if defined(QT_NO_ZLIB) && defined(QT_ZLIB) + # undef QT_NO_ZLIB + #elif !defined(QT_NO_ZLIB) && !defined(QT_ZLIB) + # define QT_NO_ZLIB + #endif + + #if defined(QT_RUNTIME_XCURSOR) && defined(QT_NO_RUNTIME_XCURSOR) + # undef QT_RUNTIME_XCURSOR + #elif !defined(QT_RUNTIME_XCURSOR) && !defined(QT_NO_RUNTIME_XCURSOR) + # define QT_RUNTIME_XCURSOR + #endif + + #if defined(QT_RUNTIME_XFIXES) && defined(QT_NO_RUNTIME_XFIXES) + # undef QT_RUNTIME_XFIXES + #elif !defined(QT_RUNTIME_XFIXES) && !defined(QT_NO_RUNTIME_XFIXES) + # define QT_RUNTIME_XFIXES + #endif + + #if defined(QT_RUNTIME_XINERAMA) && defined(QT_NO_RUNTIME_XINERAMA) + # undef QT_RUNTIME_XINERAMA + #elif !defined(QT_RUNTIME_XINERAMA) && !defined(QT_NO_RUNTIME_XINERAMA) + # define QT_RUNTIME_XINERAMA + #endif + + #if defined(QT_RUNTIME_XINPUT) && defined(QT_NO_RUNTIME_XINPUT) + # undef QT_RUNTIME_XINPUT + #elif !defined(QT_RUNTIME_XINPUT) && !defined(QT_NO_RUNTIME_XINPUT) + # define QT_RUNTIME_XINPUT + #endif + + #if defined(QT_RUNTIME_XRANDR) && defined(QT_NO_RUNTIME_XRANDR) + # undef QT_RUNTIME_XRANDR + #elif !defined(QT_RUNTIME_XRANDR) && !defined(QT_NO_RUNTIME_XRANDR) + # define QT_RUNTIME_XRANDR + #endif + + #if defined(QT_USE_MATH_H_FLOATS) && defined(QT_NO_USE_MATH_H_FLOATS) + # undef QT_USE_MATH_H_FLOATS + #elif !defined(QT_USE_MATH_H_FLOATS) && !defined(QT_NO_USE_MATH_H_FLOATS) + # define QT_USE_MATH_H_FLOATS + #endif + + #endif // QT_BOOTSTRAPPED + + #define QT_VISIBILITY_AVAILABLE + ' >> $QCONFIG + cp $QCONFIG $INSTALLPREFIX/include/QtCore/qconfig.h + + cd $INSTALLPREFIX + # 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 + # Create a .tar.gz because .zip has problems with symbolic links + find | 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/qt-linux${GBUILD_BITS}-4.6.4-gitian-r1.tar.gz diff --git a/contrib/gitian-descriptors/qt-win.yml b/contrib/gitian-descriptors/qt-win.yml new file mode 100644 index 000000000..c3f8da908 --- /dev/null +++ b/contrib/gitian-descriptors/qt-win.yml @@ -0,0 +1,92 @@ +--- +name: "qt" +suites: +- "precise" +architectures: +- "amd64" +packages: +- "mingw-w64" +- "g++-mingw-w64" +- "zip" +- "unzip" +- "faketime" +- "libz-dev" +reference_datetime: "2011-01-30 00:00:00" +remotes: [] +files: +- "qt-everywhere-opensource-src-5.2.0.tar.gz" +- "darkcoin-deps-win32-gitian-r15.zip" +- "darkcoin-deps-win64-gitian-r15.zip" +script: | + # Defines + export TZ=UTC + INDIR=$HOME/build + TEMPDIR=$HOME/tmp + # Qt: workaround for determinism in resource ordering + # Qt5's rcc uses a QHash to store the files for the resource. + # A security fix in QHash makes the ordering of keys to be different on every run + # (https://qt.gitorious.org/qt/qtbase/commit/c01eaa438200edc9a3bbcd8ae1e8ded058bea268). + # This is good in general but qrc shouldn't be doing a traversal over a randomized container. + # The thorough solution would be to use QMap instead of QHash, but this requires patching Qt. + # For now luckily there is a test mode that forces a fixed seed. + export QT_RCC_TEST=1 + # Integrity Check + echo "395ec72277c5786c65b8163ef5817fd03d0a1f524a6d47f53624baf8056f1081 qt-everywhere-opensource-src-5.2.0.tar.gz" | sha256sum -c + + for BITS in 32 64; do # for architectures + # + INSTALLPREFIX=$HOME/staging${BITS} + BUILDDIR=$HOME/build${BITS} + DEPSDIR=$HOME/deps${BITS} + if [ "$BITS" == "32" ]; then + HOST=i686-w64-mingw32 + else + HOST=x86_64-w64-mingw32 + fi + # + mkdir -p $INSTALLPREFIX $INSTALLPREFIX/host/bin $DEPSDIR $BUILDDIR + # + # Need mingw-compiled openssl from darkcoin-deps: + cd $DEPSDIR + unzip $INDIR/darkcoin-deps-win${BITS}-gitian-r15.zip + # + cd $BUILDDIR + # + tar xzf $INDIR/qt-everywhere-opensource-src-5.2.0.tar.gz + cd qt-everywhere-opensource-src-5.2.0 + SPECNAME="win32-g++" + SPECFILE="qtbase/mkspecs/${SPECNAME}/qmake.conf" + sed 's/qt_instdate=`date +%Y-%m-%d`/qt_instdate=2011-01-30/' -i qtbase/configure + sed --posix "s|QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport|QMAKE_CFLAGS\t\t= -pipe -fno-keep-inline-dllexport -isystem /usr/$HOST/include/ -frandom-seed=qtbuild -I$DEPSDIR/include|" -i ${SPECFILE} + sed --posix "s|QMAKE_LFLAGS =|QMAKE_LFLAGS\t\t= -L$DEPSDIR/lib|" -i ${SPECFILE} + # Before we tried to pass arguments to ar (static linking) in using QMAKE_LIB, however + # qt removes the arguments for ar and provides a script which makes it impossible to pass the determinism flag - + # so rather than try to replace ar, post-process all libraries and plugins at the end. + # + # Don't load faketime while compiling Qt, qmake will get stuck in nearly infinite loops + #export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + #export FAKETIME=$REFERENCE_DATETIME + # + # Compile static libraries, and use statically linked openssl (-openssl-linked): + OPENSSL_LIBS="-L$DEPSDIR/lib -lssl -lcrypto -lgdi32" ./configure -prefix $INSTALLPREFIX -bindir $INSTALLPREFIX/host/bin -confirm-license -release -opensource -static -xplatform $SPECNAME -device-option CROSS_COMPILE="$HOST-" -no-audio-backend -no-javascript-jit -no-sql-sqlite -no-sql-odbc -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-opengl -no-compile-examples -no-feature-style-windowsce -no-feature-style-windowsmobile -no-qml-debug -openssl-linked -skip qtsvg -skip qtwebkit -skip qtwebkit-examples -skip qtserialport -skip qtdeclarative -skip qtmultimedia -skip qtimageformats -skip qtlocation -skip qtsensors -skip qtquick1 -skip qtquickcontrols -skip qtactiveqt -skip qtconnectivity -skip qtwinextras -skip qtxmlpatterns -skip qtscript -skip qtdoc -system-libpng -system-zlib + make $MAKEOPTS install + # post-process all generated libraries and plugins 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 + # Remove unused non-deterministic stuff + rm host/bin/qtpaths.exe lib/libQt5Bootstrap.a lib/libQt5Bootstrap.la + # 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 + export FAKETIME=$REFERENCE_DATETIME + find -print0 | xargs -r0 touch # fix up timestamps before packaging + find | sort | zip -X@ $OUTDIR/qt-win${BITS}-5.2.0-gitian-r3.zip + unset LD_PRELOAD + unset FAKETIME + done # for BITS in