Parametrize appimage-builder recipe,

setup environment in build.sh, start from building amd64 appimage,
download appimage-builder in docker.
This commit is contained in:
Lee Miller 2023-03-02 02:56:43 +02:00
parent 1753c42fd3
commit 4e20421500
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63
3 changed files with 41 additions and 11 deletions

View File

@ -19,4 +19,7 @@ RUN apt-get update | true
RUN apt-get install -yq libssl-dev:armhf
RUN wget -qO appimage-builder-x86_64.AppImage \
https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
ADD . .

View File

@ -1,11 +1,38 @@
#!/bin/sh
#!/bin/bash
wget -O appimage-builder-x86_64.AppImage \
export APPIMAGE_EXTRACT_AND_RUN=1
BUILDER=appimage-builder-x86_64.AppImage
RECIPE=packages/AppImage/AppImageBuilder.yml
export APP_VERSION=$(python setup.py --version)
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
}
[ -f ${BUILDER} ] || wget -qO ${BUILDER} \
https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage \
&& chmod +x appimage-builder-x86_64.AppImage
&& chmod +x ${BUILDER}
APPIMAGE_EXTRACT_AND_RUN=1 ./appimage-builder-x86_64.AppImage \
--recipe packages/AppImage/AppImageBuilder.yml
export ARCH=amd64
export APPIMAGE_ARCH=x86_64
export RUNTIME=${APPIMAGE_ARCH}
set_sourceline
./${BUILDER} --recipe ${RECIPE} || exit 1
export ARCH=armhf
export RUNTIME=gnueabihf
export CC=arm-linux-gnueabihf-gcc
export CXX=${CC}
set_sourceline
./${BUILDER} --recipe ${RECIPE}
mkdir -p ../out
mv PyBitmessage*.AppImage ../out

View File

@ -2,7 +2,7 @@ version: 1
script:
# Remove any previous build
- rm -rf AppDir | true
- CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-gcc python setup.py install --prefix=/usr --root=AppDir
- python setup.py install --prefix=/usr --root=AppDir
AppDir:
path: ./AppDir
@ -11,7 +11,7 @@ AppDir:
id: pybitmessage
name: PyBitmessage
icon: pybitmessage
version: 0.6.3.2
version: !ENV ${APP_VERSION}
# Set the python executable as entry point
exec: usr/bin/python
# Set the application main script path as argument.
@ -22,9 +22,9 @@ AppDir:
- sed -i "s|GTK_.*||g" AppDir/AppRun.env
apt:
arch: armhf
arch: !ENV '${ARCH}'
sources:
- sourceline: 'deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main universe'
- sourceline: !ENV '${SOURCELINE}'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
include:
@ -67,7 +67,7 @@ AppDir:
- usr/share/doc
runtime:
arch: [ gnueabihf ]
arch: [ !ENV '${RUNTIME}' ]
env:
# Set python home
# See https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHOME
@ -77,4 +77,4 @@ AppDir:
PYTHONPATH: '${APPDIR}/usr/lib/python2.7/site-packages'
AppImage:
arch: armhf
arch: !ENV '${APPIMAGE_ARCH}'