Skip to content

Commit

Permalink
Added Support for Appimage Packaging
Browse files Browse the repository at this point in the history
updates to appimage build script

Latest changes to appimage scripts and cmake scripts

Squashed commit

Other fixed formatting

fixed formatting
Added Support for Appimage Packaging

Fixed formatting
  • Loading branch information
VasanthBalguri authored and Webster Sheets committed Oct 29, 2023
1 parent 9f10aa2 commit e2ce605
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,18 @@ install(FILES ${install_txt} DESTINATION ${PIONEER_INSTALL_DATADIR})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses
DESTINATION ${PIONEER_INSTALL_DATADIR})

if(APPIMAGE_BUILD)
set(PIONEER_EXECUTABLE init_pioneer.sh)
set(PIONEER_SH_FILE ${CMAKE_BINARY_DIR}/init_pioneer.sh)
configure_file(init_pioneer.sh.cmakein ${PIONEER_SH_FILE} @ONLY)
install(FILES ${PIONEER_SH_FILE}
DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
)
else(APPIMAGE_BUILD)
set(PIONEER_EXECUTABLE ${CMAKE_INSTALL_FULL_BINDIR}/pioneer)
endif(APPIMAGE_BUILD)

if (WIN32)
configure_file(pioneer.iss.cmakein pioneer.iss @ONLY)
file(GLOB win_libs ../pioneer-thirdparty/win32/bin/${MSVC_ARCH}/vs2019/*.dll)
Expand Down
21 changes: 21 additions & 0 deletions init_pioneer.sh.cmakein
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! /bin/bash

BIN_DIRECTORY=usr/bin
OLD_DIR=$PWD
if [ "$1" = editor ]
then
shift
cd $APPDIR && $BIN_DIRECTORY/editor "$@"
elif [ "$1" = modelcompiler ]
then
shift
cd $APPDIR && $BIN_DIRECTORY/modelcompiler "$@"
elif [ "$1" = savegamedump ]
then
shift
cd $APPDIR && $BIN_DIRECTORY/savegamedump "$@"
else
cd $APPDIR && $BIN_DIRECTORY/pioneer "$@"
fi

cd $OLD_DIR
2 changes: 1 addition & 1 deletion metadata/net.pioneerspacesim.Pioneer.desktop.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version=1.0
Name=Pioneer
GenericName=Pioneer Space Simulator
Comment=A game of lonely space adventure
Exec=@CMAKE_INSTALL_FULL_BINDIR@/pioneer
Exec=@PIONEER_EXECUTABLE@
Icon=net.pioneerspacesim.Pioneer
Terminal=false
Type=Application
Expand Down
32 changes: 32 additions & 0 deletions pioneer_appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#! /bin/bash

if [[ -z "$1" ]]; then
echo "please mention the path to appimage as follows:"
echo "pioneer_appimage.sh /path/to/linuxdeploy-x86_64.AppImage"
exit 2
fi
LINUX_DEPLOY_PATH=$1
shift


CMAKE_OPTS=("-DCMAKE_EXPORT_COMPILE_COMMANDS=1")
CMAKE_OPTS+=("-DPIONEER_DATA_DIR=usr/share/data")
CMAKE_OPTS+=("-DCMAKE_INSTALL_PREFIX=./appdir/usr")
CMAKE_OPTS+=("-DPIONEER_INSTALL_DATADIR=share")
CMAKE_OPTS+=("-DAPPIMAGE_BUILD=1")
if [ "$1" = "thirdparty" ]; then
shift 1
cd pioneer-thirdparty/ && autoconf && ./configure && make assimp && make sdl2 && make sdl2_image && cd ../
CMAKE_OPTS+=("-DUSE_PIONEER_THIRDPARTY=1")
elif [ "$1" = "cmake" ]; then
shift 1
fi

CMAKE_OPTS+=("$@")

mkdir -p build; cd build
cmake .. "${CMAKE_OPTS[@]}"

make all build-data -j4
make install
ARCH=x86_64 $LINUX_DEPLOY_PATH --appdir appdir --output appimage

0 comments on commit e2ce605

Please sign in to comment.