Merge pull request #4241 from DavidLudwig/io2d-2

[io2d] add new library to ports
This commit is contained in:
Alexander Karatarakis 2018-09-24 19:14:57 -07:00 committed by GitHub
commit 7881abfc29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 331 additions and 113 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.11)
project(cairo C)
# Add include directories
@ -162,14 +162,10 @@ set(CMAKE_DEBUG_POSTFIX "d")
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
# Make the pixman library available
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(PIXMAN_SUFFIX "d")
endif()
find_library(PIXMAN_LIBRARY NAMES pixman-1${PIXMAN_SUFFIX})
find_package(Freetype CONFIG REQUIRED)
find_package(Freetype REQUIRED)
find_package(unofficial-glib CONFIG REQUIRED)
find_package(unofficial-fontconfig CONFIG REQUIRED)
find_package(unofficial-pixman CONFIG REQUIRED)
# Cairo needs to be told which features of FreeType are availible
add_definitions(
@ -179,9 +175,6 @@ add_definitions(
-DHAVE_FT_LOAD_SFNT_TABLE=1
-DHAVE_FT_GET_X11_FONT_FORMAT=1)
# Find FontConfig
find_library(FONTCONFIG_LIBRARY fontconfig)
# additional features for macOS
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_definitions(
@ -196,20 +189,7 @@ endif()
add_library(cairo ${SOURCES})
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
RUNTIME DESTINATION bin
LIBRARY DESTINATION bin
ARCHIVE DESTINATION lib
)
target_link_libraries(cairo PRIVATE gdi32 msimg32 user32 ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 unofficial::fontconfig::fontconfig)
# GObject support module
@ -225,16 +205,43 @@ if(BUILD_SHARED_LIBS)
PROPERTIES COMPILE_DEFINITIONS "cairo_public=__declspec(dllexport)")
endif()
# Make GLib's GObject available
find_path(GLIB_INCLUDE_DIR glib.h)
find_library(GLIB_LIBRARY NAMES glib-2.0)
find_library(GOBJECT_LIBRARY NAMES gobject-2.0)
set(GLIB_LIBRARIES ${GLIB_LIBRARY} ${GOBJECT_LIBRARY})
add_library(cairo-gobject ${CAIRO_GOBJECT_SOURCES})
target_link_libraries(cairo-gobject cairo ${GLIB_LIBRARIES})
target_include_directories(cairo-gobject PRIVATE ${GLIB_INCLUDE_DIR})
install(TARGETS cairo-gobject
target_link_libraries(cairo-gobject PRIVATE cairo unofficial::glib::gobject unofficial::glib::glib)
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 PRIVATE
"/wd4244" "/wd4146" "/wd4312" "/wd4267" "/wd4996" "/wd4311" "/wd4334" "/wd4101"
)
target_compile_options(cairo-gobject PRIVATE
"/wd4244" "/wd4146" "/wd4312" "/wd4267" "/wd4996" "/wd4311" "/wd4334" "/wd4101"
)
endif()
install(TARGETS cairo cairo-gobject
EXPORT cairo-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
ARCHIVE DESTINATION lib
)
install(
EXPORT cairo-targets
NAMESPACE unofficial::cairo::
FILE unofficial-cairo-targets.cmake
DESTINATION share/unofficial-cairo
)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-cairo-config.cmake "
include(CMakeFindDependencyMacro)
find_dependency(ZLIB)
find_dependency(PNG)
find_dependency(Freetype)
find_dependency(unofficial-glib CONFIG)
find_dependency(unofficial-fontconfig CONFIG)
find_dependency(unofficial-pixman CONFIG)
include(\${CMAKE_CURRENT_LIST_DIR}/unofficial-cairo-targets.cmake)
")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-cairo-config.cmake DESTINATION share/unofficial-cairo)

View File

@ -1,4 +1,4 @@
Source: cairo
Version: 1.15.8-2
Version: 1.15.8-3
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

View File

@ -1,25 +1,18 @@
# Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
include(vcpkg_common_functions)
set(CAIRO_VERSION 1.15.8)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-${CAIRO_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "http://cairographics.org/snapshots/cairo-${CAIRO_VERSION}.tar.xz"
FILENAME "cairo-${CAIRO_VERSION}.tar.xz"
SHA512 5af1eebf432201dae0efaa5b6766b151d8273ea00dae48e104d56477005b4d423d64b5d11c512736a4cb076632fb2a572ec35becd922825a68d933bb5ff96ca1
)
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"
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${CAIRO_VERSION}
PATCHES
export-only-in-shared-build.patch
0001_fix_osx_defined.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/src)
@ -32,6 +25,8 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-cairo TARGET_PATH share/unofficial-cairo)
# Copy the appropriate header files.
foreach(FILE
"${SOURCE_PATH}/src/cairo.h"
@ -64,3 +59,5 @@ file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/cairo
file(RENAME ${CURRENT_PACKAGES_DIR}/share/cairo/COPYING ${CURRENT_PACKAGES_DIR}/share/cairo/copyright)
vcpkg_copy_pdbs()
vcpkg_test_cmake(PACKAGE_NAME unofficial-cairo)

View File

@ -43,3 +43,5 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "!defined(XML_STATIC)" "/* vcpkg static build !defined(XML_STATIC) */ 0" EXPAT_EXTERNAL_H "${EXPAT_EXTERNAL_H}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/expat_external.h "${EXPAT_EXTERNAL_H}")
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/expat)

4
ports/expat/usage Normal file
View File

@ -0,0 +1,4 @@
The package expat is compatible with built-in CMake targets:
find_package(EXPAT REQUIRED)
target_link_libraries(main PRIVATE EXPAT::EXPAT)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.11)
project(fontconfig C)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -DHAVE_CONFIG_H)
@ -6,8 +6,7 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -DHAVE_CONF
# find dependencies
find_package(unofficial-iconv CONFIG REQUIRED)
find_package(Freetype REQUIRED)
find_path(EXPAT_INCLUDE_DIR expat.h)
find_library(EXPAT_LIBRARY expat)
find_package(EXPAT REQUIRED)
add_library(fontconfig
src/fcatomic.c
@ -49,9 +48,10 @@ else()
target_include_directories(fontconfig PRIVATE ${FC_INCLUDE_DIR}/unix)
endif()
target_link_libraries(fontconfig PRIVATE unofficial::iconv::libiconv Freetype::Freetype ${EXPAT_LIBRARY})
target_link_libraries(fontconfig PRIVATE unofficial::iconv::libiconv Freetype::Freetype EXPAT::EXPAT)
install(TARGETS fontconfig
EXPORT fontconfig-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
@ -73,3 +73,20 @@ if(NOT FC_SKIP_TOOLS)
install(FILES fonts.conf DESTINATION tools/fontconfig/fonts)
install(DIRECTORY conf.d DESTINATION tools/fontconfig/fonts FILES_MATCHING PATTERN "*.conf")
endif()
install(
EXPORT fontconfig-targets
NAMESPACE unofficial::fontconfig::
FILE unofficial-fontconfig-targets.cmake
DESTINATION share/unofficial-fontconfig
)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-fontconfig-config.cmake "
include(CMakeFindDependencyMacro)
find_dependency(unofficial-iconv CONFIG)
find_dependency(Freetype)
find_dependency(EXPAT)
include(\${CMAKE_CURRENT_LIST_DIR}/unofficial-fontconfig-targets.cmake)
")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-fontconfig-config.cmake DESTINATION share/unofficial-fontconfig)

View File

@ -1,4 +1,4 @@
Source: fontconfig
Version: 2.12.4-3
Version: 2.12.4-7
Description: Library for configuring and customizing font access.
Build-Depends: freetype, expat, libiconv, dirent

View File

@ -1,18 +1,18 @@
include(vcpkg_common_functions)
set(FONTCONFIG_VERSION 2.12.4)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fontconfig-${FONTCONFIG_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz"
FILENAME "fontconfig-${FONTCONFIG_VERSION}.tar.gz"
SHA512 2be3ee0e8e0e3b62571135a3cae06e456c289dd1ad40ef2a7c780406418ee5efce863a833eca5a8ef55bc737a0ea04ef562bba6fd27e174ae43e42131b52810d)
SHA512 2be3ee0e8e0e3b62571135a3cae06e456c289dd1ad40ef2a7c780406418ee5efce863a833eca5a8ef55bc737a0ea04ef562bba6fd27e174ae43e42131b52810d
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/fcobjtypehash.patch"
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${FONTCONFIG_VERSION}
PATCHES fcobjtypehash.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
@ -28,6 +28,9 @@ vcpkg_configure_cmake(
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-fontconfig TARGET_PATH share/unofficial-fontconfig)
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
@ -40,3 +43,5 @@ endif()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright)
vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig)

View File

@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.6)
project (graphicsmagick)
find_package(Zlib REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Bzip2 REQUIRED)
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
@ -29,13 +29,6 @@ include_directories("Magick++")
include_directories("Magick++/lib")
include_directories("wand")
include_directories(${ZLIB_INCLUDE_DIRS})
include_directories(${BZIP2_INCLUDE_DIR})
include_directories(${NATIVE_JPEG_INCLUDE_PATH})
include_directories(${PNG_INCLUDE_DIRS})
include_directories(${TIFF_INCLUDE_DIRS})
include_directories(${FREETYPE_INCLUDE_DIRS})
file(READ "magick/magick_config.h.in" CONFIG_H)
string(REPLACE "#undef HasBZLIB" "#define HasBZLIB" CONFIG_H "${CONFIG_H}")
string(REPLACE "#undef HasJPEG" "#define HasJPEG" CONFIG_H "${CONFIG_H}")
@ -108,18 +101,49 @@ add_library(graphicsmagick coders/art.c coders/avs.c
Magick++/lib/TypeMetric.cpp
wand/drawing_wand.c wand/magick_compat.c wand/magick_wand.c wand/pixel_wand.c)
TARGET_LINK_LIBRARIES(graphicsmagick ${ZLIB_LIBRARIES})
TARGET_LINK_LIBRARIES(graphicsmagick ${BZIP2_LIBRARIES})
TARGET_LINK_LIBRARIES(graphicsmagick ${JPEG_LIBRARIES})
TARGET_LINK_LIBRARIES(graphicsmagick ${PNG_LIBRARIES})
TARGET_LINK_LIBRARIES(graphicsmagick ${TIFF_LIBRARIES})
TARGET_LINK_LIBRARIES(graphicsmagick ${FREETYPE_LIBRARIES})
TARGET_LINK_LIBRARIES(graphicsmagick PRIVATE
ZLIB::ZLIB
BZip2::BZip2
#${JPEG_LIBRARIES}
JPEG::JPEG
PNG::PNG
TIFF::TIFF
Freetype::Freetype
)
target_include_directories(graphicsmagick INTERFACE $<INSTALL_INTERFACE:include>)
install(TARGETS graphicsmagick
EXPORT graphicsmagick-targets
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(
EXPORT graphicsmagick-targets
FILE unofficial-graphicsmagick-targets.cmake
NAMESPACE unofficial::graphicsmagick::
DESTINATION share/unofficial-graphicsmagick
)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
find_package(TIFF REQUIRED)
find_package(Freetype REQUIRED)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-graphicsmagick-config.cmake "
include(CMakeFindDependencyMacro)
find_dependency(ZLIB)
find_dependency(BZip2)
find_dependency(JPEG)
find_dependency(PNG)
find_dependency(TIFF)
find_dependency(Freetype)
include(\${CMAKE_CURRENT_LIST_DIR}/unofficial-graphicsmagick-targets.cmake)
")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-graphicsmagick-config.cmake DESTINATION share/unofficial-graphicsmagick)
option(INSTALL_HEADERS "Install development header files" ON)
if (INSTALL_HEADERS)

View File

@ -1,5 +1,5 @@
Source: graphicsmagick
Maintainer: josuegomes@gmail.com
Version: 1.3.30
Version: 1.3.30-1
Build-Depends: zlib, bzip2, freetype, libjpeg-turbo, libpng, tiff
Description: Image processing library

View File

@ -34,6 +34,8 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-graphicsmagick TARGET_PATH share/unofficial-graphicsmagick)
# copy license
file(COPY ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/graphicsmagick)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/copyright)
@ -48,3 +50,5 @@ string(REPLACE "@windows_font_dir@" "$ENV{SYSTEMROOT}/Fonts/" TYPE_MGK "${TYPE_M
file(WRITE ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/config/type.mgk "${TYPE_MGK}")
vcpkg_copy_pdbs()
vcpkg_test_cmake(PACKAGE_NAME unofficial-graphicsmagick)

4
ports/io2d/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: io2d
Version: 0.1-1
Description: a lightweight, cross platform drawing library
Build-Depends: cairo, graphicsmagick

View File

@ -0,0 +1,47 @@
diff --git a/P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt b/P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt
index 3d4791c..1864b7a 100644
--- a/P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt
+++ b/P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt
@@ -23,7 +23,15 @@ target_compile_features(io2d_cairo PUBLIC cxx_std_17)
target_link_libraries(io2d_cairo PUBLIC io2d_core)
-if(MSVC)
+if(DEFINED VCPKG_TARGET_TRIPLET)
+ find_package(unofficial-cairo CONFIG REQUIRED)
+ set(CAIRO_INCLUDE_DIR)
+ set(CAIRO_LIB_DEBUG "CAIRO_LIB_DEBUG-NOTFOUND")
+ set(CAIRO_LIB_RELEASE unofficial::cairo::cairo)
+ find_package(unofficial-graphicsmagick CONFIG REQUIRED)
+ set(GRAPHICSMAGICK_INCLUDE_DIR)
+ set(GRAPHICSMAGICK_LIB unofficial::graphicsmagick::graphicsmagick)
+elseif(MSVC)
find_path(CAIRO_INCLUDE_DIR cairo.h)
find_path(GRAPHICSMAGICK_INCLUDE_DIR magick/api.h)
find_library(CAIRO_LIB_DEBUG cairod)
diff --git a/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt b/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt
index abb1501..b7a6e71 100644
--- a/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt
+++ b/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt
@@ -24,20 +24,7 @@ target_compile_features(io2d_cairo_win32 PUBLIC cxx_std_17)
target_link_libraries(io2d_cairo_win32 PUBLIC io2d_cairo)
if(MSVC)
- target_compile_definitions(io2d_cairo_win32 PUBLIC -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS)
-
- find_library(PIXMAN_LIB pixman-1)
- find_library(FREETYPE_LIB freetype)
- find_library(FONTCONFIG_LIB fontconfig)
- find_library(BZ_LIB bz2)
- find_library(JPEG_LIB jpeg)
- find_library(TIFF_LIB tiff)
- find_library(EXPAT_LIB expat)
- find_library(LZMA_LIB lzma)
- find_library(ICONV_LIB libiconv)
- find_library(CHARSET_LIB libcharset)
-
- target_link_libraries(io2d_cairo_win32 PUBLIC ${PIXMAN_LIB} ${FREETYPE_LIB} ${FONTCONFIG_LIB} ${BZ_LIB} ${JPEG_LIB} ${TIFF_LIB} ${EXPAT_LIB} ${LZMA_LIB} ${ICONV_LIB} ${CHARSET_LIB})
+ target_compile_definitions(io2d_cairo_win32 PRIVATE -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS)
endif()
install(

56
ports/io2d/portfile.cmake Normal file
View File

@ -0,0 +1,56 @@
# Allow use of vcpkg functions
include(vcpkg_common_functions)
# For now, io2d is always a static library.
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
# Optionally, uncomment and modify one of the 'set(...)' calls below
# to use io2d sources from a local directory, rather than Github.
# set(SOURCE_PATH "C:\\Path\\To\\P0267_RefImpl\\")
# set(SOURCE_PATH "/Path/To/P0267_RefImpl")
# Retrieve and validate io2d source code, as-needed
if ("${SOURCE_PATH}" STREQUAL "")
# TODO: point at cpp-io2d/(whatever), if and as needed
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO cpp-io2d/P0267_RefImpl
REF 21ae92c8be6916034e6e18f08aa57899a975dfb0
SHA512 5b674f98ca7705d6901af339a4189d5ce4f2c3118bfb99430734f355159602f177bc8d1b345c3a2f17947a62547553f7b91747a1f16da063707a4da7f990391d
HEAD_REF master
PATCHES find-package.patch
)
endif()
# Configure the library, using CMake
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DIO2D_WITHOUT_SAMPLES=1
-DIO2D_WITHOUT_TESTS=1
-DCMAKE_INSTALL_INCLUDEDIR:STRING=include
)
# Build + install the library, using CMake
vcpkg_install_cmake()
# Don't have duplicate header files in both include/ and debug/include/ folders
# (within <vcpkg-root>/installed/io2d_*/, as installed by vcpkg_install_cmake()):
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/io2d)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/io2d/io2dConfig.cmake ${CURRENT_PACKAGES_DIR}/share/io2d/io2dTargets.cmake)
file(WRITE ${CURRENT_PACKAGES_DIR}/share/io2d/io2dConfig.cmake "
include(CMakeFindDependencyMacro)
find_dependency(unofficial-cairo CONFIG)
find_dependency(unofficial-graphicsmagick CONFIG)
include(\${CMAKE_CURRENT_LIST_DIR}/io2dTargets.cmake)
")
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/io2d RENAME copyright)
vcpkg_test_cmake(PACKAGE_NAME io2d)

View File

@ -1,11 +1,4 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libjpeg-turbo/libjpeg-turbo
REF 1.5.3
SHA512 0e7a2cd9943b610f49b562c20a5c350a50326a87bce1d39f14fe45760ed2f89a0d2d3e3f0de9f6a7714f566aabadec6b2422b592591ebb98bbad600ea411fea7
HEAD_REF master
)
vcpkg_download_distfile(GETENV_PATCH
URLS "https://github.com/libjpeg-turbo/libjpeg-turbo/commit/bd96b30b74fe166fc94218cfc64a097fafdcc05f.diff"
@ -13,10 +6,15 @@ vcpkg_download_distfile(GETENV_PATCH
SHA512 4cd064521b5e4baba4adf972f9f574f6dd43a2cd3e3ad143ca2cdf0f165024406d4fd2ed094124d0c17c5370394140e82fdd892d3cdc49609acdf8f79db1758c
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/add-options-for-exes-docs-headers.patch"
"${CMAKE_CURRENT_LIST_DIR}/linux-cmake.patch"
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libjpeg-turbo/libjpeg-turbo
REF 1.5.3
SHA512 0e7a2cd9943b610f49b562c20a5c350a50326a87bce1d39f14fe45760ed2f89a0d2d3e3f0de9f6a7714f566aabadec6b2422b592591ebb98bbad600ea411fea7
HEAD_REF master
PATCHES
add-options-for-exes-docs-headers.patch
linux-cmake.patch
"${GETENV_PATCH}"
)
@ -67,3 +65,6 @@ file(COPY
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo/copyright)
vcpkg_copy_pdbs()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/jpeg)
vcpkg_test_cmake(PACKAGE_NAME JPEG MODULE)

View File

@ -0,0 +1,28 @@
_find_package(${ARGS})
if(JPEG_FOUND AND NOT TARGET JPEG::JPEG)
# Backfill JPEG::JPEG to versions of cmake before 3.12
add_library(JPEG::JPEG UNKNOWN IMPORTED)
if(DEFINED JPEG_INCLUDE_DIRS)
set_target_properties(JPEG::JPEG PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${JPEG_INCLUDE_DIRS}")
endif()
if(EXISTS "${JPEG_LIBRARY}")
set_target_properties(JPEG::JPEG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${JPEG_LIBRARY}")
endif()
if(EXISTS "${JPEG_LIBRARY_RELEASE}")
set_property(TARGET JPEG::JPEG APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(JPEG::JPEG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${JPEG_LIBRARY_RELEASE}")
endif()
if(EXISTS "${JPEG_LIBRARY_DEBUG}")
set_property(TARGET JPEG::JPEG APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(JPEG::JPEG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
IMPORTED_LOCATION_DEBUG "${JPEG_LIBRARY_DEBUG}")
endif()
endif()

View File

@ -46,14 +46,14 @@ file(GLOB SOURCES
)
add_library(pixman-1 ${SOURCES})
target_include_directories(pixman-1 PUBLIC $<INSTALL_INTERFACE:include>)
# pixman requires the three PACKAGE* definitions in order to compile. The USE_SSE2 definition lets it use SSE2 instructions for speed. Every target machine should have SSE2 these days.
target_compile_definitions(pixman-1
PUBLIC
PRIVATE
PACKAGE="pixman-1"
PACKAGE_VERSION="0.34.0"
PACKAGE_BUGREPORT=""
PRIVATE
USE_SSE2
)
@ -63,7 +63,15 @@ if(MSVC)
endif()
install(TARGETS pixman-1
EXPORT pixman-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(
EXPORT pixman-targets
NAMESPACE unofficial::pixman::
FILE unofficial-pixman-config.cmake
DESTINATION share/unofficial-pixman
)

View File

@ -1,3 +1,3 @@
Source: pixman
Version: 0.34.0-3
Version: 0.34.0-4
Description: Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization.

View File

@ -1,13 +1,16 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pixman-0.34.0)
set(PIXMAN_VERSION 0.34.0)
vcpkg_download_distfile(ARCHIVE
URLS "https://www.cairographics.org/releases/pixman-0.34.0.tar.gz"
FILENAME "pixman-0.34.0.tar.gz"
URLS "https://www.cairographics.org/releases/pixman-${PIXMAN_VERSION}.tar.gz"
FILENAME "pixman-${PIXMAN_VERSION}.tar.gz"
SHA512 81caca5b71582b53aaac473bc37145bd66ba9acebb4773fa8cdb51f4ed7fbcb6954790d8633aad85b2826dd276bcce725e26e37997a517760e9edd72e2669a6d
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${PIXMAN_VERSION}
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/pixman)
@ -18,6 +21,8 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-pixman TARGET_PATH share/unofficial-pixman)
# Copy the appropriate header files.
file(COPY
"${SOURCE_PATH}/pixman/pixman.h"
@ -36,3 +41,5 @@ file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pixma
file(RENAME ${CURRENT_PACKAGES_DIR}/share/pixman/COPYING ${CURRENT_PACKAGES_DIR}/share/pixman/copyright)
vcpkg_copy_pdbs()
vcpkg_test_cmake(PACKAGE_NAME unofficial-pixman)

View File

@ -1,21 +1,20 @@
include(vcpkg_common_functions)
set(LIBTIFF_VERSION 4.0.9)
set(LIBTIFF_HASH 04f3d5eefccf9c1a0393659fe27f3dddd31108c401ba0dc587bca152a1c1f6bc844ba41622ff5572da8cc278593eff8c402b44e7af0a0090e91d326c2d79f6cd)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tiff-${LIBTIFF_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "http://download.osgeo.org/libtiff/tiff-${LIBTIFF_VERSION}.tar.gz"
FILENAME "tiff-${LIBTIFF_VERSION}.tar.gz"
SHA512 ${LIBTIFF_HASH}
SHA512 04f3d5eefccf9c1a0393659fe27f3dddd31108c401ba0dc587bca152a1c1f6bc844ba41622ff5572da8cc278593eff8c402b44e7af0a0090e91d326c2d79f6cd
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-component-options.patch
${CMAKE_CURRENT_LIST_DIR}/fix-cxx-shared-libs.patch
${CMAKE_CURRENT_LIST_DIR}/crt-secure-no-deprecate.patch
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${LIBTIFF_VERSION}
PATCHES
add-component-options.patch
fix-cxx-shared-libs.patch
crt-secure-no-deprecate.patch
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
@ -53,5 +52,8 @@ file(INSTALL
DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff
RENAME copyright
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff)
vcpkg_copy_pdbs()
vcpkg_test_cmake(PACKAGE_NAME TIFF MODULE)

4
ports/tiff/usage Normal file
View File

@ -0,0 +1,4 @@
The package tiff is compatible with built-in CMake targets:
find_package(TIFF REQUIRED)
target_link_libraries(main PRIVATE TIFF::TIFF)

View File

@ -8,15 +8,16 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
endif()
find_package(JPEG)
list(APPEND TIFF_EXTRA_LIBRARIES ${JPEG_LIBRARIES})
find_package(ZLIB)
if(TARGET TIFF::TIFF)
set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${TIFF_EXTRA_LIBRARIES} ZLIB::ZLIB)
set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${TIFF_EXTRA_LIBRARIES} JPEG::JPEG ZLIB::ZLIB)
if(UNIX)
set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES m)
endif()
endif()
if(TIFF_LIBRARIES)
list(APPEND TIFF_LIBRARIES ${TIFF_EXTRA_LIBRARIES} ${ZLIB_LIBRARIES})
list(APPEND TIFF_LIBRARIES ${TIFF_EXTRA_LIBRARIES} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES})
if(UNIX)
list(APPEND TIFF_LIBRARIES m)
endif()