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

pyopengl: fix runtime shared library loading failure with 3.1.4 #79154

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkgs/development/python-modules/pyopengl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,25 @@ buildPythonPackage rec {

patchPhase = let
ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
# Theses lines are patching the name of dynamic libraries
# so pyopengl can find them at runtime.
substituteInPlace OpenGL/platform/glx.py \
--replace "'GL'" "'${pkgs.libGL}/lib/libGL${ext}'" \
--replace "'GLU'" "'${pkgs.libGLU}/lib/libGLU${ext}'" \
--replace "'glut'" "'${pkgs.freeglut}/lib/libglut${ext}'"
substituteInPlace OpenGL/platform/darwin.py \
--replace "'OpenGL'" "'${pkgs.libGL}/lib/libGL${ext}'" \
--replace "'GLUT'" "'${pkgs.freeglut}/lib/libglut${ext}'"

# https://github.com/NixOS/nixpkgs/issues/76822
# pyopengl introduced a new "robust" way of loading libraries in 3.1.4.
# The later patch of the filepath does not work anymore because
# pyopengl takes the "name" (for us: the path) and tries to add a
# few suffix during its loading phase.
# The following patch put back the "name" (i.e. the path) in the
# list of possible files.
substituteInPlace OpenGL/platform/ctypesloader.py \
--replace "filenames_to_try = []" "filenames_to_try = [name]"
'';

# Need to fix test runner
Expand Down