From 79a2b260ada00c098ca3339e5d6fa5bd6551760c Mon Sep 17 00:00:00 2001 From: Kazora Date: Wed, 6 Nov 2024 03:46:51 +0800 Subject: [PATCH] [allegro5] Add Minimp3 support (#41918) --- ports/allegro5/minimp3-fix.patch | 17 +++++++++++++++++ ports/allegro5/portfile.cmake | 3 ++- ports/allegro5/vcpkg.json | 3 ++- versions/a-/allegro5.json | 5 +++++ versions/baseline.json | 2 +- 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 ports/allegro5/minimp3-fix.patch diff --git a/ports/allegro5/minimp3-fix.patch b/ports/allegro5/minimp3-fix.patch new file mode 100644 index 00000000000000..1f3bef5ce6d6bf --- /dev/null +++ b/ports/allegro5/minimp3-fix.patch @@ -0,0 +1,17 @@ +diff --git a/addons/acodec/CMakeLists.txt b/addons/acodec/CMakeLists.txt +index 6906a99..7896989 100644 +--- a/addons/acodec/CMakeLists.txt ++++ b/addons/acodec/CMakeLists.txt +@@ -394,9 +394,10 @@ acodec_summary(" - Opus" SUPPORT_OPUS) + # MP3 + # + if(WANT_MP3) +- find_package(MiniMP3) ++ find_path(MINIMP3_INCLUDE_DIRS "minimp3/minimp3.h") ++ set(MINIMP3_FOUND true) + if(MINIMP3_FOUND) +- include_directories(SYSTEM ${MINIMP3_INCLUDE_DIRS}) ++ include_directories(SYSTEM ${MINIMP3_INCLUDE_DIRS}/minimp3) + set(ALLEGRO_CFG_ACODEC_MP3 1) + list(APPEND ACODEC_SOURCES mp3.c) + endif(MINIMP3_FOUND) diff --git a/ports/allegro5/portfile.cmake b/ports/allegro5/portfile.cmake index bd8a85e8ad7aaf..f91e20f1559c2a 100644 --- a/ports/allegro5/portfile.cmake +++ b/ports/allegro5/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES do-not-copy-pdbs-to-lib.patch msvc-arm64-atomic.patch + minimp3-fix.patch ) if(VCPKG_TARGET_IS_ANDROID AND NOT ENV{ANDROID_HOME}) @@ -43,7 +44,7 @@ vcpkg_cmake_configure( -DWANT_GLES3=ON -DWANT_IMAGE_FREEIMAGE=OFF -DWANT_MODAUDIO=OFF # Not available on vcpkg right now - -DWANT_MP3=OFF + -DWANT_MP3=ON -DWANT_OPENSL=OFF # Not yet available on vcpkg -DWANT_POPUP_EXAMPLES=OFF -DWANT_TESTS=OFF diff --git a/ports/allegro5/vcpkg.json b/ports/allegro5/vcpkg.json index 112e096f3b4650..2fef4bc680a929 100644 --- a/ports/allegro5/vcpkg.json +++ b/ports/allegro5/vcpkg.json @@ -1,6 +1,6 @@ { "name": "allegro5", - "version": "5.2.9.1", + "version": "5.2.9.2", "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://liballeg.org/", "license": "BSD-3-Clause AND Zlib", @@ -24,6 +24,7 @@ "name": "libwebp", "default-features": false }, + "minimp3", "openal-soft", "opus", "opusfile", diff --git a/versions/a-/allegro5.json b/versions/a-/allegro5.json index 20657dc6de0b65..00096954e1ee7b 100644 --- a/versions/a-/allegro5.json +++ b/versions/a-/allegro5.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c375db21b3bfa0c14dec1832be9fc687f6b28426", + "version": "5.2.9.2", + "port-version": 0 + }, { "git-tree": "1162ff1bdc43ad43036a30af2ca8214eeea566d9", "version": "5.2.9.1", diff --git a/versions/baseline.json b/versions/baseline.json index f2cea2c9b84596..d51d91a68b6a49 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -85,7 +85,7 @@ "port-version": 3 }, "allegro5": { - "baseline": "5.2.9.1", + "baseline": "5.2.9.2", "port-version": 0 }, "alpaca": {