From b34704917f0bfed53ff0696a9586fd38e0c1c33b Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Sun, 16 Oct 2022 17:51:02 +0800 Subject: [PATCH 1/8] Use 12.x branch for love-appimage-source Linux build. --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54081d888..81a78d604 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,7 @@ jobs: uses: actions/checkout@v2 with: repository: MikuAuahDark/love-appimage-source + ref: 12.x - name: Checkout LÖVE uses: actions/checkout@v2 with: From 05efd121e5d8419436047a5abb83970189e28ff0 Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Sun, 16 Oct 2022 20:22:48 +0800 Subject: [PATCH 2/8] Minor cleanup to GitHub Actions Windows build. --- .github/workflows/main.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 81a78d604..17e26ea12 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,20 +37,20 @@ jobs: path: love-${{ github.sha }}.AppImage windows-os: runs-on: windows-latest + shell: cmd strategy: matrix: platform: [Win32, x64] install: [compat, modern] include: - - platform: Win32 - arch: x86 - - platform: x64 - arch: x64 - upload_jitmodules: true - - install: compat - compatdef: -DLOVE_INSTALL_UCRT=ON - compatname: -compat - + - platform: Win32 + arch: x86 + - platform: x64 + arch: x64 + upload_jitmodules: true + - install: compat + compatdef: -DLOVE_INSTALL_UCRT=ON + compatname: -compat steps: - name: Clone Megasource uses: actions/checkout@v2 @@ -69,12 +69,10 @@ jobs: vulkan-components: Vulkan-Headers, Vulkan-Loader vulkan-use-cache: true - name: Configure - shell: cmd env: PLATFORM: ${{ matrix.platform }} run: cmake -Bbuild -Hmegasource -T v142 -A %PLATFORM% ${{ matrix.compatdef }} -DCMAKE_INSTALL_PREFIX=%CD%\install - name: Install - shell: cmd run: cmake --build build --target PACKAGE --config Release -j2 - name: Artifact uses: actions/upload-artifact@v2 From 9deaa06a737541c3b8c75cef9b3b446b679a33e9 Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Mon, 17 Oct 2022 00:28:07 +0800 Subject: [PATCH 3/8] Windows: Slight changes to ARM64 support. * Disable NSIS installer if we're compiling for Windows ARM64. * Allow arbitrary files to be added as LOVE_EXTRA_DLLS --- CMakeLists.txt | 30 ++++++++++++++++++++++-------- src/modules/window/sdl/Window.cpp | 6 ++---- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b94011ba..e86bd9586 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,12 +53,15 @@ else() set(LOVE_TARGET_PLATFORM x86) endif() -if(APPLE) - option(LOVE_JIT "Use LuaJIT" FALSE) + +if(APPLE OR MEGA_ARM64) + set(LOVE_DEFAULT_JIT FALSE) else() - option(LOVE_JIT "Use LuaJIT" TRUE) + set(LOVE_DEFAULT_JIT TRUE) endif() +option(LOVE_JIT "Use LuaJIT" ${LOVE_DEFAULT_JIT}) + if(LOVE_JIT) if(APPLE) message(WARNING "JIT not supported yet on Mac.") @@ -119,12 +122,16 @@ if(MEGA) ${MEGA_OPENAL} ) + # LOVE_EXTRA_DLLS are non-runtime DLLs which should be bundled with the + # love binary in installers, etc. It's only needed for external + # (non-CMake) targets, i.e. LuaJIT. + if(NOT DEFINED LOVE_EXTRA_DLLS) + set(LOVE_EXTRA_DLLS) + endif() + if(LOVE_JIT) set(LOVE_LUA_LIBRARY ${MEGA_LUAJIT_LIB}) - # LOVE_EXTRA_DLLS are non-runtime DLLs which should be bundled with the - # love binary in installers, etc. It's only needed for external - # (non-CMake) targets, i.e. LuaJIT. - set(LOVE_EXTRA_DLLS ${MEGA_LUAJIT_DLL}) + set(LOVE_EXTRA_DLLS ${LOVE_EXTRA_DLLS} ${MEGA_LUAJIT_DLL}) set(LOVE_EXTRA_DEPENDECIES luajit) set(LOVE_INCLUDE_DIRS @@ -1998,6 +2005,14 @@ message(STATUS "Version: ${LOVE_VERSION_STR}") ################################### install(TARGETS ${LOVE_EXE_NAME} ${LOVE_CONSOLE_EXE_NAME} ${LOVE_LIB_NAME} RUNTIME DESTINATION .) +# Our install script (and NSIS) doesn't fully support Windows ARM64 yet. +if(MEGA_ARM64) + set(CPACK_GENERATOR ZIP) + set(CPACK_SYSTEM_NAME woa64) +else() + set(CPACK_GENERATOR ZIP NSIS) +endif() + # Extra DLLs. if(LOVE_EXTRA_DLLS) foreach(DLL ${LOVE_EXTRA_DLLS}) @@ -2040,7 +2055,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/game.ico DESTINATION .) -set(CPACK_GENERATOR ZIP NSIS) set(CPACK_PACKAGE_NAME "love") set(CPACK_PACKAGE_VENDOR "love2d.org") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LOVE -- It's awesome") diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index 72dfacf72..41f10ab3e 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -262,11 +262,9 @@ std::vector Window::getContextAttribsList() const } } - if (!preferGLES) - { - const char *gleshint = SDL_GetHint("LOVE_GRAPHICS_USE_OPENGLES"); + const char *gleshint = SDL_GetHint("LOVE_GRAPHICS_USE_OPENGLES"); + if (gleshint != nullptr) preferGLES = (gleshint != nullptr && gleshint[0] != '0'); - } // Do we want a debug context? bool debug = love::graphics::isDebugEnabled(); From 0f82f6c7b3518529c3a14359ae702728d96e0977 Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Mon, 17 Oct 2022 00:30:01 +0800 Subject: [PATCH 4/8] Add Windows ARM64 workflow. --- .github/workflows/main.yml | 79 ++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 17e26ea12..3f25e0fbd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,18 +40,54 @@ jobs: shell: cmd strategy: matrix: - platform: [Win32, x64] + platform: [Win32, x64, ARM64] install: [compat, modern] - include: - - platform: Win32 - arch: x86 - - platform: x64 - arch: x64 - upload_jitmodules: true - - install: compat - compatdef: -DLOVE_INSTALL_UCRT=ON - compatname: -compat + exclude: + - platform: ARM64 + install: compat + continue-on-error: ${{ matrix.platform == 'ARM64' }} steps: + - name: Define Variables + id: vars + run: | + rem Compat/Modern switch + if "${{ matrix.install }}" == "compat" ( + echo moredef=-DLOVE_INSTALL_UCRT=ON >> "%GITHUB_OUTPUT%" + echo compatname=-compat >> "%GITHUB_OUTPUT%" + ) else ( + echo moredef= >> "%GITHUB_OUTPUT%" + echo compatname= >> "%GITHUB_OUTPUT%" + ) + + rem JIT Modules + if "${{ matrix.platform }}-${{ matrix.install }}" == "x64-modern" ( + echo jitmodules=1 >> "%GITHUB_OUTPUT%" + ) else ( + echo jitmodules=0 >> "%GITHUB_OUTPUT%" + ) + + rem Architecture-Specific Switch + goto ${{ matrix.platform }} + exit /b 1 + + :Win32 + echo arch=x86 >> "%GITHUB_OUTPUT%" + echo angle=0 >> "%GITHUB_OUTPUT%" + echo nofiles=warn >> "%GITHUB_OUTPUT%" + exit /b 0 + + :x64 + echo arch=x64 >> "%GITHUB_OUTPUT%" + echo angle=0 >> "%GITHUB_OUTPUT%" + echo nofiles=warn >> "%GITHUB_OUTPUT%" + exit /b 0 + + :ARM64 + echo arch=arm64 >> "%GITHUB_OUTPUT%" + echo angle=1 >> "%GITHUB_OUTPUT%" + echo nofiles=ignore >> "%GITHUB_OUTPUT%" + echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll + exit /b 0 - name: Clone Megasource uses: actions/checkout@v2 with: @@ -68,21 +104,34 @@ jobs: vulkan-query-version: 1.3.204.0 vulkan-components: Vulkan-Headers, Vulkan-Loader vulkan-use-cache: true + - name: Download ANGLE + uses: robinraju/release-downloader@v1.5 + if: steps.vars.outputs.angle == '1' + with: + repository: MikuAuahDark/angle-winbuild + tag: cr_5249 + fileName: angle-win-${{ steps.vars.outputs.arch }}.zip + tarBall: false + zipBall: false + out-file-path: angle + - name: Extract ANGLE + if: steps.vars.outputs.angle == '1' + working-directory: angle + run: 7z x angle-win-${{ steps.vars.outputs.arch }}.zip - name: Configure - env: - PLATFORM: ${{ matrix.platform }} - run: cmake -Bbuild -Hmegasource -T v142 -A %PLATFORM% ${{ matrix.compatdef }} -DCMAKE_INSTALL_PREFIX=%CD%\install + run: cmake -Bbuild -Hmegasource -T v142 -A ${{ matrix.platform }} -DCMAKE_INSTALL_PREFIX=%CD%\install ${{ steps.vars.outputs.moredef }} - name: Install run: cmake --build build --target PACKAGE --config Release -j2 - name: Artifact uses: actions/upload-artifact@v2 with: - name: love-windows-${{ matrix.arch }}${{ matrix.compatname }} + name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }} path: | build/*.zip build/*.exe + if-no-files-found: ${{ steps.vars.outputs.nofiles }} - name: Artifact JIT Modules - if: matrix.upload_jitmodules + if: steps.vars.outputs.jitmodules == '1' uses: actions/upload-artifact@v2 with: name: love-windows-jitmodules From 25c604a6b11f668222e79048a4d4562b24e338b0 Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Mon, 17 Oct 2022 00:31:47 +0800 Subject: [PATCH 5/8] Update workflow dependency versions. --- .github/workflows/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f25e0fbd..db5753983 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,12 +18,12 @@ jobs: libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \ libvulkan-dev - name: Checkout love-appimage-source - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: MikuAuahDark/love-appimage-source ref: 12.x - name: Checkout LÖVE - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: love2d-${{ github.sha }} - name: Build AppImage @@ -31,7 +31,7 @@ jobs: - name: Print LuaJIT branch run: git -C LuaJIT-v2.1 branch -v - name: Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: love-linux-x86_64.AppImage path: love-${{ github.sha }}.AppImage @@ -89,13 +89,13 @@ jobs: echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll exit /b 0 - name: Clone Megasource - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: megasource repository: love2d/megasource ref: 12.x - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: megasource/libs/love - name: Prepare Vulkan SDK @@ -123,7 +123,7 @@ jobs: - name: Install run: cmake --build build --target PACKAGE --config Release -j2 - name: Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }} path: | @@ -132,7 +132,7 @@ jobs: if-no-files-found: ${{ steps.vars.outputs.nofiles }} - name: Artifact JIT Modules if: steps.vars.outputs.jitmodules == '1' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: love-windows-jitmodules path: build/libs/LuaJIT/src/jit/*.lua @@ -140,9 +140,9 @@ jobs: runs-on: macos-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Clone Dependencies - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: apple-dependencies repository: love2d/love-apple-dependencies @@ -160,7 +160,7 @@ jobs: run: ditto -c -k --sequesterRsrc --keepParent love-macos/love.app love-macos.zip - name: Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: love-macos path: love-macos.zip @@ -168,9 +168,9 @@ jobs: runs-on: macos-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Clone Dependencies - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: apple-dependencies repository: love2d/love-apple-dependencies From 05c23fad75d6cfd6700254ff14a5218f72a2787f Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Mon, 17 Oct 2022 00:36:28 +0800 Subject: [PATCH 6/8] Fix default shell in Windows workflow. --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db5753983..b07080154 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,6 @@ jobs: path: love-${{ github.sha }}.AppImage windows-os: runs-on: windows-latest - shell: cmd strategy: matrix: platform: [Win32, x64, ARM64] @@ -45,6 +44,9 @@ jobs: exclude: - platform: ARM64 install: compat + defaults: + run: + shell: cmd continue-on-error: ${{ matrix.platform == 'ARM64' }} steps: - name: Define Variables From 2f9f6cd8d6eecd5d30ea058b0e9fae4acd32c984 Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Mon, 17 Oct 2022 00:59:22 +0800 Subject: [PATCH 7/8] Fix Windows workflow variable outputs. --- .github/workflows/main.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b07080154..fa84dc075 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,18 +54,18 @@ jobs: run: | rem Compat/Modern switch if "${{ matrix.install }}" == "compat" ( - echo moredef=-DLOVE_INSTALL_UCRT=ON >> "%GITHUB_OUTPUT%" - echo compatname=-compat >> "%GITHUB_OUTPUT%" + echo moredef=-DLOVE_INSTALL_UCRT=ON>> "%GITHUB_OUTPUT%" + echo compatname=-compat>> "%GITHUB_OUTPUT%" ) else ( - echo moredef= >> "%GITHUB_OUTPUT%" - echo compatname= >> "%GITHUB_OUTPUT%" + echo moredef=>> "%GITHUB_OUTPUT%" + echo compatname=>> "%GITHUB_OUTPUT%" ) rem JIT Modules if "${{ matrix.platform }}-${{ matrix.install }}" == "x64-modern" ( - echo jitmodules=1 >> "%GITHUB_OUTPUT%" + (echo jitmodules=1)>> "%GITHUB_OUTPUT%" ) else ( - echo jitmodules=0 >> "%GITHUB_OUTPUT%" + (echo jitmodules=0)>> "%GITHUB_OUTPUT%" ) rem Architecture-Specific Switch @@ -73,22 +73,22 @@ jobs: exit /b 1 :Win32 - echo arch=x86 >> "%GITHUB_OUTPUT%" - echo angle=0 >> "%GITHUB_OUTPUT%" - echo nofiles=warn >> "%GITHUB_OUTPUT%" + (echo arch=x86)>> "%GITHUB_OUTPUT%" + (echo angle=0)>> "%GITHUB_OUTPUT%" + echo nofiles=warn>> "%GITHUB_OUTPUT%" exit /b 0 :x64 - echo arch=x64 >> "%GITHUB_OUTPUT%" - echo angle=0 >> "%GITHUB_OUTPUT%" - echo nofiles=warn >> "%GITHUB_OUTPUT%" + (echo arch=x64)>> "%GITHUB_OUTPUT%" + (echo angle=0)>> "%GITHUB_OUTPUT%" + echo nofiles=warn>> "%GITHUB_OUTPUT%" exit /b 0 :ARM64 - echo arch=arm64 >> "%GITHUB_OUTPUT%" - echo angle=1 >> "%GITHUB_OUTPUT%" - echo nofiles=ignore >> "%GITHUB_OUTPUT%" - echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll + (echo arch=arm64)>> "%GITHUB_OUTPUT%" + (echo angle=1)>> "%GITHUB_OUTPUT%" + echo nofiles=ignore>> "%GITHUB_OUTPUT%" + echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll>> "%GITHUB_OUTPUT%" exit /b 0 - name: Clone Megasource uses: actions/checkout@v3 From 4862d956873401e647da34e7611924cb627a7230 Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Mon, 17 Oct 2022 01:30:44 +0800 Subject: [PATCH 8/8] Deprecate love.graphics.setNewFont. --- src/modules/graphics/wrap_Graphics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/graphics/wrap_Graphics.cpp b/src/modules/graphics/wrap_Graphics.cpp index 83a649440..d3eb49432 100644 --- a/src/modules/graphics/wrap_Graphics.cpp +++ b/src/modules/graphics/wrap_Graphics.cpp @@ -2335,6 +2335,8 @@ int w_getBackgroundColor(lua_State *L) int w_setNewFont(lua_State *L) { + luax_markdeprecated(L, 1, "love.graphics.setNewFont", API_FUNCTION, DEPRECATED_NO_REPLACEMENT, nullptr); + int ret = w_newFont(L); Font *font = luax_checktype(L, -1); instance()->setFont(font);