diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/litehtml | |
Diffstat (limited to 'vcpkg/ports/litehtml')
| -rw-r--r-- | vcpkg/ports/litehtml/fix-relative-includes.patch | 22 | ||||
| -rw-r--r-- | vcpkg/ports/litehtml/portfile.cmake | 28 | ||||
| -rw-r--r-- | vcpkg/ports/litehtml/use-vcpkg-gumbo.patch | 48 | ||||
| -rw-r--r-- | vcpkg/ports/litehtml/vcpkg.json | 18 |
4 files changed, 116 insertions, 0 deletions
diff --git a/vcpkg/ports/litehtml/fix-relative-includes.patch b/vcpkg/ports/litehtml/fix-relative-includes.patch new file mode 100644 index 0000000..e86cb5e --- /dev/null +++ b/vcpkg/ports/litehtml/fix-relative-includes.patch @@ -0,0 +1,22 @@ +diff --git a/include/litehtml.h b/include/litehtml.h +index 98a24e0..d20addd 100644 +--- a/include/litehtml.h ++++ b/include/litehtml.h +@@ -1,11 +1,11 @@ + #ifndef LITEHTML_H + #define LITEHTML_H + +-#include <litehtml/html.h> +-#include <litehtml/document.h> +-#include <litehtml/html_tag.h> +-#include <litehtml/stylesheet.h> +-#include <litehtml/element.h> +-#include <litehtml/utf8_strings.h> ++#include "html.h" ++#include "document.h" ++#include "html_tag.h" ++#include "stylesheet.h" ++#include "element.h" ++#include "utf8_strings.h" + + #endif // LITEHTML_H diff --git a/vcpkg/ports/litehtml/portfile.cmake b/vcpkg/ports/litehtml/portfile.cmake new file mode 100644 index 0000000..bad41e7 --- /dev/null +++ b/vcpkg/ports/litehtml/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO litehtml/litehtml + REF v0.9 + SHA512 2a156671b770a6a20ab00184d9869af779248dd1fb898930b3b479ee88d8b7d84f51fdbd689ae4124530ab70c8697b6641cf06b220631ce4fec4622e63845ea3 + PATCHES + use-vcpkg-gumbo.patch + fix-relative-includes.patch +) + +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DLITEHTML_BUILD_TESTING=OFF +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(PACKAGE_NAME litehtml CONFIG_PATH lib/cmake/litehtml) + + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/litehtml/use-vcpkg-gumbo.patch b/vcpkg/ports/litehtml/use-vcpkg-gumbo.patch new file mode 100644 index 0000000..b387df6 --- /dev/null +++ b/vcpkg/ports/litehtml/use-vcpkg-gumbo.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fe71729..21e77c8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,11 +10,7 @@ enable_testing() + set(PROJECT_MAJOR 0) + set(PROJECT_MINOR 0) + +-option(EXTERNAL_GUMBO "Link against external gumbo instead of shipping a bundled copy" OFF) +- +-if(NOT EXTERNAL_GUMBO) +- add_subdirectory(src/gumbo) +-endif() ++find_package(unofficial-gumbo CONFIG REQUIRED) + + set(SOURCE_LITEHTML + src/codepoint.cpp +@@ -153,7 +149,7 @@ if (LITEHTML_UTF8) + target_include_directories(${PROJECT_NAME} PRIVATE include/${PROJECT_NAME}) + + # Gumbo +-target_link_libraries(${PROJECT_NAME} PUBLIC gumbo) ++target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::gumbo::gumbo) + + # install and export + install(TARGETS ${PROJECT_NAME} +diff --git a/cmake/litehtmlConfig.cmake b/cmake/litehtmlConfig.cmake +index 5eedcf4..1027913 100644 +--- a/cmake/litehtmlConfig.cmake ++++ b/cmake/litehtmlConfig.cmake +@@ -1,3 +1,3 @@ + include(CMakeFindDependencyMacro) +-find_dependency(gumbo) ++find_dependency(unofficial-gumbo) + include(${CMAKE_CURRENT_LIST_DIR}/litehtmlTargets.cmake) +diff --git a/src/document.cpp b/src/document.cpp +index 8bd1ea8..51a9d42 100644 +--- a/src/document.cpp ++++ b/src/document.cpp +@@ -26,7 +26,7 @@ + #include <cmath> + #include <cstdio> + #include <algorithm> +-#include "gumbo.h" ++#include <gumbo.h> + #include "utf8_strings.h" + #include "render_item.h" + #include "render_table.h" diff --git a/vcpkg/ports/litehtml/vcpkg.json b/vcpkg/ports/litehtml/vcpkg.json new file mode 100644 index 0000000..721de0d --- /dev/null +++ b/vcpkg/ports/litehtml/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "litehtml", + "version": "0.9.0", + "description": "litehtml is the lightweight HTML rendering engine with CSS2/CSS3 support.", + "homepage": "https://github.com/litehtml/litehtml", + "license": "BSD-3-Clause", + "dependencies": [ + "gumbo", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |