diff --git a/ports/allegro5/do-not-copy-pdbs-to-lib.patch b/ports/allegro5/do-not-copy-pdbs-to-lib.patch new file mode 100644 index 0000000000..43b51f7fdd --- /dev/null +++ b/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/${filename}.pdb + DESTINATION lib + CONFIGURATIONS Debug RelWithDebInfo diff --git a/ports/allegro5/export-targets.patch b/ports/allegro5/export-targets.patch new file mode 100644 index 0000000000..fc79998951 --- /dev/null +++ b/ports/allegro5/export-targets.patch @@ -0,0 +1,52 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7c5720b..72880c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1156,6 +1156,24 @@ if(INSTALL_PKG_CONFIG_FILES) + endforeach(versuffix) + endif(INSTALL_PKG_CONFIG_FILES) + ++file(WRITE "${CMAKE_INSTALL_PREFIX}/share/unofficial-allegro5/unofficial-allegro5-config.cmake" ++[[ ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegroTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_audioTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_videoTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_primitivesTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_fontTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_ttfTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_memfileTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_physfsTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_imageTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_mainTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_dialogTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_colorTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-allegro_acodecTargets.cmake") ++ ++]]) ++ + #-----------------------------------------------------------------------------# + # + # Documentation +diff --git a/cmake/Common.cmake b/cmake/Common.cmake +index 74edef8..0cf1edb 100644 +--- a/cmake/Common.cmake ++++ b/cmake/Common.cmake +@@ -220,6 +220,7 @@ endfunction(set_our_framework_properties) + + function(install_our_library target filename) + install(TARGETS ${target} ++ EXPORT unofficial-${target}Targets + LIBRARY DESTINATION "lib${LIB_SUFFIX}" + ARCHIVE DESTINATION "lib${LIB_SUFFIX}" + FRAMEWORK DESTINATION "${FRAMEWORK_INSTALL_PREFIX}" +@@ -227,6 +228,10 @@ function(install_our_library target filename) + # Doesn't work, see below. + # PUBLIC_HEADER DESTINATION "include" + ) ++ install(EXPORT unofficial-${target}Targets ++ NAMESPACE unofficial-allegro5:: ++ DESTINATION share/unofficial-allegro5 ++ ) + if(0) + install(FILES ${CMAKE_BINARY_DIR}/lib/${filename}.pdb + DESTINATION lib diff --git a/ports/allegro5/portfile.cmake b/ports/allegro5/portfile.cmake index 7748a4831a..a19cbe8553 100644 --- a/ports/allegro5/portfile.cmake +++ b/ports/allegro5/portfile.cmake @@ -6,17 +6,15 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-pdb-install.patch + do-not-copy-pdbs-to-lib.patch + export-targets.patch ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(VCPKG_BUILD_SHARED_LIBS ON) -else() - set(VCPKG_BUILD_SHARED_LIBS OFF) -endif() -vcpkg_configure_cmake( +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" VCPKG_BUILD_SHARED_LIBS) + +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA OPTIONS -DWANT_DOCS=OFF -DALLEGRO_SDL=OFF @@ -62,14 +60,13 @@ vcpkg_configure_cmake( OPTIONS_DEBUG -DWANT_ALLOW_SSE=OFF ) -vcpkg_install_cmake() -vcpkg_fixup_pkgconfig() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(GLOB PDB_GLOB ${CURRENT_BUILDTREES_DIR}-dbg/lib/*.pdb) -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}-dbg/lib/Debug) -file(COPY ${PDB_GLOB} DESTINATION ${CURRENT_BUILDTREES_DIR}-dbg/lib/Debug) +vcpkg_cmake_install() vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/allegro5 RENAME copyright) +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-allegro5 CONFIG_PATH share/unofficial-allegro5) +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/allegro5/vcpkg.json b/ports/allegro5/vcpkg.json index fe3541d84a..dbc97efb3e 100644 --- a/ports/allegro5/vcpkg.json +++ b/ports/allegro5/vcpkg.json @@ -1,7 +1,7 @@ { "name": "allegro5", "version": "5.2.6.0", - "port-version": 1, + "port-version": 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://github.com/liballeg/allegro5", "dependencies": [ @@ -17,6 +17,14 @@ "opus", "opusfile", "physfs", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, "zlib" ] } diff --git a/versions/a-/allegro5.json b/versions/a-/allegro5.json index 8b467274fe..056f8d2f00 100644 --- a/versions/a-/allegro5.json +++ b/versions/a-/allegro5.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "47c415593bf3de3c28afc1d476d5eab92aa8efb2", + "version": "5.2.6.0", + "port-version": 2 + }, { "git-tree": "b851d9d0babf00bdd273eec402aea26e826cb517", "version": "5.2.6.0", diff --git a/versions/baseline.json b/versions/baseline.json index 66529b40d4..d6be190ccf 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -58,7 +58,7 @@ }, "allegro5": { "baseline": "5.2.6.0", - "port-version": 1 + "port-version": 2 }, "alsa": { "baseline": "1.2.5.1",