2023-03-02 01:56:43 +01:00
|
|
|
#!/bin/bash
|
2023-02-22 02:57:57 +01:00
|
|
|
|
2023-03-02 01:56:43 +01:00
|
|
|
export APPIMAGE_EXTRACT_AND_RUN=1
|
|
|
|
BUILDER=appimage-builder-x86_64.AppImage
|
|
|
|
RECIPE=packages/AppImage/AppImageBuilder.yml
|
|
|
|
|
2024-05-18 22:15:29 +02:00
|
|
|
git remote add -f upstream https://github.com/Bitmessage/PyBitmessage.git
|
|
|
|
HEAD="$(git rev-parse HEAD)"
|
|
|
|
UPSTREAM="$(git merge-base --fork-point upstream/v0.6)"
|
2023-03-03 04:03:14 +01:00
|
|
|
export APP_VERSION=$(git describe --tags | cut -d- -f1,3 | tr -d v)
|
2024-05-18 22:15:29 +02:00
|
|
|
[ $HEAD != $UPSTREAM ] && APP_VERSION="${APP_VERSION}-alpha"
|
2023-03-02 01:56:43 +01:00
|
|
|
|
|
|
|
function set_sourceline {
|
|
|
|
if [ ${ARCH} == amd64 ]; then
|
|
|
|
export SOURCELINE="deb http://archive.ubuntu.com/ubuntu/ bionic main universe"
|
|
|
|
else
|
|
|
|
export SOURCELINE="deb [arch=${ARCH}] http://ports.ubuntu.com/ubuntu-ports/ bionic main universe"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-05-06 19:23:24 +02:00
|
|
|
function build_appimage {
|
|
|
|
set_sourceline
|
|
|
|
./${BUILDER} --recipe ${RECIPE} || exit 1
|
|
|
|
rm -rf build
|
|
|
|
}
|
|
|
|
|
2023-03-02 01:56:43 +01:00
|
|
|
[ -f ${BUILDER} ] || wget -qO ${BUILDER} \
|
2023-02-22 02:57:57 +01:00
|
|
|
https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage \
|
2023-03-02 01:56:43 +01:00
|
|
|
&& chmod +x ${BUILDER}
|
|
|
|
|
2024-05-06 19:23:24 +02:00
|
|
|
chmod 1777 /tmp
|
2023-03-02 01:56:43 +01:00
|
|
|
|
|
|
|
export ARCH=amd64
|
|
|
|
export APPIMAGE_ARCH=x86_64
|
|
|
|
export RUNTIME=${APPIMAGE_ARCH}
|
|
|
|
|
2024-05-06 19:23:24 +02:00
|
|
|
build_appimage
|
2023-03-02 01:56:43 +01:00
|
|
|
|
|
|
|
export ARCH=armhf
|
2023-03-02 02:28:35 +01:00
|
|
|
export APPIMAGE_ARCH=${ARCH}
|
2023-03-02 01:56:43 +01:00
|
|
|
export RUNTIME=gnueabihf
|
|
|
|
export CC=arm-linux-gnueabihf-gcc
|
|
|
|
export CXX=${CC}
|
2023-02-22 02:57:57 +01:00
|
|
|
|
2024-05-06 19:23:24 +02:00
|
|
|
build_appimage
|
2023-03-02 02:28:35 +01:00
|
|
|
|
|
|
|
export ARCH=arm64
|
|
|
|
export APPIMAGE_ARCH=aarch64
|
|
|
|
export RUNTIME=${APPIMAGE_ARCH}
|
|
|
|
export CC=aarch64-linux-gnu-gcc
|
|
|
|
export CXX=${CC}
|
|
|
|
|
2024-05-06 19:23:24 +02:00
|
|
|
build_appimage
|
2023-02-22 02:57:57 +01:00
|
|
|
|
2024-05-06 19:23:24 +02:00
|
|
|
EXISTING_OWNER=$(stat -c %u ../out) || mkdir -p ../out
|
|
|
|
|
|
|
|
sha256sum PyBitmessage*.AppImage >> ../out/SHA256SUMS
|
2023-09-18 14:58:11 +02:00
|
|
|
cp PyBitmessage*.AppImage ../out
|
2024-05-06 19:23:24 +02:00
|
|
|
|
|
|
|
if [ ${EXISTING_OWNER} ]; then
|
|
|
|
chown ${EXISTING_OWNER} ../out/PyBitmessage*.AppImage ../out/SHA256SUMS
|
|
|
|
fi
|