2017-10-26 02:51:21 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h" )
2020-05-16 07:37:54 +08:00
message ( FATAL_ERROR "FATAL ERROR: ${PORT} and libmariadb are incompatible." )
2017-10-26 02:51:21 +08:00
endif ( )
2020-05-16 07:37:54 +08:00
if ( VCPKG_TARGET_IS_LINUX )
message ( WARNING "${PORT} needs ncurses on LINUX, please install ncurses first.\nOn Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel." )
2019-06-12 05:41:02 +08:00
endif ( )
2018-03-03 04:28:34 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O m y s q l / m y s q l - s e r v e r
2020-05-16 07:37:54 +08:00
R E F 7 d 1 0 c 8 2 1 9 6 c 8 e 4 5 5 5 4 f 2 7 c 0 0 6 8 1 4 7 4 a 9 f b 8 6 d 1 3 7 # 8.0.20
S H A 5 1 2 9 f 5 e 8 c c 2 5 4 e a 2 a 4 c f 7 6 3 1 3 2 8 7 c 7 b b 6 f c 6 9 3 4 0 0 8 1 0 4 6 4 d d 2 9 0 1 e 6 7 d 5 1 e c b 2 7 f 8 9 1 6 0 0 9 4 6 4 f d 8 a e d 8 3 6 5 c 3 0 3 8 3 1 4 b 8 4 5 b 3 d 5 1 7 d b 6 e 8 2 a e 5 c 7 9 0 8 6 1 2 f 0 b 3 b 7 2 3 3 5 f
2018-03-03 04:28:34 +08:00
H E A D _ R E F m a s t e r
2018-03-20 01:30:33 +08:00
P A T C H E S
2019-06-12 05:41:02 +08:00
i g n o r e - b o o s t - v e r s i o n . p a t c h
s y s t e m - l i b s . p a t c h
2020-05-14 01:26:05 +08:00
r e n a m e - v e r s i o n . p a t c h
2020-11-11 01:28:45 +08:00
e x p o r t - c m a k e - t a r g e t s . p a t c h
2021-10-27 14:45:32 +08:00
0 0 4 - a d d e d - l i m i t s - i n c l u d e . p a t c h
2022-04-07 02:04:46 +08:00
o p e n s s l . p a t c h
2017-10-26 02:51:21 +08:00
)
2021-10-27 14:45:32 +08:00
file ( REMOVE_RECURSE "${SOURCE_PATH}/include/boost_1_70_0" )
2018-03-13 23:14:58 +08:00
2018-03-08 03:10:12 +08:00
set ( STACK_DIRECTION )
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" )
set ( STACK_DIRECTION -DSTACK_DIRECTION=-1 )
endif ( )
2020-05-16 07:37:54 +08:00
#Skip the version check for Visual Studio
if ( VCPKG_TARGET_IS_WINDOWS )
set ( FORCE_UNSUPPORTED_COMPILER 1 )
endif ( )
2020-11-11 01:28:45 +08:00
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS )
string ( COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT_LINKAGE )
2021-11-23 07:51:13 +08:00
vcpkg_cmake_configure (
2021-10-27 14:45:32 +08:00
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2017-10-26 02:51:21 +08:00
O P T I O N S
- D W I T H O U T _ S E R V E R = O N
- D W I T H _ U N I T _ T E S T S = O F F
- D E N A B L E D _ P R O F I L I N G = O F F
2020-11-11 01:28:45 +08:00
- D E N A B L E _ T E S T I N G = O F F
2017-10-26 02:51:21 +08:00
- D W I X _ D I R = O F F
2018-03-08 03:10:12 +08:00
$ { S T A C K _ D I R E C T I O N }
2018-03-13 23:14:58 +08:00
- D I G N O R E _ B O O S T _ V E R S I O N = O N
2020-11-11 01:28:45 +08:00
- D W I T H _ S Y S T E M D = O F F
- D W I T H _ T E S T _ T R A C E _ P L U G I N = O F F
- D M Y S Q L _ M A I N T A I N E R _ M O D E = O F F
- D B U N D L E _ R U N T I M E _ L I B R A R I E S = O F F
- D D O W N L O A D _ B O O S T = O F F
- D E N A B L E _ D O W N L O A D S = O F F
- D W I T H _ N D B _ T E S T = O F F
- D W I T H _ N D B _ N O D E J S _ D E F A U L T = O F F
- D W I T H _ N D B A P I _ E X A M P L E S = O F F
- D M Y S Q L X _ A D D I T I O N A L _ T E S T S _ E N A B L E = O F F
2018-03-20 01:30:33 +08:00
- D W I T H _ S S L = s y s t e m
- D W I T H _ I C U = s y s t e m
- D W I T H _ L I B E V E N T = s y s t e m
- D W I T H _ L Z 4 = s y s t e m
- D W I T H _ Z L I B = s y s t e m
2020-05-16 07:37:54 +08:00
- D F O R C E _ U N S U P P O R T E D _ C O M P I L E R = $ { F O R C E _ U N S U P P O R T E D _ C O M P I L E R }
2020-11-11 01:28:45 +08:00
- D I N S T A L L _ S T A T I C _ L I B R A R I E S = $ { B U I L D _ S T A T I C _ L I B S }
- D L I N K _ S T A T I C _ R U N T I M E _ L I B R A R I E S = $ { S T A T I C _ C R T _ L I N K A G E }
2017-10-26 02:51:21 +08:00
)
2021-11-23 07:51:13 +08:00
vcpkg_cmake_install ( ADD_BIN_TO_PATH )
2017-10-26 02:51:21 +08:00
2020-11-11 01:28:45 +08:00
list ( APPEND MYSQL_TOOLS
c o m p _ e r r
m y _ p r i n t _ d e f a u l t s
m y s q l
m y s q l _ c o n f i g _ e d i t o r
m y s q l _ s e c u r e _ i n s t a l l a t i o n
m y s q l _ s s l _ r s a _ s e t u p
m y s q l a d m i n
m y s q l b i n l o g
m y s q l c h e c k
m y s q l d u m p
m y s q l i m p o r t
m y s q l p u m p
m y s q l s h o w
m y s q l s l a p
m y s q l t e s t
p e r r o r
z l i b _ d e c o m p r e s s
)
if ( VCPKG_TARGET_IS_WINDOWS )
list ( APPEND MYSQL_TOOLS
e c h o
)
else ( )
list ( APPEND MYSQL_TOOLS
m y s q l _ c o n f i g
)
endif ( )
vcpkg_copy_tools ( TOOL_NAMES ${ MYSQL_TOOLS } AUTO_CLEAN )
2021-12-23 11:53:44 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/share" "${CURRENT_PACKAGES_DIR}/${PORT}" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/${PORT}" )
2021-10-27 14:45:32 +08:00
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share" )
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/share" )
2021-12-23 11:53:44 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/${PORT}" "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/${PORT}" "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}" )
2020-11-11 01:28:45 +08:00
2021-12-23 11:53:44 +08:00
vcpkg_cmake_config_fixup ( PACKAGE_NAME unofficial-libmysql CONFIG_PATH share/ ${ PORT } /unofficial-libmysql )
2017-10-26 02:51:21 +08:00
# switch mysql into /mysql
2021-10-27 14:45:32 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/include" "${CURRENT_PACKAGES_DIR}/include2" )
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/include2" "${CURRENT_PACKAGES_DIR}/include/mysql" )
2017-10-26 02:51:21 +08:00
## delete useless vcruntime/scripts/bin/msg file
file ( REMOVE_RECURSE
2021-10-27 14:45:32 +08:00
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / i n c l u d e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d o c s "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / d o c s "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / d e b u g "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / p l u g i n "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / p l u g i n / d e b u g "
2020-11-11 01:28:45 +08:00
)
2017-10-26 02:51:21 +08:00
2020-05-16 07:37:54 +08:00
## remove misc files
2017-10-26 02:51:21 +08:00
file ( REMOVE
2021-10-27 14:45:32 +08:00
" $ { C U R R E N T _ P A C K A G E S _ D I R } / L I C E N S E "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / R E A D M E "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / L I C E N S E "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / R E A D M E "
2020-11-11 01:28:45 +08:00
)
2017-10-26 02:51:21 +08:00
2021-11-23 07:51:13 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/mysql/mysql_com.h" "#include <mysql/udf_registration_types.h>" "#include \" mysql/udf_registration_types.h\ "" )
if ( NOT VCPKG_TARGET_IS_WINDOWS )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/tools/libmysql/mysql_config" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/../.." )
endif ( )
2018-03-20 04:17:59 +08:00
2021-10-27 14:45:32 +08:00
file ( INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
file ( INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
2020-11-11 01:28:45 +08:00
2017-10-26 02:51:21 +08:00
# copy license
2021-10-27 14:45:32 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )