distributable:
  url: https://download.gnome.org/sources/at-spi2-atk/{{version.marketing}}/at-spi2-atk-{{version}}.tar.xz
  strip-components: 1
versions:
  url: https://download.gnome.org/sources/at-spi2-atk/cache.json
  match: /at-spi2-atk-\d+\.\d+\.\d+\.tar\.xz/
  strip:
    - /^at-spi2-atk-/
    - /\.tar\.xz/
dependencies:
  gnome.org/atk: '*'
  gnome.org/libxml2: '*'
  freedesktop.org/dbus: '*'
  x.org/xtst: '*'
build:
  dependencies:
    mesonbuild.com: '*'
    ninja-build.org: '*'
    freedesktop.org/pkg-config: '*'
    python.org: ~3.11
    git-scm.org: '*'
    linux:
      llvm.org: '*'
  working-directory: build
  script:
    - run: |
        sed -i.bak "s|revision=master|revision=main|g" at-spi2-core.wrap
        rm at-spi2-core.wrap.bak
      working-directory: ../subprojects
    - meson --prefix={{prefix}} --libdir={{prefix}}/lib ..
    - ninja
    - ninja install
  env:
    linux:
      LD: clang
test:
  dependencies:
    freedesktop.org/pkg-config: '*'
    linux:
      llvm.org: '*'
  script:
    - pkg-config --modversion atk-bridge-2.0 | grep {{version}}
    - cc test.c $(pkg-config --cflags --libs atk-bridge-2.0 glib-2.0 atk) -o test
    - ./test 2>&1 | grep "atk_bridge_adaptor_init"
