Merge pull request 'new build scripts for ARM' (#19) from jahway into master
Reviewed-on: https://git.hush.is/hush/lightwalletd/pulls/19
This commit is contained in:
4
Makefile
4
Makefile
@@ -15,6 +15,10 @@ build:
|
|||||||
# Build binary
|
# Build binary
|
||||||
./util/build.sh
|
./util/build.sh
|
||||||
|
|
||||||
|
build-arm:
|
||||||
|
# Build binary for ARM architecture (aarch64)
|
||||||
|
./util/build_arm.sh
|
||||||
|
|
||||||
# Stop the hushd process in the hushdlwd container
|
# Stop the hushd process in the hushdlwd container
|
||||||
#docker_img_stop_hushd:
|
#docker_img_stop_hushd:
|
||||||
# docker exec -i hushdlwd hush-cli stop
|
# docker exec -i hushdlwd hush-cli stop
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ Vcs-Git: https://git.hush.is/hush/lightwalletd.git
|
|||||||
Vcs-Browser: https://git.hush.is/hush/lightwalletd
|
Vcs-Browser: https://git.hush.is/hush/lightwalletd
|
||||||
|
|
||||||
Package: lightwalletd
|
Package: lightwalletd
|
||||||
Architecture: amd64
|
Architecture: amd64 arm64
|
||||||
Depends: ${shlibs:Depends}
|
Depends: ${shlibs:Depends}
|
||||||
Description: Hush lightwallet daemon to run a Silent Dragon Lite server. Speak And Transact Freely. Hush inherits from Bitcoin Protocol and Zcash Protocol and is focused on private communications.
|
Description: Hush lightwallet daemon to run a Silent Dragon Lite server. Speak And Transact Freely. Hush inherits from Bitcoin Protocol and Zcash Protocol and is focused on private communications.
|
||||||
|
|||||||
105
util/build-debian-package-SBC.sh
Executable file
105
util/build-debian-package-SBC.sh
Executable file
@@ -0,0 +1,105 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Copyright (c) 2021 The Hush developers
|
||||||
|
# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||||
|
#
|
||||||
|
# Remix for SBC (Single Board Computer) like PineBook, Rock64, Raspberry Pi, etc.
|
||||||
|
## Usage: ./util/build-debian-package-SBC.sh
|
||||||
|
|
||||||
|
echo "Let's see who read the README.md or not..."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check if lightwalletd is already built on system and exit if it is not
|
||||||
|
if ! [ -x "$(command -v ./lightwalletd)" ]; then
|
||||||
|
echo 'Error: lightwalletd is not compiled yet. Run "make build" and try again.' >&2
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Check if lintian is installed and exit if it is not
|
||||||
|
if ! [ -x "$(command -v lintian)" ]; then
|
||||||
|
echo 'Error: lintian is not installed yet. Consult your Linux version package manager...' >&2
|
||||||
|
echo 'On Debian/Ubuntu, try "sudo apt install lintian"'
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Check if fakeroot is installed and exit if it is not
|
||||||
|
if ! [ -x "$(command -v fakeroot)" ]; then
|
||||||
|
echo 'Error: fakeroot is not installed yet. Consult your Linux version package manager...' >&2
|
||||||
|
echo 'On Debian/Ubuntu, try "sudo apt install fakeroot"'
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# TODO - check that the lightwalletd binary is not x86 and is actually aarch64
|
||||||
|
|
||||||
|
echo "Let There Be Hush Lightwalletd Debian Packages for ARM!!!"
|
||||||
|
echo ""
|
||||||
|
echo "((_,...,_))"
|
||||||
|
echo " |o o|"
|
||||||
|
echo " \ /"
|
||||||
|
echo " ^_^ cp97"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
BUILD_PATH="/tmp/lightwalletd-debian-$$"
|
||||||
|
PACKAGE_NAME="lightwalletd"
|
||||||
|
SRC_PATH=`pwd`
|
||||||
|
SRC_DEB=$SRC_PATH/contrib/debian
|
||||||
|
SRC_DOC=$SRC_PATH/doc
|
||||||
|
ARCH="aarch64"
|
||||||
|
|
||||||
|
umask 022
|
||||||
|
|
||||||
|
if [ ! -d $BUILD_PATH ]; then
|
||||||
|
mkdir $BUILD_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
PACKAGE_VERSION=0.1.1
|
||||||
|
DEBVERSION=$(echo $PACKAGE_VERSION)
|
||||||
|
BUILD_DIR="$BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH"
|
||||||
|
|
||||||
|
if [ -d $BUILD_DIR ]; then
|
||||||
|
rm -R $BUILD_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEB_BIN=$BUILD_DIR/usr/bin
|
||||||
|
DEB_CMP=$BUILD_DIR/usr/share/bash-completion/completions
|
||||||
|
DEB_DOC=$BUILD_DIR/usr/share/doc/$PACKAGE_NAME
|
||||||
|
DEB_MAN=$BUILD_DIR/usr/share/man/man1
|
||||||
|
DEB_SHR=$BUILD_DIR/usr/share/hush
|
||||||
|
mkdir -p $BUILD_DIR/DEBIAN $DEB_CMP $DEB_BIN $DEB_DOC $DEB_MAN $DEB_SHR
|
||||||
|
chmod 0755 -R $BUILD_DIR/*
|
||||||
|
|
||||||
|
# Package maintainer scripts (currently empty)
|
||||||
|
#cp $SRC_DEB/postinst $BUILD_DIR/DEBIAN
|
||||||
|
#cp $SRC_DEB/postrm $BUILD_DIR/DEBIAN
|
||||||
|
#cp $SRC_DEB/preinst $BUILD_DIR/DEBIAN
|
||||||
|
#cp $SRC_DEB/prerm $BUILD_DIR/DEBIAN
|
||||||
|
|
||||||
|
# Copy binary
|
||||||
|
cp $SRC_PATH/lightwalletd $DEB_BIN/lightwalletd
|
||||||
|
strip $DEB_BIN/lightwalletd
|
||||||
|
cp $SRC_DEB/changelog $DEB_DOC
|
||||||
|
cp $SRC_DEB/copyright $DEB_DOC
|
||||||
|
cp -r $SRC_DEB/examples $DEB_DOC
|
||||||
|
# Copy manpage
|
||||||
|
cp $SRC_DOC/man/lightwalletd.1 $DEB_MAN/lightwalletd.1
|
||||||
|
|
||||||
|
# Gzip files
|
||||||
|
gzip --best -n $DEB_MAN/lightwalletd.1
|
||||||
|
|
||||||
|
cd $SRC_PATH/contrib
|
||||||
|
|
||||||
|
# Create the control file
|
||||||
|
dpkg-shlibdeps $DEB_BIN/lightwalletd
|
||||||
|
dpkg-gencontrol -P$BUILD_DIR -v$DEBVERSION
|
||||||
|
|
||||||
|
# Create the Debian package
|
||||||
|
fakeroot dpkg-deb --build $BUILD_DIR
|
||||||
|
cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb $SRC_PATH
|
||||||
|
shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
|
||||||
|
# Analyze with Lintian, reporting bugs and policy violations
|
||||||
|
lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
|
||||||
|
exit 0
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Copyright (c) 2021 The Hush developers
|
# Copyright (c) 2021 The Hush developers
|
||||||
# Distributed under the GPLv3 software license, see the accompanying
|
# Distributed under the GPLv3 software license, see the accompanying
|
||||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||||
|
#
|
||||||
## Usage: ./util/build-debian-package.sh
|
## Usage: ./util/build-debian-package.sh
|
||||||
|
|
||||||
echo "Let's see who read the README.md or not..."
|
echo "Let's see who read the README.md or not..."
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Copyright 2021 The Hush Developers
|
# Copyright 2021 The Hush Developers
|
||||||
# Released under GPLv3
|
# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||||
|
|
||||||
|
# Purpose: Script to build Hush lightwalletd on x86 64-bit arch
|
||||||
|
|
||||||
# Check if go is installed on system and exits if it is not
|
# Check if go is installed on system and exits if it is not
|
||||||
if ! [ -x "$(command -v go)" ]; then
|
if ! [ -x "$(command -v go)" ]; then
|
||||||
|
|||||||
34
util/build_arm.sh
Executable file
34
util/build_arm.sh
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Copyright 2021 The Hush Developers
|
||||||
|
# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||||
|
#
|
||||||
|
# Purpose: Script to build the ARM or aarch64 architecture,
|
||||||
|
# which is what the PinePhone boards are running
|
||||||
|
|
||||||
|
# Check if go is installed on system and exits if it is not
|
||||||
|
if ! [ -x "$(command -v go)" ]; then
|
||||||
|
echo 'Error: go is not installed. Install go and try again.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Welcome to the Hush magic folks..."
|
||||||
|
echo ""
|
||||||
|
echo ".------..------..------..------..------..------..------..------..------..------..------..------."
|
||||||
|
echo "|L.--. ||I.--. ||G.--. ||H.--. ||T.--. ||W.--. ||A.--. ||L.--. ||L.--. ||E.--. ||T.--. ||D.--. |"
|
||||||
|
echo "| :/\: || (\/) || :/\: || :/\: || :/\: || :/\: || (\/) || :/\: || :/\: || (\/) || :/\: || :/\: |"
|
||||||
|
echo "| (__) || :\/: || :\/: || (__) || (__) || :\/: || :\/: || (__) || (__) || :\/: || (__) || (__) |"
|
||||||
|
echo "| '--'L|| '--'I|| '--'G|| '--'H|| '--'T|| '--'W|| '--'A|| '--'L|| '--'L|| '--'E|| '--'T|| '--'D|"
|
||||||
|
echo "+------'+------'+------'+------'+------'+------'+------'+------'+------'+------'+------'+------'"
|
||||||
|
|
||||||
|
# now to compiling...
|
||||||
|
echo ""
|
||||||
|
echo "You have go installed, so starting to compile Hush lightwalletd for you..."
|
||||||
|
cd `pwd`/cmd/server
|
||||||
|
env GOOS=linux GOARCH=arm64 go build -o lightwalletd_aarch64 main.go
|
||||||
|
mv lightwalletd_aarch64 lightwalletd
|
||||||
|
mv lightwalletd `pwd`/../../lightwalletd
|
||||||
|
echo ""
|
||||||
|
echo "Hush lightwalletd is now compiled for your ARM farm or Pine Rock64. Enjoy and reach out if you need support."
|
||||||
|
echo "For options, run ./lightwalletd --help"
|
||||||
Reference in New Issue
Block a user