@@ -23,7 +23,11 @@ files:
23
23
- " db-4.8.30.NC.tar.gz"
24
24
script : |
25
25
STAGING="$HOME/install"
26
+ TEMPDIR="$HOME/tmp"
26
27
OPTFLAGS='-O2'
28
+ export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
29
+ export FAKETIME=$REFERENCE_DATETIME
30
+ export TZ=UTC
27
31
export LIBRARY_PATH="$STAGING/lib"
28
32
# Integrity Check
29
33
echo "f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3 openssl-1.0.1e.tar.gz" | sha256sum -c
@@ -37,6 +41,7 @@ script: |
37
41
cd openssl-1.0.1e
38
42
# need -fPIC to avoid relocation error in 64 bit builds
39
43
./config no-shared no-zlib no-dso no-krb5 --openssldir=$STAGING -fPIC
44
+ # need to build OpenSSL with faketime because a timestamp is embedded into cversion.o
40
45
make
41
46
make install_sw
42
47
cd ..
@@ -48,28 +53,46 @@ script: |
48
53
rm -f $STAGING/lib/libminiupnpc.so* # no way to skip shared lib build
49
54
cd ..
50
55
#
51
- tar xjfm qrencode-3.4.3.tar.bz2
56
+ tar xjf qrencode-3.4.3.tar.bz2
52
57
cd qrencode-3.4.3
58
+ unset FAKETIME # unset fake time during configure, as it does some clock sanity tests
53
59
# need --with-pic to avoid relocation error in 64 bit builds
54
- ./configure --prefix=$STAGING --enable-static --disable-shared --with-pic --without-tools --disable-maintainer-mode --disable-dependency-tracking
60
+ ./configure --prefix=$STAGING --enable-static --disable-shared --with-pic --without-tools --disable-dependency-tracking
61
+ # Workaround to prevent re-configuring by make; make all files have a date in the past
62
+ find . -print0 | xargs -r0 touch -t 200001010000
63
+ export FAKETIME=$REFERENCE_DATETIME
55
64
make $MAKEOPTS install
56
65
cd ..
57
66
#
58
- tar xjfm protobuf-2.5.0.tar.bz2
67
+ tar xjf protobuf-2.5.0.tar.bz2
59
68
cd protobuf-2.5.0
60
69
mkdir -p $STAGING/host/bin
70
+ unset FAKETIME # unset fake time during configure, as it does some clock sanity tests
61
71
# need --with-pic to avoid relocation error in 64 bit builds
62
- ./configure --prefix=$STAGING --bindir=$STAGING/host/bin --enable-static --disable-shared --with-pic
72
+ ./configure --prefix=$STAGING --bindir=$STAGING/host/bin --enable-static --disable-shared --with-pic --without-zlib
73
+ # Workaround to prevent re-configuring by make; make all files have a date in the past
74
+ find . -print0 | xargs -r0 touch -t 200001010000
75
+ export FAKETIME=$REFERENCE_DATETIME
63
76
make $MAKEOPTS install
64
77
cd ..
65
78
#
66
79
tar xzf db-4.8.30.NC.tar.gz
67
80
cd db-4.8.30.NC/build_unix
68
81
# need --with-pic to avoid relocation error in 64 bit builds
69
82
../dist/configure --prefix=$STAGING --enable-cxx --disable-shared --with-pic
83
+ # Workaround to prevent re-configuring by make; make all files have a date in the past
84
+ find . -print0 | xargs -r0 touch -t 200001010000
70
85
make $MAKEOPTS library_build
71
86
make install_lib install_include
72
87
cd ../..
88
+ # post-process all generated libraries to be deterministic
89
+ # extract them to a temporary directory then re-build them deterministically
90
+ for LIB in $(find $STAGING -name \*.a); do
91
+ rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR
92
+ ar xv $LIB | cut -b5- > /tmp/list.txt
93
+ rm $LIB
94
+ ar crsD $LIB $(cat /tmp/list.txt)
95
+ done
73
96
#
74
97
cd $STAGING
75
- zip -r $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r2 .zip include lib bin host
98
+ find include lib bin host | sort | zip -X@ $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r3 .zip
0 commit comments