
image: alpine/latest

sources:
  - https://git.sr.ht/~thestr4ng3r/chiaki

packages:
  - cmake
  - ninja
  - protoc
  - py3-protobuf
  - py3-setuptools
  - opus-dev
  - qt5-qtbase-dev
  - qt5-qtsvg-dev
  - qt5-qtmultimedia-dev
  - ffmpeg-dev
  - sdl2-dev
  - podman
  - fuse
  - udev
  - argp-standalone

artifacts:
  - chiaki.nro
  - Chiaki.AppImage

tasks:
  - setup_podman: |
      sudo rc-service udev start
      sudo rc-service cgroups start
      sudo rc-service fuse start # Fuse for AppImages
      echo build:100000:65536 | sudo tee /etc/subuid
      echo build:100000:65536 | sudo tee /etc/subgid
      # https://www.kernel.org/doc/Documentation/networking/tuntap.txt
      # for slirp4netns
      sudo mkdir -p /dev/net
      sudo mknod /dev/net/tun c 10 200
      sudo chmod 0666 /dev/net/tun
  - local_build_and_test: |
      cd chiaki
      cmake -Bbuild -GNinja -DCHIAKI_ENABLE_CLI=ON -DCHIAKI_ENABLE_GUI=ON -DCHIAKI_CLI_ARGP_STANDALONE=ON
      ninja -C build
      build/test/chiaki-unit
  - appimage: |
      cd chiaki
      scripts/run-podman-build-appimage.sh
      cp appimage/Chiaki.AppImage ../Chiaki.AppImage
  - switch: |
      cd chiaki
      scripts/switch/run-podman-build-chiaki.sh
      cp build_switch/switch/chiaki.nro ../chiaki.nro
  - bullseye: |
      cd chiaki
      scripts/run-podman-build-bullseye.sh
