Changes between Version 60 and Version 61 of BuildAndDeploymentEnvironment


Ignore:
Timestamp:
Aug 31, 2022, 4:24:52 AM (21 months ago)
Author:
Andy Alt
Comment:

add section:how to create an appimage

Legend:

Unmodified
Added
Removed
Modified
  • BuildAndDeploymentEnvironment

    v60 v61  
    141141See BuildInstructions#OSX
    142142
     143== Linux AppImage ==
     144
     145After you've built 0ad, you can use these steps to create an [https://appimage.org/ AppImage]:
     146
     147
     148{{{
     149#!/bin/sh
     150set -ev # exit on error, be verbose
     151
     152#ABS_PATH_SRC_ROOT=/0ad
     153
     154if [ -z "${ABS_PATH_SRC_ROOT}" ]; then
     155  echo "set the source root!"
     156  exit 1
     157fi
     158
     159cd $ABS_PATH_SRC_ROOT
     160
     161install -s binaries/system/pyrogenesis -Dt $HOME/AppRun/usr/bin
     162install -s binaries/system/ActorEditor -Dt $HOME/AppRun/usr/bin
     163
     164# This loop uses 'patchelf', which may not be installed on some distros.
     165
     166# TODO: add code here to check for the existence of 'patchelf'
     167
     168cd $HOME/AppRun/usr/bin
     169
     170for lib in libmozjs78-ps-release.so \
     171        libnvcore.so    \
     172        libnvimage.so   \
     173        libnvmath.so    \
     174        libnvtt.so
     175do
     176  patchelf --set-rpath $lib:${ABS_PATH_SRC_ROOT}/binaries/system pyrogenesis
     177done
     178
     179patchelf --set-rpath libAtlasUI.so:${ABS_PATH_SRC_ROOT}/binaries/system ActorEditor
     180
     181cd $ABS_PATH_SRC_ROOT
     182
     183install binaries/system/libCollada.so -Dt $HOME/AppRun/usr/lib
     184install build/resources/0ad.appdata.xml -Dt $HOME/AppRun/usr/share/appdata
     185install build/resources/0ad.desktop -Dt $HOME/AppRun/usr/share/applications
     186install build/resources/0ad.png -Dt $HOME/AppRun/usr/share/pixmaps
     187
     188mkdir -p $HOME/AppRun/usr/data/config
     189cp -a binaries/data/config/default.cfg $HOME/AppRun/usr/data/config
     190
     191cp -a binaries/data/l10n $HOME/AppRun/usr/data
     192
     193# IMPORTANT: If you're creating the image from a distribution archive, this should copy
     194# 'binaries/data/mods/mod/mod.zip', 'binaries/data/mods/public/public.zip', and
     195# 'binaries/data/mods/public/mod.json'
     196# If you're using the svn/git version, you'll need to use the pyrogenesis
     197# pyromod archive builder. It's recommended to create the two zip files
     198# in a directory outside of the AppRun folder, in case you need to remove
     199# the AppRun folder, and then copy them to $HOME/AppRun/usr/data
     200# see https://trac.wildfiregames.com/wiki/Modding_Guide#Distributingyourmods
     201#
     202cp -a binaries/data/mods $HOME/AppRun/usr/data
     203
     204# Remove any symlinks to mods that may be in binaries/data/mods (this will cause 0ad to crash
     205# when the appimage is run). If you're creating the image from a clean 0ad archive, then
     206# there won't be any symlinks of course
     207}}}
     208
     209Note that binaries/system{libmoz*,libnv*} will be moved into the AppRun folder automatically when linuxdeploy is run below.
     210
     211Change the Exec line in $HOME/AppRun/usr/share/applications/0ad.desktop to pyrogenesis and also change the Exec line for Atlas.
     212
     213Get a copy of [https://github.com/linuxdeploy/linuxdeploy/releases linuxdeploy] (you can use `wget` to get the desired release/arch).
     214
     215{{{
     216cd $HOME
     217
     218linuxdeploy -d AppRun/usr/share/applications/0ad.desktop \
     219  --icon-file=AppRun/usr/share/pixmaps/0ad.png \
     220  --icon-filename=0ad \
     221  --executable AppRun/usr/bin/pyrogenesis \
     222  --appdir AppRun \
     223  --output appimage
     224}}}
     225
     226Other Notes:
     227
     228To test any changes you might want to make to the appimage, or for debugging, after extraction you can move things around or do whatever, then cd back to the squashfs-root dir, and enter `./AppRun`.
     229
     230To use the --writableRoot option with the 0ad appimage, it must be extracted by providing the --appimage-extract option. Then cd into squashfs-root, and type in `./AppRun --writableRoot`
     231
    143232== *nix build ==
    144233Linux build process shouldn't change (much).