2023-01-03 12:18:02 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -xe
|
|
|
|
|
2023-04-06 15:48:58 +08:00
|
|
|
VERSION=$(sed -nr -e '/APP_VERSION\s*=/ s/APP_VERSION\s*=\s*(([0-9]+\.)*[0-9]+)\s*/\1/p' /build/RedPanda-CPP/Red_Panda_CPP.pro)
|
|
|
|
APPIMAGE_FILE=RedPandaIDE-$VERSION-$CARCH.AppImage
|
2023-08-13 20:56:46 +08:00
|
|
|
RUNTIME_FILE=/opt/appimage-runtime
|
|
|
|
RUNTIME_SIZE=$(wc -c <$RUNTIME_FILE)
|
2023-04-06 15:48:58 +08:00
|
|
|
|
2023-01-03 12:18:02 +08:00
|
|
|
# build RedPanda C++
|
|
|
|
mkdir -p /build/redpanda-build
|
|
|
|
cd /build/redpanda-build
|
2023-03-04 18:44:39 +08:00
|
|
|
qmake PREFIX='/usr' XDG_ADAPTIVE_ICON=ON /build/RedPanda-CPP/Red_Panda_CPP.pro
|
2023-07-03 14:06:10 +08:00
|
|
|
make LINUX_STATIC_IME_PLUGIN=ON -j$(nproc)
|
2023-01-03 12:18:02 +08:00
|
|
|
|
|
|
|
# install RedPanda C++ to AppDir
|
|
|
|
make install INSTALL_ROOT=/build/RedPandaIDE.AppDir
|
|
|
|
|
|
|
|
# setup AppImage resource
|
|
|
|
cd /build/RedPandaIDE.AppDir
|
|
|
|
ln -s usr/share/applications/redpandaide.desktop redpandaide.desktop
|
2023-01-19 20:56:59 +08:00
|
|
|
ln -s usr/share/icons/hicolor/scalable/apps/redpandaide.svg redpandaide.svg
|
2023-04-06 15:48:58 +08:00
|
|
|
# following files may come from Windows filesystem, use `install` to preseve file permission
|
|
|
|
install -m755 /build/RedPanda-CPP/packages/appimage/AppRun.sh AppRun
|
|
|
|
install -m644 /build/RedPanda-CPP/platform/linux/redpandaide.png .DirIcon
|
2023-01-03 12:18:02 +08:00
|
|
|
|
|
|
|
# create AppImage
|
|
|
|
cd /build
|
2023-08-13 20:56:46 +08:00
|
|
|
mksquashfs RedPandaIDE.AppDir $APPIMAGE_FILE -offset $RUNTIME_SIZE -comp zstd -root-owned -noappend -b 1M -mkfs-time 0
|
|
|
|
dd if=$RUNTIME_FILE of=$APPIMAGE_FILE conv=notrunc
|
|
|
|
chmod +x $APPIMAGE_FILE
|
2023-01-03 12:18:02 +08:00
|
|
|
|
|
|
|
# copy back to host
|
|
|
|
mkdir -p /build/RedPanda-CPP/dist
|
2023-04-06 15:48:58 +08:00
|
|
|
cp $APPIMAGE_FILE /build/RedPanda-CPP/dist
|