~popey/+junk/godot-snap

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
name: godot
version: '3.0-alpha'
version-script: cat $SNAPCRAFT_STAGE/version
summary: Godot Engine – Multi-platform 2D and 3D game engine
description: |
  Godot Engine is a feature-packed, cross-platform game engine to
  create 2D and 3D games from a unified interface. It provides a
  comprehensive set of common tools, so that users can focus on
  making games without having to reinvent the wheel. Games can
  be exported in one click to a number of platforms, including
  the major desktop platforms (Linux, Mac OSX, Windows) as well
  as mobile (Android, iOS) and web-based (HTML5) platforms..

grade: stable
confinement: strict

apps:
  godot:
    environment:
      XLOCALEDIR: '$SNAP/usr/share/X11/locale'
      LOCPATH: '$SNAP/usr/lib/locale'
      XDG_CONFIG_HOME: '$HOME/.config'
      XKB_CONFIG_ROOT: '$SNAP/usr/share/X11/xkb'
      XDG_CONFIG_DIRS: '$SNAP/etc/xdg:$XDG_CONFIG_DIRS'
      XDG_DATA_HOME: '$SNAP/usr/share'    
      APPDATA: '$SNAP/bin'
    command: launcher $SNAP/bin/godot
    plugs: [network, pulseaudio, x11, opengl, mount-observe, home]

parts:
  launcher:
    after: [godot-tools, export-templates]
    plugin: dump
    source: snap/scripts
    organize:
      '*': "./bin/"
  export-templates:
    plugin: dump
    source: ./export_templates
  godot-tools:
    plugin: nil
    source: https://github.com/godotengine/godot.git
    build: |
      export PKG_CONFIG_PATH=$SNAPCRAFT_STAGE/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig
      #export unix_global_settings_path=/snap/godot/current/export-templates/templates
      env
      scons --silent platform=x11 use_llvm=yes verbose=yes builtin_freetype=no builtin_libmpcdec=yes builtin_libogg=no builtin_libpng=no builtin_libtheora=no builtin_libvorbis=no builtin_libwebp=no builtin_openssl=no builtin_opus=yes builtin_speex=no builtin_squish=yes builtin_zlib=no pulseaudio=yes udev=yes target=release_debug tools=yes
    install: |
      #echo $(git describe --tags $(git rev-list --tags --max-count=1))-$(git rev-parse --short HEAD) > $SNAPCRAFT_STAGE/version
      echo 3.0-alpha-$(git rev-parse --short HEAD) > $SNAPCRAFT_STAGE/version
      mkdir $SNAPCRAFT_PART_INSTALL/bin
      cp bin/godot.x11.opt.tools.64.llvm $SNAPCRAFT_PART_INSTALL/bin/godot
    stage-packages:
      - unzip
      - libgl1-mesa-glx
      - libgl1-mesa-dri
    build-packages:
      - build-essential
      - scons 
      - git
      - pkg-config
      - clang
      - libx11-dev
      - libxcursor-dev
      - libxinerama-dev
      - libgl1-mesa-dev
      - libglu-dev
      - libasound2-dev
      - libpulse-dev
      - libfreetype6-dev
      - libssl-dev
      - libudev-dev
      - libxrandr-dev
      - libwebp-dev
#      - libpng16-dev
      - libtheora-dev
      - libvorbis-dev
#      - libopus-dev
#      - libspeex-dev
#      - zlib1g-dev
      - g++-mingw-w64
#      - g++-mingw-w64-i686
#      - g++-mingw-w64-x86-64
#      - gcc-mingw-w64
#      - gcc-mingw-w64-i686
#      - gcc-mingw-w64-x86-64
#   godot-templates:
#     after: [godot-tools]
#     plugin: nil
#     source: https://github.com/godotengine/godot.git
#     build: |
#       export PKG_CONFIG_PATH=$SNAPCRAFT_STAGE/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig
#       env
#       scons unix_global_settings_path=/snap/godot/current/ platform=x11 use_llvm=yes verbose=yes builtin_freetype=no builtin_libmpcdec=yes builtin_libogg=no builtin_libpng=no builtin_libtheora=no builtin_libvorbis=no builtin_libwebp=no builtin_openssl=no builtin_opus=yes builtin_speex=no builtin_squish=yes builtin_zlib=no pulseaudio=yes udev=yes target=release_debug tools=no
#     install: |
#       mkdir -p $SNAPCRAFT_PART_INSTALL/bin/templates/linux_x11_64_release
#       cp bin/godot.x11.opt.*.llvm $SNAPCRAFT_PART_INSTALL/bin/templates/linux_x11_64_release
#     build-packages:
#       - build-essential
#       - scons 
#       - pkg-config
#       - clang
#       - libx11-dev
#       - libxcursor-dev
#       - libxinerama-dev
#       - libgl1-mesa-dev
#       - libglu-dev
#       - libasound2-dev
#       - libpulse-dev
#       - libfreetype6-dev
#       - libssl-dev
#       - libudev-dev
#       - libxrandr-dev
#       - libwebp-dev
# #      - libpng16-dev
#       - libtheora-dev
#       - libvorbis-dev
# #      - libopus-dev
# #      - libspeex-dev
# #      - zlib1g-dev
#       - g++-mingw-w64
# #      - g++-mingw-w64-i686
# #      - g++-mingw-w64-x86-64
# #      - gcc-mingw-w64
# #      - gcc-mingw-w64-i686
# #      - gcc-mingw-w64-x86-64