2021-05-07 04:51:00 +08:00
|
|
|
set(CAIRO_VERSION 1.17.4)
|
2018-09-12 04:11:51 +08:00
|
|
|
|
2021-05-07 04:51:00 +08:00
|
|
|
vcpkg_from_gitlab(
|
|
|
|
GITLAB_URL https://gitlab.freedesktop.org
|
2018-09-12 04:11:51 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-05-07 04:51:00 +08:00
|
|
|
REPO cairo/cairo
|
|
|
|
REF 156cd3eaaebfd8635517c2baf61fcf3627ff7ec2 #v1.17.4
|
|
|
|
SHA512 2c516ad3ffe56cf646b2435d6ef3cf25e8c05aeb13d95dd18a7d0510d134d9990cba1b376063352ff99483cfc4e5d2af849afd2f9538f9136f22d44d34be362c
|
|
|
|
HEAD_REF master
|
2021-05-14 04:13:16 +08:00
|
|
|
PATCHES 0001-meson-fix-macOS-build-and-add-macOS-ci.patch
|
2021-07-16 07:01:16 +08:00
|
|
|
cairo_static_fix.patch
|
2017-06-14 14:05:50 +08:00
|
|
|
)
|
|
|
|
|
2021-04-20 06:30:03 +08:00
|
|
|
if("fontconfig" IN_LIST FEATURES)
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dfontconfig=enabled)
|
2021-04-27 01:28:21 +08:00
|
|
|
else()
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dfontconfig=disabled)
|
2021-02-04 04:56:00 +08:00
|
|
|
endif()
|
2021-04-20 06:30:03 +08:00
|
|
|
|
2021-04-27 01:28:21 +08:00
|
|
|
if("freetype" IN_LIST FEATURES)
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dfreetype=enabled)
|
2021-04-27 01:28:21 +08:00
|
|
|
else()
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dfreetype=disabled)
|
2021-04-20 06:30:03 +08:00
|
|
|
endif()
|
|
|
|
|
2019-09-20 06:18:04 +08:00
|
|
|
if ("x11" IN_LIST FEATURES)
|
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
message(FATAL_ERROR "Feature x11 only support UNIX.")
|
|
|
|
endif()
|
|
|
|
message(WARNING "You will need to install Xorg dependencies to use feature x11:\napt install libx11-dev libxft-dev\n")
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dxlib=enabled)
|
2021-04-27 01:28:21 +08:00
|
|
|
else()
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dxlib=disabled)
|
2019-09-20 06:18:04 +08:00
|
|
|
endif()
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dxcb=disabled)
|
2021-12-03 07:48:34 +08:00
|
|
|
#list(APPEND OPTIONS -Dxlib-xcb=disabled) don't forget this option with the next update!
|
2019-09-20 06:18:04 +08:00
|
|
|
|
2020-06-24 05:28:19 +08:00
|
|
|
if("gobject" IN_LIST FEATURES)
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
message(FATAL_ERROR "Feature gobject currently only supports dynamic build.")
|
|
|
|
endif()
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dglib=enabled)
|
2021-04-27 01:28:21 +08:00
|
|
|
else()
|
2021-05-07 04:51:00 +08:00
|
|
|
list(APPEND OPTIONS -Dglib=disabled)
|
2020-06-24 05:28:19 +08:00
|
|
|
endif()
|
|
|
|
|
2021-04-27 01:28:21 +08: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-07 04:51:00 +08:00
|
|
|
vcpkg_configure_meson(
|
2021-04-27 01:28:21 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS ${OPTIONS}
|
2021-05-14 04:13:16 +08:00
|
|
|
-Dtests=disabled
|
|
|
|
-Dzlib=enabled
|
|
|
|
-Dpng=enabled
|
|
|
|
-Dspectre=auto
|
|
|
|
-Dgtk2-utils=disabled
|
2017-07-13 23:21:30 +08:00
|
|
|
)
|
2021-05-07 04:51:00 +08:00
|
|
|
vcpkg_install_meson()
|
2018-09-12 04:11:51 +08:00
|
|
|
|
2020-06-11 17:27:30 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2017-06-01 14:32:41 +08:00
|
|
|
|
2021-04-27 01:28:21 +08: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-26 07:48:19 +08:00
|
|
|
# Handle copyright
|
2021-05-07 04:51:00 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2016-11-26 07:48:19 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
2021-05-07 04:51:00 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-04-27 01:28:21 +08:00
|
|
|
|
2021-05-14 04:13:16 +08:00
|
|
|
#TODO: Fix script
|
2021-05-07 04:51:00 +08:00
|
|
|
#set(TOOLS)
|
|
|
|
#if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/cairo-trace${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
|
2021-05-14 04:13:16 +08:00
|
|
|
# list(APPEND TOOLS cairo-trace) # sh script which needs to be fixed due to absolute paths in it.
|
2021-05-07 04:51:00 +08: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-14 04:13:16 +08:00
|
|
|
endif()
|