Skip to content

Commit 088ae85

Browse files
author
Cevap Master
authored
Merge pull request dashpay#74 from cevap/snap-build-with-depends
Snap build with depends
2 parents 96d938a + 522b490 commit 088ae85

File tree

3 files changed

+28
-66
lines changed

3 files changed

+28
-66
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ reset-files.bash
66

77
*.tar.gz
88
*.tar.xz
9+
*.tar.bz2
910

1011
*.exe
1112
src/ion

contrib/devtools/lint-whitespace.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ if [ -z "${TRAVIS_COMMIT_RANGE}" ]; then
3131
fi
3232

3333
showdiff() {
34-
if ! git diff -U0 "${TRAVIS_COMMIT_RANGE}" -- "." ":(exclude)depends/patches/" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/"; then
34+
if ! git diff -U0 "${TRAVIS_COMMIT_RANGE}" -- "." ":(exclude)depends/patches/" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/" ":(exclude)snap/"; then
3535
echo "Failed to get a diff"
3636
exit 1
3737
fi
3838
}
3939

4040
showcodediff() {
41-
if ! git diff -U0 "${TRAVIS_COMMIT_RANGE}" -- *.cpp *.h *.md *.py *.sh ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/"; then
41+
if ! git diff -U0 "${TRAVIS_COMMIT_RANGE}" -- *.cpp *.h *.md *.py *.sh ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/" ":(exclude)snap/"; then
4242
echo "Failed to get a diff"
4343
exit 1
4444
fi

snap/snapcraft.yaml

+25-64
Original file line numberDiff line numberDiff line change
@@ -61,82 +61,43 @@ parts:
6161
# We don't want to copy the full blockchain every time that the snap is
6262
# updated, but there's no way to define a default data dir in ion-qt.
6363
# Also, it would be better if we could split the wallet from the blockchain
64-
prepare: git apply $SNAPCRAFT_STAGE/default_data_dir.patch
64+
prepare: |
65+
export DEPENDSARCH=$(./depends/config.guess)
66+
if [ $DEPENDSARCH != "x86_64-pc-linux-gnu" ]
67+
then
68+
apt install g++-$DEPENDSARCH binutils-$DEPENDSARCH
69+
fi
70+
git apply $SNAPCRAFT_STAGE/default_data_dir.patch
71+
sed -i 's/tar --strip-components/tar --no-same-owner --strip-components/' ./depends/funcs.mk
72+
mv ./depends $SNAPCRAFT_STAGE/depends
73+
cd $SNAPCRAFT_STAGE/depends
74+
make
75+
build: |
76+
# build dependencies
77+
export DEPENDSARCH=$($SNAPCRAFT_STAGE/depends/config.guess)
78+
./autogen.sh
79+
./configure --prefix=$SNAPCRAFT_STAGE/depends/$DEPENDSARCH
80+
make
81+
install: |
82+
make install
6583
build-packages:
6684
- curl
6785
- wget
6886
- g++
6987
- gcc
88+
- make
7089
- autoconf
7190
- automake
91+
- cmake
7292
- pkg-config
73-
- libssl-dev
74-
- libevent-dev
93+
- libtool
7594
- bsdmainutils
76-
- libgmp-dev
77-
# Boost.
78-
- libboost-system-dev
79-
- libboost-filesystem-dev
80-
- libboost-chrono-dev
81-
- libboost-program-options-dev
82-
- libboost-test-dev
83-
- libboost-thread-dev
84-
# Optional.
85-
- libminiupnpc-dev
86-
- libzmq3-dev
87-
# GUI.
88-
- libqt5gui5
89-
- libqt5core5a
90-
- libqt5dbus5
91-
- qttools5-dev
92-
- qttools5-dev-tools
93-
- libprotobuf-dev
94-
- protobuf-compiler
95-
# Files from the build host were migrated into the snap to satisfy dependencies that would otherwise not be met. This feature will be removed in a future release thats why we need to include them here
96-
- libxcursor-dev
97-
- libxinerama-dev
98-
- libxrandr-dev
99-
- libatk1.0-dev
100-
#- libgdk2.0-cil
101-
- libgtk2.0-dev
102-
# Optional.
103-
- libqrencode-dev
95+
- g++-multilib
96+
- binutils-gold
97+
- python3
10498
stage-packages: [ca-certificates]
10599
after:
106-
- berkeleydb
107-
- desktop-qt5
108100
- patches
109-
desktop-qt5:
110-
stage-packages:
111-
- libxkbcommon0
112-
- ttf-ubuntu-font-family
113-
- dmz-cursor-theme
114-
- light-themes
115-
- shared-mime-info
116-
- libqt5gui5
117-
- libgdk-pixbuf2.0-0
118-
- libqt5svg5 # for loading icon themes which are svg
119-
- locales-all
120-
- qtwayland5
121-
berkeleydb:
122-
source: http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
123-
plugin: nil
124-
build: |
125-
# Apply a patch necessary when building with clang and c++11 (see https://community.oracle.com/thread/3952592)
126-
CLANG_CXX11_PATCH_URL='https://gist.githubusercontent.com/LnL7/5153b251fd525fe15de69b67e63a6075/raw/7778e9364679093a32dec2908656738e16b6bdcb/clang.patch'
127-
CLANG_CXX11_PATCH_HASH='7a9a47b03fd5fb93a16ef42235fa9512db9b0829cfc3bdf90edd3ec1f44d637c'
128-
wget --no-check-certificate "${CLANG_CXX11_PATCH_URL}" -O "clang.patch"
129-
echo "${CLANG_CXX11_PATCH_HASH} clang.patch" | sha256sum -c
130-
patch -p2 < clang.patch
131-
cp $SNAPCRAFT_STAGE/../depends/config.guess ./dist
132-
cp $SNAPCRAFT_STAGE/../depends/config.sub ./dist
133-
cd build_unix
134-
../dist/configure --enable-cxx --disable-shared --disable-replication --with-pic --prefix=$SNAPCRAFT_PART_INSTALL "${@}"
135-
install: |
136-
cd build_unix
137-
make install
138-
prime:
139-
- -*
140101
patches:
141102
source: snap/patches
142103
plugin: dump

0 commit comments

Comments
 (0)