pythonPackages.glfw: init at 2.2.0

This commit is contained in:
Nguyễn Gia Phong 2021-09-10 16:22:52 +07:00
parent 870959c7fb
commit 3e10c97c85
No known key found for this signature in database
GPG Key ID: 27148B2C06A2224B
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

@ -2951,6 +2951,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 { };