Merge branch 'master' of github.com:royqh1979/RedPanda-CPP

This commit is contained in:
Roy Qu 2023-04-13 10:20:55 +08:00
commit 9be0daf9c9
3 changed files with 17 additions and 6 deletions

View File

@ -467,12 +467,12 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file)
} }
} }
if (fileType==FileType::CppSource || fileType==FileType::CppSource) { if (fileType==FileType::CSource || fileType==FileType::CppSource) {
if (mOnlyCheckSyntax) { if (mOnlyCheckSyntax) {
if (unit->compileCpp()) if (unit->compileCpp())
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " $(CXXFLAGS) " + encodingStr); writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " $(CXXFLAGS) " + encodingStr);
else else
writeln(file, "\t(CC) -c " + genMakePath1(shortFileName) + " $(CFLAGS) " + encodingStr); writeln(file, "\t$(CC) -c " + genMakePath1(shortFileName) + " $(CFLAGS) " + encodingStr);
} else { } else {
if (unit->compileCpp()) if (unit->compileCpp())
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CXXFLAGS) " + encodingStr); writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CXXFLAGS) " + encodingStr);

View File

@ -2,6 +2,9 @@
set -xe set -xe
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
# build RedPanda C++ # build RedPanda C++
mkdir -p /build/redpanda-build mkdir -p /build/redpanda-build
cd /build/redpanda-build cd /build/redpanda-build
@ -13,18 +16,19 @@ make install INSTALL_ROOT=/build/RedPandaIDE.AppDir
# setup AppImage resource # setup AppImage resource
cd /build/RedPandaIDE.AppDir cd /build/RedPandaIDE.AppDir
ln -s usr/bin/RedPandaIDE AppRun
ln -s usr/share/applications/redpandaide.desktop redpandaide.desktop ln -s usr/share/applications/redpandaide.desktop redpandaide.desktop
ln -s usr/share/icons/hicolor/scalable/apps/redpandaide.svg redpandaide.svg ln -s usr/share/icons/hicolor/scalable/apps/redpandaide.svg redpandaide.svg
cp /build/RedPanda-CPP/platform/linux/redpandaide.png .DirIcon # 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
# copy dependency # copy dependency
cp /usr/local/bin/alacritty usr/bin cp /usr/local/bin/alacritty usr/bin
# create AppImage # create AppImage
cd /build cd /build
appimagetool --appimage-extract-and-run RedPandaIDE.AppDir RedPandaIDE-$CARCH.AppImage appimagetool --appimage-extract-and-run RedPandaIDE.AppDir $APPIMAGE_FILE
# copy back to host # copy back to host
mkdir -p /build/RedPanda-CPP/dist mkdir -p /build/RedPanda-CPP/dist
cp RedPandaIDE-$CARCH.AppImage /build/RedPanda-CPP/dist cp $APPIMAGE_FILE /build/RedPanda-CPP/dist

7
packages/appimage/AppRun.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# AppImage runtime set `argv[0]` to AppImage file, which is not reliable.
# Qt framework expects reliable `argv[0]` to locate configuration files.
# This wrapper fixes `argv[0]`.
exec "$(dirname "$0")/usr/bin/RedPandaIDE" "$@"