2022-10-14 02:20:24 +08:00
set ( GLIB_MAJOR_MINOR 2.74 )
set ( GLIB_PATCH 0 )
vcpkg_download_distfile ( GLIB_ARCHIVE
U R L S " h t t p s : / / d o w n l o a d . g n o m e . o r g / s o u r c e s / g l i b / $ { G L I B _ M A J O R _ M I N O R } / g l i b - $ { G L I B _ M A J O R _ M I N O R } . $ { G L I B _ P A T C H } . t a r . x z "
F I L E N A M E " g l i b - $ { G L I B _ M A J O R _ M I N O R } . $ { G L I B _ P A T C H } . t a r . x z "
S H A 5 1 2 5 c d a d d 2 f 4 5 6 8 c 0 c 3 d 4 5 0 8 3 b 4 d 3 9 6 9 9 a b f 6 5 1 e 4 2 e 0 2 0 f 7 b c 8 8 0 c c e 3 f f 3 3 d 2 8 9 4 3 1 1 8 3 8 8 d 1 7 a 0 6 3 2 7 7 7 e 8 4 3 f 4 8 0 0 9 c 1 f 9 7 d 5 6 3 4 f d e 3 c b 8 c 6 9 c 7 c 7 f 3 5 b 2 7 8 a c 8 2 2 5
)
vcpkg_extract_source_archive (
S O U R C E _ P A T H
A R C H I V E $ { G L I B _ A R C H I V E }
2017-01-14 09:55:41 +08:00
P A T C H E S
2019-03-01 14:58:46 +08:00
u s e - l i b i c o n v - o n - w i n d o w s . p a t c h
2021-11-30 04:31:32 +08:00
l i b i n t l . p a t c h
2019-03-01 14:58:46 +08:00
)
2017-01-12 04:20:53 +08:00
2021-04-27 01:28:21 +08:00
if ( selinux IN_LIST FEATURES )
if ( NOT VCPKG_TARGET_IS_WINDOWS AND NOT EXISTS "/usr/include/selinux" )
2022-10-14 02:20:24 +08:00
message ( "Selinux was not found in its typical system location. Your build may fail. You can install Selinux with \" apt-get install selinux libselinux1-dev\ "." )
2021-04-27 01:28:21 +08:00
endif ( )
list ( APPEND OPTIONS -Dselinux=enabled )
else ( )
list ( APPEND OPTIONS -Dselinux=disabled )
2019-09-17 06:10:11 +08:00
endif ( )
2021-11-24 12:54:53 +08:00
if ( libmount IN_LIST FEATURES )
list ( APPEND OPTIONS -Dlibmount=enabled )
else ( )
list ( APPEND OPTIONS -Dlibmount=disabled )
endif ( )
2021-04-27 01:28:21 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
list ( APPEND OPTIONS -Diconv=external )
endif ( )
2019-09-17 06:10:11 +08:00
2021-04-27 01:28:21 +08:00
vcpkg_configure_meson (
2022-05-07 02:20:25 +08:00
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2021-04-27 01:28:21 +08:00
O P T I O N S
- D i n s t a l l e d _ t e s t s = f a l s e
$ { O P T I O N S }
2021-11-30 04:31:32 +08:00
- D t e s t s = f a l s e
- D x a t t r = f a l s e
- D l i b e l f = d i s a b l e d
2018-07-10 08:29:28 +08:00
)
2017-01-12 04:20:53 +08:00
2021-04-27 01:28:21 +08:00
vcpkg_install_meson ( ADD_BIN_TO_PATH )
2018-07-10 08:29:28 +08:00
2017-01-12 04:20:53 +08:00
vcpkg_copy_pdbs ( )
2022-05-07 02:20:25 +08:00
set ( GLIB_TOOLS gdbus
g i o
g i o - q u e r y m o d u l e s
g l i b - c o m p i l e - r e s o u r c e s
g l i b - c o m p i l e - s c h e m a s
g o b j e c t - q u e r y
g r e s o u r c e
g s e t t i n g s
)
2021-04-27 01:28:21 +08:00
if ( NOT VCPKG_TARGET_IS_WINDOWS )
if ( NOT VCPKG_TARGET_IS_OSX )
list ( APPEND GLIB_TOOLS gapplication )
endif ( )
list ( APPEND GLIB_TOOLS glib-gettextize gtester )
endif ( )
set ( GLIB_SCRIPTS gdbus-codegen glib-genmarshal glib-mkenums gtester-report )
2019-08-31 02:53:11 +08:00
2021-04-27 01:28:21 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64|arm64" )
list ( APPEND GLIB_TOOLS gspawn-win64-helper ${ VCPKG_EXECUTABLE_SUFFIX }
g s p a w n - w i n 6 4 - h e l p e r - c o n s o l e $ { V C P K G _ E X E C U T A B L E _ S U F F I X } )
elseif ( VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
list ( APPEND GLIB_TOOLS gspawn-win32-helper ${ VCPKG_EXECUTABLE_SUFFIX }
g s p a w n - w i n 3 2 - h e l p e r - c o n s o l e $ { V C P K G _ E X E C U T A B L E _ S U F F I X } )
endif ( )
vcpkg_copy_tools ( TOOL_NAMES ${ GLIB_TOOLS } AUTO_CLEAN )
foreach ( script IN LISTS GLIB_SCRIPTS )
file ( RENAME "${CURRENT_PACKAGES_DIR}/bin/${script}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${script}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${script}" )
endforeach ( )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
2022-08-02 03:48:35 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS )
2021-04-27 01:28:21 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
endif ( )
2022-01-26 02:31:15 +08:00
2021-04-27 01:28:21 +08:00
IF ( VCPKG_TARGET_IS_WINDOWS )
set ( SYSTEM_LIBRARIES dnsapi iphlpapi winmm lshlwapi )
else ( )
set ( SYSTEM_LIBRARIES resolv mount blkid selinux )
endif ( )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gio-2.0.pc" )
2022-09-14 07:50:41 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gio-2.0.pc" "\${bindir}" "\${prefix}/tools/${PORT}" )
2021-04-27 01:28:21 +08:00
endif ( )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gio-2.0.pc" )
2022-09-14 07:50:41 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gio-2.0.pc" "\${bindir}" "\${prefix}/../tools/${PORT}" )
2021-04-27 01:28:21 +08:00
endif ( )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/glib-2.0.pc" )
2022-09-14 07:50:41 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/glib-2.0.pc" "\${bindir}" "\${prefix}/tools/${PORT}" )
2021-04-27 01:28:21 +08:00
endif ( )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glib-2.0.pc" )
2022-09-14 07:50:41 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glib-2.0.pc" "\${bindir}" "\${prefix}/../tools/${PORT}" )
2021-04-27 01:28:21 +08:00
endif ( )
vcpkg_fixup_pkgconfig ( SYSTEM_LIBRARIES ${ SYSTEM_LIBRARIES } )
2020-06-12 12:30:40 +08:00
2022-10-14 02:20:24 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSES/LGPL-2.1-or-later.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )
2021-04-27 01:28:21 +08:00
# Fix python scripts
set ( _file "${CURRENT_PACKAGES_DIR}/tools/${PORT}/gdbus-codegen" )
file ( READ "${_file}" _contents )
string ( REPLACE "elif os.path.basename(filedir) == 'bin':" "elif os.path.basename(filedir) == 'tools':" _contents "${_contents}" )
string ( REPLACE "path = os.path.join(filedir, '..', 'share', 'glib-2.0')" "path = os.path.join(filedir, '../..', 'share', 'glib-2.0')" _contents "${_contents}" )
string ( REPLACE "path = os.path.join(filedir, '..')" "path = os.path.join(filedir, '../../share/glib-2.0')" _contents "${_contents}" )
string ( REPLACE "path = os.path.join('${CURRENT_PACKAGES_DIR}/share', 'glib-2.0')" "path = os.path.join('unuseable/share', 'glib-2.0')" _contents "${_contents}" )
file ( WRITE "${_file}" "${_contents}" )
2021-11-10 03:49:00 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/gdb" )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/tools/glib/glib-gettextize" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/tools/glib/glib-gettextize" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/../.." )
endif ( )