summaryrefslogtreecommitdiff
path: root/org.metamuffin.hurrycurry.client.yaml
blob: 758c5adcc56b3459934a7d73a5e1225f1193b4d6 (plain)
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
app-id: org.metamuffin.hurrycurry.client
runtime: org.freedesktop.Platform
runtime-version: "24.08"
sdk: org.freedesktop.Sdk
sdk-extensions:
  - org.freedesktop.Sdk.Extension.node20
command: hurrycurry
finish-args:
  - --share=ipc
  - --socket=wayland
  - --socket=fallback-x11
  - --socket=pulseaudio
  - --device=dri
  - --share=network

build-options:
  arch:
    x86_64:
      env:
        # Only enable link-time optimization when targeting x86_64
        # (causes issues on other architectures)
        SCONS_FLAGS_EXTRA: use_lto=yes
  env:
    BUILD_NAME: hurrycurry

modules:
  - shared-modules/glu/glu-9.json

  - name: scons
    buildsystem: simple
    cleanup: ["*"]
    sources:
      - type: archive
        sha256: 6e928fc97984e719814270f6863f2183b3b72180b0162a5ed09db68c9994100c
        url: https://downloads.sourceforge.net/project/scons/scons/4.8.0/SCons-4.8.0.tar.gz
    build-commands:
      - python3 -m pip install --no-index --no-build-isolation --prefix=/app .

  - name: godot
    buildsystem: simple
    sources:
      - type: archive
        sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        url: https://github.com/godotengine/godot/releases/download/4.4.1-stable/Godot_v4.4.1-stable_linux.x86_64.zip

      - type: file
        path: custom.py

    build-commands:
      - python3 /app/bin/scons $SCONS_FLAGS_EXTRA profile=custom.py target=editor -j "$FLATPAK_BUILDER_N_JOBS"
      - python3 /app/bin/scons $SCONS_FLAGS_EXTRA profile=custom.py target=template_release -j "$FLATPAK_BUILDER_N_JOBS"
      - install -Dm755 bin/godot.linuxbsd.template_release.* /app/bin/godot
      - install -Dm755 bin/godot.linuxbsd.editor.* /app/bin/godot-editor

  - name: rust
    buildsystem: simple
    build-options:
      strip: false
      no-debuginfo: true
    cleanup: ["*"]

    sources:
      - type: archive
        only-arches:
          - aarch64
        dest: rust
        url: https://static.rust-lang.org/dist/2024-11-27/rust-nightly-aarch64-unknown-linux-gnu.tar.xz
        sha256: 943775f84ad169e81f55a24dc101b5c41400d86782f28513f0912826fc6adcd3
      - type: archive
        only-arches:
          - x86_64
        dest: rust
        url: https://static.rust-lang.org/dist/2024-11-27/rust-nightly-x86_64-unknown-linux-gnu.tar.xz
        sha256: 6c1813b174485c66a36e7667b4524dff12c97e89f4fb4909083f8ba9bdd55fee
    build-commands:
      - cd rust && ./install.sh --prefix=/app/sdk/rust-nightly --without=rust-docs --without=rust-docs-json-preview --disable-ldconfig --verbose

  - name: hurrycurry
    buildsystem: simple
    build-options:
      append-path: /usr/lib/sdk/node20/bin:/app/sdk/rust-nightly/bin
      env:
        CARGO_HOME: /run/build/hurrycurry/cargo
    sources:
      - type: archive
        sha256: d26d7b4fc6966e597f7d374235bbf7664eb8e8d833803b2b52f32e4f48b8a7f2
        url: https://codeberg.org/hurrycurry/hurrycurry/archive/v2.3.0.tar.gz

      - generated-sources.json
    build-commands:
      - cargo --offline fetch --manifest-path Cargo.toml
      - make JSR=node -C data
      - make DATA_SEARCH_PATH=/app/share/hurrycurry/data CARGOFLAGS=--offline -C server discover server
      - make -C client assets locales
      - install -Dm755 target/release/hurrycurry-server /app/bin/hurrycurry-server
      - install -Dm755 target/release/hurrycurry-discover /app/bin/hurrycurry-discover
      - install -dD /app/share/hurrycurry/data/recipes
      - install -dD /app/share/hurrycurry/data/maps
      - cp -v data/index.yaml /app/share/hurrycurry/data/index.yaml
      - cp -vr data/recipes/*.yaml /app/share/hurrycurry/data/recipes
      - cp -vr data/maps/*.yaml /app/share/hurrycurry/data/maps
      - godot-editor --headless --export-pack wasm32-unknown-unknown /app/share/hurrycurry/client.pck client/project.godot
      - rm /app/bin/godot-editor
      - >
        for size in {32,64,128,256,512}; do
          ffmpeg -i client/icons/main.png -vf scale=${size}:${size} "$size.png"
          install -Dm644 "$size.png" "/app/share/icons/hicolor/${size}x${size}/apps/org.metamuffin.hurrycurry.client.png"
        done

  - name: hurrycurry-dist
    buildsystem: simple
    sources:
      - type: archive
        sha256: 14d90e3866603722fb995316cb497a36d59f59f448b99cc48548b58336980baa
        url: https://codeberg.org/hurrycurry/hurrycurry-dist-extra/archive/v2.3.0.tar.gz
    build-commands:
      - python translate.py
      - install -Dm755 hurrycurry /app/bin/hurrycurry
      - install -Dm644 org.metamuffin.hurrycurry.client.desktop /app/share/applications/org.metamuffin.hurrycurry.client.desktop
      - install -Dm644 org.metamuffin.hurrycurry.client.metainfo.xml /app/share/metainfo/org.metamuffin.hurrycurry.client.metainfo.xml