This commit is contained in:
Richard Smith 2024-10-15 20:29:41 +01:00
parent 7e2da775ae
commit 10692d5168
2 changed files with 53 additions and 136 deletions

View file

@ -80,106 +80,76 @@ jobs:
name: wheel name: wheel
path: dist/* path: dist/*
build-mac-universal: # build-mac-universal:
runs-on: macos-14 # runs-on: macos-14
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ]
raylib-platform: ['Desktop', 'SDL']
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build SDL
run: |
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
tar xvfz release-2.30.7.tar.gz
mkdir build
cd build
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
cmake --build . --config Release
sudo cmake --install .
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: ${{ matrix.python-version }}
architecture: arm64
# Runs a set of commands using the runners shell
- name: Build raylib without SDL because SDL version has incorrect pkg-config
run: |
cd raylib-c
mkdir build
cd build
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 ..
make -j2
sudo make install
- name: Build raylib with SDL if selected
run: |
cd raylib-c
mkdir build2
cd build2
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 ..
make -j2
sudo cp raylib/libraylib.a /usr/local/lib/libraylib.a
- name: Copy extras
run: |
sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
sudo cp physac/src/physac.h /usr/local/include/
sudo cp raygui/src/raygui.h /usr/local/include/
- name: Build raylib-python-cffi
run: |
python -m pip install --upgrade pip
pip3 install "cffi>=1.17.1"
pip3 install wheel
pip3 install setuptools
RAYLIB_PLATFORM=${{ matrix.raylib-platform }} python setup.py bdist_wheel
- name: Upload build Artifact wheel
uses: actions/upload-artifact@v3.2.1
with:
name: wheel
path: dist/*
# build-mac12-arm64:
# runs-on: macos-12
# strategy: # strategy:
# matrix: # matrix:
# python-version: ['3.10', '3.11.0-alpha - 3.11.0' ] # python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ]
# # Requires universal2 build of python, which we get if we ask for 3.10.5 x86! Pypy not available in universal2 # raylib-platform: ['Desktop', 'SDL']
# env:
# MACOSX_DEPLOYMENT_TARGET: 11.0
# steps: # steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v2 # - uses: actions/checkout@v2
# with: # with:
# submodules: recursive # submodules: recursive
# #
# - name: Build SDL
# run: |
# wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
# tar xvfz release-2.30.7.tar.gz
# mkdir build
# cd build
# 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
# cmake --build . --config Release
# sudo cmake --install .
#
# - name: Setup Python # - name: Setup Python
# uses: actions/setup-python@v2.2.2 # uses: actions/setup-python@v2.2.2
# with: # with:
# # Version range or exact version of a Python version to use, using SemVer's version range syntax.
# python-version: ${{ matrix.python-version }} # python-version: ${{ matrix.python-version }}
# architecture: x64 # architecture: arm64
# #
# # Only build raylib for arm64 (although we could make a fat universal2 binary by asking for x86_64 as well) # # Runs a set of commands using the runners shell
# - name: Build raylib # - name: Build raylib without SDL because SDL version has incorrect pkg-config
# run: | # run: |
# cd raylib-c # cd raylib-c
# mkdir build # mkdir build
# cd build # cd build
# cmake -DBUILD_EXAMPLES=off -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release .. # 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 ..
# make -j2 # make -j2
# sudo make install # sudo make install
#
# - name: Build raylib with SDL if selected
# run: |
# cd raylib-c
# mkdir build2
# cd build2
# 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 ..
# make -j2
# sudo cp raylib/libraylib.a /usr/local/lib/libraylib.a
#
# - name: Copy extras # - name: Copy extras
# run: | # run: |
# sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
# sudo cp physac/src/physac.h /usr/local/include/ # sudo cp physac/src/physac.h /usr/local/include/
# sudo cp raygui/src/raygui.h /usr/local/include/ # sudo cp raygui/src/raygui.h /usr/local/include/
#
# - name: Build raylib-python-cffi
# run: |
# python -m pip install --upgrade pip
# pip3 install "cffi>=1.17.1"
# pip3 install wheel
# pip3 install setuptools
# RAYLIB_PLATFORM=${{ matrix.raylib-platform }} python setup.py bdist_wheel
#
# - name: Upload build Artifact wheel
# uses: actions/upload-artifact@v3.2.1
# with:
# name: wheel
# path: dist/*
# #
# # Name defaults to universal2 and it technically is, but we override name to arm64. Why don't we make a working universal2 wheel? Because # # Name defaults to universal2 and it technically is, but we override name to arm64. Why don't we make a working universal2 wheel? Because
# # 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 # # 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
@ -190,62 +160,6 @@ jobs:
# pip3 install cffi # pip3 install cffi
# pip3 install wheel # pip3 install wheel
# python setup.py bdist_wheel --plat-name macosx_12_0_arm64 # python setup.py bdist_wheel --plat-name macosx_12_0_arm64
#
#
# - name: Upload build Artifact wheel
# uses: actions/upload-artifact@v3.2.1
# with:
# name: wheel
# path: dist/*
#
#
# build-mac11-arm64:
# runs-on: macos-11
# strategy:
# matrix:
# python-version: [ '3.10.5' ]
# # Requires universal2 build of python, which we get if we ask for 3.10.5 x86! Pypy not available in universal2
# env:
# MACOSX_DEPLOYMENT_TARGET: 11.6
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
#
# - name: Setup Python
# uses: actions/setup-python@v2.2.2
# with:
# python-version: ${{ matrix.python-version }}
# architecture: x64
#
# # build raylib for arm64 and x86_64 as well
# - name: Build raylib
# run: |
# cd raylib-c
# mkdir build
# cd build
# cmake -DBUILD_EXAMPLES=off -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
# make -j2
# sudo make install
# - name: Copy extras
# run: |
# sudo cp physac/src/physac.h /usr/local/include/
# sudo cp raygui/src/raygui.h /usr/local/include/
#
#
# - name: Build raylib-python-cffi
# run: |
# python -m pip install --upgrade pip
# pip3 install cffi
# pip3 install wheel
# python setup.py bdist_wheel --plat-name macosx_11_0_arm64
#
# - name: Upload build Artifact wheel
# uses: actions/upload-artifact@v3.2.1
# with:
# name: wheel
# path: dist/*
#

View file

@ -168,17 +168,20 @@ def build_unix():
extra_link_args = [get_the_lib_path() + '/libraylib.a', '-framework', 'OpenGL', '-framework', 'Cocoa', extra_link_args = [get_the_lib_path() + '/libraylib.a', '-framework', 'OpenGL', '-framework', 'Cocoa',
'-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework', '-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework',
'CoreVideo'] 'CoreVideo']
if USE_SDL2:
extra_link_args += ['/usr/local/lib/libSDL2.a']
libraries = [] libraries = []
extra_compile_args = ["-Wno-error=incompatible-function-pointer-types", "-D_CFFI_NO_LIMITED_API"] extra_compile_args = ["-Wno-error=incompatible-function-pointer-types", "-D_CFFI_NO_LIMITED_API"]
else: #platform.system() == "Linux": else: #platform.system() == "Linux":
print("BUILDING FOR LINUX") print("BUILDING FOR LINUX")
extra_link_args = get_lib_flags() + [ '-lm', '-lpthread', '-lGL', extra_link_args = get_lib_flags() + [ '-lm', '-lpthread', '-lGL',
'-lrt', '-lm', '-ldl', '-lX11', '-lpthread', '-latomic'] '-lrt', '-lm', '-ldl', '-lX11', '-lpthread', '-latomic']
if USE_SDL2:
extra_link_args += ['-lSDL2']
extra_compile_args = ["-Wno-incompatible-pointer-types", "-D_CFFI_NO_LIMITED_API"] extra_compile_args = ["-Wno-incompatible-pointer-types", "-D_CFFI_NO_LIMITED_API"]
libraries = [] # Not sure why but we put them in extra_link_args instead so *shouldnt* be needed here libraries = [] # Not sure why but we put them in extra_link_args instead so *shouldnt* be needed here
if USE_SDL2:
extra_link_args += ['-lSDL2']
print("extra_link_args: "+str(extra_link_args)) print("extra_link_args: "+str(extra_link_args))
print("extra_compile_args: "+str(extra_compile_args)) print("extra_compile_args: "+str(extra_compile_args))
print("libraries: "+str(libraries)) print("libraries: "+str(libraries))