Skip to content

Commit a79be2d

Browse files
Build updates - use old glibc in docker image for linux build compatability (#181)
1 parent 60ca9e4 commit a79be2d

File tree

4 files changed

+65
-152
lines changed

4 files changed

+65
-152
lines changed

.cirrus.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
pi_task:
55
arm_container:
66
matrix:
7+
# - image: dtcooper/raspberrypi-os:python3.14-bullseye
8+
- image: dtcooper/raspberrypi-os:python3.13-bullseye
79
- image: dtcooper/raspberrypi-os:python3.12-bullseye
810
- image: dtcooper/raspberrypi-os:python3.11-bullseye
911
- image: dtcooper/raspberrypi-os:python3.10-bullseye
10-
- image: dtcooper/raspberrypi-os:python3.9-bullseye
1112
env:
1213
matrix:
1314
- RAYLIB_PLATFORM: "Desktop"
@@ -76,11 +77,11 @@ mac_task:
7677
MACOSX_DEPLOYMENT_TARGET: "11.0"
7778
matrix:
7879
- env:
79-
PY_VER: "3.9"
80-
RAYLIB_PLATFORM: Desktop
81-
- env:
82-
PY_VER: "3.9"
83-
RAYLIB_PLATFORM: SDL
80+
# PY_VER: "3.14"
81+
# RAYLIB_PLATFORM: Desktop
82+
# - env:
83+
# PY_VER: "3.14"
84+
# RAYLIB_PLATFORM: SDL
8485
- env:
8586
PY_VER: "3.10"
8687
RAYLIB_PLATFORM: Desktop

.github/workflows/build.yml

Lines changed: 51 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: macos-13
1616
strategy:
1717
matrix:
18-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11' ]
18+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14.0-rc.2', 'pypy-3.10', 'pypy-3.11' ]
1919
raylib-platform: ['Desktop', 'SDL']
2020
env:
2121
MACOSX_DEPLOYMENT_TARGET: '10.13'
@@ -31,11 +31,11 @@ jobs:
3131
3232
- name: Build SDL
3333
run: |
34-
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
35-
tar xvfz release-2.30.7.tar.gz
34+
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.32.8.tar.gz
35+
tar xvfz release-2.32.8.tar.gz
3636
mkdir build
3737
cd build
38-
cmake ../SDL-release-2.30.7 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
38+
cmake ../SDL-release-2.32.8 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
3939
cmake --build . --config Release
4040
sudo cmake --install .
4141
@@ -75,11 +75,12 @@ jobs:
7575
- name: Build raylib-python-cffi
7676
env:
7777
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
78+
7879
run: |
7980
python -m pip install --upgrade pip
80-
pip3 install "cffi>=1.17.1"
81-
pip3 install wheel
82-
pip3 install setuptools
81+
pip3 install --upgrade "cffi>=1.17.1"
82+
pip3 install --upgrade wheel
83+
pip3 install --upgrade setuptools
8384
python setup.py bdist_wheel --plat-name macosx_10_13_x86_64
8485
8586
- name: Test
@@ -102,129 +103,35 @@ jobs:
102103
name: wheel-mac-${{ matrix.raylib-platform }}-${{ matrix.python-version }}
103104
path: dist/*
104105

105-
# build-mac-universal:
106-
# runs-on: macos-14
107-
# strategy:
108-
# matrix:
109-
# python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ]
110-
# raylib-platform: ['Desktop', 'SDL']
111-
# env:
112-
# MACOSX_DEPLOYMENT_TARGET: 11.0
113-
# steps:
114-
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
115-
# - uses: actions/checkout@v4
116-
# with:
117-
# submodules: recursive
118-
#
119-
# - name: Build SDL
120-
# run: |
121-
# wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
122-
# tar xvfz release-2.30.7.tar.gz
123-
# mkdir build
124-
# cd build
125-
# cmake ../SDL-release-2.30.7 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
126-
# cmake --build . --config Release
127-
# sudo cmake --install .
128-
#
129-
# - name: Setup Python
130-
# uses: actions/setup-python@v5
131-
# with:
132-
# # Version range or exact version of a Python version to use, using SemVer's version range syntax.
133-
# python-version: ${{ matrix.python-version }}
134-
# architecture: arm64
135-
#
136-
# # Runs a set of commands using the runners shell
137-
# - name: Build raylib without SDL because SDL version has incorrect pkg-config
138-
# run: |
139-
# cd raylib-c
140-
# mkdir build
141-
# cd build
142-
# cmake -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
143-
# make -j2
144-
# sudo make install
145-
#
146-
# - name: Build raylib with SDL if selected
147-
# run: |
148-
# cd raylib-c
149-
# mkdir build2
150-
# cd build2
151-
# cmake -DPLATFORM=${{ matrix.raylib-platform }} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DPLATFORM=SDL -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
152-
# make -j2
153-
# sudo cp raylib/libraylib.a /usr/local/lib/libraylib.a
154-
#
155-
# - name: Copy extras
156-
# run: |
157-
# sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
158-
# sudo cp physac/src/physac.h /usr/local/include/
159-
# sudo cp raygui/src/raygui.h /usr/local/include/
160-
#
161-
# - name: Build raylib-python-cffi
162-
# run: |
163-
# python -m pip install --upgrade pip
164-
# pip3 install "cffi>=1.17.1"
165-
# pip3 install wheel
166-
# pip3 install setuptools
167-
# RAYLIB_PLATFORM=${{ matrix.raylib-platform }} python setup.py bdist_wheel
168-
#
169-
# - name: Upload build Artifact wheel
170-
# uses: actions/upload-artifact@v3.2.1
171-
# with:
172-
# name: wheel
173-
# path: dist/*
174-
175-
#
176-
# # Name defaults to universal2 and it technically is, but we override name to arm64. Why don't we make a working universal2 wheel? Because
177-
# # I'd rather have a separate x86_64 that I can test, and I want it to work on 10_15 but I'm not sure a 'macosx_10_15_universal2' is valid
178-
# # given that there is no SDK for universal until macosx_11_0
179-
# - name: Build raylib-python-cffi
180-
# run: |
181-
# python -m pip install --upgrade pip
182-
# pip3 install cffi
183-
# pip3 install wheel
184-
# python setup.py bdist_wheel --plat-name macosx_12_0_arm64
185-
186106

187107

188108
build-linux:
189-
runs-on: ubuntu-22.04
109+
runs-on: ubuntu-latest
110+
container:
111+
image: electronstudio/ubuntu16-modern:latest
112+
options: --user root
113+
volumes:
114+
# override /__e/node20 because GitHub Actions uses a version that requires too-recent glibc
115+
- /tmp:/__e/node20
190116
strategy:
191117
# You can use PyPy versions in python-version.
192118
# For example, pypy2 and pypy3
193119
matrix:
194-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11' ]
120+
python-version: ['python3.10', 'python3.11', 'python3.12', 'python3.13', 'pypy3.10', 'pypy3.11']
195121
raylib-platform: ['Desktop', 'SDL', 'DRM']
196122
steps:
197-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
198-
- uses: actions/checkout@v4
123+
- name: fix node
124+
run: |
125+
ln -s /usr/local/bin /__e/node20/bin
126+
127+
- uses: actions/checkout@v2
199128
with:
200129
submodules: recursive
201130

202131
- name: fix raygui bug
203132
run: |
204133
patch -p0 <raygui.h.diff
205134
206-
- name: Setup Python
207-
uses: actions/setup-python@v5
208-
with:
209-
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
210-
python-version: ${{ matrix.python-version }}
211-
# The target architecture (x86, x64) of the Python interpreter.
212-
architecture: x64
213-
214-
- name: install prereqs
215-
run: |
216-
sudo apt update
217-
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libwayland-dev libxkbcommon-dev
218-
- name: Build SDL
219-
run: |
220-
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
221-
tar xvfz release-2.30.7.tar.gz
222-
mkdir build
223-
cd build
224-
cmake ../SDL-release-2.30.7 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
225-
cmake --build . --config Release
226-
sudo cmake --install .
227-
228135
# Runs a set of commands using the runners shell
229136
- name: Build raylib
230137
run: |
@@ -233,26 +140,28 @@ jobs:
233140
cd build
234141
cmake -DPLATFORM=${{ matrix.raylib-platform }} -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release -DOpenGL_GL_PREFERENCE=GLVND ..
235142
make -j2
236-
sudo make install
143+
make install
237144
- name: Copy extras
238145
run: |
239-
sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
240-
sudo cp physac/src/physac.h /usr/local/include/
241-
sudo cp raygui/src/raygui.h /usr/local/include/
146+
cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
147+
cp physac/src/physac.h /usr/local/include/
148+
cp raygui/src/raygui.h /usr/local/include/
242149
- name: Build raylib-python-cffi
243150
env:
244151
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
152+
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
245153
run: |
246-
python -m pip install --upgrade pip
247-
pip3 install "cffi>=1.17.1"
248-
pip3 install wheel
249-
pip3 install setuptools
250-
python setup.py bdist_wheel --plat-name manylinux2014_x86_64
154+
${{ matrix.python-version }} -m pip install --upgrade pip
155+
${{ matrix.python-version }} -m pip install --upgrade "cffi>=1.17.1"
156+
${{ matrix.python-version }} -m pip install --upgrade wheel
157+
${{ matrix.python-version }} -m pip install --upgrade setuptools
158+
${{ matrix.python-version }} setup.py bdist_wheel --plat-name manylinux2014_x86_64
159+
shell: bash
251160
- name: Test
252161
run: |
253-
pip3 install dist/*.whl
162+
${{ matrix.python-version }} -m pip install dist/*.whl
254163
cd /
255-
python3 -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
164+
${{ matrix.python-version }} -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
256165
cat /tmp/output
257166
if grep -q "INFO: Initializing raylib" /tmp/output; then
258167
echo "Passed"
@@ -261,7 +170,7 @@ jobs:
261170
echo "Failed"
262171
exit 1
263172
fi
264-
173+
265174
266175
- name: Upload build Artifact wheel
267176
uses: actions/upload-artifact@v4
@@ -270,26 +179,20 @@ jobs:
270179
path: dist/*
271180

272181

273-
274-
275182
build-windows:
276183
# The type of runner that the job will run on
277-
runs-on: windows-2019
184+
runs-on: windows-2022
278185
strategy:
279186
# You can use PyPy versions in python-version.
280187
# For example, pypy2 and pypy3
281188
matrix:
282-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11' ]
189+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14.0-rc.2', 'pypy-3.10', 'pypy-3.11' ]
283190
raylib-platform: ['Desktop', 'SDL']
284191
steps:
285192
- uses: actions/checkout@v4
286193
with:
287194
submodules: recursive
288195

289-
- name: fix raygui bug
290-
run: |
291-
patch -p0 <raygui.h.diff
292-
293196
- name: Download SDL2
294197
run: curl -L -o SDL2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.30.8/SDL2-devel-2.30.8-VC.zip
295198

@@ -313,6 +216,11 @@ jobs:
313216
- name: Add msbuild to PATH
314217
uses: microsoft/setup-msbuild@v2
315218

219+
- name: fix raygui bug
220+
run: |
221+
patch -p0 <raygui.h.diff
222+
shell: cmd
223+
316224
- name: Build raylib
317225
run: |
318226
cd raylib-c
@@ -331,9 +239,9 @@ jobs:
331239
copy ${{ runner.temp }}\SDL2\lib\x64\SDL2.lib .
332240
copy ${{ runner.temp }}\SDL2\lib\x64\SDL2.dll raylib\
333241
python -m pip install --upgrade pip
334-
pip3 install "cffi>=1.17.1"
335-
pip3 install wheel
336-
pip3 install setuptools
242+
pip3 install --upgrade "cffi>=1.17.1"
243+
pip3 install --upgrade wheel
244+
pip3 install --upgrade setuptools
337245
del raylib\dynamic\*.so* >nul 2>&1
338246
del raylib\dynamic\*.dll >nul 2>&1
339247
del raylib\dynamic\*.dylib >nul 2>&1
@@ -402,9 +310,9 @@ jobs:
402310
- name: Build raylib-python-cffi
403311
run: |
404312
python -m pip install --upgrade pip
405-
pip3 install "cffi>=1.17.1"
406-
pip3 install wheel
407-
pip3 install setuptools
313+
pip3 install --upgrade "cffi>=1.17.1"
314+
pip3 install --upgrade wheel
315+
pip3 install --upgrade setuptools
408316
python setup.py sdist
409317
410318
- name: Upload build Artifact wheel
@@ -437,9 +345,9 @@ jobs:
437345
- name: Build raylib-python-cffi-dynamic
438346
run: |
439347
python -m pip install --upgrade pip
440-
pip3 install "cffi>=1.17.1"
441-
pip3 install wheel
442-
pip3 install setuptools
348+
pip3 install --upgrade "cffi>=1.17.1"
349+
pip3 install --upgrade wheel
350+
pip3 install --upgrade setuptools
443351
cd dynamic
444352
python setup.py sdist
445353

raylib/build.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@
3333
RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "Desktop")
3434

3535
def check_raylib_installed():
36-
return subprocess.run(['pkg-config', '--exists', 'raylib'], text=True, stdout=subprocess.PIPE).returncode == 0
36+
# this should be 'pkg-config --exists raylib' but result is non-deterministic on old versions of pkg-config!
37+
return subprocess.run(['pkg-config', '--libs', 'raylib'], text=True, stdout=subprocess.PIPE).returncode == 0
3738

3839
def check_SDL_installed():
39-
return subprocess.run(['pkg-config', '--exists', 'sdl2'], text=True, stdout=subprocess.PIPE).returncode == 0
40+
# this should be 'pkg-config --exists sdl2' but result is non-deterministic on old versions of pkg-config!
41+
return subprocess.run(['pkg-config', '--libs', 'sdl2'], text=True, stdout=subprocess.PIPE).returncode == 0
4042

4143
def get_the_include_path():
4244
return subprocess.run(['pkg-config', '--variable=includedir', 'raylib'], text=True,
@@ -110,9 +112,11 @@ def check_header_exists(file):
110112

111113
def build_unix():
112114
if not check_raylib_installed():
115+
print("PKG_CONFIG_PATH is set to: "+os.getenv("PKG_CONFIG_PATH"))
113116
raise Exception("ERROR: raylib not found by pkg-config. Please install pkg-config and Raylib.")
114117

115118
if RAYLIB_PLATFORM=="SDL" and not check_SDL_installed():
119+
print("PKG_CONFIG_PATH is set to: "+os.getenv("PKG_CONFIG_PATH"))
116120
raise Exception("ERROR: SDL2 not found by pkg-config. Please install pkg-config and SDL2.")
117121

118122
raylib_h = get_the_include_path() + "/raylib.h"

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "5.5.0.2"
1+
__version__ = "5.5.0.3"

0 commit comments

Comments
 (0)