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

anki: use wrapQtAppsHook to fix execution #66796

Merged
merged 4 commits into from Aug 26, 2019
Merged

Conversation

oxij
Copy link
Member

@oxij oxij commented Aug 17, 2019

What?

At the moment running anki fails with

qt: Could not find the Qt platform plugin "xcb" in ""
qt: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

This PR fixes it, properly, by inheriting the hook from the pyqtwebengine so that QT versions match.

Why?

The use of wrapQtAppsHook is now required for Qt apps. See #65399 for more info.

git log

  • pyqtwebengine: passthru wrapQtAppsHook

  • anki: use wrapQtAppsHook from pyqtwebengine

  • anki: add myself as a maintainer

    (Adding to the front of the list because it was I who added this expression to
    nixpkgs in e00c031 7 years ago. :])

nix-instantiate environment

  • Host OS: Linux 4.9, SLNOS 19.09
  • Nix: nix-env (Nix) 2.2.2
  • Multi-user: yes
  • Sandbox: yes
  • NIXPKGS_CONFIG:
{
  checkMeta = true;
  doCheckByDefault = true;
}

nix-env -qaP diffs

  • On x86_64-linux:
    • Updated (1):
      • anki
  • On aarch64-linux: noop
  • On x86_64-darwin:
    • Updated (1):
      • anki

/cc @Profpatsch @asymmetric @ttuegel

(Adding to the front of the list because it was I who added this expression to
nixpkgs in e00c031 7 years ago. :])
@oxij
Copy link
Member Author

oxij commented Aug 17, 2019 via email

@oxij
Copy link
Member Author

oxij commented Aug 17, 2019 via email

@flokli
Copy link
Contributor

flokli commented Aug 17, 2019 via email

@@ -158,6 +161,9 @@ buildPythonApplication rec {
cp -rv anki aqt web $pp/

wrapPythonPrograms
for program in $out/bin/*; do
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have to do wrapPythonPrograms in buildPythonApplication? I thought that'd happen automatically.

Also by doing this we get two wrappers, maybe give makeWrapperArgs "\${qtWrapperArgs[@]}"?

@asymmetric
Copy link
Contributor

From a quick run, this works as expected.

@symphorien
Copy link
Member

symphorien commented Aug 18, 2019

I think "keeping the version of qt in qtwebengine and anki in sync" is the job of libsForQt5.callPackage.

@oxij
Copy link
Member Author

oxij commented Aug 18, 2019 via email

# copy the manual into $doc
cp -r ${manual}/share/doc/anki/html $doc/share/doc/anki
'';

dontWrapQtApps = true;
makeWrapperArgs = [
''--prefix PATH ':' "${lame}/bin:${mplayer}/bin"''
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use the same string type for both array elements?

Suggested change
''--prefix PATH ':' "${lame}/bin:${mplayer}/bin"''
"--prefix PATH ':' ${lame}/bin:${mplayer}/bin"

@worldofpeace
Copy link
Contributor

@oxij How about calling anki with libsForQt5.callPackage instead of python3Packages?
You'd then have to use python3Packages directly in the expression, but you wouldn't have to use a passthru attribute in pyqtwebengine

@oxij
Copy link
Member Author

oxij commented Aug 19, 2019 via email

@ttuegel
Copy link
Member

ttuegel commented Aug 20, 2019

I would rather not do that either until anki needs a lot, A LOT, of that passthru stuff.

I agree that the passthru attribute is probably the least-bad way to handle a one-off problem like this. My only reservation is that someone finds this example first and thinks it's the preferred solution, and then it proliferates. @oxij would you add a comment where the passthru is added that says something like, "this is a one-off solution for anki", so that it makes sense to someone looking at it out of context? Then I am happy to merge.

@flokli
Copy link
Contributor

flokli commented Aug 20, 2019

@ttuegel isn't that the preferred/only solution for all python applications using some qt bindings in one way or another? In that case, it probably should be added to the documentation…

@ttuegel
Copy link
Member

ttuegel commented Aug 22, 2019

@flokli If every Python package is going to start using this, then no: it is not the preferred solution and we need to actually solve the problem.

@oxij
Copy link
Member Author

oxij commented Aug 23, 2019 via email

@timokau
Copy link
Member

timokau commented Aug 25, 2019

Can we merge this now? I have no opinion on the meta discussion, but for now it would be nice to have anki working on unstable again.

@timokau
Copy link
Member

timokau commented Aug 26, 2019

Given that it has been a few days without new discussion and this PR is a definite improvement for now, I'll merge. Thanks @oxij for taking care of this!

@timokau timokau merged commit 09cc908 into NixOS:master Aug 26, 2019
@Profpatsch
Copy link
Member

Great, thanks @oxij

@puzzlewolf puzzlewolf mentioned this pull request Jan 3, 2020
10 tasks
@oxij oxij deleted the pkgs/fix-anki branch August 12, 2023 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants