Skip to content

Commit

Permalink
build_appimages.sh: Functionalize client AppImage build
Browse files Browse the repository at this point in the history
See RM #575

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
  • Loading branch information
cazfi committed May 29, 2024
1 parent 3e105c1 commit 3b69bf5
Showing 1 changed file with 34 additions and 25 deletions.
59 changes: 34 additions & 25 deletions platforms/appimage/build_appimages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,42 @@ if test "${PLATFORM_ROOT}" = "${BUILD_ROOT}" ; then
exit 1
fi

client_appimage() {
if ! mkdir "AppDir/$1" || ! mkdir "build/$1" ; then
echo "Failed to create $1 directories!" >&2
return 1
fi

cd "build/$1"
if ! meson setup -Dack_experimental=true -Dappimage=true -Dprefix=/usr -Ddefault_library=static \
-Dclients=$1 -Dfcmp=[] -Druledit=false "${SRC_ROOT}"
then
echo "$1 setup with meson failed!" >&2
return 1
fi

if ! DESTDIR="${BUILD_ROOT}/AppDir/$1" ninja install ; then
echo "$1 build with ninja failed!" >&2
return 1
fi

cd "${BUILD_ROOT}"
if ! tools/linuxdeploy-x86_64.AppImage --appdir "AppDir/$1" --output appimage
then
echo "$1 image build with linuxdeploy failed!" >&2
return 1
fi
if ! mv Freeciv-x86_64.AppImage "Freeciv-$1-x86_64.AppImage" ; then
echo "$1 appimage rename failed!" >&2
return 1
fi
}

if ! mkdir tools ||
! mkdir -p AppDir/server ||
! mkdir AppDir/gtk4 ||
! mkdir -p build/server ||
! mkdir build/gtk4
! mkdir -p build/server
then
echo "Failed to create required directories!" >&2
echo "Failed to create server directories!" >&2
exit 1
fi

Expand Down Expand Up @@ -61,26 +90,6 @@ then
exit 1
fi

cd build/gtk4
if ! meson setup -Dack_experimental=true -Dappimage=true -Dprefix=/usr -Ddefault_library=static \
-Dclients=gtk4 -Dfcmp=[] -Druledit=false "${SRC_ROOT}"
then
echo "Gtk4-client setup with meson failed!" >&2
exit 1
fi

if ! DESTDIR="${BUILD_ROOT}/AppDir/gtk4" ninja install ; then
echo "Gtk4-client build with ninja failed!" >&2
exit 1
fi

cd "${BUILD_ROOT}"
if ! tools/linuxdeploy-x86_64.AppImage --appdir AppDir/gtk4 --output appimage
then
echo "Gtk4-client image build with linuxdeploy failed!" >&2
exit 1
fi
if ! mv Freeciv-x86_64.AppImage Freeciv-gtk4-x86_64.AppImage ; then
echo "gtk4-client appimage rename failed!" >&2
if ! client_appimage gtk4 ; then
exit 1
fi

0 comments on commit 3b69bf5

Please sign in to comment.