From f0cdf0e9b5a30361c542dafd18df2343f749ab55 Mon Sep 17 00:00:00 2001 From: Undefine Date: Sun, 29 Jun 2025 23:44:45 +0200 Subject: [PATCH] Meta: Fix building skia on FreeBSD --- .../overlay-ports/skia/fix-freebsd.patch | 28 +++++++++++++++++++ .../vcpkg/overlay-ports/skia/portfile.cmake | 7 +++++ 2 files changed, 35 insertions(+) create mode 100644 Meta/CMake/vcpkg/overlay-ports/skia/fix-freebsd.patch diff --git a/Meta/CMake/vcpkg/overlay-ports/skia/fix-freebsd.patch b/Meta/CMake/vcpkg/overlay-ports/skia/fix-freebsd.patch new file mode 100644 index 00000000000..50634e16929 --- /dev/null +++ b/Meta/CMake/vcpkg/overlay-ports/skia/fix-freebsd.patch @@ -0,0 +1,28 @@ +diff --git a/BUILD.gn b/BUILD.gn +index 72d9a23..9c0532e 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -26,7 +26,8 @@ import("gn/ios.gni") + + # Skia public API, generally provided by :skia. + config("skia_public") { +- include_dirs = [ "." ] ++ include_dirs = [ ".", "/usr/local/include" ] ++ lib_dirs = [ "/usr/local/lib" ] + + defines = [ + "SK_CODEC_DECODES_BMP", +diff --git a/gn/toolchain/BUILD.gn b/gn/toolchain/BUILD.gn +index 85858b5..8d6a0ae 100644 +--- a/gn/toolchain/BUILD.gn ++++ b/gn/toolchain/BUILD.gn +@@ -315,7 +315,7 @@ template("gcc_like_toolchain") { + rspfile = "{{output}}.rsp" + rspfile_content = "{{inputs}}" + rm_py = rebase_path("../rm.py") +- command = "$shell python3 \"$rm_py\" \"{{output}}\" && $ar rcs {{output}} @$rspfile" ++ command = "$shell python3 \"$rm_py\" \"{{output}}\" && $ar rcs {{output}} `cat $rspfile`" + } + + outputs = + diff --git a/Meta/CMake/vcpkg/overlay-ports/skia/portfile.cmake b/Meta/CMake/vcpkg/overlay-ports/skia/portfile.cmake index c7fa6f43f77..03cd48167ca 100644 --- a/Meta/CMake/vcpkg/overlay-ports/skia/portfile.cmake +++ b/Meta/CMake/vcpkg/overlay-ports/skia/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( vulkan-headers.patch pdfsubsetfont-uwp.diff skparagraph-gni.diff + fix-freebsd.patch ) # De-vendor @@ -123,6 +124,8 @@ elseif(VCPKG_TARGET_IS_WINDOWS) string(APPEND OPTIONS " skia_enable_skparagraph=false") string(APPEND OPTIONS " skia_enable_bentleyottmann=false") endif() +elseif(VCPKG_TARGET_IS_FREEBSD) + string(APPEND OPTIONS " target_os=\"linux\"") endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") @@ -131,6 +134,10 @@ else() string(APPEND OPTIONS " is_component_build=false") endif() +if(VCPKG_TARGET_IS_FREEBSD) + string(APPEND OPTIONS " skia_use_dng_sdk=false") +endif() + set(required_externals dng_sdk expat