| 1 |
--- |
| 2 |
name: freeorion |
| 3 |
base: core22 |
| 4 |
summary: turn-based space empire and galactic conquest (4X) computer game |
| 5 |
description: | |
| 6 |
FreeOrion is a free, open source, turn-based space empire and galactic |
| 7 |
conquest (4X) computer game being designed and built by the FreeOrion project. |
| 8 |
FreeOrion is inspired by the tradition of the Master of Orion games, but is |
| 9 |
not a clone or remake of that series or any other game. |
| 10 |
confinement: strict |
| 11 |
adopt-info: freeorion |
| 12 |
architectures: |
| 13 |
- build-on: amd64 |
| 14 |
|
| 15 |
|
| 16 |
apps: |
| 17 |
freeorion: |
| 18 |
command: usr/bin/freeorion -S $SNAP_USER_COMMON/save |
| 19 |
extensions: [gnome] |
| 20 |
plugs: [home, pulseaudio, opengl, network, screen-inhibit-control, browser-support, x11] |
| 21 |
desktop: usr/share/applications/org.freeorion.FreeOrion.desktop |
| 22 |
environment: |
| 23 |
LD_LIBRARY_PATH: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}/freeorion:$SNAP/usr/lib/${CRAFT_ARCH_TRIPLET} |
| 24 |
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}/dri |
| 25 |
|
| 26 |
freeorion-godot: |
| 27 |
|
| 28 |
command: usr/bin/godot3-runner --main-pack $SNAP/usr/share/freeorion/freeorion.pck --resource.path $SNAP/usr/share/freeorion/default/ -S $SNAP_USER_COMMON/save |
| 29 |
extensions: [gnome] |
| 30 |
plugs: [home, pulseaudio, opengl, network, screen-inhibit-control, browser-support, x11] |
| 31 |
desktop: usr/share/applications/org.freeorion.FreeOrion.desktop |
| 32 |
environment: |
| 33 |
LD_LIBRARY_PATH: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}/freeorion:$SNAP/usr/lib/${CRAFT_ARCH_TRIPLET} |
| 34 |
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}/dri |
| 35 |
|
| 36 |
freeoriond: |
| 37 |
command: usr/bin/freeoriond |
| 38 |
plugs: [home, network, network-bind] |
| 39 |
environment: |
| 40 |
LD_LIBRARY_PATH: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}/freeorion:$SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}:$SNAP_DESKTOP_RUNTIME/usr/lib/${CRAFT_ARCH_TRIPLET} |
| 41 |
|
| 42 |
freeoriond-dedicated: |
| 43 |
command: usr/bin/freeoriond --hostless --network.server.unconn-human-empire-players.max 0 --network.server.conn-human-empire-players.min 0 |
| 44 |
plugs: [home, network, network-bind] |
| 45 |
environment: |
| 46 |
LD_LIBRARY_PATH: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}/freeorion:$SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}:$SNAP_DESKTOP_RUNTIME/usr/lib/${CRAFT_ARCH_TRIPLET} |
| 47 |
|
| 48 |
|
| 49 |
layout: |
| 50 |
|
| 51 |
|
| 52 |
/usr/lib/${CRAFT_ARCH_TRIPLET}/freeorion: |
| 53 |
symlink: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}/freeorion |
| 54 |
|
| 55 |
parts: |
| 56 |
freeorion: |
| 57 |
source: . |
| 58 |
override-build: | |
| 59 |
# Icon paths in the desktop file will be rewritten to use ${SNAP}/<file> if specified as desktop file in snapcraft.yaml |
| 60 |
sed -i.bak -e "s|Icon=freeorion$|Icon=meta/gui/icon.png|g" ../src/packaging/org.freeorion.FreeOrion.desktop |
| 61 |
sed -i.bak -e 's|="res://bin/linux.*/libfreeoriongodot.so"|="/usr/lib/${CRAFT_ARCH_TRIPLET}/freeorion/libfreeoriongodot.so"|g' ../src/godot/freeoriongodot.gdnlib |
| 62 |
craftctl default |
| 63 |
# godot-headless wants a writable homedir, simulate it |
| 64 |
mkdir -p home/ |
| 65 |
mkdir -p "${CRAFT_PART_INSTALL}/usr/share/freeorion/" |
| 66 |
# Note: we use godot3-headless really |
| 67 |
HOME=$(pwd)/home godot3-server --path ../src/godot --export-pack "Linux/X11" "${CRAFT_PART_INSTALL}/usr/share/freeorion/freeorion.pck" |
| 68 |
plugin: cmake |
| 69 |
cmake-parameters: |
| 70 |
- -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_CLIENT_GODOT=ON |
| 71 |
|
| 72 |
override-pull: | |
| 73 |
craftctl default |
| 74 |
branchn="$(git rev-parse --abbrev-ref HEAD)" |
| 75 |
daterev="$(git log -n1 --date=short --format='%cd.%h' $branchn)" |
| 76 |
longtagn="$(git describe --tags || echo none)" |
| 77 |
case $longtagn in |
| 78 |
v*) version=${longtagn} ;; |
| 79 |
*) case $daterev in |
| 80 |
v*) version=$(echo $daterev | tail -c +2) ;; |
| 81 |
*) version=$(echo $daterev | head -c 32) ;; |
| 82 |
esac ;; |
| 83 |
esac |
| 84 |
[ -n "$(echo $version | grep '^[0-9]+-')" ] && grade=devel || grade=stable |
| 85 |
craftctl set version="$version" |
| 86 |
craftctl set grade="$grade" |
| 87 |
override-prime: | |
| 88 |
craftctl default |
| 89 |
mkdir -p ${CRAFT_PRIME}/meta/gui |
| 90 |
cp ${CRAFT_PART_SRC}/default/data/art/icons/FO_Icon_256x256.png ${CRAFT_PRIME}/meta/gui/icon.png |
| 91 |
build-packages: |
| 92 |
- cmake |
| 93 |
- debhelper |
| 94 |
- dpkg-dev |
| 95 |
- git |
| 96 |
- libalut-dev |
| 97 |
- libboost1.74-all-dev |
| 98 |
- libfreetype6-dev |
| 99 |
|
| 100 |
- libglew-dev |
| 101 |
- libjpeg-dev |
| 102 |
- libogg-dev |
| 103 |
- libopenal-dev |
| 104 |
- libpng-dev |
| 105 |
- libsdl2-dev |
| 106 |
- libtiff-dev |
| 107 |
- libvorbis-dev |
| 108 |
- pkg-config |
| 109 |
- godot3-server |
| 110 |
|
| 111 |
stage-packages: |
| 112 |
- mesa-utils |
| 113 |
- libgl1-mesa-dri |
| 114 |
|
| 115 |
|
| 116 |
- libboost-date-time1.74.0 |
| 117 |
- libboost-filesystem1.74.0 |
| 118 |
- libboost-iostreams1.74.0 |
| 119 |
- libboost-locale1.74.0 |
| 120 |
- libboost-log1.74.0 |
| 121 |
- libboost-python1.74.0 |
| 122 |
- libboost-regex1.74.0 |
| 123 |
- libboost-serialization1.74.0 |
| 124 |
- libboost-system1.74.0 |
| 125 |
- libboost-thread1.74.0 |
| 126 |
- libboost-test1.74.0 |
| 127 |
- libglew2.2 |
| 128 |
|
| 129 |
- libopenal1 |
| 130 |
- libsdl2-2.0-0 |
| 131 |
- libvorbis0a |
| 132 |
- libvorbisfile3 |
| 133 |
- libpng16-16 |
| 134 |
- libfreetype6 |
| 135 |
- godot3-runner |
| 136 |
- libenet7 |
| 137 |
|
| 138 |
|
| 139 |
cleanup: |
| 140 |
after: [freeorion] |
| 141 |
plugin: nil |
| 142 |
build-snaps: [core22, gtk-common-themes, gnome-42-2204] |
| 143 |
override-prime: | |
| 144 |
set -eux |
| 145 |
for snap in "core22" "gtk-common-themes" "gnome-42-2204"; do |
| 146 |
cd "/snap/$snap/current" && find . -type f,l -name *.so.* -exec rm -f "$CRAFT_PRIME/{}" \; |
| 147 |
done |