Merge pull request #137256 from McSinyx/pyGLFW

pythonPackages.glfw: init at 2.2.0
This commit is contained in:
Sandro 2021-09-10 19:47:53 +02:00 committed by GitHub
commit bcefe732ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,31 @@
{ lib, buildPythonPackage, fetchFromGitHub, glfw3 }:
buildPythonPackage rec {
pname = "glfw";
version = "2.2.0";
src = fetchFromGitHub {
owner = "FlorianRhiem";
repo = "pyGLFW";
rev = "v${version}";
sha256 = "1ygcwnh0x07yi87wkxykw566g74vfi8n0w2rzypidhdss14x3pvf";
};
# Patch path to GLFW shared object
patches = [ ./search-path.patch ];
postPatch = ''
substituteInPlace glfw/library.py --replace "@GLFW@" '${glfw3}/lib'
'';
propagatedBuildInputs = [ glfw3 ];
# Project has no tests
doCheck = false;
pythonImportsCheck = [ "glfw" ];
meta = with lib; {
description = "Python bindings for GLFW";
homepage = "https://github.com/FlorianRhiem/pyGLFW";
license = licenses.mit;
maintainers = [ maintainers.McSinyx ];
};
}

View File

@ -0,0 +1,11 @@
diff --git a/glfw/library.py b/glfw/library.py
index 20387e1..9bdd62a 100644
--- a/glfw/library.py
+++ b/glfw/library.py
@@ -189,5 +189,4 @@ elif sys.platform == 'win32':
except OSError:
pass
else:
- glfw = _load_library(['glfw', 'glfw3'], ['.so', '.dylib'],
- _get_library_search_paths(), _glfw_get_version)
+ glfw = _load_library(['glfw', 'glfw3'], ['.so', '.dylib'], ['@GLFW@'], _glfw_get_version)

View File

@ -2961,6 +2961,8 @@ in {
glcontext = callPackage ../development/python-modules/glcontext { };
glfw = callPackage ../development/python-modules/glfw { };
glob2 = callPackage ../development/python-modules/glob2 { };
globre = callPackage ../development/python-modules/globre { };