aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/allegro5
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/allegro5')
-rw-r--r--vcpkg/ports/allegro5/android-glext-prototypes.diff15
-rw-r--r--vcpkg/ports/allegro5/cmake-project-include.cmake8
-rw-r--r--vcpkg/ports/allegro5/do-not-copy-pdbs-to-lib.patch13
-rw-r--r--vcpkg/ports/allegro5/minimp3-fix.patch17
-rw-r--r--vcpkg/ports/allegro5/msvc-arm64-atomic.patch13
-rw-r--r--vcpkg/ports/allegro5/portfile.cmake67
-rw-r--r--vcpkg/ports/allegro5/skip-android-aar.diff12
-rw-r--r--vcpkg/ports/allegro5/vcpkg.json66
8 files changed, 211 insertions, 0 deletions
diff --git a/vcpkg/ports/allegro5/android-glext-prototypes.diff b/vcpkg/ports/allegro5/android-glext-prototypes.diff
new file mode 100644
index 0000000..5660699
--- /dev/null
+++ b/vcpkg/ports/allegro5/android-glext-prototypes.diff
@@ -0,0 +1,15 @@
+diff --git a/src/opengl/ogl_fbo.c b/src/opengl/ogl_fbo.c
+index dcb01fb..2c0f2aa 100644
+--- a/src/opengl/ogl_fbo.c
++++ b/src/opengl/ogl_fbo.c
+@@ -13,6 +13,10 @@
+ * See LICENSE.txt for copyright information.
+ */
+
++#if defined(__ANDROID__) && !defined(GL_GLEXT_PROTOTYPES)
++# define GL_GLEXT_PROTOTYPES
++#endif
++
+ #include <float.h>
+
+ #include "allegro5/allegro.h"
diff --git a/vcpkg/ports/allegro5/cmake-project-include.cmake b/vcpkg/ports/allegro5/cmake-project-include.cmake
new file mode 100644
index 0000000..5b736db
--- /dev/null
+++ b/vcpkg/ports/allegro5/cmake-project-include.cmake
@@ -0,0 +1,8 @@
+if(MSVC AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
+ add_compile_options(/Gy)
+endif()
+
+# https://gitlab.kitware.com/cmake/cmake/-/issues/25635
+if(CMAKE_VERSION VERSION_EQUAL "3.28.0" OR CMAKE_VERSION VERSION_EQUAL "3.28.1")
+ list(APPEND CMAKE_IGNORE_PATH "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/freetype")
+endif()
diff --git a/vcpkg/ports/allegro5/do-not-copy-pdbs-to-lib.patch b/vcpkg/ports/allegro5/do-not-copy-pdbs-to-lib.patch
new file mode 100644
index 0000000..eabc5eb
--- /dev/null
+++ b/vcpkg/ports/allegro5/do-not-copy-pdbs-to-lib.patch
@@ -0,0 +1,13 @@
+diff --git a/cmake/Common.cmake b/cmake/Common.cmake
+index 86c194f..74edef8 100644
+--- a/cmake/Common.cmake
++++ b/cmake/Common.cmake
+@@ -227,7 +227,7 @@ function(install_our_library target filename)
+ # Doesn't work, see below.
+ # PUBLIC_HEADER DESTINATION "include"
+ )
+- if(MSVC AND BUILD_SHARED_LIBS)
++ if(0)
+ install(FILES ${CMAKE_BINARY_DIR}/lib/\${CMAKE_INSTALL_CONFIG_NAME}/${filename}.pdb
+ DESTINATION lib
+ CONFIGURATIONS Debug RelWithDebInfo
diff --git a/vcpkg/ports/allegro5/minimp3-fix.patch b/vcpkg/ports/allegro5/minimp3-fix.patch
new file mode 100644
index 0000000..1f3bef5
--- /dev/null
+++ b/vcpkg/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/vcpkg/ports/allegro5/msvc-arm64-atomic.patch b/vcpkg/ports/allegro5/msvc-arm64-atomic.patch
new file mode 100644
index 0000000..7b8a074
--- /dev/null
+++ b/vcpkg/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/vcpkg/ports/allegro5/portfile.cmake b/vcpkg/ports/allegro5/portfile.cmake
new file mode 100644
index 0000000..677a76b
--- /dev/null
+++ b/vcpkg/ports/allegro5/portfile.cmake
@@ -0,0 +1,67 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO liballeg/allegro5
+ REF "${VERSION}"
+ SHA512 fe9a1c28824b88d34045cf3a296a5671f5b6992f881678bbeb5290ec220138ab9bd3608fa241539d39a2c6eec32ef267d31f2694a4c5b06d13164eead6a13a5b
+ HEAD_REF master
+ PATCHES
+ do-not-copy-pdbs-to-lib.patch
+ msvc-arm64-atomic.patch
+ minimp3-fix.patch
+ android-glext-prototypes.diff
+ skip-android-aar.diff # Building AAR, not needed for vcpkg
+)
+
+if(VCPKG_TARGET_IS_ANDROID AND "$ENV{ANDROID_HOME}" STREQUAL "")
+ message(FATAL_ERROR "${PORT} requires environment variable ANDROID_HOME to be set.")
+endif()
+
+vcpkg_find_acquire_program(PKGCONFIG)
+set(ENV{PKG_CONFIG} "${PKGCONFIG}")
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" VCPKG_BUILD_SHARED_LIBS)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS options
+ FEATURES
+ direct3d WANT_D3D
+ opengl WANT_OPENGL
+)
+if(NOT WANT_OPENGL)
+ list(APPEND options -DWANT_X11=OFF)
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ "-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
+ -DINSTALL_PKG_CONFIG_FILES=true
+ -DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
+ -DSHARED=${VCPKG_BUILD_SHARED_LIBS}
+ ${options}
+ -DALLEGRO_SDL=OFF
+ -DWANT_D3D9EX=OFF # Not available on vcpkg
+ -DWANT_DEMO=OFF
+ -DWANT_DOCS=OFF
+ -DWANT_EXAMPLES=OFF
+ -DWANT_GLES3=ON
+ -DWANT_IMAGE_FREEIMAGE=OFF
+ -DWANT_MODAUDIO=OFF # Not available on vcpkg right now
+ -DWANT_MP3=ON
+ -DWANT_OPENSL=OFF # Not yet available on vcpkg
+ -DWANT_POPUP_EXAMPLES=OFF
+ -DWANT_TESTS=OFF
+ -DWANT_TREMOR=OFF # Not yet available on vcpkg
+ MAYBE_UNUSED_VARIABLES
+ PKG_CONFIG_USE_CMAKE_PREFIX_PATH
+)
+
+vcpkg_cmake_install()
+
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/allegro)
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/allegro5/skip-android-aar.diff b/vcpkg/ports/allegro5/skip-android-aar.diff
new file mode 100644
index 0000000..9b01526
--- /dev/null
+++ b/vcpkg/ports/allegro5/skip-android-aar.diff
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0b2ccfb..a6029b9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1110,7 +1110,6 @@ configure_file(
+
+ if(ANDROID)
+ include(AndroidApp)
+- add_subdirectory(android)
+ endif(ANDROID)
+
+ #-----------------------------------------------------------------------------#
diff --git a/vcpkg/ports/allegro5/vcpkg.json b/vcpkg/ports/allegro5/vcpkg.json
new file mode 100644
index 0000000..1647042
--- /dev/null
+++ b/vcpkg/ports/allegro5/vcpkg.json
@@ -0,0 +1,66 @@
+{
+ "name": "allegro5",
+ "version": "5.2.10.0",
+ "port-version": 1,
+ "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",
+ "dependencies": [
+ {
+ "name": "alsa",
+ "platform": "linux"
+ },
+ "bzip2",
+ {
+ "name": "freetype",
+ "default-features": false
+ },
+ "libflac",
+ "libjpeg-turbo",
+ "libogg",
+ "libpng",
+ "libtheora",
+ "libvorbis",
+ {
+ "name": "libwebp",
+ "default-features": false
+ },
+ "minimp3",
+ "openal-soft",
+ "opus",
+ "opusfile",
+ "physfs",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "zlib"
+ ],
+ "default-features": [
+ {
+ "name": "direct3d",
+ "platform": "windows"
+ },
+ {
+ "name": "opengl",
+ "platform": "!(arm & windows) & !uwp & !xbox"
+ }
+ ],
+ "features": {
+ "direct3d": {
+ "description": "Direct3D support",
+ "supports": "windows"
+ },
+ "opengl": {
+ "description": "OpenGL support",
+ "supports": "!(arm & windows) & !uwp & !xbox",
+ "dependencies": [
+ "opengl"
+ ]
+ }
+ }
+}