Prosody AppImage: aarch64 architecture.
This commit is contained in:
parent
059c6522b6
commit
e6da0a879f
@ -13,10 +13,10 @@ fi
|
|||||||
|
|
||||||
cd "$prosody_build_dir"
|
cd "$prosody_build_dir"
|
||||||
|
|
||||||
if [ -f "$prosody_build_dir/livechat-prosody-x86_64.AppImage" ]; then
|
if [ -f "$prosody_build_dir/livechat-prosody-x86_64.AppImage" ] && [ -f "$prosody_build_dir/livechat-prosody-aarch64.AppImage" ]; then
|
||||||
echo "Prosody image already built."
|
echo "Prosody images already built."
|
||||||
else
|
else
|
||||||
echo "Prosody image must be build..."
|
echo "Prosody images must be build..."
|
||||||
|
|
||||||
# Prerequisite: you must have python3-venv installed on your system
|
# Prerequisite: you must have python3-venv installed on your system
|
||||||
if [[ ! -d "venv" ]]; then
|
if [[ ! -d "venv" ]]; then
|
||||||
@ -32,22 +32,31 @@ else
|
|||||||
|
|
||||||
echo "Copying appimage source files..."
|
echo "Copying appimage source files..."
|
||||||
cp "$rootdir/prosody/appimage_x86_64.yml" "$prosody_build_dir/appimage_x86_64.yml"
|
cp "$rootdir/prosody/appimage_x86_64.yml" "$prosody_build_dir/appimage_x86_64.yml"
|
||||||
|
cp "$rootdir/prosody/appimage_aarch64.yml" "$prosody_build_dir/appimage_aarch64.yml"
|
||||||
cp "$rootdir/prosody/launcher.lua" "$prosody_build_dir/launcher.lua"
|
cp "$rootdir/prosody/launcher.lua" "$prosody_build_dir/launcher.lua"
|
||||||
|
|
||||||
echo "Building Prosody..."
|
echo "Building Prosody x86_64..."
|
||||||
appimage-builder --recipe "$prosody_build_dir/appimage_x86_64.yml"
|
appimage-builder --recipe "$prosody_build_dir/appimage_x86_64.yml"
|
||||||
|
|
||||||
|
echo "Cleaning build folders before building aarch64..."
|
||||||
|
rm -rf "$prosody_build_dir/AppDir"
|
||||||
|
rm -rf "$prosody_build_dir/appimage-build"
|
||||||
|
|
||||||
|
echo "Building Prosody aarch64..."
|
||||||
|
appimage-builder --recipe "$prosody_build_dir/appimage_aarch64.yml"
|
||||||
|
|
||||||
|
# For some obscur reason, if we keep AppDir and appimage-build folders,
|
||||||
|
# and if we try to install the plugin using the Peertube CLI,
|
||||||
|
# the installation fails because there are some subfolders that are right protected.
|
||||||
|
# To avoid that, we clean them:
|
||||||
|
echo "Cleaning build folders..."
|
||||||
|
rm -rf "$prosody_build_dir/AppDir"
|
||||||
|
rm -rf "$prosody_build_dir/appimage-build"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Copying Prosody dist files..."
|
echo "Copying Prosody dist files..."
|
||||||
mkdir -p "$prosody_destination_dir" && cp $prosody_build_dir/livechat-prosody-x86_64.AppImage "$prosody_destination_dir/"
|
mkdir -p "$prosody_destination_dir" && cp $prosody_build_dir/livechat-prosody-x86_64.AppImage "$prosody_destination_dir/"
|
||||||
|
mkdir -p "$prosody_destination_dir" && cp $prosody_build_dir/livechat-prosody-aarch64.AppImage "$prosody_destination_dir/"
|
||||||
# For some obscur reason, if we keep AppDir and appimage-build folders,
|
|
||||||
# and if we try to install the plugin using the Peertube CLI,
|
|
||||||
# the installation fails because there are some subfolders that are right protected.
|
|
||||||
# To avoid that, we clean them:
|
|
||||||
echo "Cleaning build folders..."
|
|
||||||
rm -rf "$prosody_build_dir/AppDir"
|
|
||||||
rm -rf "$prosody_build_dir/appimage-build"
|
|
||||||
|
|
||||||
echo "Prosody AppImage OK."
|
echo "Prosody AppImage OK."
|
||||||
|
|
||||||
|
60
prosody/appimage_aarch64.yml
Normal file
60
prosody/appimage_aarch64.yml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
# This file is meant to be used with appimage-builder: https://appimage-builder.readthedocs.io
|
||||||
|
# See it is use in the build-prosody.sh script.
|
||||||
|
|
||||||
|
version: 1
|
||||||
|
|
||||||
|
script:
|
||||||
|
# Remove any previous build
|
||||||
|
- rm -rf AppDir | true
|
||||||
|
# Make usr dirs
|
||||||
|
- mkdir -p AppDir/usr/bin
|
||||||
|
# Copy the launcher code into the AppDir
|
||||||
|
- cp ./launcher.lua AppDir/usr/bin/
|
||||||
|
|
||||||
|
AppDir:
|
||||||
|
path: ./AppDir
|
||||||
|
|
||||||
|
app_info:
|
||||||
|
id: org.peertube-plugin-livechat.prosody
|
||||||
|
name: prosody
|
||||||
|
icon: utilities-terminal
|
||||||
|
version: 1.0.0
|
||||||
|
exec: usr/bin/lua5.2
|
||||||
|
exec_args: "$APPDIR/usr/bin/launcher.lua $@"
|
||||||
|
|
||||||
|
apt:
|
||||||
|
arch: arm64
|
||||||
|
sources:
|
||||||
|
- sourceline: 'deb [arch=arm64] https://deb.debian.org/debian/ bullseye main contrib'
|
||||||
|
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x648ACFD622F3D138'
|
||||||
|
- sourceline: 'deb [arch=arm64] https://deb.debian.org/debian/ bullseye-backports main contrib'
|
||||||
|
|
||||||
|
include:
|
||||||
|
- lua5.2
|
||||||
|
- lua-unbound
|
||||||
|
- prosody/bullseye-backports
|
||||||
|
|
||||||
|
files:
|
||||||
|
exclude:
|
||||||
|
- usr/share/man
|
||||||
|
- usr/share/doc/*/README.*
|
||||||
|
- usr/share/doc/*/changelog.*
|
||||||
|
- usr/share/doc/*/NEWS.*
|
||||||
|
- usr/share/doc/*/TODO.*
|
||||||
|
- etc/init.d/*
|
||||||
|
- etc/logrotate.d/*
|
||||||
|
|
||||||
|
runtime:
|
||||||
|
# Here we use the path_mappings to rewrite, on runtime, all paths.
|
||||||
|
# Note: this assume that peertube-plugin-livechat is not in a subdir of one of following mappings.
|
||||||
|
# This seems a reasonable assumption.
|
||||||
|
path_mappings:
|
||||||
|
- /etc/:$APPDIR/etc/
|
||||||
|
- /lib/:$APPDIR/lib/
|
||||||
|
- /lib64/:$APPDIR/lib64/
|
||||||
|
- /runtime/:$APPDIR/runtime/
|
||||||
|
- /usr/:$APPDIR/usr/
|
||||||
|
|
||||||
|
AppImage:
|
||||||
|
arch: aarch64
|
||||||
|
file_name: 'livechat-prosody-aarch64.AppImage'
|
@ -37,6 +37,14 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
|
|||||||
|
|
||||||
result.messages.push(`Prosody path will be '${wantedConfig.paths.exec}'`)
|
result.messages.push(`Prosody path will be '${wantedConfig.paths.exec}'`)
|
||||||
|
|
||||||
|
if (wantedConfig.paths.appImageToExtract) {
|
||||||
|
result.messages.push(`Prosody will be using the '${wantedConfig.paths.appImageToExtract}' AppImage`)
|
||||||
|
} else {
|
||||||
|
result.messages.push('Prosody will not be using any AppImage')
|
||||||
|
}
|
||||||
|
|
||||||
|
result.messages.push(`Prosody AppImage extract path will be '${wantedConfig.paths.appImageExtractPath}'`)
|
||||||
|
|
||||||
result.messages.push(`Prosody modules path will be '${wantedConfig.paths.modules}'`)
|
result.messages.push(`Prosody modules path will be '${wantedConfig.paths.modules}'`)
|
||||||
|
|
||||||
result.messages.push(`Prosody rooms will be grouped by '${wantedConfig.roomType}'.`)
|
result.messages.push(`Prosody rooms will be grouped by '${wantedConfig.roomType}'.`)
|
||||||
|
@ -43,7 +43,13 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
|
|||||||
execCtl = 'prosodyctl'
|
execCtl = 'prosodyctl'
|
||||||
execCtlArgs = []
|
execCtlArgs = []
|
||||||
} else {
|
} else {
|
||||||
appImageToExtract = path.resolve(__dirname, '../../prosody/livechat-prosody-x86_64.AppImage')
|
const arch = process.arch
|
||||||
|
if (arch === 'arm' || arch === 'arm64') {
|
||||||
|
logger.info('Node process.arch is ' + arch + ', we will be using the aarch64 Prosody AppImage')
|
||||||
|
appImageToExtract = path.resolve(__dirname, '../../prosody/livechat-prosody-aarch64.AppImage')
|
||||||
|
} else {
|
||||||
|
appImageToExtract = path.resolve(__dirname, '../../prosody/livechat-prosody-x86_64.AppImage')
|
||||||
|
}
|
||||||
exec = path.resolve(appImageExtractPath, 'squashfs-root/AppRun')
|
exec = path.resolve(appImageExtractPath, 'squashfs-root/AppRun')
|
||||||
execArgs = ['prosody']
|
execArgs = ['prosody']
|
||||||
execCtl = exec
|
execCtl = exec
|
||||||
|
Loading…
x
Reference in New Issue
Block a user