From 015b6f88e7ab78ece14ab531e37e5b4bf6b882b3 Mon Sep 17 00:00:00 2001 From: "Michael R. P. Ragazzon" Date: Thu, 1 Jul 2021 19:25:42 +0200 Subject: [PATCH] [rmlui] Add Rmlui library (#18409) * Add RmlUi port * Update versions * Fix uwp build * Update versions * Add maintainers to manifest * Update version * Update ports/rmlui/portfile.cmake Co-authored-by: Noam Chitayat * - Update to RmlUi 4.1, fixes some issues with missing dependencies. - Add robin-hood-hashing as dependency, replacing built-in copy. - Only need FreeType core. - Static library definition now replaced in-source. * Fix config name * Change source in current packages directory * Use robin_hood.h included from vcpkg * Move source modifications to robin_hood patch * Fix path in patch Co-authored-by: Noam Chitayat --- ports/rmlui/add-robin-hood.patch | 38 ++++++++++++++++++++++ ports/rmlui/portfile.cmake | 56 ++++++++++++++++++++++++++++++++ ports/rmlui/vcpkg.json | 34 +++++++++++++++++++ versions/baseline.json | 4 +++ versions/r-/rmlui.json | 9 +++++ 5 files changed, 141 insertions(+) create mode 100644 ports/rmlui/add-robin-hood.patch create mode 100644 ports/rmlui/portfile.cmake create mode 100644 ports/rmlui/vcpkg.json create mode 100644 versions/r-/rmlui.json diff --git a/ports/rmlui/add-robin-hood.patch b/ports/rmlui/add-robin-hood.patch new file mode 100644 index 00000000000..4a39a8a5a1a --- /dev/null +++ b/ports/rmlui/add-robin-hood.patch @@ -0,0 +1,38 @@ +diff --git a/CMake/FileList.cmake b/CMake/FileList.cmake +index 9c3042c..c3820df 100644 +--- a/CMake/FileList.cmake ++++ b/CMake/FileList.cmake +@@ -133,7 +133,6 @@ set(Core_PUB_HDR_FILES + ${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ComputedValues.h + ${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Containers/chobo/flat_map.hpp + ${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Containers/chobo/flat_set.hpp +- ${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Containers/robin_hood.h + ${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/Context.h + ${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ContextInstancer.h + ${PROJECT_SOURCE_DIR}/Include/RmlUi/Core/ConvolutionFilter.h +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 62432f1..d9287c9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -387,6 +387,8 @@ if( ENABLE_SVG_PLUGIN ) + message("-- Can SVG plugin be enabled - yes - lunasvg library found") + endif() + ++find_path(ROBIN_HOOD_INCLUDE_DIR robin_hood.h) ++include_directories(${ROBIN_HOOD_INCLUDE_DIR}) + + if(NOT BUILD_FRAMEWORK) + #=================================== +diff --git a/Include/RmlUi/Config/Config.h b/Include/RmlUi/Config/Config.h +index dc42753..5249e1d 100644 +--- a/Include/RmlUi/Config/Config.h ++++ b/Include/RmlUi/Config/Config.h +@@ -57,7 +57,7 @@ + #else + #include "../Core/Containers/chobo/flat_map.hpp" + #include "../Core/Containers/chobo/flat_set.hpp" +-#include "../Core/Containers/robin_hood.h" ++#include + #endif // RMLUI_NO_THIRDPARTY_CONTAINERS + + namespace Rml { diff --git a/ports/rmlui/portfile.cmake b/ports/rmlui/portfile.cmake new file mode 100644 index 00000000000..cf9ec6f0570 --- /dev/null +++ b/ports/rmlui/portfile.cmake @@ -0,0 +1,56 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mikke89/RmlUi + REF 4.1 + SHA512 f79bd30104c42469142e4c79a81f120c61f5bd3ae918df9847fa42d05fcda372d3adb5f6884c81c8517a440a81235e70ffcdde8d98751a14d2e4265fc2051a01 + HEAD_REF master + PATCHES + add-robin-hood.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + lua BUILD_LUA_BINDINGS + INVERTED_FEATURES + freetype NO_FONT_INTERFACE_DEFAULT +) + +# Remove built-in header, instead we use vcpkg version (from robin-hood-hashing port) +file(REMOVE ${SOURCE_PATH}/Include/RmlUi/Core/Containers/robin_hood.h) + +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup( + CONFIG_PATH lib/RmlUi/cmake +) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/lib/RmlUi + ${CURRENT_PACKAGES_DIR}/lib/RmlUi +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/RmlUi/Core/Header.h + "#if !defined RMLUI_STATIC_LIB" + "#if 0" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/RmlUi/Debugger/Header.h + "#if !defined RMLUI_STATIC_LIB" + "#if 0" + ) + if ("lua" IN_LIST FEATURES) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/RmlUi/Lua/Header.h + "#if !defined RMLUI_STATIC_LIB" + "#if 0" + ) + endif() +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/rmlui/vcpkg.json b/ports/rmlui/vcpkg.json new file mode 100644 index 00000000000..9b42867c635 --- /dev/null +++ b/ports/rmlui/vcpkg.json @@ -0,0 +1,34 @@ +{ + "name": "rmlui", + "version": "4.1", + "maintainers": "Michael R. P. Ragazzon ", + "description": "RmlUi is the C++ user interface library based on the HTML and CSS standards, designed as a complete solution for any project's interface needs.", + "homepage": "https://github.com/mikke89/RmlUi", + "documentation": "https://mikke89.github.io/RmlUiDoc/", + "license": "MIT", + "dependencies": [ + "robin-hood-hashing", + "vcpkg-cmake", + "vcpkg-cmake-config" + ], + "default-features": [ + "freetype" + ], + "features": { + "freetype": { + "description": "Include font engine based on FreeType", + "dependencies": [ + { + "name": "freetype", + "default-features": false + } + ] + }, + "lua": { + "description": "Build Lua bindings", + "dependencies": [ + "lua" + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 4921454024e..ef0805696f5 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5524,6 +5524,10 @@ "baseline": "0.3.0", "port-version": 0 }, + "rmlui": { + "baseline": "4.1", + "port-version": 0 + }, "roaring": { "baseline": "2019-03-05-2", "port-version": 0 diff --git a/versions/r-/rmlui.json b/versions/r-/rmlui.json new file mode 100644 index 00000000000..f3c15b656f8 --- /dev/null +++ b/versions/r-/rmlui.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "83f463f3ebcc4e415d6903bea260fb1601a14dd2", + "version": "4.1", + "port-version": 0 + } + ] +}