~osomon/+junk/0ad-snap-svn-trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: 0ad
adopt-info: 0ad-svn-build
summary: Real-time strategy game of ancient warfare
description: |
 0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
 real-time strategy (RTS) game of ancient warfare. In short, it is a
 historically-based war/economy game that allows players to relive or rewrite
 the history of Western civilizations, focusing on the years between 500 B.C.
 and 500 A.D. The project is highly ambitious, involving state-of-the-art 3D
 graphics, detailed artwork, sound, and a flexible and powerful custom-built
 game engine.
confinement: strict
base: core18

apps:
  0ad:
    command: play0ad.launcher
    desktop: 0ad.desktop
    common-id: com.play0ad.zeroad
    plugs:
      - audio-playback
      - home
      - network
      - network-bind
      - opengl
      - process-control
      - pulseaudio # remove once snapd 2.41 is available everywhere
      - removable-media
      - screen-inhibit-control
      - x11
  atlas:
    command: play0ad.launcher -editor
    plugs:
      - audio-playback
      - home
      - opengl
      - process-control
      - pulseaudio # remove once snapd 2.41 is available everywhere
      - removable-media
      - x11

parts:
  0ad-patches:
    plugin: nil
    source: patches
    override-build: |
      mkdir -p $SNAPCRAFT_PART_INSTALL/patches
      cp *.patch $SNAPCRAFT_PART_INSTALL/patches/
    override-prime: ""
  0ad-svn-build:
    after: [ 0ad-patches ]
    plugin: nil
    source: http://svn.wildfiregames.com/public/ps/trunk/
    source-type: svn
    build-packages:
      - cargo
      - cmake
      - libboost-dev
      - libboost-filesystem-dev
      - libcurl4-gnutls-dev
      - libenet-dev
      - libfmt-dev
      - libgloox-dev
      - libicu-dev
      - libminiupnpc-dev
      - libnspr4-dev
      - libogg-dev
      - libopenal-dev
      - libpng-dev
      - libsdl2-dev
      - libsodium-dev
      - libvorbis-dev
      - libwxgtk3.0-dev
      - libxcursor-dev
      - libxml2-dev
      - patch
      - pkg-config
      - python
      - rustc
      - zlib1g-dev
    override-pull: |
      snapcraftctl pull
      snapcraftctl set-version trunk~$(svn info --show-item revision)
    override-build: |
      patch -d . -p1 < $SNAPCRAFT_STAGE/patches/allow-build-with-root.patch
      build/workspaces/update-workspaces.sh -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
      patch -d . -p1 < $SNAPCRAFT_STAGE/patches/allow-running-as-root.patch
      make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT config=release -C build/workspaces/gcc
      P=binaries/data
      ./binaries/system/pyrogenesis -mod=mod -archivebuild=$P/mods/public -archivebuild-output=$P/public.zip
      ./binaries/system/pyrogenesis -archivebuild=$P/mods/mod -archivebuild-output=$P/mod.zip
      patch -d . -R -p1 < $SNAPCRAFT_STAGE/patches/allow-running-as-root.patch
      make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT config=release -C build/workspaces/gcc
      P=binaries/system
      mkdir -p $SNAPCRAFT_PART_INSTALL/$P
      cp $P/libnvcore.so $P/libnvimage.so $P/libnvmath.so $P/libnvtt.so $SNAPCRAFT_PART_INSTALL/$P/
      cp $P/pyrogenesis $P/ActorEditor $P/libAtlasUI.so $P/libCollada.so $P/libmozjs*-ps-release.so $P/readme.txt $SNAPCRAFT_PART_INSTALL/$P/
      P=binaries/data
      mkdir -p $SNAPCRAFT_PART_INSTALL/$P
      cp -R $P/config $P/l10n $P/tools $SNAPCRAFT_PART_INSTALL/$P/
      mkdir -p $SNAPCRAFT_PART_INSTALL/$P/mods/public
      cp $P/public.zip $SNAPCRAFT_PART_INSTALL/$P/mods/public/
      mkdir -p $SNAPCRAFT_PART_INSTALL/$P/mods/mod
      cp $P/mod.zip $SNAPCRAFT_PART_INSTALL/$P/mods/mod/
      cp build/resources/0ad.desktop $SNAPCRAFT_PART_INSTALL/
      sed -i -e "s#Icon=0ad#Icon=/icon.png#" $SNAPCRAFT_PART_INSTALL/0ad.desktop
  0ad-launcher:
    plugin: dump
    source: .
    prime:
      - etc/fonts/
      - lib/
      - usr/lib/
      - usr/share/fonts/
      - usr/share/themes/
      - usr/share/X11/
      - play0ad.launcher
      - icon.png
    stage-packages:
      - libboost-filesystem1.65.1
      - libboost-system1.65.1
      - libcurl3-gnutls
      - libenet7
      - libgl1-mesa-glx
      - libgloox15
      - libicu60
      - libminiupnpc10
      - libnspr4
      - libopenal1
      - libpng16-16
      - libsdl2-2.0-0
      - libsodium23
      - libvorbisfile3
      - libwxbase3.0-0v5
      - libwxgtk3.0-0v5
      - libx11-6
      - libxcursor1
      - libxml2
      - locales-all