From 10692d516821ee8d3c95491d4f59cdc0adf63381 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 15 Oct 2024 20:29:41 +0100 Subject: [PATCH] try --- .github/workflows/build.yml | 182 ++++++++++-------------------------- raylib/build.py | 7 +- 2 files changed, 53 insertions(+), 136 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87184b8..1925159 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,106 +80,76 @@ jobs: name: wheel path: dist/* - build-mac-universal: - 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 +# build-mac-universal: +# runs-on: macos-14 # strategy: # matrix: -# python-version: ['3.10', '3.11.0-alpha - 3.11.0' ] -# # Requires universal2 build of python, which we get if we ask for 3.10.5 x86! Pypy not available in universal2 +# 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: x64 +# architecture: arm64 # -# # Only build raylib for arm64 (although we could make a fat universal2 binary by asking for x86_64 as well) -# - name: Build raylib +# # 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 -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 # 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/* + # # # 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 @@ -190,62 +160,6 @@ jobs: # pip3 install cffi # pip3 install wheel # 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/* -# diff --git a/raylib/build.py b/raylib/build.py index 18a6259..c6a9325 100644 --- a/raylib/build.py +++ b/raylib/build.py @@ -168,17 +168,20 @@ def build_unix(): extra_link_args = [get_the_lib_path() + '/libraylib.a', '-framework', 'OpenGL', '-framework', 'Cocoa', '-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework', 'CoreVideo'] + if USE_SDL2: + extra_link_args += ['/usr/local/lib/libSDL2.a'] libraries = [] extra_compile_args = ["-Wno-error=incompatible-function-pointer-types", "-D_CFFI_NO_LIMITED_API"] else: #platform.system() == "Linux": print("BUILDING FOR LINUX") extra_link_args = get_lib_flags() + [ '-lm', '-lpthread', '-lGL', '-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"] 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_compile_args: "+str(extra_compile_args)) print("libraries: "+str(libraries))