Debian Codegraph @

contrib/gitian/gitian-android.yml

raw symbols SCIP
1 ---
2 name: "monero-android-0.18"
3 enable_cache: true
4 suites:
5 - "bionic"
6 architectures:
7 - "amd64"
8 packages:
9 - "curl"
10 - "gperf"
11 - "gcc-7"
12 - "g++-7"
13 - "gcc"
14 - "g++"
15 - "binutils-gold"
16 - "git"
17 - "pkg-config"
18 - "build-essential"
19 - "autoconf"
20 - "libtool"
21 - "automake"
22 - "faketime"
23 - "bsdmainutils"
24 - "ca-certificates"
25 - "python"
26 - "cmake"
27 - "unzip"
28 remotes:
29 - "url": "https://github.com/monero-project/monero.git"
30 "dir": "monero"
31 files: []
32 script: |
33
34 WRAP_DIR=$HOME/wrapped
35 HOSTS="arm-linux-android aarch64-linux-android"
36 FAKETIME_HOST_PROGS="clang clang++ ar nm"
37 FAKETIME_PROGS="date"
38 HOST_CFLAGS="-O2 -g"
39 HOST_CXXFLAGS="-O2 -g"
40 HOST_LDFLAGS=-static-libstdc++
41
42 export GZIP="-9n"
43 export TZ="UTC"
44 export BUILD_DIR=`pwd`
45 mkdir -p ${WRAP_DIR}
46 if test -n "$GBUILD_CACHE_ENABLED"; then
47 export SOURCES_PATH=${GBUILD_COMMON_CACHE}
48 export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
49 export GITIAN=1
50 mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
51 fi
52
53 export ZERO_AR_DATE=1
54
55 function create_global_faketime_wrappers {
56 for prog in ${FAKETIME_PROGS}; do
57 echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
58 echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
59 echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
60 echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
61 echo "\$REAL \$@" >> $WRAP_DIR/${prog}
62 chmod +x ${WRAP_DIR}/${prog}
63 done
64 }
65
66 function create_per-host_faketime_wrappers {
67 for i in $HOSTS; do
68 ABI=$i
69 if expr $i : arm- > /dev/null
70 then
71 ABI=$i"eabi"
72 fi
73 NDKDIR="${BUILD_DIR}/monero/contrib/depends/$i/native/bin"
74 for prog in ${FAKETIME_HOST_PROGS}; do
75 WRAPPER=${WRAP_DIR}/${ABI}-${prog}
76 echo '#!/usr/bin/env bash' > ${WRAPPER}
77 echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAPPER}
78 echo "export FAKETIME=\"$1\"" >> ${WRAPPER}
79 echo "$NDKDIR/${ABI}-$prog \$@" >> ${WRAPPER}
80 chmod +x ${WRAPPER}
81 done
82 done
83 }
84
85 # Faketime for depends so intermediate results are comparable
86 export PATH_orig=${PATH}
87 create_global_faketime_wrappers "2000-01-01 12:00:00"
88 create_per-host_faketime_wrappers "2000-01-01 12:00:00"
89 export PATH=${WRAP_DIR}:${PATH}
90
91 # gcc 7+ honors SOURCE_DATE_EPOCH, no faketime needed
92 export SOURCE_DATE_EPOCH=`date -d 2000-01-01T12:00:00 +%s`
93
94 git config --global core.abbrev 9
95 cd monero
96 # Set the version string that gets added to the tar archive name
97 version="`git describe`"
98 if [[ $version == *"-"*"-"* ]]; then
99 version="`git rev-parse --short=9 HEAD`"
100 version="`echo $version | head -c 9`"
101 fi
102
103 BASEPREFIX=`pwd`/contrib/depends
104 # Build dependencies for each host
105 export TAR_OPTIONS=--mtime=2000-01-01T12:00:00
106 for i in $HOSTS; do
107 make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
108 done
109
110 # Faketime for binaries
111 export PATH=${PATH_orig}
112 create_global_faketime_wrappers "${REFERENCE_DATETIME}"
113 create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
114
115 # Build in a new dir for each host
116 export TAR_OPTIONS=--mtime=${REFERENCE_DATE}T${REFERENCE_TIME}
117 for i in ${HOSTS}; do
118 export PATH=${WRAP_DIR}:${BASEPREFIX}/${i}/native/bin:${PATH_orig}
119 mkdir build && cd build
120 cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake -DCMAKE_BUILD_TYPE=Release
121 make ${MAKEOPTS}
122 chmod 755 bin/*
123 cp ../LICENSE ../README.md ../docs/ANONYMITY_NETWORKS.md bin
124 chmod 644 bin/LICENSE bin/*.md
125 DISTNAME=monero-${i}-${version}
126 mv bin ${DISTNAME}
127 find ${DISTNAME}/ | sort | tar --no-recursion --owner=0 --group=0 -c -T - | bzip2 -9 > ${OUTDIR}/${DISTNAME}.tar.bz2
128 cd ..
129 rm -rf build
130 done
131