freedesktop.org/at-spi2-atk (#3843)

* new file:   projects/freedesktop.org/at-spi2-atk/package.yml
	new file:   projects/freedesktop.org/at-spi2-atk/test.c

* fix revision

* +git

* linux llvm
This commit is contained in:
Andrew 2023-10-26 20:00:07 +03:00 committed by GitHub
parent 313a213839
commit 2277aacc46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,44 @@
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"

View file

@ -0,0 +1,56 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <glib.h>
#include <atk/atk.h>
#include <atk-bridge.h>
static AtkObject *root_accessible;
static GMainLoop *mainloop;
static gchar *tdata_path = NULL;
AtkObject *test_get_root(void)
{
return root_accessible;
}
static AtkObject *get_root(void)
{
return test_get_root();
}
const gchar *get_toolkit_name(void)
{
return strdup("atspitesting-toolkit");
}
static void setup_atk_util(void)
{
AtkUtilClass *klass;
klass = g_type_class_ref(ATK_TYPE_UTIL);
klass->get_root = get_root;
klass->get_toolkit_name = get_toolkit_name;
g_type_class_unref(klass);
}
static GOptionEntry optentries[] = {
{"test-data-file", 0, 0, G_OPTION_ARG_STRING, &tdata_path, "Path to file of test data", NULL},
{NULL}};
int main(int argc, char *argv[])
{
GOptionContext *opt;
GError *err = NULL;
opt = g_option_context_new(NULL);
g_option_context_add_main_entries(opt, optentries, NULL);
g_option_context_set_ignore_unknown_options(opt, TRUE);
if (!g_option_context_parse(opt, &argc, &argv, &err))
g_error("Option parsing failed: %s", err->message);
setup_atk_util();
atk_bridge_adaptor_init(NULL, NULL);
return 0;
}