aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2023-01-20 16:09:03 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2023-01-20 19:49:17 +0000
commitde388e576961501429ee507ea3f5e8d4bd27e363 (patch)
treec9873e15da55e514b08872c75d559d9a10953ece
parente905d57f398296e6c3a96037e9bb4d2bc859626d (diff)
downloadports-de388e576961501429ee507ea3f5e8d4bd27e363.tar.gz
ports-de388e576961501429ee507ea3f5e8d4bd27e363.zip
graphics/py-glcontext: New port: Portable OpenGL context for Python
-rw-r--r--graphics/Makefile1
-rw-r--r--graphics/py-glcontext/Makefile31
-rw-r--r--graphics/py-glcontext/distinfo3
-rw-r--r--graphics/py-glcontext/files/patch-glcontext_egl.cpp11
-rw-r--r--graphics/py-glcontext/pkg-descr5
5 files changed, 51 insertions, 0 deletions
diff --git a/graphics/Makefile b/graphics/Makefile
index bb42c7d2230f..d01e41b1d6c0 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -865,6 +865,7 @@
SUBDIR += py-geopandas
SUBDIR += py-giddy
SUBDIR += py-gizeh
+ SUBDIR += py-glcontext
SUBDIR += py-glfw
SUBDIR += py-glooey
SUBDIR += py-gphoto2
diff --git a/graphics/py-glcontext/Makefile b/graphics/py-glcontext/Makefile
new file mode 100644
index 000000000000..a208bdab9399
--- /dev/null
+++ b/graphics/py-glcontext/Makefile
@@ -0,0 +1,31 @@
+PORTNAME= glcontext
+DISTVERSION= 2.3.7
+CATEGORIES= graphics
+#MASTER_SITES= PYPI # no tests
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Portable OpenGL context for Python
+WWW= https://github.com/moderngl/glcontext
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+
+USES= localbase python xorg
+USE_PYTHON= pep517 autoplist pytest
+USE_XORG= x11
+
+USE_GITHUB= yes
+GH_ACCOUNT= moderngl
+
+TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+TEST_WRKSRC= ${WRKSRC}/tests
+
+post-install:
+ @${STRIP_CMD} \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/glcontext/x11${PYTHON_EXT_SUFFIX}.so \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/glcontext/egl${PYTHON_EXT_SUFFIX}.so
+
+.include <bsd.port.mk>
diff --git a/graphics/py-glcontext/distinfo b/graphics/py-glcontext/distinfo
new file mode 100644
index 000000000000..0f875aea5609
--- /dev/null
+++ b/graphics/py-glcontext/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1674242863
+SHA256 (moderngl-glcontext-2.3.7_GH0.tar.gz) = 91f649b1b7db6ebb66ca7c0ec5e032c9abd19975caeefb77c8fe063a401e7fe3
+SIZE (moderngl-glcontext-2.3.7_GH0.tar.gz) = 22254
diff --git a/graphics/py-glcontext/files/patch-glcontext_egl.cpp b/graphics/py-glcontext/files/patch-glcontext_egl.cpp
new file mode 100644
index 000000000000..634ebae65fa7
--- /dev/null
+++ b/graphics/py-glcontext/files/patch-glcontext_egl.cpp
@@ -0,0 +1,11 @@
+--- glcontext/egl.cpp.orig 2023-01-20 19:29:43 UTC
++++ glcontext/egl.cpp
+@@ -216,7 +216,7 @@ GLContext * meth_create_context(PyObject * self, PyObj
+ return NULL;
+ }
+
+- EGLDeviceEXT* devices = malloc(sizeof(EGLDeviceEXT) * num_devices);
++ EGLDeviceEXT* devices = (EGLDeviceEXT*)malloc(sizeof(EGLDeviceEXT) * num_devices);
+ if (!res->m_eglQueryDevicesEXT(num_devices, devices, &num_devices)) {
+ PyErr_Format(PyExc_Exception, "eglQueryDevicesEXT failed (0x%x)", res->m_eglGetError());
+ free(devices);
diff --git a/graphics/py-glcontext/pkg-descr b/graphics/py-glcontext/pkg-descr
new file mode 100644
index 000000000000..814adbaff441
--- /dev/null
+++ b/graphics/py-glcontext/pkg-descr
@@ -0,0 +1,5 @@
+glcontext is a library providing OpenGL implementation for ModernGL on multiple
+platforms:
+* glcontext on github
+* glcontext on pypi
+* ModernGL