nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPackages,
5 pkg-config,
6 fetchurl,
7 meson,
8 ninja,
9 wrapGAppsHook3,
10 gobject-introspection,
11 gettext,
12 yelp-tools,
13 itstool,
14 python3,
15 gtk3,
16 gnome,
17 replaceVars,
18 at-spi2-atk,
19 at-spi2-core,
20 dbus,
21 xkbcomp,
22 procps,
23 gnugrep,
24 coreutils,
25 gsettings-desktop-schemas,
26 speechd-minimal,
27 brltty,
28 liblouis,
29 gst_all_1,
30}:
31
32python3.pkgs.buildPythonApplication rec {
33 pname = "orca";
34 version = "49.5";
35
36 pyproject = false;
37
38 src = fetchurl {
39 url = "mirror://gnome/sources/orca/${lib.versions.major version}/orca-${version}.tar.xz";
40 hash = "sha256-U99BVYMZ6XwehK1gSYmVegK10P9TFBkZDwWH6mslYDQ=";
41 };
42
43 patches = [
44 (replaceVars ./fix-paths.patch {
45 cat = "${coreutils}/bin/cat";
46 grep = "${gnugrep}/bin/grep";
47 pgrep = "${procps}/bin/pgrep";
48 xkbcomp = "${xkbcomp}/bin/xkbcomp";
49 })
50 ];
51
52 # needed for cross-compilation
53 depsBuildBuild = [ pkg-config ];
54
55 nativeBuildInputs = [
56 # cross-compilation support requires the host environment's build time
57 # to make the following buildPackages available.
58 buildPackages.gtk3
59 buildPackages.python3
60 buildPackages.python3Packages.pygobject3
61 meson
62 ninja
63 wrapGAppsHook3
64 pkg-config
65 gettext
66 yelp-tools
67 itstool
68 gobject-introspection
69 ];
70
71 pythonPath = with python3.pkgs; [
72 dasbus
73 pygobject3
74 dbus-python
75 pyxdg
76 brltty
77 liblouis
78 psutil
79 speechd-minimal
80 gst-python
81 setproctitle
82 ];
83
84 strictDeps = false;
85
86 buildInputs = [
87 python3
88 gtk3
89 at-spi2-atk
90 at-spi2-core
91 dbus
92 gsettings-desktop-schemas
93 gst_all_1.gstreamer
94 gst_all_1.gst-plugins-base
95 gst_all_1.gst-plugins-good
96 ];
97
98 # Help GI find typelibs during Meson's configure step in cross builds
99 preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
100 export GI_TYPELIB_PATH=${buildPackages.gtk3}/lib/girepository-1.0''${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}
101 '';
102
103 dontWrapGApps = true; # Prevent double wrapping
104
105 preFixup = ''
106 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
107 substituteInPlace $out/lib/systemd/user/orca.service --replace-fail ExecStart=orca ExecStart=$out/bin/orca
108 '';
109
110 passthru = {
111 updateScript = gnome.updateScript {
112 packageName = "orca";
113 };
114 };
115
116 meta = {
117 homepage = "https://orca.gnome.org/";
118 changelog = "https://gitlab.gnome.org/GNOME/orca/-/blob/main/NEWS";
119 description = "Screen reader";
120 mainProgram = "orca";
121 longDescription = ''
122 A free, open source, flexible and extensible screen reader that provides
123 access to the graphical desktop via speech and refreshable braille.
124 It works with applications and toolkits that support the Assistive
125 Technology Service Provider Interface (AT-SPI). That includes the GNOME
126 GTK toolkit, the Java platform's Swing toolkit, LibreOffice, Gecko, and
127 WebKitGtk. AT-SPI support for the KDE Qt toolkit is being pursued.
128
129 Needs `services.gnome.at-spi2-core.enable = true;` in `configuration.nix`.
130 '';
131 maintainers = with lib.maintainers; [ berce ];
132 teams = [ lib.teams.gnome ];
133 license = lib.licenses.lgpl21;
134 platforms = lib.platforms.linux;
135 };
136}