Skip to content

Commit

Permalink
v3.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
cgohlke committed Oct 28, 2024
1 parent 1d087bf commit c933c44
Show file tree
Hide file tree
Showing 8 changed files with 412 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.diff binary
92 changes: 92 additions & 0 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build PyOpenGL wheels for Windows

on:
workflow_dispatch:

env:
PYOPENGL_VER: release-3.1.8
FREEGLUT_VER: v3.6.0
GLE_VER: 3.1.0
PIP_NO_VERIFY: 0
PIP_VERBOSE: 1
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT_WINDOWS: "PIP_NO_BUILD_ISOLATION=false"
CIBW_BEFORE_BUILD: pip install -U setuptools wheel numpy Cython
# CIBW_TEST_REQUIRES:
# CIBW_TEST_COMMAND:
# CIBW_TEST_SKIP: "*win32 cp313*"
CIBW_SKIP: "pp* cp36* cp37* cp38*"
MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT: 1

jobs:
build_amd64:
name: Build AMD64 wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
env:
VS_PLATFORM: x64
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- run: download.cmd
shell: cmd
- run: build.cmd
shell: cmd
- name: Move PyOpenGL package
run: mv pyopengl-${{env.PYOPENGL_VER}}/* ./
- uses: pypa/[email protected]
env:
CIBW_ARCHS_WINDOWS: AMD64
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: wheels-win-amd64
build_x86:
name: Build x86 wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
env:
VS_PLATFORM: Win32
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86
- run: download.cmd
shell: cmd
- run: build.cmd
shell: cmd
- name: Move PyOpenGL package
run: mv pyopengl-${{env.PYOPENGL_VER}}/* ./
- uses: pypa/[email protected]
env:
CIBW_ARCHS_WINDOWS: x86
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: wheels-win32
build_accelerate:
name: Build accelerate wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
steps:
- uses: actions/checkout@v4
- run: download.cmd
shell: cmd
- name: Move PyOpenGL-accelerate package
run: mv pyopengl-${{env.PYOPENGL_VER}}/accelerate/* ./
- uses: pypa/[email protected]
env:
CIBW_ARCHS_WINDOWS: AMD64 x86
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: wheels-accelerate
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_/
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# pyopengl-build
Build PyOpenGL wheels for Windows

Build [PyOpenGL](https://github.com/mcfletch/pyopengl) wheels for Windows with [freeglut](https://github.com/freeglut/freeglut) and [GLE](https://sourceforge.net/projects/gle/) DLLs using [GitHub Actions](https://github.com/cgohlke/pyopengl-build/actions/workflows/wheel.yml).

The wheels can be downloaded from the [Releases](https://github.com/cgohlke/pyopengl-build/releases) page.

Install the wheels on the command line, for example for Python 3.13 64-bit:

py.exe -3.13 -m pip install PyOpenGL-3.1.8-cp313-cp313-win_amd64.whl
py.exe -3.13 -m pip install PyOpenGL_accelerate-3.1.8-cp313-cp313-win_amd64.whl
91 changes: 91 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
:: Download and build FreeGLUT and GLE
:: Requires download.cmd run before

@echo on
setlocal

:: set PYOPENGL_VER=release-3.1.8
:: set FREEGLUT_VER=v3.6.0
:: set GLE_VER=3.1.0

set PYOPENGL_DIR=pyopengl-%PYOPENGL_VER%
set FREEGLUT_DIR=freeglut-%FREEGLUT_VER%
set GLE_DIR=gle-%GLE_VER%

:: GLE32
setlocal

curl -L -o gle-%GLE_VER%.tar.gz https://sourceforge.net/projects/gle/files/gle/gle-%GLE_VER%/gle-%GLE_VER%.tar.gz
if errorlevel 1 exit /B 1

tar -xf gle-%GLE_VER%.tar.gz
if errorlevel 1 exit /B 1

git apply -p1 --verbose --directory=%GLE_DIR% gle.diff
if errorlevel 1 exit /B 1

cd %GLE_DIR%\src

cl.exe -I. -I.. ^
ex_alpha.c ^
ex_angle.c ^
ex_cut_round.c ^
ex_raw.c ^
extrude.c ^
intersect.c ^
qmesh.c ^
rot_prince.c ^
rotate.c ^
round_cap.c ^
segment.c ^
texgen.c ^
urotate.c ^
view.c ^
/D WIN32 /D NDEBUG /D _WINDOWS /D _USRDLL /D _WINDLL /D _UNICODE /D UNICODE ^
/link /DLL /DEF:..\gle.def /IMPLIB:gle32.lib /out:gle32.dll glu32.lib opengl32.lib
if errorlevel 1 exit /B 1

copy /Y /B gle32.dll ..\..\%PYOPENGL_DIR%\OpenGL\DLLS\gle32.dll
if errorlevel 1 echo Build failed! && exit /B 1

cd ..
cd ..

endlocal

:: FreeGLUT
setlocal

set CMAKE_GENERATOR=NMake Makefiles
set CMAKE_BUILD_TYPE=Release
set CMAKE_CONFIGURATION_TYPES=Release
set CMAKE_SKIP_RPATH=ON
set CMAKE_VERBOSE_MAKEFILE=ON
set CMAKE_RULE_MESSAGES=OFF
set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON

git.exe clone -c advice.detachedHead=false --depth 1 --recurse-submodules --branch %FREEGLUT_VER% https://github.com/FreeGLUTProject/freeglut %FREEGLUT_DIR%
if errorlevel 1 exit /B 1

:: git apply -p1 --verbose --directory=%FREEGLUT_DIR% freeglut.diff
:: if errorlevel 1 exit /B 1

cd %FREEGLUT_DIR%

cmake.exe -DCMAKE_INSTALL_PREFIX=_release
if errorlevel 1 exit /B 1

nmake.exe /nologo all
if errorlevel 1 exit /B 1

nmake.exe /nologo install
if errorlevel 1 exit /B 1

copy /B _release\bin\*.dll ..\%PYOPENGL_DIR%\OpenGL\DLLS\
if errorlevel 1 exit /B 1

cd ..

endlocal

endlocal
24 changes: 24 additions & 0 deletions download.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
:: Download PyOpenGL

@echo on
setlocal

:: set PYOPENGL_VER=release-3.1.8
set PYOPENGL_DIR=pyopengl-%PYOPENGL_VER%

curl -L -o %PYOPENGL_VER%.tar.gz https://github.com/mcfletch/pyopengl/archive/refs/tags/%PYOPENGL_VER%.tar.gz
if errorlevel 1 exit /B 1

tar -xf %PYOPENGL_VER%.tar.gz
if errorlevel 1 exit /B 1

:: https://stackoverflow.com/questions/24821431
git apply -p1 --verbose --directory=%PYOPENGL_DIR% pyopengl.diff
if errorlevel 1 exit /B 1

rd /S /Q %PYOPENGL_DIR%\.github
del %PYOPENGL_DIR%\.gitignore
del /S %PYOPENGL_DIR%\OpenGL\DLLS\*.dll
del /S %PYOPENGL_DIR%\accelerate\src\*.c

endlocal
83 changes: 83 additions & 0 deletions gle.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..4964ed4
--- /dev/null
+++ b/config.h
@@ -0,0 +1,37 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS
+
+/* Define if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
+
+/* Standard C headers present */
+#undef STDC_HEADERS
+
+/* Build for OpenGL by default, and not for old IrisGL aka GL 3.2 */
+#define OPENGL_10 1
+#undef GL_32
+
+/* Disable debugging stuff (debugging replaces GL output with printfs) */
+#undef DEBUG_OUTPUT
+
+/* Do we have a lenient tesselator? */
+#undef LENIENT_TESSELATOR
+#define DELICATE_TESSELATOR 1
+
+/* Enable texture mapping by default. */
+#define AUTO_TEXTURE 1
+
+/* Define if you have the memcpy function. */
+#define HAVE_MEMCPY
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
diff --git a/gle.def b/gle.def
new file mode 100644
index 0000000..49a2d9b
--- /dev/null
+++ b/gle.def
@@ -0,0 +1,33 @@
+;
+
+LIBRARY GLE32
+DESCRIPTION "GLE OpenGL Extrusion library"
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD MOVEABLE MULTIPLE
+
+EXPORTS
+ gleExtrusion
+ gleGetJoinStyle
+ gleGetNumSides
+ gleHelicoid
+ gleLathe
+ glePolyCone
+ glePolyCylinder
+ gleScrew
+ gleSetJoinStyle
+ gleSetNumSides
+ gleSpiral
+ gleSuperExtrusion
+ gleTextureMode
+ gleToroid
+ gleTwistExtrusion
+ rot_about_axis
+ rot_axis
+ rot_omega
+ rot_prince
+ urot_about_axis
+ urot_axis
+ urot_omega
+ urot_prince
+ uview_direction
+ uviewpoint
\ No newline at end of file
Loading

0 comments on commit c933c44

Please sign in to comment.