@@ -35,6 +35,7 @@ script: |
35
35
export TZ=UTC
36
36
INDIR=$HOME/build
37
37
OPTFLAGS='-O2'
38
+ TEMPDIR="$HOME/tempdir"
38
39
NEEDDIST=1
39
40
# Qt: workaround for determinism in resource ordering
40
41
# Qt5's rcc uses a QHash to store the files for the resource.
@@ -54,6 +55,7 @@ script: |
54
55
else
55
56
HOST=x86_64-w64-mingw32
56
57
fi
58
+ export PATH=$STAGING/host/bin:$PATH
57
59
mkdir -p $STAGING $BUILDDIR $BINDIR
58
60
#
59
61
cd $STAGING
@@ -63,22 +65,18 @@ script: |
63
65
unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip
64
66
if [ "$NEEDDIST" == "1" ]; then
65
67
# Make source code archive which is architecture independent so it only needs to be done once
66
- cd $HOME/build/
67
- cd bitcoin
68
- export PATH=$STAGING/host/bin:$PATH
69
- export TAR_OPTIONS=--mtime=`echo $REFERENCE_DATETIME | awk '{ print $1 }'`
68
+ cd $HOME/build/bitcoin
70
69
./autogen.sh
71
70
./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=bitcoin ${OPTFLAGS}"
72
71
make dist
73
- mkdir -p $OUTDIR/src
74
- cp -f bitcoin-*.tar.* $OUTDIR/src
72
+ DISTNAME=`echo bitcoin-*.tar.gz`
75
73
NEEDDIST=0
76
74
fi
77
75
# Build platform-dependent executables from source archive
78
76
cd $BUILDDIR
79
77
mkdir -p distsrc
80
78
cd distsrc
81
- tar --strip-components=1 -xf $HOME/build/bitcoin/bitcoin-*.tar.*
79
+ tar --strip-components=1 -xf $HOME/build/bitcoin/$DISTNAME
82
80
./configure --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=bitcoin ${OPTFLAGS}"
83
81
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
84
82
export FAKETIME=$REFERENCE_DATETIME
@@ -90,3 +88,10 @@ script: |
90
88
unset FAKETIME
91
89
done # for BITS in
92
90
91
+ # sort distribution tar file and normalize user/group/mtime information for deterministic output
92
+ mkdir -p $OUTDIR/src
93
+ rm -rf $TEMPDIR
94
+ mkdir -p $TEMPDIR
95
+ cd $TEMPDIR
96
+ tar -xvf $HOME/build/bitcoin/$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
97
+
0 commit comments