aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Johnson <AdamJohnso@gmail.com>2021-02-03 15:56:00 -0500
committerGitHub <noreply@github.com>2021-02-03 12:56:00 -0800
commit323a0a387a8a13d05590ce72916acffa7d4c8cb8 (patch)
tree8b496d100ae4d1b69b7dc7584c972f17a2663527
parent9adaafc4f46250ee4b88a91de6db74a476e6fdc3 (diff)
downloadvcpkg-323a0a387a8a13d05590ce72916acffa7d4c8cb8.tar.gz
vcpkg-323a0a387a8a13d05590ce72916acffa7d4c8cb8.zip
[cairo] Make freetype and fontconfig optional. (#15965)
* [cairo] Make fontconfig optional. * [cairo] Update port versions
-rw-r--r--ports/cairo/CMakeLists.txt46
-rw-r--r--ports/cairo/CONTROL13
-rw-r--r--ports/cairo/cairo-features.h.in (renamed from ports/cairo/cairo-features.h)4
-rw-r--r--ports/cairo/portfile.cmake8
-rw-r--r--ports/cairo/vcpkg.json33
-rw-r--r--versions/baseline.json2
-rw-r--r--versions/c-/cairo.json5
7 files changed, 77 insertions, 34 deletions
diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt
index a68491fbd..b66d0b905 100644
--- a/ports/cairo/CMakeLists.txt
+++ b/ports/cairo/CMakeLists.txt
@@ -156,10 +156,13 @@ file(GLOB SOURCES
"cairo-svg-surface.c"
# script surface
"cairo-script-surface.c"
-# fontconfig + freetype
-"cairo-ft-font.c"
)
+if(WITH_FREETYPE)
+ file(GLOB _FREETYPE_SOURCES "cairo-ft-font.c")
+ list(APPEND SOURCES ${_FREETYPE_SOURCES})
+endif()
+
# win32
file(GLOB PLATFORM_SOURCES_WIN32
"win32/cairo-win32-debug.c"
@@ -181,17 +184,21 @@ set(CMAKE_DEBUG_POSTFIX "d")
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
-find_package(Freetype REQUIRED)
-find_package(Fontconfig REQUIRED)
+if(WITH_FREETYPE)
+ find_package(Freetype REQUIRED)
+ find_package(Fontconfig REQUIRED)
+endif()
find_package(unofficial-pixman CONFIG REQUIRED)
# Cairo needs to be told which features of FreeType are availible
-add_definitions(
- -DHAVE_FT_GLYPHSLOT_EMBOLDEN=1
- -DHAVE_FT_LIBRARY_SETLCDFILTER=1
- -DHAVE_FT_GLYPHSLOT_OBLIQUE=1
- -DHAVE_FT_LOAD_SFNT_TABLE=1
- -DHAVE_FT_GET_X11_FONT_FORMAT=1)
+if(WITH_FREETYPE)
+ add_definitions(
+ -DHAVE_FT_GLYPHSLOT_EMBOLDEN=1
+ -DHAVE_FT_LIBRARY_SETLCDFILTER=1
+ -DHAVE_FT_GLYPHSLOT_OBLIQUE=1
+ -DHAVE_FT_LOAD_SFNT_TABLE=1
+ -DHAVE_FT_GET_X11_FONT_FORMAT=1)
+endif()
# additional features for macOS
if(UNIX OR APPLE)
@@ -210,8 +217,11 @@ add_library(cairo ${SOURCES})
if (WITH_X11)
target_compile_definitions(cairo PUBLIC -DCAIRO_HAS_XLIB_SURFACE=1)
endif()
-target_include_directories(cairo PUBLIC ${FREETYPE_INCLUDE_DIRS})
-target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 Fontconfig::Fontconfig)
+if(WITH_FREETYPE)
+ target_include_directories(cairo PUBLIC ${FREETYPE_INCLUDE_DIRS})
+ target_link_libraries(cairo PRIVATE Freetype::Freetype Fontconfig::Fontconfig)
+endif()
+target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG unofficial::pixman::pixman-1)
if(WIN32)
target_link_libraries(cairo PRIVATE gdi32 msimg32 user32)
@@ -292,14 +302,16 @@ install(
DESTINATION share/unofficial-cairo
)
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-cairo-config.cmake "
-include(CMakeFindDependencyMacro)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-cairo-config.cmake
+"include(CMakeFindDependencyMacro)
find_dependency(ZLIB)
find_dependency(PNG)
-find_dependency(Freetype)
-find_dependency(Fontconfig)
+if(${WITH_FREETYPE})
+ find_dependency(Freetype)
+ find_dependency(Fontconfig)
+endif()
find_dependency(unofficial-pixman CONFIG)
-if(WITH_GOBJECT)
+if(${WITH_GOBJECT})
find_dependency(unofficial-glib CONFIG)
endif()
diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL
deleted file mode 100644
index 06877af9b..000000000
--- a/ports/cairo/CONTROL
+++ /dev/null
@@ -1,13 +0,0 @@
-Source: cairo
-Version: 1.16.0
-Port-Version: 8
-Homepage: https://cairographics.org
-Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.
-Build-Depends: zlib, libpng, pixman, freetype, fontconfig
-
-Feature: x11
-Description: build with x11 support
-
-Feature: gobject
-Description: build gobject module
-Build-Depends: glib \ No newline at end of file
diff --git a/ports/cairo/cairo-features.h b/ports/cairo/cairo-features.h.in
index e3eb31c13..1254b59e5 100644
--- a/ports/cairo/cairo-features.h
+++ b/ports/cairo/cairo-features.h.in
@@ -30,9 +30,9 @@
#define CAIRO_HAS_GOBJECT_FUNCTIONS 1
/* Require FreeType */
-#define CAIRO_HAS_FT_FONT 1
+#cmakedefine01 CAIRO_HAS_FT_FONT
/* Require FontConfig */
-#define CAIRO_HAS_FC_FONT 1
+#cmakedefine01 CAIRO_HAS_FC_FONT
#endif
diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake
index 414c0df19..c567dc2cc 100644
--- a/ports/cairo/portfile.cmake
+++ b/ports/cairo/portfile.cmake
@@ -15,7 +15,12 @@ vcpkg_extract_source_archive_ex(
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/src)
-file(COPY ${CURRENT_PORT_DIR}/cairo-features.h DESTINATION ${SOURCE_PATH}/src)
+
+if("freetype" IN_LIST FEATURES)
+ set(CAIRO_HAS_FT_FONT TRUE)
+ set(CAIRO_HAS_FC_FONT TRUE)
+endif()
+configure_file("${CMAKE_CURRENT_LIST_DIR}/cairo-features.h.in" "${SOURCE_PATH}/src/cairo-features.h")
if ("x11" IN_LIST FEATURES)
if (VCPKG_TARGET_IS_WINDOWS)
@@ -33,6 +38,7 @@ endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
x11 WITH_X11
gobject WITH_GOBJECT
+ freetype WITH_FREETYPE
)
vcpkg_configure_cmake(
diff --git a/ports/cairo/vcpkg.json b/ports/cairo/vcpkg.json
new file mode 100644
index 000000000..a8c093e81
--- /dev/null
+++ b/ports/cairo/vcpkg.json
@@ -0,0 +1,33 @@
+{
+ "name": "cairo",
+ "version-string": "1.16.0",
+ "port-version": 9,
+ "description": "Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.",
+ "homepage": "https://cairographics.org",
+ "dependencies": [
+ "libpng",
+ "pixman",
+ "zlib"
+ ],
+ "default-features": [
+ "freetype"
+ ],
+ "features": {
+ "freetype": {
+ "description": "use the freetype font backend",
+ "dependencies": [
+ "fontconfig",
+ "freetype"
+ ]
+ },
+ "gobject": {
+ "description": "build gobject module",
+ "dependencies": [
+ "glib"
+ ]
+ },
+ "x11": {
+ "description": "build with x11 support"
+ }
+ }
+}
diff --git a/versions/baseline.json b/versions/baseline.json
index 3851f388c..43962df21 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -1046,7 +1046,7 @@
},
"cairo": {
"baseline": "1.16.0",
- "port-version": 8
+ "port-version": 9
},
"cairomm": {
"baseline": "1.15.3",
diff --git a/versions/c-/cairo.json b/versions/c-/cairo.json
index aefdf577b..b2fab7af9 100644
--- a/versions/c-/cairo.json
+++ b/versions/c-/cairo.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "eb09773c303a9608687dca6a0480ff551c0c2bf9",
+ "version-string": "1.16.0",
+ "port-version": 9
+ },
+ {
"git-tree": "b3a1d73d5c8c18a8c6512385b59d40719f963c8c",
"version-string": "1.16.0",
"port-version": 8