From 33ca2dcc243c1ce1828fa9be8bd03495d11f1f7a Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 19 Oct 2022 03:25:28 +0200 Subject: [PATCH] [allegro5|baseline] Minor changes, expect CI fail for arm64-windows (#27294) * CI [skip actions] * Remove obsolete vars * Minor changes * Trim patching * Fix arm64 MSVC build * Update versions * Use msvc arm64 atomic ops * Declare license * CI [skip actions] * Update versions * Update baseline --- ports/allegro5/cmake-project-include.cmake | 3 ++ ports/allegro5/do-not-copy-pdbs-to-lib.patch | 2 +- ports/allegro5/export-targets.patch | 2 +- ports/allegro5/fix-pdb-install.patch | 34 -------------------- ports/allegro5/msvc-arm64-atomic.patch | 13 ++++++++ ports/allegro5/portfile.cmake | 16 ++++----- ports/allegro5/vcpkg.json | 3 +- scripts/ci.baseline.txt | 2 ++ versions/a-/allegro5.json | 5 +++ versions/baseline.json | 2 +- 10 files changed, 36 insertions(+), 46 deletions(-) create mode 100644 ports/allegro5/cmake-project-include.cmake delete mode 100644 ports/allegro5/fix-pdb-install.patch create mode 100644 ports/allegro5/msvc-arm64-atomic.patch diff --git a/ports/allegro5/cmake-project-include.cmake b/ports/allegro5/cmake-project-include.cmake new file mode 100644 index 0000000000..4c1beb129b --- /dev/null +++ b/ports/allegro5/cmake-project-include.cmake @@ -0,0 +1,3 @@ +if(MSVC AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + add_compile_options(/Gy) +endif() diff --git a/ports/allegro5/do-not-copy-pdbs-to-lib.patch b/ports/allegro5/do-not-copy-pdbs-to-lib.patch index 43b51f7fdd..eabc5eb3ea 100644 --- a/ports/allegro5/do-not-copy-pdbs-to-lib.patch +++ b/ports/allegro5/do-not-copy-pdbs-to-lib.patch @@ -8,6 +8,6 @@ index 86c194f..74edef8 100644 ) - if(MSVC AND BUILD_SHARED_LIBS) + if(0) - install(FILES ${CMAKE_BINARY_DIR}/lib/${filename}.pdb + install(FILES ${CMAKE_BINARY_DIR}/lib/\${CMAKE_INSTALL_CONFIG_NAME}/${filename}.pdb DESTINATION lib CONFIGURATIONS Debug RelWithDebInfo diff --git a/ports/allegro5/export-targets.patch b/ports/allegro5/export-targets.patch index fc79998951..53dc57b7df 100644 --- a/ports/allegro5/export-targets.patch +++ b/ports/allegro5/export-targets.patch @@ -48,5 +48,5 @@ index 74edef8..0cf1edb 100644 + DESTINATION share/unofficial-allegro5 + ) if(0) - install(FILES ${CMAKE_BINARY_DIR}/lib/${filename}.pdb + install(FILES ${CMAKE_BINARY_DIR}/lib/\${CMAKE_INSTALL_CONFIG_NAME}/${filename}.pdb DESTINATION lib diff --git a/ports/allegro5/fix-pdb-install.patch b/ports/allegro5/fix-pdb-install.patch deleted file mode 100644 index 714c69cf55..0000000000 --- a/ports/allegro5/fix-pdb-install.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 72348fe..c6fbecb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1010,14 +1010,9 @@ else() - set(PKG_CONFIG_FILES allegro ${ADDON_PKG_CONFIG_FILES}) - endif(WANT_MONOLITH) - --# Install pkg-config files on Unix, and when cross-compiling on Unix. -+# Install pkg-config files - --if(UNIX AND NOT WANT_FRAMEWORKS AND NOT IPHONE) -- set(INSTALL_PKG_CONFIG_FILES true) --endif() --if(CMAKE_CROSSCOMPILING AND CMAKE_HOST_UNIX) -- set(INSTALL_PKG_CONFIG_FILES true) --endif() -+set(INSTALL_PKG_CONFIG_FILES true) - - if(INSTALL_PKG_CONFIG_FILES) - append_lib_type_suffix(lib_type) -diff --git a/cmake/Common.cmake b/cmake/Common.cmake -index 782196f..de29535 100644 ---- a/cmake/Common.cmake -+++ b/cmake/Common.cmake -@@ -223,7 +223,7 @@ function(install_our_library target filename) - # PUBLIC_HEADER DESTINATION "include" - ) - if(MSVC AND BUILD_SHARED_LIBS) -- install(FILES ${CMAKE_BINARY_DIR}/lib/\${CMAKE_INSTALL_CONFIG_NAME}/${filename}.pdb -+ install(FILES ${CMAKE_BINARY_DIR}/lib/${filename}.pdb - DESTINATION lib - CONFIGURATIONS Debug RelWithDebInfo - ) diff --git a/ports/allegro5/msvc-arm64-atomic.patch b/ports/allegro5/msvc-arm64-atomic.patch new file mode 100644 index 0000000000..7b8a074b5e --- /dev/null +++ b/ports/allegro5/msvc-arm64-atomic.patch @@ -0,0 +1,13 @@ +diff --git a/include/allegro5/internal/aintern_atomicops.h b/include/allegro5/internal/aintern_atomicops.h +index 5054552..a4310f1 100644 +--- a/include/allegro5/internal/aintern_atomicops.h ++++ b/include/allegro5/internal/aintern_atomicops.h +@@ -49,7 +49,7 @@ + return old - 1; + }) + +-#elif defined(_MSC_VER) && _M_IX86 >= 400 ++#elif defined(_MSC_VER) && (_M_IX86 >= 400 || defined(_M_ARM64)) + + /* MSVC, x86 */ + /* MinGW supports these too, but we already have asm code above. */ diff --git a/ports/allegro5/portfile.cmake b/ports/allegro5/portfile.cmake index a19cbe8553..b9521f48df 100644 --- a/ports/allegro5/portfile.cmake +++ b/ports/allegro5/portfile.cmake @@ -5,23 +5,24 @@ vcpkg_from_github( SHA512 d590c1a00d1b314c6946e0f6ad3e3a8b6e6309bada2ec38857186f817147ac99dae8a1c4412abe701af88da5dca3dd8f989a1da66630192643d3c08c0146b603 HEAD_REF master PATCHES - fix-pdb-install.patch do-not-copy-pdbs-to-lib.patch export-targets.patch + msvc-arm64-atomic.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" VCPKG_BUILD_SHARED_LIBS) vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" OPTIONS + "-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake" -DWANT_DOCS=OFF -DALLEGRO_SDL=OFF -DWANT_DEMO=OFF -DSHARED=${VCPKG_BUILD_SHARED_LIBS} + -DINSTALL_PKG_CONFIG_FILES=true -DWANT_EXAMPLES=OFF - -DWANT_CURL_EXAMPLE=OFF -DWANT_TESTS=OFF -DWANT_AUDIO=ON -DWANT_COLOR=ON @@ -30,7 +31,6 @@ vcpkg_cmake_configure( -DWANT_DSOUND=ON -DWANT_FLAC=ON -DWANT_FONT=ON - -DWANT_GLES2=ON -DWANT_GLES3=ON -DWANT_IMAGE=ON -DWANT_IMAGE_JPG=ON @@ -54,10 +54,10 @@ vcpkg_cmake_configure( -DWANT_TTF=ON -DWANT_VIDEO=ON -DWANT_VORBIS=ON - -DOPENAL_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/AL - -DZLIB_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include - OPTIONS_RELEASE -DWANT_ALLOW_SSE=ON - OPTIONS_DEBUG -DWANT_ALLOW_SSE=OFF + OPTIONS_RELEASE + -DWANT_ALLOW_SSE=ON + OPTIONS_DEBUG + -DWANT_ALLOW_SSE=OFF ) vcpkg_cmake_install() diff --git a/ports/allegro5/vcpkg.json b/ports/allegro5/vcpkg.json index dbc97efb3e..3c5f701c62 100644 --- a/ports/allegro5/vcpkg.json +++ b/ports/allegro5/vcpkg.json @@ -1,9 +1,10 @@ { "name": "allegro5", "version": "5.2.6.0", - "port-version": 2, + "port-version": 3, "description": "Allegro is a cross-platform library mainly aimed at video game and multimedia programming. It handles common, low-level tasks such as creating windows, accepting user input, loading data, drawing images, playing sounds, etc. and generally abstracting away the underlying platform. However, Allegro is not a game engine: you are free to design and structure your program as you like.", "homepage": "https://github.com/liballeg/allegro5", + "license": "BSD-3-Clause AND Zlib", "dependencies": [ "bzip2", "freetype", diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index c8abe36c05..f0b7613a29 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -34,6 +34,8 @@ # Add new items alphabetically +# Fails with "fatal error LNK1322: cannot avoid potential ARM hazard" even with /Gy +allegro5:arm64-windows=fail # Cross compiling CI machine cannot run gen_test_char to generate apr_escape_test_char.h apr:arm64-windows=fail # broken when `python` is python3, https://github.com/microsoft/vcpkg/issues/18937 diff --git a/versions/a-/allegro5.json b/versions/a-/allegro5.json index 056f8d2f00..006def03d7 100644 --- a/versions/a-/allegro5.json +++ b/versions/a-/allegro5.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "09b555503c34ca7a0052436996b19bb4deb5d701", + "version": "5.2.6.0", + "port-version": 3 + }, { "git-tree": "47c415593bf3de3c28afc1d476d5eab92aa8efb2", "version": "5.2.6.0", diff --git a/versions/baseline.json b/versions/baseline.json index c062582da7..fdbe75361f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -66,7 +66,7 @@ }, "allegro5": { "baseline": "5.2.6.0", - "port-version": 2 + "port-version": 3 }, "alpaca": { "baseline": "0.2.0",