2022-08-01 23:21:17 +02:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
|
|
set(PATCHES fix_clang-cl_build.patch)
|
|
|
|
endif()
|
|
|
|
|
2021-05-06 22:51:00 +02:00
|
|
|
vcpkg_from_gitlab(
|
2018-09-11 13:11:51 -07:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2023-02-27 21:51:45 +02:00
|
|
|
GITLAB_URL https://gitlab.freedesktop.org
|
2021-05-06 22:51:00 +02:00
|
|
|
REPO cairo/cairo
|
2023-06-30 17:36:41 -07:00
|
|
|
REF "${VERSION}"
|
2023-02-27 21:51:45 +02:00
|
|
|
SHA512 e12f4b05326c1ac7d930e18d95398dc9c65f3af9745d7fd301ef1663dd378feeb43acc47de17fd082d0acf96e9fc60310557c24e3fe8af06d17931590c7759c6
|
2022-04-07 22:45:25 +08:00
|
|
|
PATCHES
|
|
|
|
cairo_static_fix.patch
|
|
|
|
disable-atomic-ops-check.patch # See https://gitlab.freedesktop.org/cairo/cairo/-/issues/554
|
2022-07-07 23:15:53 +02:00
|
|
|
mingw-dllexport.patch
|
2023-01-19 12:52:48 -08:00
|
|
|
fix-static-missing-lib-msimg32.patch
|
2022-08-01 23:21:17 +02:00
|
|
|
${PATCHES}
|
2017-06-14 08:05:50 +02:00
|
|
|
)
|
|
|
|
|
2021-04-20 00:30:03 +02:00
|
|
|
if("fontconfig" IN_LIST FEATURES)
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dfontconfig=enabled)
|
2021-04-26 19:28:21 +02:00
|
|
|
else()
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dfontconfig=disabled)
|
2021-02-03 15:56:00 -05:00
|
|
|
endif()
|
2021-04-20 00:30:03 +02:00
|
|
|
|
2021-04-26 19:28:21 +02:00
|
|
|
if("freetype" IN_LIST FEATURES)
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dfreetype=enabled)
|
2021-04-26 19:28:21 +02:00
|
|
|
else()
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dfreetype=disabled)
|
2021-04-20 00:30:03 +02:00
|
|
|
endif()
|
|
|
|
|
2019-09-20 06:18:04 +08:00
|
|
|
if ("x11" IN_LIST FEATURES)
|
2022-05-05 04:35:37 +03:00
|
|
|
message(WARNING "You will need to install Xorg dependencies to use feature x11:\nsudo apt install libx11-dev libxft-dev libxext-dev\n")
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dxlib=enabled)
|
2021-04-26 19:28:21 +02:00
|
|
|
else()
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dxlib=disabled)
|
2019-09-20 06:18:04 +08:00
|
|
|
endif()
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dxcb=disabled)
|
2022-04-01 21:39:10 +00:00
|
|
|
list(APPEND OPTIONS -Dxlib-xcb=disabled)
|
2019-09-20 06:18:04 +08:00
|
|
|
|
2020-06-24 05:28:19 +08:00
|
|
|
if("gobject" IN_LIST FEATURES)
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dglib=enabled)
|
2021-04-26 19:28:21 +02:00
|
|
|
else()
|
2021-05-06 22:51:00 +02:00
|
|
|
list(APPEND OPTIONS -Dglib=disabled)
|
2020-06-24 05:28:19 +08:00
|
|
|
endif()
|
|
|
|
|
2021-04-26 19:28:21 +02:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
|
|
set(ENV{CPP} "cl_cpp_wrapper")
|
|
|
|
endif()
|
2019-09-20 06:18:04 +08:00
|
|
|
|
2021-05-06 22:51:00 +02:00
|
|
|
vcpkg_configure_meson(
|
2022-04-07 22:45:25 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-06-30 17:36:41 -07:00
|
|
|
OPTIONS
|
|
|
|
${OPTIONS}
|
2021-05-13 22:13:16 +02:00
|
|
|
-Dtests=disabled
|
|
|
|
-Dzlib=enabled
|
|
|
|
-Dpng=enabled
|
|
|
|
-Dspectre=auto
|
|
|
|
-Dgtk2-utils=disabled
|
2022-04-01 21:39:10 +00:00
|
|
|
-Dsymbol-lookup=disabled
|
2017-07-13 17:21:30 +02:00
|
|
|
)
|
2021-05-06 22:51:00 +02:00
|
|
|
vcpkg_install_meson()
|
2018-09-11 13:11:51 -07:00
|
|
|
|
2020-06-11 17:27:30 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2017-06-01 08:32:41 +02:00
|
|
|
|
2021-04-26 19:28:21 +02:00
|
|
|
set(_file "${CURRENT_PACKAGES_DIR}/include/cairo/cairo.h")
|
|
|
|
file(READ ${_file} CAIRO_H)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
string(REPLACE "defined (CAIRO_WIN32_STATIC_BUILD)" "1" CAIRO_H "${CAIRO_H}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "defined (CAIRO_WIN32_STATIC_BUILD)" "0" CAIRO_H "${CAIRO_H}")
|
|
|
|
endif()
|
|
|
|
file(WRITE ${_file} "${CAIRO_H}")
|
|
|
|
|
2016-11-25 18:48:19 -05:00
|
|
|
vcpkg_copy_pdbs()
|
2021-05-06 22:51:00 +02:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-04-26 19:28:21 +02:00
|
|
|
|
2021-05-13 22:13:16 +02:00
|
|
|
#TODO: Fix script
|
2021-05-06 22:51:00 +02:00
|
|
|
#set(TOOLS)
|
|
|
|
#if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/cairo-trace${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
|
2021-05-13 22:13:16 +02:00
|
|
|
# list(APPEND TOOLS cairo-trace) # sh script which needs to be fixed due to absolute paths in it.
|
2021-05-06 22:51:00 +02:00
|
|
|
#endif()
|
|
|
|
#vcpkg_copy_tools(TOOL_NAMES ${TOOLS} AUTO_CLEAN)
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2021-05-13 22:13:16 +02:00
|
|
|
endif()
|
2022-04-07 22:45:25 +08:00
|
|
|
|
2023-06-30 17:36:41 -07:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-04-07 22:45:25 +08:00
|
|
|
# Handle copyright
|
2023-07-11 02:16:20 +02:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/COPYING-LGPL-2.1" "${SOURCE_PATH}/COPYING-MPL-1.1")
|