From 446ac90e055b40a38cda81987e4170d5b281b574 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Tue, 28 May 2019 13:44:29 +0200 Subject: [PATCH 1/2] python.pkgs.pyglet: hardcode library paths Fixes failure to find certain libraries such as libc. --- .../python-modules/pyglet/default.nix | 58 ++++++++++++++++--- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/pyglet/default.nix b/pkgs/development/python-modules/pyglet/default.nix index 4bc1cd0608c5..1b00e1264ffc 100644 --- a/pkgs/development/python-modules/pyglet/default.nix +++ b/pkgs/development/python-modules/pyglet/default.nix @@ -1,5 +1,14 @@ -{ stdenv, buildPythonPackage, fetchPypi -, libGLU_combined, xorg, freetype, fontconfig, future}: +{ stdenv +, buildPythonPackage +, fetchPypi +, libGLU_combined +, xorg +, future +, pytest +, glibc +, gtk2-x11 +, gdk_pixbuf +}: buildPythonPackage rec { version = "1.3.2"; @@ -10,15 +19,50 @@ buildPythonPackage rec { sha256 = "b00570e7cdf6971af8953b6ece50d83d13272afa5d1f1197c58c0f478dd17743"; }; + # find_library doesn't reliably work with nix (https://github.com/NixOS/nixpkgs/issues/7307). + # Even naively searching `LD_LIBRARY_PATH` won't work since `libc.so` is a linker script and + # ctypes.cdll.LoadLibrary cannot deal with those. Therefore, just hardcode the paths to the + # necessary libraries. postPatch = let - libs = [ libGLU_combined xorg.libX11 freetype fontconfig ]; - paths = builtins.concatStringsSep "," (map (l: "\"${l}/lib\"") libs); - in "sed -i -e 's|directories\.extend.*lib[^]]*|&,${paths}|' pyglet/lib.py"; - - doCheck = false; + ext = stdenv.hostPlatform.extensions.sharedLibrary; + in '' + cat > pyglet/lib.py < Date: Tue, 28 May 2019 14:00:17 +0200 Subject: [PATCH 2/2] python.pkgs.roboschool: disable for python2 This has never worked. --- pkgs/development/python-modules/roboschool/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/roboschool/default.nix b/pkgs/development/python-modules/roboschool/default.nix index 8aa45966bd20..a86e17e921b6 100644 --- a/pkgs/development/python-modules/roboschool/default.nix +++ b/pkgs/development/python-modules/roboschool/default.nix @@ -1,5 +1,6 @@ { lib , buildPythonPackage +, isPy3k , python , fetchFromGitHub , fetchpatch @@ -23,6 +24,9 @@ buildPythonPackage rec { sha256 = "1s7rp5bbiglnrfm33wf7x7kqj0ks3b21bqyz18c5g6vx39rxbrmh"; }; + # fails to find boost_python for some reason + disabled = !isPy3k; + propagatedBuildInputs = [ gym ];