acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / at / at-spi2-core / package.nix
blob709ea738e46b39f94d035d04b7f95e530b0d9497
1 { lib
2 , stdenv
3 , fetchurl
4 , meson
5 , ninja
6 , pkg-config
7 , gobject-introspection
8 , buildPackages
9 , withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
10 , gsettings-desktop-schemas
11 , makeWrapper
12 , dbus
13 , glib
14 , dconf
15 , libX11
16 , libxml2
17 , libXtst
18 , libXi
19 , libXext
20 , gnome
21 , systemd
22 , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
25 stdenv.mkDerivation rec {
26   pname = "at-spi2-core";
27   version = "2.54.0";
29   outputs = [ "out" "dev" ];
30   separateDebugInfo = true;
32   src = fetchurl {
33     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
34     hash = "sha256-1+7n51vt3MJyztwrYFNWAPOq5uSBWJ68Znr8Q3wKYHk=";
35   };
37   nativeBuildInputs = [
38     glib
39     meson
40     ninja
41     pkg-config
42     makeWrapper
43   ] ++ lib.optionals withIntrospection [
44     gobject-introspection
45   ];
47   buildInputs = [
48     libX11
49     libxml2
50     # at-spi2-core can be build without X support, but due it is a client-side library, GUI-less usage is a very rare case
51     libXtst
52     libXi
53     # libXext is a transitive dependency of libXi
54     libXext
55   ] ++ lib.optionals systemdSupport [
56     # libsystemd is a needed for dbus-broker support
57     systemd
58   ];
60   # In atspi-2.pc dbus-1 glib-2.0
61   # In atk.pc gobject-2.0
62   propagatedBuildInputs = [
63     dbus
64     glib
65   ];
67   # fails with "AT-SPI: Couldn't connect to accessibility bus. Is at-spi-bus-launcher running?"
68   doCheck = false;
70   mesonFlags = [
71     # Provide dbus-daemon fallback when it is not already running when
72     # at-spi2-bus-launcher is executed. This allows us to avoid
73     # including the entire dbus closure in libraries linked with
74     # the at-spi2-core libraries.
75     "-Ddbus_daemon=/run/current-system/sw/bin/dbus-daemon"
76   ] ++ lib.optionals systemdSupport [
77     # Same as the above, but for dbus-broker
78     "-Ddbus_broker=/run/current-system/sw/bin/dbus-broker-launch"
79   ] ++ lib.optionals (!systemdSupport) [
80     "-Duse_systemd=false"
81   ];
83   passthru = {
84     updateScript = gnome.updateScript {
85       packageName = pname;
86       versionPolicy = "odd-unstable";
87     };
88   };
90   postFixup = ''
91     # Cannot use wrapGAppsHook'due to a dependency cycle
92     wrapProgram $out/libexec/at-spi-bus-launcher \
93       --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \
94       --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}
95   '';
97   meta = with lib; {
98     description = "Assistive Technology Service Provider Interface protocol definitions and daemon for D-Bus";
99     homepage = "https://gitlab.gnome.org/GNOME/at-spi2-core";
100     license = licenses.lgpl21Plus;
101     maintainers = teams.gnome.members ++ (with maintainers; [ raskin ]);
102     platforms = platforms.unix;
103   };