Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orca: init 3.26.0 #32866

Merged
merged 2 commits into from Jan 2, 2018
Merged

Orca: init 3.26.0 #32866

merged 2 commits into from Jan 2, 2018

Conversation

berce
Copy link
Contributor

@berce berce commented Dec 19, 2017

Motivation for this change

Also visually impaired people should be able to enjoy the magic of nix.
Orca is part of Gnome.

It builds, some parts run.
The main issue is with gst-python now. I 'd like some help to fix this.

Braille won't be supported until brlapi and liblouis becomes available.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@berce
Copy link
Contributor Author

berce commented Dec 19, 2017

Remark: I reverted from the last unstable release to the last stable release. The sha256 for fetchFromGithub did not need to change. Is that expected?

@jtojnar jtojnar added 2.status: work-in-progress 6.topic: GNOME GNOME desktop environment and its underlying platform 8.has: package (new) labels Dec 20, 2017
@jtojnar
Copy link
Contributor

jtojnar commented Dec 20, 2017

Remark: I reverted from the last unstable release to the last stable release. The sha256 for fetchFromGithub did not need to change. Is that expected?

If you already have something with a certain hash in your nix store, the URL will not get downloaded. You can try using update-source-version orca 3.26.0 or just change a single letter in the hash and try to rebuild.

name = "orca-${version}";
version = "3.26.0";
# Tags in git are in the form of "ORCA_3_27_3"
gittag = concatStrings [ "ORCA_" (stringAsChars (x: if x == "." then "_" else x) version) ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use "ORCA_${builtins.replaceStrings [ "." ] [ "_" ] version}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much nicer indeed.

# export GSTREAMER_CFLAGS=${gst_all_1.gstreamer}/include
# '';

wrapPrefixVariables = [ "PYTHONPATH" "GST_PLUGIN_SYSTEM_PATH_1_0" ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GST_PLUGIN_SYSTEM_PATH_1_0 is already wrapped by default.

for v in $wrapPrefixVariables GST_PLUGIN_SYSTEM_PATH_1_0 GI_TYPELIB_PATH GRL_PLUGIN_PATH; do

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if you use python3Packages.buildPythonApplication, you will not need to wrap PYTHONPATH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildPythonApplication unsuccessfully looks for setup.py.
Orca uses automake.

GST_PLUGIN_SYSTEM_PATH_1_0 was added in an attempt to fix the gst-python issue. Removing it now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for autotools, see the format attribute mentioned above.

@@ -16247,6 +16247,10 @@ with pkgs;

opera = callPackage ../applications/networking/browsers/opera {};

orca = python3Packages.callPackage ../applications/misc/orca {
yelp-tools = gnome3.yelp_tools;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use inherit (gnome3) yelp_tools and use the name with the underscore in the derivation? #32804 will convert it to dash soon and this would then become repetitive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you really want.
My objection: Changing to yelp_tools (and back later) would need edits in several places (3 lines in 2 files). Keeping it as it is, would make the change a oneliner in all-packages.nix, so no need for anyone else to touch orca/default.nix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will replace the underscores in all the files by a script. This would save me manual work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Needs `services.gnoom3.at-spi2-core.enable = true;` in `configuration.nix`.
'';
maintainers = gnome3.maintainers ++ [ berce ];
license = licenses.lgpl2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, nice catch.

Gtk+ toolkit, the Java platform's Swing toolkit, LibreOffice, Gecko, and
WebKitGtk. AT-SPI support for the KDE Qt toolkit is being pursued.

Needs `services.gnoom3.at-spi2-core.enable = true;` in `configuration.nix`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gnoom3gnome3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# Tags in git are in the form of "ORCA_3_27_3"
gittag = concatStrings [ "ORCA_" (stringAsChars (x: if x == "." then "_" else x) version) ];

src = fetchFromGitHub {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GNOME mirror is preferred for GNOME packages:

--- a/pkgs/applications/misc/orca/default.nix
+++ b/pkgs/applications/misc/orca/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, pkgconfig, fetchFromGitHub, pkgs
+{ stdenv, lib, pkgconfig, fetchurl, pkgs
 , autoreconfHook, wrapGAppsHook
 , intltool, yelp-tools, itstool, libxmlxx3
 , python, pygobject3, gtk3
@@ -14,17 +14,15 @@
 
 with lib;
 #pkgs.python3Packages.buildPythonPackage rec {
-stdenv.mkDerivation rec {
-  name = "orca-${version}";
+let
   version = "3.26.0";
-  # Tags in git are in the form of "ORCA_3_27_3"
-  gittag = concatStrings [ "ORCA_" (stringAsChars (x: if x == "." then "_" else x) version) ];
+  majorVersion = builtins.concatStringsSep "." (take 2 (splitString "." version));
+in stdenv.mkDerivation rec {
+  name = "orca-${version}";
 
-  src = fetchFromGitHub {
-    owner = "GNOME";
-    repo = "orca";
-    rev = gittag;
-    sha256 = "0xpg7zgkp0kvcfpsfclrm3ssz4ryryfvk7vzbg8d18bdgw0zdw3b";
+  src = fetchurl {
+    url = "mirror://gnome/sources/orca/${majorVersion}/${name}.tar.xz";
+    sha256 = "0xk5k9cbswymma60nrfj00dl97wypx59c107fb1hwi75gm0i07a7";
   };
 
   # doCheck = true;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, builds, runs.

nativeBuildInputs = [ autoreconfHook wrapGAppsHook pkgconfig libxmlxx3
intltool yelp-tools itstool ];

buildInputs = [ python pygobject3 gtk3 pyatspi dbus-python xkbcomp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the python libraries need to be in propagatedBuildInputs, see https://nixos.org/nixpkgs/manual/#handling-dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the manual is wrong there. I added this to issue #13686.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As vcunat mentions, unfortunately python derivations behave differently than propagatedBuildInputs is intended to be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it builds and runs fine, do you still want me to use the propagetedBuldInputs?

Copy link
Contributor

@jtojnar jtojnar Dec 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, adding PYTHONPATH to wrapPrefixVariables makes it work even without propagating the inputs. Though I would be wary of PYTHONPATH since it is passed to subprocesses, see also #22688. Not sure if it will be problem here, maybe @FRidh could suggest a better solution.

}:

with lib;
#pkgs.python3Packages.buildPythonPackage rec {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Import directly python3Packages instead of using pkgs.
  • buildPythonApplication should be used instead of buildPythonPackage.
  • You need to add format = "other" to be able to build it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took it one step further and imported buildPythonApplication.
format = "other"; did solve the error about not finding setyp.py indeed.


wrapPrefixVariables = [ "PYTHONPATH" "GST_PLUGIN_SYSTEM_PATH_1_0" ];

preInstall = ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Substitution like these are best done in the postPatch phase so they are available in all the subsequent phases (especially checkPhase which is before installPhase).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

@jtojnar
Copy link
Contributor

jtojnar commented Dec 20, 2017

TypeError: Argument 1 does not allow None as a value

Reading this, I somehow managed to guess we are missing gst_all_1.gst-plugins-good.

, intltool, yelp_tools, itstool, libxmlxx3
, python, pygobject3, gtk3, gnome3
, at_spi2_atk, at_spi2_core, pyatspi, dbus, dbus-python, pyxdg
, louis ? null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is that supposed to be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

louis or liblouis is a requirement to support braille, but it doesn't exist yet in nixpkgs (or I couldn't find it). One of the reasons it's WIP.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A TODO comment next to buildInputs is probably a better place to mention it. Arguments for non-existing variables are quite confusing.

sha256 = "0xk5k9cbswymma60nrfj00dl97wypx59c107fb1hwi75gm0i07a7";
};

# doCheck = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be either removed or uncommented?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jtojnar
Copy link
Contributor

jtojnar commented Dec 20, 2017

The code looks fine, however I do not hear any sound from Orca.

@@ -61,7 +61,7 @@ in buildPythonApplication rec {

Needs `services.gnome3.at-spi2-core.enable = true;` in `configuration.nix`.
'';
maintainers = gnome3.maintainers ++ [ maintainters.berce ];
maintainers = gnome3.maintainers ++ [ stdenv.lib.maintainters.berce ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib is already in scope, the issue is a typo maintainTers

@berce
Copy link
Contributor Author

berce commented Dec 20, 2017

No sound here either, but I 'm not in Gnome I was hoping that was the cause. Now the code seems fine, I 'll setup a test environment ... WIP :-)

The Grahamc checks always fail with an error about not finding maintainers. It builds fine on my machine. Any suggestions? How can I make it fail on my system too, for quicker testing?

@jtojnar
Copy link
Contributor

jtojnar commented Dec 20, 2017

meta attributes are not used during build and since Nix is lazy, they are not checked. Orivej recommends nix-env -f . -qa --meta --xml --drv-path >/dev/null for checking the metadata but I find nix-build nixos/release.nix slightly easier to remember.

@jtojnar
Copy link
Contributor

jtojnar commented Dec 20, 2017

From irc://irc.gnome.org#a11y:

youpi jtojnar: first check that spd-say works
youpi if not, no need to deal with orca :)
youpi possibly speech-dispatcher's autolaunch is not working for some reason
youpi if it doesn't speak "screen reader on", it's really a speech-dispatcher issue, not orca

They are right, speechd does not work: env (nix-build -A speechd)/bin/spd-say "testing speechd"

@berce
Copy link
Contributor Author

berce commented Dec 20, 2017

Thank you for all the quick and educative feedback. I 'll try solving the remaining issues and post them back here. I expect it will take some time.

@jtojnar
Copy link
Contributor

jtojnar commented Dec 21, 2017

Apparently, you need to change the speech synthesiser. generic (default?) and cicero do not work, dummy is pretty useless. Pico is the only one that should work, since env $(nix-build -A speechd)/bin/spd-say "Hello word!" -o pico does speak, but Orca does not seem to like this one either. If you build speechd with espeak or flite, that finally works.

@berce
Copy link
Contributor Author

berce commented Dec 21, 2017

I added PR #32924 for a more suited speechd. It's not yet tested with orca.
It makes Orca read out of the box. It defaulds to espeak-ng and takes the language from the user locale.

To try run: orca -s to get the settings dialog that supports screen reading. No other applications on my system seem to support the api. Gnome users might be more lucky.

@jtojnar
Copy link
Contributor

jtojnar commented Dec 25, 2017

I cleaned it up a little, making the optional packages required, adding brltty and liblouis. Hopefully, this is ready to be squashed and merged.

@berce
Copy link
Contributor Author

berce commented Dec 25, 2017

Great work!
Did you succeed testing it without a braille device? There's some instructions to do it on the Orca wiki, but I couldn't pass arguments to brlttyyet.
In the section Troubleshooting at the same page, there's also mentioned that python bindings are often missing. I see no reference to python in our brltty package. An old source mentions pyrex to be a runtime dependency of brltty pythonbindings.

Merry Christmas!

@berce
Copy link
Contributor Author

berce commented Dec 25, 2017

The help button does not work for me. It may be related to not running in a DE.

@jtojnar
Copy link
Contributor

jtojnar commented Dec 26, 2017

I did not really test it. Orca suggests xw driver, which is not built on Nix because it requires some GUI toolkit or something (https://github.com/brltty/brltty/blob/8d0c5c3dc4a22dcc85f5a129e73388375405521e/configure.ac#L1527).

For help, you probably need to have yelp installed.

@jtojnar jtojnar merged commit 866c511 into NixOS:master Jan 2, 2018
GNOME automation moved this from In Progress to Done Jan 2, 2018
@jtojnar
Copy link
Contributor

jtojnar commented Jan 2, 2018

Thanks.

@berce berce deleted the orca branch January 10, 2018 12:59
@jtojnar jtojnar changed the title Orca: [WIP] init 3.26.0 Orca: init 3.26.0 Jan 24, 2018
@jtojnar jtojnar added this to To do in a11y via automation Apr 25, 2018
@jtojnar jtojnar moved this from To do to Done in a11y Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
GNOME
  
Done
a11y
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants