mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-16 22:42:18 +00:00
Meta: Add libjxl overlay port
We need some msvc-only cusotmization here to get LibGfx building
This commit is contained in:
parent
91e7664849
commit
35c34a87c0
Notes:
github-actions[bot]
2025-06-27 01:38:02 +00:00
Author: https://github.com/ayeteadoe
Commit: 35c34a87c0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5188
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/stasoid
3 changed files with 136 additions and 0 deletions
39
Meta/CMake/vcpkg/overlay-ports/libjxl/fix-dependencies.patch
Normal file
39
Meta/CMake/vcpkg/overlay-ports/libjxl/fix-dependencies.patch
Normal file
|
@ -0,0 +1,39 @@
|
|||
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
|
||||
index ea22103e..c6dbbe9f 100644
|
||||
--- a/third_party/CMakeLists.txt
|
||||
+++ b/third_party/CMakeLists.txt
|
||||
@@ -31,8 +31,9 @@ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/highway/CMakeLists.txt" AND
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/highway/LICENSE"
|
||||
${PROJECT_BINARY_DIR}/LICENSE.highway COPYONLY)
|
||||
else()
|
||||
- find_package(HWY 1.0.7)
|
||||
- if (NOT HWY_FOUND)
|
||||
+ find_package(HWY NAMES hwy REQUIRED)
|
||||
+ add_library(hwy ALIAS hwy::hwy)
|
||||
+ if (NOT TARGET hwy::hwy)
|
||||
message(FATAL_ERROR
|
||||
"Highway library (hwy) not found. Install libhwy-dev or download it "
|
||||
"to third_party/highway from https://github.com/google/highway . "
|
||||
@@ -48,7 +49,11 @@ endif()
|
||||
# brotli
|
||||
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/brotli/c/include/brotli/decode.h" OR
|
||||
JPEGXL_FORCE_SYSTEM_BROTLI)
|
||||
- find_package(Brotli)
|
||||
+ find_package(Brotli NAMES unofficial-brotli REQUIRED)
|
||||
+ foreach(brlib IN ITEMS brotlienc brotlidec brotlicommon)
|
||||
+ add_library(${brlib} ALIAS unofficial::brotli::${brlib})
|
||||
+ add_library(${brlib}-static ALIAS unofficial::brotli::${brlib})
|
||||
+ endforeach()
|
||||
if (NOT Brotli_FOUND)
|
||||
message(FATAL_ERROR
|
||||
"Brotli not found, install brotli-dev or download brotli source code to"
|
||||
@@ -106,7 +111,8 @@ if (JPEGXL_ENABLE_SKCMS)
|
||||
endif ()
|
||||
if (JPEGXL_ENABLE_VIEWERS OR NOT JPEGXL_ENABLE_SKCMS OR JPEGXL_ENABLE_PLUGINS)
|
||||
if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lcms/.git" OR JPEGXL_FORCE_SYSTEM_LCMS2 )
|
||||
- find_package(LCMS2 2.12)
|
||||
+ find_package(LCMS2 NAMES lcms2 REQUIRED)
|
||||
+ add_library(lcms2 ALIAS lcms2::lcms2)
|
||||
if ( NOT LCMS2_FOUND )
|
||||
message(FATAL_ERROR "Please install lcms2 or run git submodule update --init")
|
||||
endif ()
|
70
Meta/CMake/vcpkg/overlay-ports/libjxl/portfile.cmake
Normal file
70
Meta/CMake/vcpkg/overlay-ports/libjxl/portfile.cmake
Normal file
|
@ -0,0 +1,70 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO libjxl/libjxl
|
||||
REF "v${VERSION}"
|
||||
SHA512 0cfd81d9d3b783f96bd04f244d73ffbc12186c89993d46064a2751bef0a446a5e86be05add5c10f60d4482d39333d9bf3f9a866d6eb84f8fa0d4e8b5828fd74c
|
||||
HEAD_REF main
|
||||
PATCHES
|
||||
fix-dependencies.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
tools JPEGXL_ENABLE_TOOLS
|
||||
INVERTED_FEATURES
|
||||
tools CMAKE_DISABLE_FIND_PACKAGE_GIF
|
||||
tools CMAKE_DISABLE_FIND_PACKAGE_JPEG
|
||||
tools CMAKE_DISABLE_FIND_PACKAGE_PNG
|
||||
tools CMAKE_DISABLE_FIND_PACKAGE_ZLIB
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_UWP)
|
||||
string(APPEND VCPKG_C_FLAGS " /wd4146")
|
||||
string(APPEND VCPKG_CXX_FLAGS " /wd4146")
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
"-DJPEGXL_VERSION=${JPEGXL_VERSION}"
|
||||
-DJPEGXL_FORCE_SYSTEM_HWY=ON
|
||||
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON
|
||||
-DJPEGXL_FORCE_SYSTEM_HWY=ON
|
||||
-DJPEGXL_FORCE_SYSTEM_LCMS2=ON
|
||||
${FEATURE_OPTIONS}
|
||||
-DJPEGXL_ENABLE_BENCHMARK=OFF
|
||||
-DJPEGXL_ENABLE_DOXYGEN=OFF
|
||||
-DJPEGXL_ENABLE_EXAMPLES=OFF
|
||||
-DJPEGXL_ENABLE_FUZZERS=OFF
|
||||
-DJPEGXL_ENABLE_JNI=OFF
|
||||
-DJPEGXL_ENABLE_MANPAGES=OFF
|
||||
-DJPEGXL_ENABLE_OPENEXR=OFF
|
||||
-DJPEGXL_ENABLE_PLUGINS=OFF
|
||||
-DJPEGXL_ENABLE_SJPEG=OFF
|
||||
-DJPEGXL_ENABLE_SKCMS=OFF
|
||||
-DJPEGXL_ENABLE_TCMALLOC=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
-DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON
|
||||
-DJPEGXL_BUNDLE_LIBPNG=OFF
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
CMAKE_DISABLE_FIND_PACKAGE_GIF
|
||||
CMAKE_DISABLE_FIND_PACKAGE_JPEG
|
||||
CMAKE_DISABLE_FIND_PACKAGE_PNG
|
||||
CMAKE_DISABLE_FIND_PACKAGE_ZLIB
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
if(JPEGXL_ENABLE_TOOLS)
|
||||
vcpkg_copy_tools(TOOL_NAMES cjxl djxl jxlinfo AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/jxl/jxl_export.h" "ifdef JXL_STATIC_DEFINE" "if 1")
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
27
Meta/CMake/vcpkg/overlay-ports/libjxl/vcpkg.json
Normal file
27
Meta/CMake/vcpkg/overlay-ports/libjxl/vcpkg.json
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "libjxl",
|
||||
"version-semver": "0.11.1",
|
||||
"description": "JPEG XL image format reference implementation",
|
||||
"homepage": "https://github.com/libjxl/libjxl",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
"brotli",
|
||||
"highway",
|
||||
"lcms",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"tools": {
|
||||
"description": "Build user tools: cjxl and djxl",
|
||||
"dependencies": [
|
||||
"giflib",
|
||||
"libjpeg-turbo",
|
||||
"libpng",
|
||||
"zlib"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue