2022-01-27 02:00:37 +08:00
2022-05-26 04:44:12 +08:00
set ( GI_MAJOR_MINOR 1.72 )
2022-01-27 02:00:37 +08:00
set ( GI_PATCH 0 )
vcpkg_download_distfile ( 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 o b j e c t - i n t r o s p e c t i o n / $ { G I _ M A J O R _ M I N O R } / g o b j e c t - i n t r o s p e c t i o n - $ { G I _ M A J O R _ M I N O R } . $ { G I _ P A T C H } . t a r . x z "
F I L E N A M E " g o b j e c t - i n t r o s p e c t i o n - $ { G I _ M A J O R _ M I N O R } . $ { G I _ P A T C H } . t a r . x z "
2022-05-26 04:44:12 +08:00
S H A 5 1 2 b 8 f b a 2 b d 1 2 e 9 3 7 7 6 c 5 5 2 2 8 a c f 3 4 8 7 b e f 3 6 e e 4 0 b 1 a b d c 7 f 6 8 1 b 8 2 7 7 8 0 a c 9 4 a 8 b f a 1 f 5 9 b 0 c 3 0 d 6 0 f a 5 a 1 f e a 2 f 6 1 0 d e 7 8 b 9 e 5 2 0 2 9 f 4 1 1 1 2 8 0 6 7 8 0 8 f 1 7 e b 6 3 7 4 c d c 5
2022-01-27 02:00:37 +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 }
P A T C H E S
0 0 0 1 - g - i r - t o o l - t e m p l a t e . i n . p a t c h
0 0 0 2 - c r o s s - b u i l d . p a t c h
2022-08-11 04:22:26 +08:00
0 0 0 3 - f i x - p a t h s . p a t c h
2022-05-26 04:44:12 +08:00
p y t h o n . p a t c h
2022-01-27 02:00:37 +08:00
)
vcpkg_find_acquire_program ( FLEX )
vcpkg_find_acquire_program ( BISON )
set ( OPTIONS_DEBUG -Dbuild_introspection_data=false )
set ( OPTIONS_RELEASE -Dbuild_introspection_data=true )
2022-05-26 04:44:12 +08:00
if ( VCPKG_CROSSCOMPILING AND
2022-02-09 14:37:19 +08:00
NOT ( CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" ) )
2022-01-27 02:00:37 +08:00
list ( APPEND OPTIONS_RELEASE -Dgi_cross_use_prebuilt_gi=true )
endif ( )
vcpkg_configure_meson (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
O P T I O N S _ D E B U G
$ { O P T I O N S _ D E B U G }
O P T I O N S _ R E L E A S E
$ { O P T I O N S _ R E L E A S E }
A D D I T I O N A L _ N A T I V E _ B I N A R I E S
f l e x = ' $ { F L E X } '
b i s o n = ' $ { B I S O N } '
A D D I T I O N A L _ C R O S S _ B I N A R I E S
f l e x = ' $ { F L E X } '
b i s o n = ' $ { B I S O N } '
g - i r - a n n o t a t i o n - t o o l = ' $ { C U R R E N T _ H O S T _ I N S T A L L E D _ D I R } / t o o l s / g o b j e c t - i n t r o s p e c t i o n / g - i r - a n n o t a t i o n - t o o l '
g - i r - c o m p i l e r = ' $ { C U R R E N T _ H O S T _ I N S T A L L E D _ D I R } / t o o l s / g o b j e c t - i n t r o s p e c t i o n / g - i r - c o m p i l e r $ { V C P K G _ H O S T _ E X E C U T A B L E _ S U F F I X } '
g - i r - s c a n n e r = ' $ { C U R R E N T _ H O S T _ I N S T A L L E D _ D I R } / t o o l s / g o b j e c t - i n t r o s p e c t i o n / g - i r - s c a n n e r '
)
vcpkg_host_path_list ( APPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig" )
vcpkg_host_path_list ( APPEND ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib" )
vcpkg_install_meson ( ADD_BIN_TO_PATH )
vcpkg_copy_pdbs ( )
vcpkg_fixup_pkgconfig ( )
file ( INSTALL ${ SOURCE_PATH } /COPYING DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )
set ( GI_TOOLS
g - i r - c o m p i l e r
g - i r - g e n e r a t e
g - i r - i n s p e c t
)
set ( GI_SCRIPTS
g - i r - a n n o t a t i o n - t o o l
g - i r - s c a n n e r
)
vcpkg_copy_tools ( TOOL_NAMES ${ GI_TOOLS } AUTO_CLEAN )
foreach ( script IN LISTS GI_SCRIPTS )
file ( READ "${CURRENT_PACKAGES_DIR}/bin/${script}" _contents )
string ( REPLACE "#!/usr/bin/env ${PYTHON3}" "#!/usr/bin/env python3" _contents "${_contents}" )
2022-08-11 04:22:26 +08:00
string ( REPLACE "datadir = \" ${ CURRENT_PACKAGES_DIR } /share\ "" "raise Exception('could not find right path') " _contents "${_contents}" )
string ( REPLACE "pylibdir = os.path.join('${CURRENT_PACKAGES_DIR}/lib', 'gobject-introspection')" "raise Exception('could not find right path') " _contents "${_contents}" )
2022-01-27 02:00:37 +08:00
file ( WRITE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${script}" "${_contents}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/bin/${script}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${script}" )
endforeach ( )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/${PORT}" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man" )
set ( VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES enabled ) # _giscanner.lib