Skip to content

Commit

Permalink
Merge pull request dashpay#74 from cevap/snap-build-with-depends
Browse files Browse the repository at this point in the history
Snap build with depends
  • Loading branch information
Cevap Master authored Jan 27, 2019
2 parents 96d938a + 522b490 commit 088ae85
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 66 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ reset-files.bash

*.tar.gz
*.tar.xz
*.tar.bz2

*.exe
src/ion
Expand Down
4 changes: 2 additions & 2 deletions contrib/devtools/lint-whitespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ if [ -z "${TRAVIS_COMMIT_RANGE}" ]; then
fi

showdiff() {
if ! git diff -U0 "${TRAVIS_COMMIT_RANGE}" -- "." ":(exclude)depends/patches/" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/"; then
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
echo "Failed to get a diff"
exit 1
fi
}

showcodediff() {
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
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
echo "Failed to get a diff"
exit 1
fi
Expand Down
89 changes: 25 additions & 64 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,82 +61,43 @@ parts:
# We don't want to copy the full blockchain every time that the snap is
# updated, but there's no way to define a default data dir in ion-qt.
# Also, it would be better if we could split the wallet from the blockchain
prepare: git apply $SNAPCRAFT_STAGE/default_data_dir.patch
prepare: |
export DEPENDSARCH=$(./depends/config.guess)
if [ $DEPENDSARCH != "x86_64-pc-linux-gnu" ]
then
apt install g++-$DEPENDSARCH binutils-$DEPENDSARCH
fi
git apply $SNAPCRAFT_STAGE/default_data_dir.patch
sed -i 's/tar --strip-components/tar --no-same-owner --strip-components/' ./depends/funcs.mk
mv ./depends $SNAPCRAFT_STAGE/depends
cd $SNAPCRAFT_STAGE/depends
make
build: |
# build dependencies
export DEPENDSARCH=$($SNAPCRAFT_STAGE/depends/config.guess)
./autogen.sh
./configure --prefix=$SNAPCRAFT_STAGE/depends/$DEPENDSARCH
make
install: |
make install
build-packages:
- curl
- wget
- g++
- gcc
- make
- autoconf
- automake
- cmake
- pkg-config
- libssl-dev
- libevent-dev
- libtool
- bsdmainutils
- libgmp-dev
# Boost.
- libboost-system-dev
- libboost-filesystem-dev
- libboost-chrono-dev
- libboost-program-options-dev
- libboost-test-dev
- libboost-thread-dev
# Optional.
- libminiupnpc-dev
- libzmq3-dev
# GUI.
- libqt5gui5
- libqt5core5a
- libqt5dbus5
- qttools5-dev
- qttools5-dev-tools
- libprotobuf-dev
- protobuf-compiler
# 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
- libxcursor-dev
- libxinerama-dev
- libxrandr-dev
- libatk1.0-dev
#- libgdk2.0-cil
- libgtk2.0-dev
# Optional.
- libqrencode-dev
- g++-multilib
- binutils-gold
- python3
stage-packages: [ca-certificates]
after:
- berkeleydb
- desktop-qt5
- patches
desktop-qt5:
stage-packages:
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- shared-mime-info
- libqt5gui5
- libgdk-pixbuf2.0-0
- libqt5svg5 # for loading icon themes which are svg
- locales-all
- qtwayland5
berkeleydb:
source: http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
plugin: nil
build: |
# Apply a patch necessary when building with clang and c++11 (see https://community.oracle.com/thread/3952592)
CLANG_CXX11_PATCH_URL='https://gist.githubusercontent.com/LnL7/5153b251fd525fe15de69b67e63a6075/raw/7778e9364679093a32dec2908656738e16b6bdcb/clang.patch'
CLANG_CXX11_PATCH_HASH='7a9a47b03fd5fb93a16ef42235fa9512db9b0829cfc3bdf90edd3ec1f44d637c'
wget --no-check-certificate "${CLANG_CXX11_PATCH_URL}" -O "clang.patch"
echo "${CLANG_CXX11_PATCH_HASH} clang.patch" | sha256sum -c
patch -p2 < clang.patch
cp $SNAPCRAFT_STAGE/../depends/config.guess ./dist
cp $SNAPCRAFT_STAGE/../depends/config.sub ./dist
cd build_unix
../dist/configure --enable-cxx --disable-shared --disable-replication --with-pic --prefix=$SNAPCRAFT_PART_INSTALL "${@}"
install: |
cd build_unix
make install
prime:
- -*
patches:
source: snap/patches
plugin: dump
Expand Down

0 comments on commit 088ae85

Please sign in to comment.