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/woff2 | |
Diffstat (limited to 'vcpkg/ports/woff2')
| -rw-r--r-- | vcpkg/ports/woff2/0001-unofficial-brotli.patch | 57 | ||||
| -rw-r--r-- | vcpkg/ports/woff2/0002-stdint-include.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/woff2/portfile.cmake | 36 | ||||
| -rw-r--r-- | vcpkg/ports/woff2/vcpkg.json | 13 |
4 files changed, 119 insertions, 0 deletions
diff --git a/vcpkg/ports/woff2/0001-unofficial-brotli.patch b/vcpkg/ports/woff2/0001-unofficial-brotli.patch new file mode 100644 index 0000000..611e49c --- /dev/null +++ b/vcpkg/ports/woff2/0001-unofficial-brotli.patch @@ -0,0 +1,57 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ecfbb83..420c578 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,13 +34,6 @@ endif() + # Find Brotli dependencies + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +-find_package(BrotliDec) +-if (NOT BROTLIDEC_FOUND) +- message(FATAL_ERROR "librotlidec is needed to build woff2.") +-endif () +-find_package(BrotliEnc) +-if (NOT BROTLIENC_FOUND) +- message(FATAL_ERROR "librotlienc is needed to build woff2.") +-endif () ++ find_package(unofficial-brotli REQUIRED) + + # Set compiler flags + if (NOT CANONICAL_PREFIXES) +@@ -63,9 +73,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAG}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAG}") + set(CMAKE_CXX_STANDARD 11) + +-# Set search path for our private/public headers as well as Brotli headers +-include_directories("src" "include" +- "${BROTLIDEC_INCLUDE_DIRS}" "${BROTLIENC_INCLUDE_DIRS}") ++# Set search path for our private/public headers ++include_directories("src" "include") + + # Common part used by decoder and encoder + add_library(woff2common +@@ -77,7 +86,7 @@ add_library(woff2common + add_library(woff2dec + src/woff2_dec.cc + src/woff2_out.cc) +-target_link_libraries(woff2dec woff2common "${BROTLIDEC_LIBRARIES}") ++target_link_libraries(woff2dec woff2common unofficial::brotli::brotlidec) + add_executable(woff2_decompress src/woff2_decompress.cc) + target_link_libraries(woff2_decompress woff2dec) + +@@ -88,7 +97,7 @@ add_library(woff2enc + src/normalize.cc + src/transform.cc + src/woff2_enc.cc) +-target_link_libraries(woff2enc woff2common "${BROTLIENC_LIBRARIES}") ++target_link_libraries(woff2enc woff2common unofficial::brotli::brotlienc) + add_executable(woff2_compress src/woff2_compress.cc) + target_link_libraries(woff2_compress woff2enc) + +@@ -264,6 +273,7 @@ if (NOT BUILD_SHARED_LIBS) + install( + TARGETS woff2_decompress woff2_compress woff2_info + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + endif() + diff --git a/vcpkg/ports/woff2/0002-stdint-include.patch b/vcpkg/ports/woff2/0002-stdint-include.patch new file mode 100644 index 0000000..43f7fc8 --- /dev/null +++ b/vcpkg/ports/woff2/0002-stdint-include.patch @@ -0,0 +1,13 @@ +diff --git a/include/woff2/output.h b/include/woff2/output.h +index dc78ccf..b12d538 100644 +--- a/include/woff2/output.h ++++ b/include/woff2/output.h +@@ -9,6 +9,8 @@ + #ifndef WOFF2_WOFF2_OUT_H_ + #define WOFF2_WOFF2_OUT_H_ + ++#include <stdint.h> ++ + #include <algorithm> + #include <cstring> + #include <memory> diff --git a/vcpkg/ports/woff2/portfile.cmake b/vcpkg/ports/woff2/portfile.cmake new file mode 100644 index 0000000..f70fdc3 --- /dev/null +++ b/vcpkg/ports/woff2/portfile.cmake @@ -0,0 +1,36 @@ +vcpkg_check_linkage(
+ ONLY_STATIC_LIBRARY
+)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO google/woff2
+ REF v1.0.2
+ SHA512 c788bba1530aec463e755e901f9342f4b599e3a07f54645fef1dc388ab5d5c30625535e5dd38e9e792e04a640574baa50eeefb6b7338ab403755f4a4e0c3044d
+ HEAD_REF master
+ PATCHES
+ 0001-unofficial-brotli.patch
+ 0002-stdint-include.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DCANONICAL_PREFIXES=ON
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+file(COPY "${CURRENT_PACKAGES_DIR}/bin/" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/woff2")
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/bin"
+ "${CURRENT_PACKAGES_DIR}/debug/bin"
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+)
+
+vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/woff2")
+
+vcpkg_fixup_pkgconfig()
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/woff2" RENAME copyright)
diff --git a/vcpkg/ports/woff2/vcpkg.json b/vcpkg/ports/woff2/vcpkg.json new file mode 100644 index 0000000..c43c693 --- /dev/null +++ b/vcpkg/ports/woff2/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "woff2", + "version": "1.0.2", + "port-version": 5, + "description": "font compression reference code", + "dependencies": [ + "brotli", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |