2020-02-03 14:22:52 -08:00
if ( VCPKG_TARGET_IS_LINUX )
2018-03-11 23:41:51 -07:00
set ( VCPKG_POLICY_EMPTY_PACKAGE enabled )
2019-09-05 03:20:38 +08:00
if ( NOT EXISTS "/usr/include/libintl.h" )
message ( FATAL_ERROR "Please use command \" sudo apt-get install gettext\ " to install gettext on linux." )
endif ( )
2018-03-11 23:41:51 -07:00
return ( )
2020-02-03 14:22:52 -08:00
else ( )
set ( VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS enabled )
2018-03-11 23:41:51 -07:00
endif ( )
2016-11-01 20:12:26 +01:00
#Based on https://github.com/winlibs/gettext
2020-11-17 18:18:59 +01:00
set ( GETTEXT_VERSION 0.21 )
2019-02-08 00:24:33 +01:00
2016-11-01 20:12:26 +01:00
vcpkg_download_distfile ( ARCHIVE
2019-02-08 00:24:33 +01:00
U R L S " h t t p s : / / f t p . g n u . o r g / p u b / g n u / g e t t e x t / g e t t e x t - $ { G E T T E X T _ V E R S I O N } . t a r . g z " " h t t p s : / / w w w . m i r r o r s e r v i c e . o r g / s i t e s / f t p . g n u . o r g / g n u / g e t t e x t / g e t t e x t - $ { G E T T E X T _ V E R S I O N } . t a r . g z "
F I L E N A M E " g e t t e x t - $ { G E T T E X T _ V E R S I O N } . t a r . g z "
2020-11-17 18:18:59 +01:00
S H A 5 1 2 b b e 5 9 0 c 5 d d 3 5 8 0 c 7 5 b f 3 0 f f 7 6 8 d a 9 9 a 8 8 e b 8 d 4 6 6 e c 1 a c 9 e e a 2 0 b e 4 c a b 4 3 5 7 e c f 7 2 4 4 8 e 6 b 8 1 b 4 7 4 2 5 e 3 9 d 5 0 f a 6 3 2 0 b a 4 2 6 6 3 2 9 1 4 d 7 8 9 8 d f e b b 4 f 1 5 9 a b c 3 9 c 3 1 d 1
2016-11-01 20:12:26 +01:00
)
2020-11-17 18:18:59 +01:00
if ( VCPKG_TARGET_IS_UWP )
set ( PATCHES uwp_remove_localcharset.patch )
endif ( )
2019-02-08 00:24:33 +01: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 $ { G E T T E X T _ V E R S I O N }
P A T C H E S
0 0 0 2 - F i x - u w p - b u i l d . p a t c h
2020-02-03 18:14:03 -05:00
0 0 0 3 - F i x - w i n - u n i c o d e - p a t h s . p a t c h
2020-11-17 18:18:59 +01:00
$ { P A T C H E S }
2019-02-08 00:24:33 +01:00
)
2020-11-17 18:18:59 +01:00
vcpkg_find_acquire_program ( BISON )
get_filename_component ( BISON_PATH ${ BISON } DIRECTORY )
vcpkg_add_to_path ( ${ BISON_PATH } )
2016-11-01 20:12:26 +01:00
2020-11-17 18:18:59 +01:00
if ( VCPKG_TARGET_IS_WINDOWS )
# This is required. For some reason these do not get correctly identified for release builds.
list ( APPEND OPTIONS ac_cv_func_wcslen=yes
a c _ c v _ f u n c _ m e m m o v e = y e s
#The following are required for a full gettext built.
# Left here for future reference.
g l _ c v _ f u n c _ p r i n t f _ d i r e c t i v e _ n = n o #segfaults otherwise with popup window
a c _ c v _ f u n c _ m e m s e t = y e s #not detected in release builds
)
endif ( )
vcpkg_configure_make ( SOURCE_PATH ${ SOURCE_PATH } /gettext-runtime # Port should probably be renamed to gettext-runtime instead of only gettext. Removing the subdir here builds all of gettext
D E T E R M I N E _ B U I L D _ T R I P L E T
U S E _ W R A P P E R S
A D D _ B I N _ T O _ P A T H # So configure can check for working iconv
O P T I O N S - - e n a b l e - r e l o c a t a b l e #symbol duplication with glib-init.c?
- - e n a b l e - c + +
- - d i s a b l e - j a v a
$ { O P T I O N S }
)
if ( VCPKG_TARGET_IS_UWP )
vcpkg_install_make ( SUBPATH "/intl" ) # Could make a port intl or libintl or have features in Gettext
else ( )
vcpkg_install_make ( SUBPATH "/intl" )
endif ( )
2016-11-01 20:12:26 +01:00
2019-02-08 00:24:33 +01:00
2016-11-01 20:12:26 +01:00
# Handle copyright
file ( COPY ${ SOURCE_PATH } /COPYING DESTINATION ${ CURRENT_PACKAGES_DIR } /share/gettext )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /share/gettext/COPYING ${ CURRENT_PACKAGES_DIR } /share/gettext/copyright )
2016-11-02 11:05:59 -07:00
2020-11-17 18:18:59 +01:00
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } /bin )
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } /debug/bin )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
set ( GNU_DLL_PATHS lib/ debug/lib/ )
set ( GNU_DLL_NAME GNU.Gettext.dll ) #C# dll?
foreach ( DLL_PATH IN LISTS GNU_DLL_PATHS )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/${DLL_PATH}${GNU_DLL_NAME}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/${DLL_PATH}${GNU_DLL_NAME}" )
endif ( )
endforeach ( )
2018-04-17 16:19:59 -07:00
vcpkg_copy_pdbs ( )
2020-11-17 18:18:59 +01:00
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /vcpkg-cmake-wrapper.cmake DESTINATION ${ CURRENT_PACKAGES_DIR } /share/intl )