Skip to content

Truly independent web browser

Meta: Fix build zmij build errors on clang-cl

Zaggy1024490c94e28f17
diff --git a/Meta/CMake/vcpkg/overlay-ports/zmij/001-explicit-array-sizes.patch b/Meta/CMake/vcpkg/overlay-ports/zmij/001-explicit-array-sizes.patch
new file mode 100644
index 00000000000..73633c599e0
--- /dev/null
+++ b/Meta/CMake/vcpkg/overlay-ports/zmij/001-explicit-array-sizes.patch
@@ -0,0 +1,30 @@
+diff --git a/zmij.h b/zmij.h
+--- a/zmij.h
++++ b/zmij.h
+@@ -292,7 +292,7 @@ constexpr
+
+ // Compressed 128-bit significands of powers of 10.
+ template <typename = void> struct pow10_data {
+- static constexpr uint64_t minor[] = {
++ static constexpr uint64_t minor[28] = {
+ 0x8000000000000000, 0xa000000000000000, 0xc800000000000000,
+ 0xfa00000000000000, 0x9c40000000000000, 0xc350000000000000,
+ 0xf424000000000000, 0x9896800000000000, 0xbebc200000000000,
+@@ -304,7 +304,7 @@ template <typename = void> struct pow10_data {
+ 0xd3c21bcecceda100, 0x84595161401484a0, 0xa56fa5b99019a5c8,
+ 0xcecb8f27f4200f3a,
+ };
+- static constexpr uint128 major[] = {
++ static constexpr uint128 major[25] = {
+ {0xaddcb9e83c6b1793, 0xdf4abe242a1bbf3e}, // -331 (+1 ULP: see fixups)
+ {0xaf8e5410288e1b6f, 0x07ecf0ae5ee44dda}, // -303
+ {0xb1442798f49ffb4a, 0x99cd11cfdf41779d}, // -275
+@@ -331,7 +331,7 @@ template <typename = void> struct pow10_data {
+ {0xd94ad8b1c7380874, 0x18375281ae7822bd}, // 313 (+1 ULP: see fixups)
+ {0xdb68c2ca82ed2a05, 0xa67398db9f6820e1}, // 341
+ };
+- static constexpr uint32_t fixups[] = {
++ static constexpr uint32_t fixups[21] = {
+ 0x8d8fc810, 0x06100293, 0x19000000, 0x00100000, 0x00000908, 0x00000000,
+ 0x04e00300, 0x3807e0b2, 0x3d83d793, 0x0006f5cc, 0x00000000, 0xffff0000,
+ 0x8076337d, 0x4ff45ba0, 0x09405033, 0x034376d9, 0x09000000, 0x4e100501,
diff --git a/Meta/CMake/vcpkg/overlay-ports/zmij/portfile.cmake b/Meta/CMake/vcpkg/overlay-ports/zmij/portfile.cmake
new file mode 100644
index 00000000000..ce580ba96c6
--- /dev/null
+++ b/Meta/CMake/vcpkg/overlay-ports/zmij/portfile.cmake
@@ -0,0 +1,29 @@
+if(VCPKG_TARGET_IS_WINDOWS)
+ # Upstream does not export symbols for Windows shared libraries.
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO vitaut/zmij
+ REF "v${VERSION}"
+ SHA512 f7c73c6cadb5588e717feac96ea6c4b0eb0bd1317b16008e3fe761af265808832ea03b2bc97b188200a5e14726d229fc589afaafee87f59fc290a6266a2b2a92
+ HEAD_REF main
+ PATCHES
+ 001-explicit-array-sizes.patch # https://github.com/vitaut/zmij/commit/5b87a80c60
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DZMIJ_TEST=OFF
+ -DZMIJ_EXAMPLE=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/zmij")
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/Meta/CMake/vcpkg/overlay-ports/zmij/vcpkg.json b/Meta/CMake/vcpkg/overlay-ports/zmij/vcpkg.json
new file mode 100644
index 00000000000..18b25c92f1f
--- /dev/null
+++ b/Meta/CMake/vcpkg/overlay-ports/zmij/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "zmij",
+ "version": "1.2",
+ "port-version": 1,
+ "description": "A fast floating-point-to-string conversion library for C and C++",
+ "homepage": "https://github.com/vitaut/zmij",
+ "license": "MIT OR BSL-1.0",
+ "supports": "!arm | arm64",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}
diff --git a/vcpkg.json b/vcpkg.json
index da8c0ef6a8c..0d6754f1438 100644
--- a/vcpkg.json
+++ b/vcpkg.json
@@ -457,7 +457,7 @@
},
{
"name": "zmij",
- "version": "1.2#0"
+ "version": "1.2#1"
}
]
}