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

python.pkgs.pyglet: Fix missing libraries #70967

Closed
wants to merge 1 commit into from

Conversation

talanis85
Copy link
Contributor

Add the paths for Xext, fontconfig and freetype to the hardcoded library
paths in load_library.

Motivation for this change

Pyglet currently throws an exception if one of these libs cannot be found by load_library(). fontconfig and freetype seem to be missing at least since 446ac90. The Xext dependency was introduced by 24c9137.

Things done

Modified postPatch to make load_library find these three libraries.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Add the paths for Xext, fontconfig and freetype to the hardcoded library
paths in load_library.
@iimog
Copy link
Member

iimog commented Oct 31, 2019

I can confirm that this commit fixes an issue with pyglet that prevented gym (see demo) from working. On current master I get this error message:

Traceback (most recent call last):
  File "simple.py", line 5, in <module>
    env.render()
  File "/nix/store/m09msp90g7xf1rxk8df6azl37lk34pmz-python3.7-gym-0.15.3/lib/python3.7/site-packages/gym/core.py", line 233, in render
    return self.env.render(mode, **kwargs)
  File "/nix/store/m09msp90g7xf1rxk8df6azl37lk34pmz-python3.7-gym-0.15.3/lib/python3.7/site-packages/gym/envs/classic_control/cartpole.py", line 150, in render
    from gym.envs.classic_control import rendering
  File "/nix/store/m09msp90g7xf1rxk8df6azl37lk34pmz-python3.7-gym-0.15.3/lib/python3.7/site-packages/gym/envs/classic_control/rendering.py", line 27, in <module>
    from pyglet.gl import *
  File "/nix/store/slipi43p97wjjf2ni43c3shs3phfrzb6-python3.7-pyglet-1.4.2/lib/python3.7/site-packages/pyglet/gl/__init__.py", line 237, in <module>
    import pyglet.window
  File "/nix/store/slipi43p97wjjf2ni43c3shs3phfrzb6-python3.7-pyglet-1.4.2/lib/python3.7/site-packages/pyglet/window/__init__.py", line 1883, in <module>
    from pyglet.window.xlib import XlibWindow as Window
  File "/nix/store/slipi43p97wjjf2ni43c3shs3phfrzb6-python3.7-pyglet-1.4.2/lib/python3.7/site-packages/pyglet/window/xlib/__init__.py", line 62, in <module>
    from pyglet.libs.x11 import xsync
  File "/nix/store/slipi43p97wjjf2ni43c3shs3phfrzb6-python3.7-pyglet-1.4.2/lib/python3.7/site-packages/pyglet/libs/x11/xsync.py", line 52, in <module>
    _lib = pyglet.lib.load_library('Xext')
  File "/nix/store/slipi43p97wjjf2ni43c3shs3phfrzb6-python3.7-pyglet-1.4.2/lib/python3.7/site-packages/pyglet/lib.py", line 19, in load_library
    raise Exception("Could not load library {}".format(names))
Exception: Could not load library ('Xext',)

It works without any issues when applying this fix. I also did not experience any other issues and the changes look good to me.

@iimog
Copy link
Member

iimog commented Nov 5, 2019

@FRidh is there anything that I can do to help you with the review of this pr?

@FRidh
Copy link
Member

FRidh commented Nov 5, 2019

Thanks. I've pushed fa2909b.

@FRidh FRidh closed this Nov 5, 2019
@FRidh
Copy link
Member

FRidh commented Nov 5, 2019

backported to 19.09 in 5e0ad55

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

4 participants