2019-03-16 02:41:42 +08:00
set ( CAIRO_VERSION 1.16.0 )
2018-09-12 04:11:51 +08:00
2016-11-26 07:48:19 +08:00
vcpkg_download_distfile ( ARCHIVE
2019-03-16 02:41:42 +08:00
U R L S " h t t p s : / / w w w . c a i r o g r a p h i c s . o r g / r e l e a s e s / c a i r o - $ { C A I R O _ V E R S I O N } . t a r . x z "
2017-07-13 23:21:30 +08:00
F I L E N A M E " c a i r o - $ { C A I R O _ V E R S I O N } . t a r . x z "
2019-03-16 02:41:42 +08:00
S H A 5 1 2 9 e b 2 7 c 4 c f 0 1 c 0 b 8 b 5 6 f 2 e 1 5 e 6 5 1 f 6 d 4 e 5 2 c 9 9 d 0 0 0 5 8 7 5 5 4 6 4 0 5 b 6 4 f 1 1 3 2 a e d 1 2 f b f 8 4 7 2 7 2 7 3 f 4 9 3 d 8 4 0 5 6 a 1 3 1 0 5 e 0 6 5 0 0 9 d 8 9 e 9 4 a 8 b f a f 2 b e 2 6 4 9 e 2 3 2 b 8 2 3 7 7 f
2016-11-26 07:48:19 +08:00
)
2018-09-12 04:11:51 +08:00
vcpkg_extract_source_archive_ex (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
A R C H I V E $ { A R C H I V E }
R E F $ { C A I R O _ V E R S I O N }
P A T C H E S
e x p o r t - o n l y - i n - s h a r e d - b u i l d . p a t c h
0 0 0 1 _ f i x _ o s x _ d e f i n e d . p a t c h
2021-04-27 01:28:21 +08:00
b u i l d 2 . p a t c h
r e m o v e _ t e s t _ p e r f . p a t c h
2017-06-14 14:05:50 +08:00
)
2021-04-27 01:28:21 +08:00
#TODO the autoconf script has a lot of additional option which use auto detection and should be disabled!
2021-04-20 06:30:03 +08:00
if ( "fontconfig" IN_LIST FEATURES )
2021-04-27 01:28:21 +08:00
list ( APPEND OPTIONS --enable-fc=yes )
else ( )
list ( APPEND OPTIONS --enable-fc=no )
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 )
list ( APPEND OPTIONS --enable-ft=yes )
else ( )
list ( APPEND OPTIONS --enable-ft=no )
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-04-27 01:28:21 +08:00
list ( APPEND OPTIONS --with-x --enable-xlib=yes )
else ( )
list ( APPEND OPTIONS --enable-xlib=no )
2019-09-20 06:18:04 +08:00
endif ( )
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-04-27 01:28:21 +08:00
list ( APPEND OPTIONS --enable-gobject=yes )
else ( )
list ( APPEND OPTIONS --enable-gobject=no )
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-04-27 01:28:21 +08:00
vcpkg_configure_make (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
A U T O C O N F I G
O P T I O N S $ { O P T I O N S }
a x _ c v _ c _ f l o a t _ w o r d s _ b i g e n d i a n = n o
a c _ c v _ l i b _ z _ c o m p r e s s = y e s
a c _ c v _ l i b _ l z o 2 _ l z o 2 a _ d e c o m p r e s s = y e s
l t _ c v _ d e p l i b s _ c h e c k _ m e t h o d = p a s s _ a l l
2017-07-13 23:21:30 +08:00
)
2021-04-27 01:28:21 +08:00
vcpkg_install_make ( )
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}" )
2017-06-08 15:01:29 +08:00
2016-11-26 07:48:19 +08:00
# Handle copyright
2020-06-11 17:27:30 +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-04-27 01:28:21 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
set ( ZLINK "-lzlibd" )
else ( )
set ( ZLINK "-lz" )
endif ( )
set ( _file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/cairo-script.pc" )
if ( EXISTS "${_file}" )
vcpkg_replace_string ( "${_file}" "Libs: ${ZLINK}" "Requires.private: lzo2 zlib\nLibs: -L\${libdir} -lcairo-script-interpreter" )
file ( INSTALL "${_file}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/" RENAME cairo-script-interpreter.pc ) #normally the *.pc file is named like the library
endif ( )
if ( VCPKG_TARGET_IS_WINDOWS )
set ( ZLINK "-lzlib" )
endif ( )
set ( _file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/cairo-script.pc" )
if ( EXISTS "${_file}" )
vcpkg_replace_string ( "${_file}" "Libs: ${ZLINK}" "Requires.private: lzo2 zlib\nLibs: -L\${libdir} -lcairo-script-interpreter" )
file ( INSTALL "${_file}" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/" RENAME cairo-script-interpreter.pc ) #normally the *.pc file is named like the library
endif ( )
vcpkg_fixup_pkgconfig ( )