diff options
| author | angelmixu <salemixu@gmail.com> | 2018-08-01 02:10:12 +0200 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-07-31 17:10:12 -0700 |
| commit | 81d3b2cc6ac89cb9d4f88d24e03bd2b5917fbe49 (patch) | |
| tree | cee2d684f1bab088faf3d63ed5039609e4411cea | |
| parent | 0618d13b2e0e2b1a922e58b69b20e67a1706c10d (diff) | |
| download | vcpkg-81d3b2cc6ac89cb9d4f88d24e03bd2b5917fbe49.tar.gz vcpkg-81d3b2cc6ac89cb9d4f88d24e03bd2b5917fbe49.zip | |
fix pixman and cairo for macOS (#3923)
* fix pixman error message about Unknown thread local support
* fixes for building cairo on macOS
* corrected appending files to sources
* [cairo][pixman] Bump package versions to include source code changes
| -rw-r--r-- | ports/cairo/0001_fix_osx_defined.patch | 13 | ||||
| -rw-r--r-- | ports/cairo/CMakeLists.txt | 53 | ||||
| -rw-r--r-- | ports/cairo/CONTROL | 2 | ||||
| -rw-r--r-- | ports/cairo/portfile.cmake | 1 | ||||
| -rw-r--r-- | ports/pixman/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | ports/pixman/CONTROL | 2 |
6 files changed, 61 insertions, 15 deletions
diff --git a/ports/cairo/0001_fix_osx_defined.patch b/ports/cairo/0001_fix_osx_defined.patch new file mode 100644 index 000000000..7365dcce2 --- /dev/null +++ b/ports/cairo/0001_fix_osx_defined.patch @@ -0,0 +1,13 @@ +diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c +index 3b308757..36700ff0 100644 +--- a/src/cairo-ft-font.c ++++ b/src/cairo-ft-font.c +@@ -67,7 +67,7 @@ + #include FT_LCD_FILTER_H + #endif + +-#if HAVE_UNISTD_H ++#if defined(HAVE_UNISTD_H) + #include <unistd.h> + #else + #define access(p, m) 0 diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt index 692c29cd5..5ace57604 100644 --- a/ports/cairo/CMakeLists.txt +++ b/ports/cairo/CMakeLists.txt @@ -2,7 +2,10 @@ cmake_minimum_required(VERSION 3.0) project(cairo C) # Add include directories -include_directories("." "./win32") +include_directories(".") +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + include_directories("./win32") +endif() file(GLOB SOURCES "cairo-analysis-surface.c" @@ -112,15 +115,6 @@ file(GLOB SOURCES "cairo-user-font.c" "cairo-version.c" "cairo-wideint.c" -# win32 -"win32/cairo-win32-debug.c" -"win32/cairo-win32-device.c" -"win32/cairo-win32-gdi-compositor.c" -"win32/cairo-win32-system.c" -"win32/cairo-win32-surface.c" -"win32/cairo-win32-display-surface.c" -"win32/cairo-win32-printing-surface.c" -"win32/cairo-win32-font.c" # generic font support "cairo-cff-subset.c" "cairo-scaled-font-subsets.c" @@ -148,6 +142,22 @@ file(GLOB SOURCES "cairo-ft-font.c" ) +# win32 +file(GLOB PLATFORM_SOURCES_WIN32 +"win32/cairo-win32-debug.c" +"win32/cairo-win32-device.c" +"win32/cairo-win32-gdi-compositor.c" +"win32/cairo-win32-system.c" +"win32/cairo-win32-surface.c" +"win32/cairo-win32-display-surface.c" +"win32/cairo-win32-printing-surface.c" +"win32/cairo-win32-font.c" +) + +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + list(APPEND SOURCES ${PLATFORM_SOURCES_WIN32}) +endif() + set(CMAKE_DEBUG_POSTFIX "d") find_package(ZLIB REQUIRED) @@ -172,10 +182,27 @@ add_definitions( # Find FontConfig find_library(FONTCONFIG_LIBRARY fontconfig) +# additional features for macOS +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + add_definitions( + -DHAVE_INTTYPES_H=1 + -DHAVE_STDINT_H=1 + -DHAVE_SYS_TYPES_H=1 + -DHAVE_UINT64_T=1 + -DHAVE_UNISTD_H=1 + -DCAIRO_HAS_PTHREAD=1 + -DCAIRO_HAS_REAL_PTHREAD=1) +endif() + add_library(cairo ${SOURCES}) -# cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files -target_compile_options(cairo PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" - PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101") + +if(MSVC) + # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files + # NOTE: options only available to MSVC, clang in macOS doesn't understand these flags + target_compile_options(cairo PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" + PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101") +endif() + target_link_libraries(cairo gdi32 msimg32 user32 ZLIB::ZLIB PNG::PNG freetype ${PIXMAN_LIBRARY} ${FONTCONFIG_LIBRARY}) install(TARGETS cairo diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL index 80269f5a7..eb1964c8a 100644 --- a/ports/cairo/CONTROL +++ b/ports/cairo/CONTROL @@ -1,4 +1,4 @@ Source: cairo -Version: 1.15.8-1 +Version: 1.15.8-2 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, glib, freetype, fontconfig diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake index 6fb0e7ce8..bc74654d0 100644 --- a/ports/cairo/portfile.cmake +++ b/ports/cairo/portfile.cmake @@ -19,6 +19,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/export-only-in-shared-build.patch" + "${CMAKE_CURRENT_LIST_DIR}/0001_fix_osx_defined.patch" ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/src) diff --git a/ports/pixman/CMakeLists.txt b/ports/pixman/CMakeLists.txt index 322c08a9c..8dc9940cb 100644 --- a/ports/pixman/CMakeLists.txt +++ b/ports/pixman/CMakeLists.txt @@ -4,6 +4,11 @@ project(pixman VERSION 0.32.0 LANGUAGES C) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set(CMAKE_DEBUG_POSTFIX "d") +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + add_definitions(-DTLS=__thread) + add_definitions(-DHAVE_PTHREADS) +endif() + include_directories(".") file(GLOB SOURCES diff --git a/ports/pixman/CONTROL b/ports/pixman/CONTROL index 940c30cc2..0deb60d33 100644 --- a/ports/pixman/CONTROL +++ b/ports/pixman/CONTROL @@ -1,3 +1,3 @@ Source: pixman -Version: 0.34.0-2 +Version: 0.34.0-3 Description: Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization. |
