From f29eb0598f62fc3b5f09f2de5a89c0437c6164d9 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 21 Jan 2020 18:52:40 +0000 Subject: gentoo resync : 21.01.2020 --- dev-db/Manifest.gz | Bin 17786 -> 17772 bytes dev-db/kyotocabinet/Manifest | 2 +- dev-db/kyotocabinet/kyotocabinet-1.2.77.ebuild | 4 +- dev-db/mysql-connector-c++/Manifest | 16 +- ...ysql-connector-c++-1.1.11-fix-cpp-linking.patch | 15 - .../mysql-connector-c++-1.1.8-fix-mariadb.patch | 45 - .../mysql-connector-c++-8.0.15-fix-build.patch | 307 ------ .../mysql-connector-c++-8.0.18-fix-build.patch | 275 ----- .../mysql-connector-c++-8.0.19-fix-build.patch | 307 ++++++ ...connector-c++-8.0.19-fix-libressl-support.patch | 89 ++ .../mysql-connector-c++-1.1.11-r1.ebuild | 63 -- .../mysql-connector-c++-1.1.9-r1.ebuild | 62 -- .../mysql-connector-c++-8.0.15.ebuild | 41 - .../mysql-connector-c++-8.0.18.ebuild | 43 - .../mysql-connector-c++-8.0.19.ebuild | 44 + dev-db/mysql-connector-c/Manifest | 10 +- ...-8.0.17-always-build-decompress-utilities.patch | 22 - .../files/mysql-connector-c-8.0.17-libressl.patch | 258 ----- ...onnector-c-8.0.19-do-not-install-comp_err.patch | 12 + .../files/mysql-connector-c-8.0.19-libressl.patch | 297 ++++++ .../mysql-connector-c-8.0.17-r3.ebuild | 111 -- .../mysql-connector-c-8.0.18.ebuild | 110 -- .../mysql-connector-c-8.0.19.ebuild | 111 ++ dev-db/mysql/Manifest | 6 +- dev-db/mysql/mysql-8.0.18.ebuild | 1117 ------------------- dev-db/mysql/mysql-8.0.19.ebuild | 1120 ++++++++++++++++++++ 26 files changed, 1994 insertions(+), 2493 deletions(-) delete mode 100644 dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.11-fix-cpp-linking.patch delete mode 100644 dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.8-fix-mariadb.patch delete mode 100644 dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.15-fix-build.patch delete mode 100644 dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.18-fix-build.patch create mode 100644 dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.19-fix-build.patch create mode 100644 dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.19-fix-libressl-support.patch delete mode 100644 dev-db/mysql-connector-c++/mysql-connector-c++-1.1.11-r1.ebuild delete mode 100644 dev-db/mysql-connector-c++/mysql-connector-c++-1.1.9-r1.ebuild delete mode 100644 dev-db/mysql-connector-c++/mysql-connector-c++-8.0.15.ebuild delete mode 100644 dev-db/mysql-connector-c++/mysql-connector-c++-8.0.18.ebuild create mode 100644 dev-db/mysql-connector-c++/mysql-connector-c++-8.0.19.ebuild delete mode 100644 dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-always-build-decompress-utilities.patch delete mode 100644 dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-libressl.patch create mode 100644 dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-do-not-install-comp_err.patch create mode 100644 dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-libressl.patch delete mode 100644 dev-db/mysql-connector-c/mysql-connector-c-8.0.17-r3.ebuild delete mode 100644 dev-db/mysql-connector-c/mysql-connector-c-8.0.18.ebuild create mode 100644 dev-db/mysql-connector-c/mysql-connector-c-8.0.19.ebuild delete mode 100644 dev-db/mysql/mysql-8.0.18.ebuild create mode 100644 dev-db/mysql/mysql-8.0.19.ebuild (limited to 'dev-db') diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz index bc2f3a98eba4..ec9f9192753d 100644 Binary files a/dev-db/Manifest.gz and b/dev-db/Manifest.gz differ diff --git a/dev-db/kyotocabinet/Manifest b/dev-db/kyotocabinet/Manifest index c257fe47a620..6001b0ccb4ba 100644 --- a/dev-db/kyotocabinet/Manifest +++ b/dev-db/kyotocabinet/Manifest @@ -2,5 +2,5 @@ AUX fix_configure-1.2.62.patch 1668 BLAKE2B 5a572607b5c848c3616fcccac1e936f9218a AUX kyotocabinet-1.2.76-configure-8-byte-atomics.patch 1250 BLAKE2B 882c4897a40609bbfa1183cb97e80e5ed6d95d0035c30c836e3f252962db822249f8b48934923e816a720d3cbf64a6f47f80cef77528216f3171f332ca3a350b SHA512 4833cecd6c67515e0c59d7161be6891df290ae816593de1bf35718e9c9d8691db221bec5078c5dc7cf56e55b0086d61c415e148a7ee63b2a47ac4885f6d0960e AUX kyotocabinet-1.2.76-flags.patch 894 BLAKE2B 50efb4b21f0101a942eb758213cf703460056a951617298057567d08b116c7e0a631d631eace992ff447bed5b74940d2b60a8adad373cb77fe42b8c40bfcc9fd SHA512 60a15c54994a5f338cf168feb831d858fdd2cadd16ea0c8001ef652e8502797f5920d3fed0a3ec4a6a2d817381b4690410878a18c7c859df34e26b033f48fe03 DIST kyotocabinet-1.2.77.tar.gz 949326 BLAKE2B faacde57e8c7fed3fb232ea6fd12b668f2d2ee352cd357d5e16e0d1740cd8f73e223964249efeae50f3ea5d0672117b2410b91ba557ebe1ac7ba4075ac28deab SHA512 f38794c11faa3f4b64097a2e314307e1a6b75ddc495103647ebe52786a689336754496e7083697417ea90436e7fad681f16440975abec9ae917874aa25153e0f -EBUILD kyotocabinet-1.2.77.ebuild 1530 BLAKE2B a1abca816e16ff3738f1cdd3d93238f5182db60fc189097cf63097141d8879f417226305ac3e40842ec9aaffab3f6aef24cc0fe8a9d8a71705eb7a1a37fb29c3 SHA512 ba0a50310eeb5b73872974f4d5917649e08e7a1618b54460ab6b60b2180acd51311d05150dd0224f656ed22da0240cfb5d333e24e7cf6fd9e48ae84739663a3c +EBUILD kyotocabinet-1.2.77.ebuild 1529 BLAKE2B 589021c8a06e22a6ac3beb2609f50c42feeb4f86e9281dee68b8ca1bc1104a2a109665fe66f15f1e314a7d1aa9cab9c4ac4f4361fc6228e9596e48bdd28d4bb3 SHA512 6b792121518910ca86efacffd2391c922df8f595f6e8759282c61edf2dadbefc76bc2b5c9a6c07fb318d8f802842e1bbc905a8b16da485dbd668d641701d52b5 MISC metadata.xml 167 BLAKE2B e4dadf27fd344484f2bccb5b904909c89aac568c32e5b3c44bdf139eacefd4b4fae74419f503d2b7da0dccc1b68ba05d777d11292c0f89270d1ac5c9c703e8ca SHA512 7c8decb24ee3a850e38186cf3c7f8933a28017426806870ad6ef9ceb2533be147a2681fc789b535a81cb528af8c29d90d3006e4f250aee23bd7dea4561294e33 diff --git a/dev-db/kyotocabinet/kyotocabinet-1.2.77.ebuild b/dev-db/kyotocabinet/kyotocabinet-1.2.77.ebuild index b8d4c86ff2ef..0b831df71e97 100644 --- a/dev-db/kyotocabinet/kyotocabinet-1.2.77.ebuild +++ b/dev-db/kyotocabinet/kyotocabinet-1.2.77.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI="7" @@ -11,7 +11,7 @@ SRC_URI="https://fallabs.com/kyotocabinet/pkg/${P}.tar.gz" LICENSE="GPL-3" SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ia64 ppc ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris" IUSE="debug doc examples +lzma +lzo static-libs" DEPEND="sys-libs/zlib[static-libs?] diff --git a/dev-db/mysql-connector-c++/Manifest b/dev-db/mysql-connector-c++/Manifest index d9d3bb62f097..982b1c37c488 100644 --- a/dev-db/mysql-connector-c++/Manifest +++ b/dev-db/mysql-connector-c++/Manifest @@ -1,17 +1,9 @@ -AUX mysql-connector-c++-1.1.11-fix-cpp-linking.patch 440 BLAKE2B 2b78f683c8e4645df7a306783ec3e61263682688b0069fff61cb3a85575d41aa33de481314bc1d18f8a5181c5e2dbb29cfb8c89d6a36b44c11f27340b4f7921c SHA512 f941e32d4f1e52d603958bb01d17e75c8fb89738d20f5af29d4c30bbe77ba82af4b25cc27f1e2df934d1b309f6c75faf2fb0fc88fb250770a0669f867cc16e1c AUX mysql-connector-c++-1.1.11-fix-mariadb.patch 1939 BLAKE2B 4ca552777bfcb8671e5dc0213c411f9e1e8fbcbeb0f9f3369572c82ba03304a9df2ab98725b1fb3a365a63e4c8ed9d3d86332c54ffcb14210469b3d6078d89da SHA512 3d02972b57a0c2a544edef9ec5050c82f9214a7013e941cdc13a8f0742b7608812f33bc0c84367e70ea556562efb653297730ce5fc8d928458c5af1d71f3f60a AUX mysql-connector-c++-1.1.6-fix-cmake.patch 762 BLAKE2B 4cecebd2cb075c6e1af7ab74a84132f41beeeb202d4d286038b05cbbb202cef709e7114563bdbee12aab4e6a738a9e23bbb9455fc1ce0f906d952af4e0042f05 SHA512 c4c89b398aa88a9e7b4ed4cf42b055b79670dc70685775afd1ef2d683e5b3754575c831a6083ef0d097431e796513597e1daf7737e3ade710abad917f63ed32f -AUX mysql-connector-c++-1.1.8-fix-mariadb.patch 1939 BLAKE2B f2d2528cacfa4457c20587557e5125f9d642ce162319ba6b077173b5407319d8d07e6b525a5fb95e797d43a3ad4e9ceb111ebd07a52cf38df1db71b9b4f2ab4c SHA512 66e4783b2ad2db463b243d2fcd7c4f89f1ddbb02f6c5711adb09b402bb448e4ee69b50f635c60201cf63048aebaea25b5db6a18f46b35b25e8d7920dbcfde9bd -AUX mysql-connector-c++-8.0.15-fix-build.patch 10052 BLAKE2B 11c37dcfaf64783bddb05f15a4a31a41123904bbdc39d7bff3f314f30c5e6fb56bf4890fd6aefc824bee2b39e9c8ac28f42c96d4a752695109ff9a1fd0176773 SHA512 fdc38272ff584d7ec3cfb2b014693102654b59f4864b68866455fdfaca171d1e4cbe800a06d2dd2c5975d47cb8d88211219c8201fbd571177c8c35c5e9055840 -AUX mysql-connector-c++-8.0.18-fix-build.patch 8968 BLAKE2B 1a738d7ca5e291e5dc17ddcf0f316e0b4588a0e01a4b3fe2b4961e7d082aca6a61870c43f4821a69aca1bfc5ae5777b837440d5863fd6a45d190b425adde20e4 SHA512 ef226d90d2d968e4e7aed3852c8ae8e608b383adbdc81818d1ca8ea1646b5d034db2fa8fb62ab6ffa3095362d326d2a11519782d5541965bacea3ecddb475a2b -DIST mysql-connector-c++-1.1.11.tar.gz 504872 BLAKE2B 16a265ce291d18d3e76f6654b42271d8c6cc9329f047d9eb0c6cdfaea37e1c13f04932e595e4333882b26154f0940949bc9bdab9d8af8e25d2bfff43be0030fa SHA512 d6839ecda12d1f088f24b20c08f3e9a757e9907d3375dba39e0f247b6a11de59817739644201e74d782d4c900aa18bf60910fe60a9ee98a2c0138104fb55dc22 +AUX mysql-connector-c++-8.0.19-fix-build.patch 9695 BLAKE2B c3334f74160a9b1148a588c7190db6f3a79fe70530d921428b7d86ec02f01324cf02c4130cd8d0cf42ecc4ccaccbecf90ffe0ac1cf8b265ea5cd9dea1046f30f SHA512 3d726b70a270e56ab38e8cebe5eb0186c4d0293dbd72844914ca9ef20674f20bc0fb4d2f0c449da77e4e6a81cc3ae454447a7983468d386e73f946dccd4a20cc +AUX mysql-connector-c++-8.0.19-fix-libressl-support.patch 3358 BLAKE2B 795c9f313d2495c3fee01066c7116fa3272a162b7401359657256d1adfb24d236049bbad6016e763de2a62ec9b6ccc93546eccffc457ae0bafca29b2c7e21b5d SHA512 d7b4b1424a6fd237ad0e7bd5648b156f770e352ec8fb3edfa6dfb767ebbe73e8ebc186b327e8543aa7bc12b7bc6081fae225a6ff0e153e25bb76900142adaa31 DIST mysql-connector-c++-1.1.12.tar.gz 518615 BLAKE2B 386a4753ca3f03999a49a89507da1b1172b3db89797c38403fee4eea86e7108a5e4f91f24a17de86d585c2a3d9e5742a117fa84d9b14aad649f938a597f3dae9 SHA512 d7e132dbc2efda4a77f8ae00c24006a1ade1d0a50f22d89ece453505e6d206427ee7988df29c0d6ef8b396ad6b8d326b6d263a1d4fa08ef5db0966fb4f1479f4 -DIST mysql-connector-c++-1.1.9.tar.gz 508255 BLAKE2B e2cd300946a873a94beab13d9d1cb64ecb5bd9a9a56ef2217b1f7aff1643adc9afc0aa22c2ff1e0f6b8318cd34d12a7fe95f0584c96c212307fa9bd0cb54a2a1 SHA512 ec4d6cb7f21d52e786de3bff951e65ea5ad7391ba097b599d0094d3e8356cf17f700dee618e38e79d7a9e562684a6c51cca95fb8e2e225942766d33f8d0a5646 -DIST mysql-connector-c++-8.0.15-src.tar.gz 2210243 BLAKE2B 45e0ffa2134c9df5a7e311963c7f2c58b5d7cfc0eefd80a5dc323bbe34ba60d40c79154f932e19c5f8e18ae45d0b61d304b7b7daba4955f92f830cf20c718931 SHA512 9a217b8f61babe5dac405be19b12d34b22673e779433d880a3aa31ea2e128f93434599a3fe0c1150b3f7b8c4d03f595d545d8cc33342a60561a2f60bff71ef14 -DIST mysql-connector-c++-8.0.18-src.tar.gz 3115736 BLAKE2B f28229593d20f4a401a3e9d0e636ee896a90fb7573f06d9b60340540d6c4d577b4f44daa287c7896a03a60d75dec343413cba981e63a22607ce60eb20f4de122 SHA512 f5b202677392bcf5c5bdd4c3433332e57aa20c1a140de81b57ce3ce69709661d572e2466ae022926fc220b20159c90f09f15b5e44f384529103a24fd592de60d -EBUILD mysql-connector-c++-1.1.11-r1.ebuild 1621 BLAKE2B fdf824ec8993976294bbc03467c63da10206bd04ed066ec33a2d7ce9310e654a0cdd1440e57517bcb22c37851310da0fb2e8e8c48696a99800da3e45cdc0c47a SHA512 7c05b18bac4af342c9feab9622e63afc916bd408a8f2b88dcf59c6192b5a62fba481b3e3f5cbca6826f61d092e7c91e9ef8f20f29b7272c11454c28a836fb15c +DIST mysql-connector-c++-8.0.19-src.tar.gz 3137484 BLAKE2B 82a2900b0daa00bcfd72d562818ada25fe15901991a896a46ecdd9304e03066c4e7a3804287540559df1c74dbd1b3983b450ab783ee8cb7f0d7ec152f3cdc6b0 SHA512 5987ae31cda3a5db18ceded201ccbe66263b8ab7665ceacf70af6bb6b99130377b40514b96644b0768fd809b36ee02580520923c11c1edecccc75da15d7bb0bd EBUILD mysql-connector-c++-1.1.12-r1.ebuild 1642 BLAKE2B 6e6fa755a9c7f51fc9ddd4310664b7f1a9dfa1e348ea033006195ae9ef7d1f6cbbfa82c13394ea3355fb15bca3d05baa5bee43a287b7c63d9fcbe5240d0a59ab SHA512 0a0d2ec5bd5231f708baa1d605c8d24118d2bf3ca8583d5f22e3b9cbdcbd55c6a2fc3f5aa53bc3e4858884d5f7ad4d70221dbe57d2dc60df68cc3c27fceb16d4 -EBUILD mysql-connector-c++-1.1.9-r1.ebuild 1570 BLAKE2B 2f5d17177fe53a0ab0a70efe13d225a6982746819191719d1378b072881037ce81b0d63beb1e0e3dd9106dc04d17ef29b6ac010831734fca2f184901568ba2b2 SHA512 ce9598a2a5f8924cb24822dec8b5349f1655148ba7aba234e324912999d7a5df054a3b3d78c7e9c33c909d046d28bceb9322dc1848370fbed00b27941d49d387 -EBUILD mysql-connector-c++-8.0.15.ebuild 909 BLAKE2B 3a0fa261424e3ce299cf1d10ff5ace8e8bedc4e91fd0eb098916ca1b2d2353562a21d4aaf3fb73c119a665ad64da113036fba6ad9a02a6199306cece67b1f835 SHA512 32c8692e66ed3805c3e01ad5b4e66b04bc0a750e1fd270fc52f70777242abd21d5f11acdff27210b9194190e2ea1bfb3d203e264986c985f0d13210618e51047 -EBUILD mysql-connector-c++-8.0.18.ebuild 1015 BLAKE2B e14bf0abe5da065ff96a350c16ce5e90bd8f2190665d0fc45d29a3c6cfe447987733a9b10bb42671cc6c9ccdef485070a3ab265880b256739958cd46a4f7b186 SHA512 3b53b586627adeb2567d275a1a7f8f1787dc9d01d996015bf273e2fed9b387666793eba0add85961fc1eae2c011d8ce11b359f400217154a2029ea67c2783de1 +EBUILD mysql-connector-c++-8.0.19.ebuild 1070 BLAKE2B 1a42cb615fb70dccb3be62cbb4430770220534fe8bad1a69d828ec1342e0fb5c003034130320d0e7838416b1a1fb12063b3f0953a8af45c95698a968bbf5a45a SHA512 81ed1cc863ee4f5a8b30fffbceb2821f9fd59379c7ac6b382392526670649f3fe858fa54191fb7304db6a4611632752c09fecb5f4c5b5f58df3145836a5a4cbc MISC metadata.xml 378 BLAKE2B 43fdbbc8d3b6ef99e51da96ddfefbdeaa70ef5fcb2fc6067305f75f75b7ee2fd21b79ca76704d8752bf59ae057b28efb187b063770964246f93fea629b58b467 SHA512 c6e545fb60d306792421ea26a937aaa6aea53d2a4100c9cafe78cf695c9dd0620cf3e770d43ff42749ae42bbe3a35212407ea84edee9af2dcb0255c2b763ddfc diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.11-fix-cpp-linking.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.11-fix-cpp-linking.patch deleted file mode 100644 index 4b8a4a983096..000000000000 --- a/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.11-fix-cpp-linking.patch +++ /dev/null @@ -1,15 +0,0 @@ -https://bugs.mysql.com/bug.php?id=90727 - ---- a/FindMySQL.cmake -+++ b/FindMySQL.cmake -@@ -700,8 +700,10 @@ endif() - - # For dynamic linking use the built-in sys and strings - if(NOT MYSQLCLIENT_STATIC_LINKING) -+IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") - list(APPEND SYS_LIBRARIES "mysql_sys") - list(APPEND SYS_LIBRARIES "mysql_strings") -+endif() - list(APPEND SYS_LIBRARIES ${MYSQL_LIBRARIES}) - SET(MYSQL_LIBRARIES ${SYS_LIBRARIES}) - diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.8-fix-mariadb.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.8-fix-mariadb.patch deleted file mode 100644 index 35ed218e18dc..000000000000 --- a/dev-db/mysql-connector-c++/files/mysql-connector-c++-1.1.8-fix-mariadb.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -aurN a/driver/mysql_connection.cpp b/driver/mysql_connection.cpp ---- a/driver/mysql_connection.cpp 2016-12-14 04:58:54.000000000 -0500 -+++ b/driver/mysql_connection.cpp 2017-01-26 16:33:58.086005627 -0500 -@@ -1023,6 +1023,7 @@ - proxy->get_character_set_info(&cs); - *(static_cast(optionValue)) = cs.mbmaxlen; - /* mysql_get_option() was added in mysql 5.7.3 version */ -+#if !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID ) - } else if ( proxy->get_server_version() >= 50703 ) { - try { - if (GET_CONN_OPTION(optionName, optionValue, intOptions)) { -@@ -1036,6 +1037,7 @@ - CPP_ERR_FMT("Unsupported option : %d:(%s) %s", proxy->errNo(), proxy->sqlstate().c_str(), proxy->error().c_str()); - throw e; - } -+#endif - } - } - /* }}} */ -@@ -1053,11 +1055,13 @@ - MY_CHARSET_INFO cs; - proxy->get_character_set_info(&cs); - return cs.dir ? sql::SQLString(cs.dir) : ""; -+#if !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID ) - } else if ( proxy->get_server_version() >= 50703 ) { - const char* optionValue= NULL; - if (GET_CONN_OPTION(optionName, &optionValue, stringOptions)) { - return optionValue ? sql::SQLString(optionValue) : ""; - } -+#endif - } - return ""; - } -diff -aurN a/driver/nativeapi/libmysql_static_proxy.cpp b/driver/nativeapi/libmysql_static_proxy.cpp ---- a/driver/nativeapi/libmysql_static_proxy.cpp 2017-01-26 16:35:46.256038741 -0500 -+++ b/driver/nativeapi/libmysql_static_proxy.cpp 2017-01-26 16:28:34.114915809 -0500 -@@ -319,7 +319,7 @@ - int - LibmysqlStaticProxy::get_option(MYSQL * mysql, enum mysql_option option, const void *arg) - { --#if MYSQL_VERSION_ID >= 50703 -+#if MYSQL_VERSION_ID >= 50703 && !defined( MARIADB_BASE_VERSION ) && !defined ( MARIADB_VERSION_ID ) - if (::mysql_get_option(mysql, option, arg)) { - throw sql::InvalidArgumentException("Unsupported option provided to mysql_get_option()"); - } else { diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.15-fix-build.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.15-fix-build.patch deleted file mode 100644 index 4e3996914109..000000000000 --- a/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.15-fix-build.patch +++ /dev/null @@ -1,307 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -666,7 +666,7 @@ set_target_properties(connector PROPERTIES - - - install(TARGETS connector -- CONFIGURATIONS Release RelWithDebInfo -+ CONFIGURATIONS Release RelWithDebInfo Gentoo - ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}" COMPONENT XDevAPIDev - RUNTIME DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll -@@ -737,6 +737,12 @@ TARGET_LINK_LIBRARIES(try connector) - SET_INTERFACE_OPTIONS(try devapi) - # ADD_GCOV(try) - -+IF(WITH_SSL STREQUAL "system") -+ find_package(OpenSSL REQUIRED) -+ TARGET_LINK_LIBRARIES(try ${OPENSSL_LIBRARIES}) -+ENDIF() -+ -+ - if(WITH_JDBC) - - add_executable(try_jdbc EXCLUDE_FROM_ALL try_jdbc.cc) ---- a/cdk/cmake/install_macros.cmake -+++ b/cdk/cmake/install_macros.cmake -@@ -327,7 +327,7 @@ FUNCTION(INSTALL_DEBUG_TARGET target) - DESTINATION ${ARG_DESTINATION} - ${RENAME_PARAM} - ${PERMISSIONS_${target_type}} -- CONFIGURATIONS Release RelWithDebInfo -+ CONFIGURATIONS Release RelWithDebInfo Gentoo - COMPONENT ${ARG_COMPONENT} - OPTIONAL) - -@@ -346,7 +346,7 @@ FUNCTION(INSTALL_DEBUG_TARGET target) - INSTALL(FILES ${debug_pdb_target_location} - DESTINATION ${ARG_PDB_DESTINATION} - ${PDB_RENAME_PARAM} -- CONFIGURATIONS Release RelWithDebInfo -+ CONFIGURATIONS Release RelWithDebInfo Gentoo - COMPONENT ${ARG_COMPONENT} - OPTIONAL) - ENDIF() ---- a/cdk/cmake/libutils.cmake -+++ b/cdk/cmake/libutils.cmake -@@ -282,14 +282,7 @@ function(add_library_ex TARGET) - endforeach() - - if(libs) -- -- if(${type} STREQUAL "STATIC") -- merge_static_libraries(${TARGET} ${libs}) -- add_dependencies(${TARGET} ${libs}) -- else() - target_link_libraries(${TARGET} PRIVATE ${libs}) -- endif() -- - endif() - - # ---- a/cdk/cmake/protobuf.cmake -+++ b/cdk/cmake/protobuf.cmake -@@ -26,201 +26,8 @@ - # along with this program; if not, write to the Free Software Foundation, Inc., - # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - --# --# Usage: --# --# INCLUDE(protobuf) --# [USE_FULL_PROTOBUF()] --# --# MYSQLX_PROTOBUF_GENERATE_CPP(SRCS HDRS ) --# ADD_LIBRARY(target ... ${SRCS}) --# -- --if(DEFINED WITH_PROTOBUF) -- -- # -- # If WITH_PROTOBUF is defined, it should point at external location where -- # protobuf libraries were built using our CMakeLists.txt (so that -- # exports.cmake was produced). -- # -- -- if (NOT EXISTS "${WITH_PROTOBUF}/exports.cmake") -- message(FATAL_ERROR -- "Valid protobuf build not found at the given location" -- " (could not find exports.cmake): ${WITH_PROTOBUF}" -- ) -- endif() -- -- message("Using protobuf build at: ${WITH_PROTOBUF}") -- --else(DEFINED WITH_PROTOBUF) -- -- # -- # If external WITH_PROTOBUF location is not given, then we arrange for -- # building of protbuf from bundled sources in ${PROJECT_BINARY_DIR}/protobuf. -- # -- -- message("Configuring Protobuf build using cmake generator: ${CMAKE_GENERATOR}") -- file(REMOVE "${PROJECT_BINARY_DIR}/protobuf/CMakeCache.txt") -- file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/protobuf") -- -- # -- # Pick build configuration for the protobuf build. Normally we build using the -- # same build configuration that is used for building CDK (Release/Debug/etc.). -- # But we also support building CDK under non-standard build configuration -- # named 'Static' (this is a dirty trick we use to simplify building our MSIs). -- # Since protobuf does not know 'Static' build configuration, we build protobuf -- # under 'Release' configuration in that case. -- # -- # We need to handle two cases. For some build systems, like Makefiles, -- # the build configuration is specified at cmake time using CMAKE_BUILD_TYPE -- # variable. In that case we also set it during protobuf build configuration. -- # Another case is a multi-configuration build system like MSVC. In this case -- # we use generator expression to pick correct configuration when the build -- # command is invoked below. -- # -- -- if(CMAKE_BUILD_TYPE) -- if(CMAKE_BUILD_TYPE MATCHES "[Ss][Tt][Aa][Tt][Ii][Cc]") -- set(set_build_type -DCMAKE_BUILD_TYPE=Release) -- else() -- set(set_build_type -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) -- endif() -- endif() -- -- set(CONFIG_EXPR -- $<$:Release>$<$>:$> -- ) -- -- execute_process( -- COMMAND ${CMAKE_COMMAND} -- -G "${CMAKE_GENERATOR}" -- ${set_build_type} -- -DSTATIC_MSVCRT=${STATIC_MSVCRT} -- -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE} -- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -- -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -- -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -- -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -- -DCMAKE_CXX_FLAGS_MINSIZEREL=${CMAKE_CXX_FLAGS_MINSIZEREL} -- -DCMAKE_STATIC_LINKER_FLAGS=${CMAKE_STATIC_LINKER_FLAGS} -- ${PROJECT_SOURCE_DIR}/protobuf -- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/protobuf -- RESULT_VARIABLE protobuf_config -- ) -- -- if(protobuf_config) -- message(FATAL_ERROR "Could not configure Protobuf build: ${protobuf_config}") -- endif() -- -- set(WITH_PROTOBUF "${PROJECT_BINARY_DIR}/protobuf") -- --endif(DEFINED WITH_PROTOBUF) -- --# Import targets exported by protobuf -- --include(${WITH_PROTOBUF}/exports.cmake) -- --# --# Protobuf library targets imported above (pb_protobuf --# and pb_protobuf-lite) are local to the directory from which --# they were imported. This is not good if cdk is used as --# a sub-project of a parent project, because the parent project --# must have access to these targets. --# --# For that reason below we create global protobuf/protobuf-lite targets --# and copy their locations from the imported targets. --# --# Note: we can't use ALIAS library because it does not work with imported --# targets --# -- --add_library(protobuf STATIC IMPORTED GLOBAL) --add_library(protobuf-lite STATIC IMPORTED GLOBAL) -- --foreach(lib protobuf protobuf-lite) -- #message("processing: ${lib}") -- -- foreach(CONF NOCONFIG DEBUG RELEASE MINSIZEREL RELWITHDEBINFO) -- #message("- CONF: ${CONF}") -- -- get_target_property(LOC pb_${lib} IMPORTED_LOCATION_${CONF}) -- if(LOC) -- #message("- setting imported location to: ${LOC}") -- set_target_properties(${lib} PROPERTIES -- IMPORTED_LOCATION_${CONF} "${LOC}" -- ) -- set_property(TARGET ${lib} APPEND PROPERTY -- IMPORTED_CONFIGURATIONS ${CONF} -- ) -- endif() -- -- endforeach(CONF) -- --endforeach(lib) -- --# --# To support 'Static' build configuration the targets imported from the --# Protobuf project need to have IMPORTED_LOCATION_STATIC defined. We use --# 'Release' locations as Protobuf is built using 'Release' configuration in --# that case. --# -- --foreach(tgt protobuf protobuf-lite pb_protoc) -- -- get_target_property(LOC ${tgt} IMPORTED_LOCATION_RELEASE) -- set_property(TARGET ${tgt} PROPERTY IMPORTED_LOCATION_STATIC ${LOC}) -- --endforeach(tgt) -- -- --# protobuf depends on protobuf-lite -- --set_target_properties(protobuf PROPERTIES -- INTERFACE_LINK_LIBRARIES "protobuf-lite" --) -- -- --message("Protobuf include path: ${PROTOBUF_INCLUDE_DIR}") -- --set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIR} -- CACHE INTERNAL "Protobuf include path" FORCE) --set(PROTOBUF_PROTOC_EXECUTABLE pb_protoc -- CACHE INTERNAL "Protobuf compiler" FORCE) -- --# --# Custom target build_protobuf ensures that Protobuf project is built. --# --# Note: this depends on Protobuf project generating the stamp file --# -- --if(NOT DEFINED PROTOBUF_BUILD_STAMP) -- message(FATAL_ERROR "Protobuf build stamp file not defined") --endif() -- -- --if(CMAKE_VERSION VERSION_LESS 3.0) -- add_custom_command(OUTPUT ${PROTOBUF_BUILD_STAMP} -- COMMAND ${CMAKE_COMMAND} --build . --config $ -- WORKING_DIRECTORY ${WITH_PROTOBUF} -- COMMENT "Building protobuf using configuration: $(Configuration)" -- ) --else() -- add_custom_command(OUTPUT ${PROTOBUF_BUILD_STAMP} -- COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG_EXPR} -- WORKING_DIRECTORY ${WITH_PROTOBUF} -- COMMENT "Building protobuf using configuration: $(Configuration)" -- ) --endif() -- --add_custom_target(build_protobuf -- DEPENDS ${PROTOBUF_BUILD_STAMP} --) -- --add_dependencies(protobuf build_protobuf) --add_dependencies(protobuf-lite build_protobuf) --add_dependencies(pb_protoc build_protobuf) -+#SET(Protobuf_USE_STATIC_LIBS ON) -+find_package(Protobuf REQUIRED) - - # - # Choice between full and lite version of the library. ---- a/cdk/protocol/mysqlx/crud.cc -+++ b/cdk/protocol/mysqlx/crud.cc -@@ -295,7 +295,7 @@ public: - class Placeholder_conv_imp - : public Args_conv - { -- map m_map; -+ std::map m_map; - - public: - -@@ -303,7 +303,7 @@ public: - - unsigned conv_placeholder(const string &name) - { -- map::const_iterator it = m_map.find(name); -+ std::map::const_iterator it = m_map.find(name); - if (it == m_map.end()) - throw_error("Placeholder converter: Placeholder was not defined on args"); - //throw Generic_error((boost::format("Placeholder %s was not defined on args.") -@@ -314,7 +314,7 @@ public: - - void add_placeholder(const string &name) - { -- map::const_iterator it = m_map.find(name); -+ std::map::const_iterator it = m_map.find(name); - if (it != m_map.end()) - throw_error("Placeholder converter: Redefined placeholder"); - //throw Generic_error((boost::format("Redifined placeholder %s.") ---- a/jdbc.cmake -+++ b/jdbc.cmake -@@ -66,7 +66,7 @@ if(MYSQL_CONFIG_EXECUTABLE) - list(APPEND jdbc_cmake_opts -DMYSQL_CONFIG_EXECUTABLE=${MYSQL_CONFIG_EXECUTABLE}) - endif() - --list(APPEND jdbc_cmake_opts -DMYSQLCLIENT_STATIC_LINKING=ON) -+list(APPEND jdbc_cmake_opts -DMYSQLCLIENT_STATIC_LINKING=OFF) - - if(CMAKE_BUILD_TYPE) - if(CMAKE_BUILD_TYPE MATCHES "[Ss][Tt][Aa][Tt][Ii][Cc]") diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.18-fix-build.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.18-fix-build.patch deleted file mode 100644 index 484220442ab8..000000000000 --- a/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.18-fix-build.patch +++ /dev/null @@ -1,275 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -463,7 +463,7 @@ set_target_properties(connector PROPERTIES - - - install(TARGETS connector -- CONFIGURATIONS Release RelWithDebInfo -+ CONFIGURATIONS Release RelWithDebInfo Gentoo - ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}" COMPONENT XDevAPIDev - RUNTIME DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll ---- a/cdk/cmake/DepFindProtobuf.cmake -+++ b/cdk/cmake/DepFindProtobuf.cmake -@@ -48,197 +48,7 @@ if(TARGET Protobuf::pb) - return() - endif() - --message(STATUS "Setting up Protobuf.") -- --set(PB_SOURCE_DIR "${PROJECT_SOURCE_DIR}/protobuf") --set(PB_BINARY_DIR "${PROJECT_BINARY_DIR}/protobuf") --set(config_stamp "${PB_BINARY_DIR}/config.stamp") --set(build_stamp "${PB_BINARY_DIR}/build.stamp") -- -- --# --# Pick build configuration for the protobuf build. Normally we build using the --# same build configuration that is used for building CDK (Release/Debug/etc.). --# But we also support building CDK under non-standard build configuration --# named 'Static' (this is a dirty trick we use to simplify building our MSIs). --# Since protobuf does not know 'Static' build configuration, we build protobuf --# under 'Release' configuration in that case. --# --# We need to handle two cases. For some build systems, like Makefiles, --# the build configuration is specified at cmake time using CMAKE_BUILD_TYPE --# variable. In that case we also set it during protobuf build configuration. --# Another case is a multi-configuration build system like MSVC. In this case --# we use generator expression to pick correct configuration when the build --# command is invoked below. --# -- --set(build_type) --if(CMAKE_BUILD_TYPE) -- if(CMAKE_BUILD_TYPE MATCHES "[Ss][Tt][Aa][Tt][Ii][Cc]") -- set(set_build_type -DCMAKE_BUILD_TYPE=Release) -- else() -- set(set_build_type -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) -- endif() --endif() -- --set(CONFIG_EXPR -- $<$:Release>$<$>:$> --) -- -- --if(NOT EXISTS "${PB_BINARY_DIR}/exports.cmake") -- -- message("==== Configuring Protobuf build using cmake generator: ${CMAKE_GENERATOR}") -- -- file(REMOVE "${PB_BINARY_DIR}/CMakeCache.txt") -- file(MAKE_DIRECTORY "${PB_BINARY_DIR}") -- -- # Dirty trick to speed up cmake set up time. -- #file( -- # COPY "${CMAKE_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}" -- # DESTINATION "${PB_BINARY_DIR}/CMakeFiles" -- #) -- -- execute_process( -- COMMAND ${CMAKE_COMMAND} -- -G "${CMAKE_GENERATOR}" -- ${set_build_type} -- -DSTATIC_MSVCRT=${STATIC_MSVCRT} -- -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE} -- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -- -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -- -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -- -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -- -DCMAKE_CXX_FLAGS_MINSIZEREL=${CMAKE_CXX_FLAGS_MINSIZEREL} -- -DCMAKE_STATIC_LINKER_FLAGS=${CMAKE_STATIC_LINKER_FLAGS} -- ${PB_SOURCE_DIR} -- WORKING_DIRECTORY ${PB_BINARY_DIR} -- RESULT_VARIABLE protobuf_config -- ) -- -- if(protobuf_config) -- message(FATAL_ERROR "Could not configure Protobuf build: ${protobuf_config}") -- endif() -- -- message("==== Protobuf build configured.") -- --endif() -- -- --include(${PB_BINARY_DIR}/exports.cmake) -- --# --# Protobuf library targets imported above (pb_protobuf --# and pb_protobuf-lite) are local to the directory from which --# they were imported. This is not good if cdk is used as --# a sub-project of a parent project, because the parent project --# must have access to these targets. --# --# For that reason below we create global protobuf/protobuf-lite targets --# and copy their locations from the imported targets. --# --# Note: we can't use ALIAS library because it does not work with imported --# targets --# -- --add_library(Protobuf::pb-full STATIC IMPORTED GLOBAL) --add_library(Protobuf::pb-lite STATIC IMPORTED GLOBAL) --add_executable(Protobuf::protoc IMPORTED GLOBAL) -- --set(TGT_protobuf Protobuf::pb-full) --set(TGT_protobuf-lite Protobuf::pb-lite) --set(TGT_protoc Protobuf::protoc) -- --foreach(tgt protobuf protobuf-lite protoc) -- -- #message("processing: ${tgt}") -- -- set(loc_list) -- -- foreach(CONF NOCONFIG DEBUG RELEASE MINSIZEREL RELWITHDEBINFO) -- -- #message("- CONF: ${CONF}") -- -- get_target_property(LOC pb_${tgt} IMPORTED_LOCATION_${CONF}) -- -- if(LOC) -- -- #message("- setting imported location to: ${LOC}") -- list(APPEND loc_list "${LOC}") -- -- set_target_properties(${TGT_${tgt}} PROPERTIES -- IMPORTED_LOCATION_${CONF} "${LOC}" -- ) -- -- set_property(TARGET ${TGT_${tgt}} APPEND PROPERTY -- IMPORTED_CONFIGURATIONS ${CONF} -- ) -- -- endif() -- -- endforeach(CONF) -- -- # -- # To support 'Static' build configuration the targets imported from the -- # Protobuf project need to have IMPORTED_LOCATION_STATIC defined. We use -- # 'Release' locations as Protobuf is built using 'Release' configuration in -- # that case. -- # -- -- get_target_property(LOC ${TGT_${tgt}} IMPORTED_LOCATION_RELEASE) -- set_property(TARGET ${TGT_${tgt}} PROPERTY IMPORTED_LOCATION_STATIC ${LOC}) -- --endforeach(tgt) -- -- --#message("Protobuf include path: ${PROTOBUF_INCLUDE_DIR}") --set(PROTOBUF_INCLUDE_DIR ${PROTOBUF_INCLUDE_DIR} CACHE INTERNAL "") -- --set_target_properties(Protobuf::pb-lite PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${PROTOBUF_INCLUDE_DIR}" --) -- --set_target_properties(Protobuf::pb-full PROPERTIES -- INTERFACE_LINK_LIBRARIES Protobuf::pb-lite --) -- --# On UNIX Protobuf uses pthread library --if(UNIX) -- set_property(TARGET Protobuf::pb-lite APPEND PROPERTY -- INTERFACE_LINK_LIBRARIES pthread -- ) --endif() -- --# --# Note: This is needed to correctly compile headers generated by protobuf --# with sunpro compiler. --# -- --if(SUNPRO) -- set_property(TARGET Protobuf::pb-lite APPEND PROPERTY -- INTERFACE_COMPILE_DEFINITIONS SOLARIS_64BIT_ENABLED -- ) --endif() -- -- --add_custom_command(OUTPUT "${build_stamp}" -- COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG_EXPR} -- COMMAND ${CMAKE_COMMAND} -E touch "${build_stamp}" -- WORKING_DIRECTORY "${PB_BINARY_DIR}" -- COMMENT "Building protobuf" --) -- --add_custom_target(build_protobuf -- SOURCES "${build_stamp}" --) -- --add_dependencies(Protobuf::pb-full build_protobuf) --add_dependencies(Protobuf::pb-lite build_protobuf) --add_dependencies(Protobuf::protoc build_protobuf) -- --# TODO: Handle lite/full version -- -+find_package(Protobuf REQUIRED) - - - # Standard PROTOBUF_GENERATE_CPP modified to our usage -@@ -268,11 +78,11 @@ function(mysqlx_protobuf_generate_cpp SRCS HDRS) - "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.h" - COMMAND ${CMAKE_COMMAND} - -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/protobuf" -- COMMAND Protobuf::protoc -+ COMMAND ${Protobuf_PROTOC_EXECUTABLE} - ARGS --cpp_out "${CMAKE_CURRENT_BINARY_DIR}/protobuf" - -I ${ABS_PATH} ${ABS_FIL} -- --proto_path=${PROJECT_SOURCE_DIR}/protobuf/protobuf-3.6.1/src -- DEPENDS ${ABS_FIL} #${PROTOBUF_PROTOC_EXECUTABLE} -+ --proto_path=${Protobuf_INCLUDE_DIR} -+ DEPENDS ${ABS_FIL} #${Protobuf_PROTOC_EXECUTABLE} - COMMENT "Running C++ protocol buffer compiler on ${FIL}" - VERBATIM - ) ---- a/cdk/core/CMakeLists.txt -+++ b/cdk/core/CMakeLists.txt -@@ -44,7 +44,7 @@ add_library(cdk STATIC ${cdk_sources} ${HEADERS}) - - target_link_libraries(cdk - PUBLIC cdk_mysqlx cdk_parser -- PRIVATE Protobuf::pb-lite # required by codecc.cc -+ PRIVATE protobuf # required by codecc.cc - ) - - add_coverage(cdk) ---- a/cdk/protocol/mysqlx/CMakeLists.txt -+++ b/cdk/protocol/mysqlx/CMakeLists.txt -@@ -125,11 +125,7 @@ target_include_directories(cdk_proto_mysqlx PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - ) - --if(use_full_protobuf) -- target_link_libraries(cdk_proto_mysqlx PRIVATE Protobuf::pb-full) --else() -- target_link_libraries(cdk_proto_mysqlx PRIVATE Protobuf::pb-lite) --endif() -+target_link_libraries(cdk_proto_mysqlx PRIVATE protobuf) - - target_link_libraries(cdk_proto_mysqlx PRIVATE cdk_foundation) - ---- a/jdbc.cmake -+++ b/jdbc.cmake -@@ -66,7 +66,7 @@ if(MYSQL_CONFIG_EXECUTABLE) - list(APPEND jdbc_cmake_opts -DMYSQL_CONFIG_EXECUTABLE=${MYSQL_CONFIG_EXECUTABLE}) - endif() - --list(APPEND jdbc_cmake_opts -DMYSQLCLIENT_STATIC_LINKING=ON) -+list(APPEND jdbc_cmake_opts -DMYSQLCLIENT_STATIC_LINKING=OFF) - - if(CMAKE_BUILD_TYPE) - if(CMAKE_BUILD_TYPE MATCHES "[Ss][Tt][Aa][Tt][Ii][Cc]") ---- a/jdbc/CMakeLists.txt -+++ b/jdbc/CMakeLists.txt -@@ -272,7 +272,7 @@ set_target_properties(connector-jdbc - - - install(TARGETS connector-jdbc -- CONFIGURATIONS Release RelWithDebInfo -+ CONFIGURATIONS Release RelWithDebInfo Gentoo - ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}" COMPONENT JDBCDev - RUNTIME DESTINATION "${INSTALL_LIB_DIR}" COMPONENT JDBCDll - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT JDBCDll diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.19-fix-build.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.19-fix-build.patch new file mode 100644 index 000000000000..b8976199afc5 --- /dev/null +++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.19-fix-build.patch @@ -0,0 +1,307 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -475,7 +475,7 @@ set_target_properties(connector PROPERTIES + + + install(TARGETS connector +- CONFIGURATIONS Release RelWithDebInfo ++ CONFIGURATIONS Release RelWithDebInfo Gentoo + ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}" COMPONENT XDevAPIDev + RUNTIME DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll +--- a/cdk/cmake/DepFindProtobuf.cmake ++++ b/cdk/cmake/DepFindProtobuf.cmake +@@ -48,229 +48,7 @@ if(TARGET Protobuf::pb) + return() + endif() + +-message(STATUS "Setting up Protobuf.") +- +-set(PB_SOURCE_DIR "${PROJECT_SOURCE_DIR}/protobuf") +-set(PB_BINARY_DIR "${PROJECT_BINARY_DIR}/protobuf") +-set(config_stamp "${PB_BINARY_DIR}/config.stamp") +-set(build_stamp "${PB_BINARY_DIR}/build.stamp") +- +- +-# +-# Pick build configuration for the protobuf build. Normally we build using the +-# same build configuration that is used for building CDK (Release/Debug/etc.). +-# But we also support building CDK under non-standard build configuration +-# named 'Static' (this is a dirty trick we use to simplify building our MSIs). +-# Since protobuf does not know 'Static' build configuration, we build protobuf +-# under 'Release' configuration in that case. +-# +-# We need to handle two cases. For some build systems, like Makefiles, +-# the build configuration is specified at cmake time using CMAKE_BUILD_TYPE +-# variable. In that case we also set it during protobuf build configuration. +-# Another case is a multi-configuration build system like MSVC. In this case +-# we use generator expression to pick correct configuration when the build +-# command is invoked below. +-# +- +-set(build_type) +-if(CMAKE_BUILD_TYPE) +- if(CMAKE_BUILD_TYPE MATCHES "[Ss][Tt][Aa][Tt][Ii][Cc]") +- set(set_build_type -DCMAKE_BUILD_TYPE=Release) +- else() +- set(set_build_type -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) +- endif() +-endif() +- +-set(CONFIG_EXPR +- $<$:Release>$<$>:$> +-) +- +-set(set_arch) +-if(CMAKE_GENERATOR_PLATFORM) +- set(set_arch -A ${CMAKE_GENERATOR_PLATFORM}) +-endif() +- +-set(set_toolset) +-if(CMAKE_GENERATOR_TOOLSET) +- set(set_toolset -T ${CMAKE_GENERATOR_TOOLSET}) +-endif() +- +-if(NOT EXISTS "${PB_BINARY_DIR}/exports.cmake") +- +- message("==== Configuring Protobuf build using cmake generator: ${CMAKE_GENERATOR} ${set_arch} ${set_toolset}") +- +- file(REMOVE "${PB_BINARY_DIR}/CMakeCache.txt") +- file(MAKE_DIRECTORY "${PB_BINARY_DIR}") +- +- # Dirty trick to speed up cmake set up time. +- #file( +- # COPY "${CMAKE_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}" +- # DESTINATION "${PB_BINARY_DIR}/CMakeFiles" +- #) +- +- execute_process( +- COMMAND ${CMAKE_COMMAND} +- -G "${CMAKE_GENERATOR}" +- ${set_arch} +- ${set_toolset} +- ${set_build_type} +- -DSTATIC_MSVCRT=${STATIC_MSVCRT} +- -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE} +- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} +- -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} +- -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} +- -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} +- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO} +- -DCMAKE_CXX_FLAGS_MINSIZEREL=${CMAKE_CXX_FLAGS_MINSIZEREL} +- -DCMAKE_STATIC_LINKER_FLAGS=${CMAKE_STATIC_LINKER_FLAGS} +- ${PB_SOURCE_DIR} +- WORKING_DIRECTORY ${PB_BINARY_DIR} +- RESULT_VARIABLE protobuf_config +- ) +- +- if(protobuf_config) +- message(FATAL_ERROR "Could not configure Protobuf build: ${protobuf_config}") +- endif() +- +- message("==== Protobuf build configured.") +- +-endif() +- +- +-include(${PB_BINARY_DIR}/exports.cmake) +- +-# +-# Protobuf library targets imported above (pb_protobuf +-# and pb_protobuf-lite) are local to the directory from which +-# they were imported. This is not good if cdk is used as +-# a sub-project of a parent project, because the parent project +-# must have access to these targets. +-# +-# For that reason below we create global protobuf/protobuf-lite targets +-# and copy their locations from the imported targets. +-# +-# Note: we can't use ALIAS library because it does not work with imported +-# targets +-# +- +-add_library(Protobuf::pb-full STATIC IMPORTED GLOBAL) +-add_library(Protobuf::pb-lite STATIC IMPORTED GLOBAL) +-add_executable(Protobuf::protoc IMPORTED GLOBAL) +- +-set(TGT_protobuf Protobuf::pb-full) +-set(TGT_protobuf-lite Protobuf::pb-lite) +-set(TGT_protoc Protobuf::protoc) +- +-foreach(tgt protobuf protobuf-lite protoc) +- +- #message("processing: ${tgt}") +- +- set(loc_list) +- +- foreach(CONF NOCONFIG DEBUG RELEASE MINSIZEREL RELWITHDEBINFO) +- +- #message("- CONF: ${CONF}") +- +- get_target_property(LOC pb_${tgt} IMPORTED_LOCATION_${CONF}) +- +- if(LOC) +- +- #message("- setting imported location to: ${LOC}") +- list(APPEND loc_list "${LOC}") +- +- set_target_properties(${TGT_${tgt}} PROPERTIES +- IMPORTED_LOCATION_${CONF} "${LOC}" +- ) +- +- set_property(TARGET ${TGT_${tgt}} APPEND PROPERTY +- IMPORTED_CONFIGURATIONS ${CONF} +- ) +- +- endif() +- +- endforeach(CONF) +- +- # +- # To support 'Static' build configuration the targets imported from the +- # Protobuf project need to have IMPORTED_LOCATION_STATIC defined. We use +- # 'Release' locations as Protobuf is built using 'Release' configuration in +- # that case. +- # +- +- get_target_property(LOC ${TGT_${tgt}} IMPORTED_LOCATION_RELEASE) +- set_property(TARGET ${TGT_${tgt}} PROPERTY IMPORTED_LOCATION_STATIC ${LOC}) +- +-endforeach(tgt) +- +- +-#message("Protobuf include path: ${PROTOBUF_INCLUDE_DIR}") +-set(PROTOBUF_INCLUDE_DIR ${PROTOBUF_INCLUDE_DIR} CACHE INTERNAL "") +- +-set_target_properties(Protobuf::pb-lite PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${PROTOBUF_INCLUDE_DIR}" +-) +- +-set_target_properties(Protobuf::pb-full PROPERTIES +- INTERFACE_LINK_LIBRARIES Protobuf::pb-lite +-) +- +-# On UNIX Protobuf uses pthread library +-if(UNIX) +- set_property(TARGET Protobuf::pb-lite APPEND PROPERTY +- INTERFACE_LINK_LIBRARIES pthread +- ) +-endif() +- +-# +-# Note: This is needed to correctly compile headers generated by protobuf +-# with sunpro compiler. +-# +- +-if(SUNPRO) +- set_property(TARGET Protobuf::pb-lite APPEND PROPERTY +- INTERFACE_COMPILE_DEFINITIONS SOLARIS_64BIT_ENABLED +- ) +-endif() +- +-# +-# Try using parallel builds for protobuf. +-# +- +-include(ProcessorCount) +-ProcessorCount(N) +- +-MESSAGE("Processor Count: ${N}") +- +-set(opt_build) +-set(opt_tool) +-if(NOT N EQUAL 0) +- if(NOT CMAKE_VERSION VERSION_LESS 3.12) +- set(opt_build --parallel ${N}) +- elseif(CMAKE_MAKE_PROGRAM MATCHES "make") +- set(opt_tool -j${N}) +- endif() +-endif() +- +-add_custom_command(OUTPUT "${build_stamp}" +- COMMAND ${CMAKE_COMMAND} --build . ${opt_build} --config ${CONFIG_EXPR} -- ${opt_tool} +- COMMAND ${CMAKE_COMMAND} -E touch "${build_stamp}" +- WORKING_DIRECTORY "${PB_BINARY_DIR}" +- COMMENT "Building protobuf" +-) +- +-add_custom_target(build_protobuf +- SOURCES "${build_stamp}" +-) +- +-set_target_properties(build_protobuf PROPERTIES FOLDER "Misc") +- +-add_dependencies(Protobuf::pb-full build_protobuf) +-add_dependencies(Protobuf::pb-lite build_protobuf) +-add_dependencies(Protobuf::protoc build_protobuf) +- +-# TODO: Handle lite/full version +- +- ++find_package(Protobuf REQUIRED) + + # Standard PROTOBUF_GENERATE_CPP modified to our usage + +@@ -299,11 +77,11 @@ function(mysqlx_protobuf_generate_cpp SRCS HDRS) + "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.h" + COMMAND ${CMAKE_COMMAND} + -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/protobuf" +- COMMAND Protobuf::protoc ++ COMMAND ${Protobuf_PROTOC_EXECUTABLE} + ARGS --cpp_out "${CMAKE_CURRENT_BINARY_DIR}/protobuf" + -I ${ABS_PATH} ${ABS_FIL} +- --proto_path=${PROJECT_SOURCE_DIR}/protobuf/protobuf-3.6.1/src +- DEPENDS ${ABS_FIL} #${PROTOBUF_PROTOC_EXECUTABLE} ++ --proto_path=${Protobuf_INCLUDE_DIR} ++ DEPENDS ${ABS_FIL} #${Protobuf_PROTOC_EXECUTABLE} + COMMENT "Running C++ protocol buffer compiler on ${FIL}" + VERBATIM + ) +--- a/cdk/core/CMakeLists.txt ++++ b/cdk/core/CMakeLists.txt +@@ -44,7 +44,7 @@ add_library(cdk STATIC ${cdk_sources} ${HEADERS}) + + target_link_libraries(cdk + PUBLIC cdk_mysqlx cdk_parser +- PRIVATE Protobuf::pb-lite # required by codecc.cc ++ PRIVATE protobuf # required by codecc.cc + ) + + add_coverage(cdk) +--- a/cdk/protocol/mysqlx/CMakeLists.txt ++++ b/cdk/protocol/mysqlx/CMakeLists.txt +@@ -126,11 +126,7 @@ target_include_directories(cdk_proto_mysqlx PRIVATE + ${CMAKE_CURRENT_BINARY_DIR} + ) + +-if(use_full_protobuf) +- target_link_libraries(cdk_proto_mysqlx PRIVATE Protobuf::pb-full) +-else() +- target_link_libraries(cdk_proto_mysqlx PRIVATE Protobuf::pb-lite) +-endif() ++target_link_libraries(cdk_proto_mysqlx PRIVATE protobuf) + + target_link_libraries(cdk_proto_mysqlx PRIVATE cdk_foundation) + +--- a/jdbc.cmake ++++ b/jdbc.cmake +@@ -66,7 +66,7 @@ if(MYSQL_CONFIG_EXECUTABLE) + list(APPEND jdbc_cmake_opts -DMYSQL_CONFIG_EXECUTABLE=${MYSQL_CONFIG_EXECUTABLE}) + endif() + +-list(APPEND jdbc_cmake_opts -DMYSQLCLIENT_STATIC_LINKING=ON) ++list(APPEND jdbc_cmake_opts -DMYSQLCLIENT_STATIC_LINKING=OFF) + + if(CMAKE_BUILD_TYPE) + if(CMAKE_BUILD_TYPE MATCHES "[Ss][Tt][Aa][Tt][Ii][Cc]") +--- a/jdbc/CMakeLists.txt ++++ b/jdbc/CMakeLists.txt +@@ -272,7 +272,7 @@ set_target_properties(connector-jdbc + + + install(TARGETS connector-jdbc +- CONFIGURATIONS Release RelWithDebInfo ++ CONFIGURATIONS Release RelWithDebInfo Gentoo + ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}" COMPONENT JDBCDev + RUNTIME DESTINATION "${INSTALL_LIB_DIR}" COMPONENT JDBCDll + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT JDBCDll diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.19-fix-libressl-support.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.19-fix-libressl-support.patch new file mode 100644 index 000000000000..fc6eb777063e --- /dev/null +++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-8.0.19-fix-libressl-support.patch @@ -0,0 +1,89 @@ +--- a/cdk/cmake/DepFindSSL.cmake ++++ b/cdk/cmake/DepFindSSL.cmake +@@ -88,7 +88,7 @@ function(main) + + set(OPENSSL_LIB_DIR "${OPENSSL_LIB_DIR}" CACHE INTERNAL "") + +- if(NOT OPENSSL_VERSION_MAJOR EQUAL 1) ++ if(NOT OPENSSL_VERSION_MAJOR VERSION_GREATER_EQUAL 1) + message(SEND_ERROR "OpenSSL version 1.x is required but version ${OPENSSL_VERSION} was found") + else() + message(STATUS "Using OpenSSL version: ${OPENSSL_VERSION}") +@@ -182,42 +182,33 @@ function(find_openssl) + set(OPENSSL_INCLUDE_DIR "${OPENSSL_INCLUDE_DIR}" PARENT_SCOPE) + message("-- found OpenSSL headers at: ${OPENSSL_INCLUDE_DIR}") + +- + # Verify version number. Version information looks like: +- # #define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1a 20 Nov 2018" +- ++ # #define OPENSSL_VERSION_NUMBER 0x1000103fL ++ # Encoded as MNNFFPPS: major minor fix patch status + FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" + OPENSSL_VERSION_NUMBER +- REGEX "#[ ]*define[\t ]+OPENSSL_VERSION_TEXT" ++ REGEX "^#[ ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" + ) +- +- #message("== OPENSSL_VERSION_NUMBER: ${OPENSSL_VERSION_NUMBER}") + STRING(REGEX REPLACE +- "^.*OPENSSL_VERSION_TEXT[\t ]+\"OpenSSL[\t ]([0-9]+)\\.([0-9]+)\\.([0-9]+)([a-z]*)[\t ].*$" +- "\\1;\\2;\\3;\\4" +- version_list "${OPENSSL_VERSION_NUMBER}" ++ "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" ++ OPENSSL_VERSION_MAJOR "${OPENSSL_VERSION_NUMBER}" ++ ) ++ STRING(REGEX REPLACE ++ "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9]([0-9][0-9]).*$" "\\1" ++ OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_NUMBER}" ++ ) ++ STRING(REGEX REPLACE ++ "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1" ++ OPENSSL_VERSION_FIX "${OPENSSL_VERSION_NUMBER}" + ) +- #message("-- OPENSSL_VERSION: ${version_list}") +- +- list(GET version_list 0 OPENSSL_VERSION_MAJOR) +- math(EXPR OPENSSL_VERSION_MAJOR ${OPENSSL_VERSION_MAJOR}) +- +- list(GET version_list 1 OPENSSL_VERSION_MINOR) +- math(EXPR OPENSSL_VERSION_MINOR ${OPENSSL_VERSION_MINOR}) +- +- list(GET version_list 2 OPENSSL_VERSION_FIX) +- math(EXPR OPENSSL_VERSION_FIX ${OPENSSL_VERSION_FIX}) +- +- list(GET version_list 3 OPENSSL_VERSION_PATCH) +- +- + + set(OPENSSL_VERSION +- "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH}" ++ "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}" + PARENT_SCOPE + ) + set(OPENSSL_VERSION_MAJOR ${OPENSSL_VERSION_MAJOR} PARENT_SCOPE) + ++ CHECK_SYMBOL_EXISTS(TLS1_3_VERSION "openssl/tls1.h" HAVE_TLS1_3_VERSION) + + find_library(OPENSSL_LIBRARY + NAMES ssl ssleay32 ssleay32MD libssl +--- a/cdk/foundation/connection_openssl.cc ++++ b/cdk/foundation/connection_openssl.cc +@@ -211,7 +211,7 @@ static void throw_ssl_error(SSL* tls, int err) + case SSL_ERROR_WANT_CONNECT: + case SSL_ERROR_WANT_ACCEPT: + case SSL_ERROR_WANT_X509_LOOKUP: +-# if OPENSSL_VERSION_NUMBER >= 0x10100000L ++# if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + case SSL_ERROR_WANT_ASYNC: + case SSL_ERROR_WANT_ASYNC_JOB: + # endif +@@ -387,7 +387,7 @@ void TLS_helper::setup(SSL_CTX *ctx) + + SSL_CTX_set_cipher_list(ctx, m_cipher_list.c_str()); + +-#if OPENSSL_VERSION_NUMBER>=0x1010100fL ++#if HAVE_TLS1_3_VERSION + + /* + Note: If TLSv1.3 is not enabled, there is no need to restrict diff --git a/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.11-r1.ebuild b/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.11-r1.ebuild deleted file mode 100644 index 812af80237d4..000000000000 --- a/dev-db/mysql-connector-c++/mysql-connector-c++-1.1.11-r1.ebuild +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -inherit cmake-utils flag-o-matic - -DESCRIPTION="MySQL database connector for C++ (mimics JDBC 4.0 API)" -HOMEPAGE="https://dev.mysql.com/downloads/connector/cpp/" -URI_DIR="Connector-C++" -SRC_URI="https://dev.mysql.com/get/Downloads/${URI_DIR}/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 arm ~arm64 ppc ppc64 sparc x86" -IUSE="debug examples gcov static-libs" - -DEPEND="dev-db/mysql-connector-c:= - dev-libs/boost:= - dev-libs/openssl:0= - ! -Date: Sat, 8 Jun 2019 15:52:26 +0300 -Subject: [PATCH] Fix build with LibreSSL - -- Fix version checks as OPENSSL_VERSION_NUMBER in OpenSSL is always - 0x20000000L. -- FIPS support is removed from LibreSSL, do not use it. -- Check for TLS1_3_VERSION define, not OpenSSL/LibreSSL version. - Theoretically even OpenSSL >=1.1.1 can be built with TLS 1.3 disabled. - - ---- a/cmake/ssl.cmake -+++ b/cmake/ssl.cmake -@@ -304,13 +304,14 @@ MACRO (MYSQL_CHECK_SSL) - OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}" - ) - ENDIF() -- IF("${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}" VERSION_GREATER "1.1.0") -+ CHECK_SYMBOL_EXISTS(TLS1_3_VERSION "openssl/tls1.h" HAVE_TLS1_3_VERSION) -+ IF(HAVE_TLS1_3_VERSION) - ADD_DEFINITIONS(-DHAVE_TLSv13) - ENDIF() - IF(OPENSSL_INCLUDE_DIR AND - OPENSSL_LIBRARY AND - CRYPTO_LIBRARY AND -- OPENSSL_MAJOR_VERSION STREQUAL "1" -+ OPENSSL_MAJOR_VERSION VERSION_GREATER_EQUAL "1" - ) - SET(OPENSSL_FOUND TRUE) - FIND_PROGRAM(OPENSSL_EXECUTABLE openssl ---- a/extra/libevent/openssl-compat.h -+++ b/extra/libevent/openssl-compat.h -@@ -24,7 +24,6 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name) - #define BIO_set_init(b, val) (b)->init = (val) - #define BIO_set_data(b, val) (b)->ptr = (val) - #define BIO_set_shutdown(b, val) (b)->shutdown = (val) --#define BIO_get_init(b) (b)->init - #define BIO_get_data(b) (b)->ptr - #define BIO_get_shutdown(b) (b)->shutdown - -@@ -32,4 +31,8 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name) - - #endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -+#define BIO_get_init(b) (b)->init -+#endif -+ - #endif /* OPENSSL_COMPAT_H */ ---- a/mysys/my_md5.cc -+++ b/mysys/my_md5.cc -@@ -56,7 +56,7 @@ static void my_md5_hash(unsigned char *digest, unsigned const char *buf, - int compute_md5_hash(char *digest, const char *buf, int len) { - int retval = 0; - int fips_mode = 0; --#if !defined(HAVE_WOLFSSL) -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - fips_mode = FIPS_mode(); - #endif /* HAVE_WOLFSSL */ - /* If fips mode is ON/STRICT restricted method calls will result into abort, ---- a/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c -+++ b/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c -@@ -297,7 +297,7 @@ error: - return 1; - } - --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - #define OPENSSL_ERROR_LENGTH 512 - static int configure_ssl_fips_mode(const uint fips_mode) { - int rc = -1; -@@ -521,7 +521,7 @@ int xcom_init_ssl(const char *server_key_file, const char *server_cert_file, - int verify_server = SSL_VERIFY_NONE; - int verify_client = SSL_VERIFY_NONE; - --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - if (configure_ssl_fips_mode(ssl_fips_mode) != 1) { - G_ERROR("Error setting the ssl fips mode"); - goto error; ---- a/plugin/x/client/xconnection_impl.cc -+++ b/plugin/x/client/xconnection_impl.cc -@@ -523,7 +523,7 @@ XError Connection_impl::get_ssl_error(const int error_id) { - return XError(CR_SSL_CONNECTION_ERROR, buffer); - } - --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - /** - Set fips mode in openssl library, - When we set fips mode ON/STRICT, it will perform following operations: -@@ -573,7 +573,7 @@ XError Connection_impl::activate_tls() { - if (!m_context->m_ssl_config.is_configured()) - return XError{CR_SSL_CONNECTION_ERROR, ER_TEXT_TLS_NOT_CONFIGURATED}; - --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - char err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; - if (set_fips_mode((int)m_context->m_ssl_config.m_ssl_fips_mode, err_string) != - 1) { ---- a/router/src/http/src/tls_client_context.cc -+++ b/router/src/http/src/tls_client_context.cc -@@ -54,7 +54,7 @@ void TlsClientContext::verify(TlsVerify verify) { - - void TlsClientContext::cipher_suites(const std::string &ciphers) { - // TLSv1.3 ciphers are controlled via SSL_CTX_set_ciphersuites() --#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1) -+#ifdef TLS1_3_VERSION - if (1 != SSL_CTX_set_ciphersuites(ssl_ctx_.get(), ciphers.c_str())) { - throw TlsError("set-cipher-suites"); - } ---- a/router/src/http/src/tls_context.cc -+++ b/router/src/http/src/tls_context.cc -@@ -93,7 +93,7 @@ static constexpr int o11x_version(TlsVersion version) { - return TLS1_1_VERSION; - case TlsVersion::TLS_1_2: - return TLS1_2_VERSION; --#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1) -+#ifdef TLS1_3_VERSION - case TlsVersion::TLS_1_3: - return TLS1_3_VERSION; - #endif -@@ -123,9 +123,11 @@ void TlsContext::version_range(TlsVersion min_version, TlsVersion max_version) { - default: - // unknown, leave all disabled - // fallthrough -+#ifdef TLS1_3_VERSION - case TlsVersion::TLS_1_3: - opts |= SSL_OP_NO_TLSv1_2; - // fallthrough -+#endif - case TlsVersion::TLS_1_2: - opts |= SSL_OP_NO_TLSv1_1; - // fallthrough -@@ -172,8 +174,10 @@ TlsVersion TlsContext::min_version() const { - return TlsVersion::TLS_1_1; - case TLS1_2_VERSION: - return TlsVersion::TLS_1_2; -+#ifdef TLS1_3_VERSION - case TLS1_3_VERSION: - return TlsVersion::TLS_1_3; -+#endif - case 0: - return TlsVersion::AUTO; - default: ---- a/router/src/http/src/tls_server_context.cc -+++ b/router/src/http/src/tls_server_context.cc -@@ -170,7 +170,8 @@ void TlsServerContext::init_tmp_dh(const std::string &dh_params) { - } - - } else { --#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) -+#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \ -+ !defined(LIBRESSL_VERSION_NUMBER) - dh2048.reset(DH_get_2048_256()); - #else - /* ---- a/sql-common/client.cc -+++ b/sql-common/client.cc -@@ -7602,7 +7602,8 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option, - #endif - break; - case MYSQL_OPT_SSL_FIPS_MODE: { --#if defined(HAVE_OPENSSL) && !defined(HAVE_WOLFSSL) -+#if defined(HAVE_OPENSSL) && \ -+ !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; - ENSURE_EXTENSIONS_PRESENT(&mysql->options); - mysql->options.extension->ssl_fips_mode = *static_cast(arg); ---- a/sql/mysqld.cc -+++ b/sql/mysqld.cc -@@ -4795,7 +4795,7 @@ static int init_thread_environment() { - - static PSI_memory_key key_memory_openssl = PSI_NOT_INSTRUMENTED; - --#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - #define FILE_LINE_ARGS - #else - #define FILE_LINE_ARGS , const char *, int -@@ -4831,7 +4831,7 @@ static void init_ssl() { - } - - static int init_ssl_communication() { --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; - int ret_fips_mode = set_fips_mode(opt_ssl_fips_mode, ssl_err_string); - if (ret_fips_mode != 1) { ---- a/sql/sys_vars.cc -+++ b/sql/sys_vars.cc -@@ -4377,7 +4377,7 @@ static Sys_var_ulong Sys_max_execution_time( - HINT_UPDATEABLE SESSION_VAR(max_execution_time), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1)); - --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - static bool update_fips_mode(sys_var *, THD *, enum_var_type) { - char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; - if (set_fips_mode(opt_ssl_fips_mode, ssl_err_string) != 1) { -@@ -4390,7 +4390,7 @@ static bool update_fips_mode(sys_var *, THD *, enum_var_type) { - } - #endif - --#ifdef HAVE_WOLFSSL -+#if defined(HAVE_WOLFSSL) || defined(LIBRESSL_VERSION_NUMBER) - static const char *ssl_fips_mode_names[] = {"OFF", 0}; - #else - static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0}; -@@ -4398,7 +4398,7 @@ static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0}; - static Sys_var_enum Sys_ssl_fips_mode( - "ssl_fips_mode", - "SSL FIPS mode (applies only for OpenSSL); " --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - "permitted values are: OFF, ON, STRICT", - #else - "permitted values are: OFF", -@@ -4406,7 +4406,7 @@ static Sys_var_enum Sys_ssl_fips_mode( - GLOBAL_VAR(opt_ssl_fips_mode), CMD_LINE(REQUIRED_ARG, OPT_SSL_FIPS_MODE), - ssl_fips_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, - ON_CHECK(NULL), --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - ON_UPDATE(update_fips_mode), - #else - ON_UPDATE(NULL), ---- a/vio/viossl.cc -+++ b/vio/viossl.cc -@@ -507,7 +507,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, - #if !defined(HAVE_WOLFSSL) && !defined(DBUG_OFF) - { - STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; -- ssl_comp_methods = SSL_COMP_get_compression_methods(); -+ ssl_comp_methods = (STACK_OF(SSL_COMP) *)SSL_COMP_get_compression_methods(); - n = sk_SSL_COMP_num(ssl_comp_methods); - DBUG_PRINT("info", ("Available compression methods:\n")); - if (n == 0) -@@ -515,7 +515,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, - else - for (j = 0; j < n; j++) { - SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j); --#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - DBUG_PRINT("info", (" %d: %s\n", c->id, c->name)); - #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ - DBUG_PRINT("info", ---- a/vio/viosslfactories.cc -+++ b/vio/viosslfactories.cc -@@ -429,7 +429,7 @@ void ssl_start() { - } - } - --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - /** - Set fips mode in openssl library, - When we set fips mode ON/STRICT, it will perform following operations: diff --git a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-do-not-install-comp_err.patch b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-do-not-install-comp_err.patch new file mode 100644 index 000000000000..94329eeeb3c7 --- /dev/null +++ b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-do-not-install-comp_err.patch @@ -0,0 +1,12 @@ +diff --git a/utilities/CMakeLists.txt b/utilities/CMakeLists.txt +index c855f8ab..0ebef451 100644 +--- a/utilities/CMakeLists.txt ++++ b/utilities/CMakeLists.txt +@@ -27,6 +27,7 @@ IF(NOT CMAKE_CROSSCOMPILING) + comp_err.cc + COMPONENT Server + LINK_LIBRARIES mysys ++ SKIP_INSTALL + ) + ENDIF() + diff --git a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-libressl.patch b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-libressl.patch new file mode 100644 index 000000000000..1fc949ae8564 --- /dev/null +++ b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-libressl.patch @@ -0,0 +1,297 @@ +--- a/cmake/ssl.cmake ++++ b/cmake/ssl.cmake +@@ -229,13 +229,14 @@ MACRO (MYSQL_CHECK_SSL) + OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}" + ) + ENDIF() +- IF("${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}" VERSION_GREATER "1.1.0") ++ CHECK_SYMBOL_EXISTS(TLS1_3_VERSION "openssl/tls1.h" HAVE_TLS1_3_VERSION) ++ IF(HAVE_TLS1_3_VERSION) + ADD_DEFINITIONS(-DHAVE_TLSv13) + ENDIF() + IF(OPENSSL_INCLUDE_DIR AND + OPENSSL_LIBRARY AND + CRYPTO_LIBRARY AND +- OPENSSL_MAJOR_VERSION STREQUAL "1" ++ OPENSSL_MAJOR_VERSION VERSION_GREATER_EQUAL "1" + ) + SET(OPENSSL_FOUND TRUE) + FIND_PROGRAM(OPENSSL_EXECUTABLE openssl +--- a/mysys/my_md5.cc ++++ b/mysys/my_md5.cc +@@ -56,7 +56,9 @@ static void my_md5_hash(unsigned char *digest, unsigned const char *buf, + int compute_md5_hash(char *digest, const char *buf, int len) { + int retval = 0; + int fips_mode = 0; ++#ifndef LIBRESSL_VERSION_NUMBER + fips_mode = FIPS_mode(); ++#endif + /* If fips mode is ON/STRICT restricted method calls will result into abort, + * skipping call. */ + if (fips_mode == 0) { +--- a/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c ++++ b/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c +@@ -329,6 +329,7 @@ error: + return 1; + } + ++#ifndef LIBRESSL_VERSION_NUMBER + #define OPENSSL_ERROR_LENGTH 512 + static int configure_ssl_fips_mode(const uint fips_mode) { + int rc = -1; +@@ -352,6 +353,7 @@ static int configure_ssl_fips_mode(const uint fips_mode) { + EXIT: + return rc; + } ++#endif + + static int configure_ssl_ca(SSL_CTX *ssl_ctx, const char *ca_file, + const char *ca_path) { +@@ -555,10 +557,12 @@ int xcom_init_ssl(const char *server_key_file, const char *server_cert_file, + int verify_server = SSL_VERIFY_NONE; + int verify_client = SSL_VERIFY_NONE; + ++#ifndef LIBRESSL_VERSION_NUMBER + if (configure_ssl_fips_mode(ssl_fips_mode) != 1) { + G_ERROR("Error setting the ssl fips mode"); + goto error; + } ++#endif + + SSL_library_init(); + SSL_load_error_strings(); +@@ -622,7 +626,7 @@ error: + void xcom_cleanup_ssl() { + if (!xcom_use_ssl()) return; + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + ERR_remove_thread_state(0); + #endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + } +--- a/plugin/x/client/xconnection_impl.cc ++++ b/plugin/x/client/xconnection_impl.cc +@@ -520,6 +520,7 @@ XError Connection_impl::get_ssl_error(const int error_id) { + return XError(CR_SSL_CONNECTION_ERROR, buffer); + } + ++#ifndef LIBRESSL_VERSION_NUMBER + /** + Set fips mode in openssl library, + When we set fips mode ON/STRICT, it will perform following operations: +@@ -559,6 +560,7 @@ int set_fips_mode(const uint32_t fips_mode, + EXIT: + return rc; + } ++#endif + + XError Connection_impl::activate_tls() { + if (nullptr == m_vio) return get_socket_error(SOCKET_ECONNRESET); +@@ -569,12 +571,14 @@ XError Connection_impl::activate_tls() { + if (!m_context->m_ssl_config.is_configured()) + return XError{CR_SSL_CONNECTION_ERROR, ER_TEXT_TLS_NOT_CONFIGURATED, true}; + ++#ifndef LIBRESSL_VERSION_NUMBER + char err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; + if (set_fips_mode( + static_cast(m_context->m_ssl_config.m_ssl_fips_mode), + err_string) != 1) { + return XError{CR_SSL_CONNECTION_ERROR, err_string, true}; + } ++#endif + auto ssl_ctx_flags = process_tls_version( + details::null_when_empty(m_context->m_ssl_config.m_tls_version)); + +--- a/router/src/http/src/tls_client_context.cc ++++ b/router/src/http/src/tls_client_context.cc +@@ -54,7 +54,7 @@ void TlsClientContext::verify(TlsVerify verify) { + + void TlsClientContext::cipher_suites(const std::string &ciphers) { + // TLSv1.3 ciphers are controlled via SSL_CTX_set_ciphersuites() +-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1) ++#ifdef TLS1_3_VERSION + if (1 != SSL_CTX_set_ciphersuites(ssl_ctx_.get(), ciphers.c_str())) { + throw TlsError("set-cipher-suites"); + } +--- a/router/src/http/src/tls_context.cc ++++ b/router/src/http/src/tls_context.cc +@@ -91,7 +91,7 @@ static int o11x_version(TlsVersion version) { + return TLS1_1_VERSION; + case TlsVersion::TLS_1_2: + return TLS1_2_VERSION; +-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1) ++#ifdef TLS1_3_VERSION + case TlsVersion::TLS_1_3: + return TLS1_3_VERSION; + #endif +@@ -120,9 +120,11 @@ void TlsContext::version_range(TlsVersion min_version, TlsVersion max_version) { + switch (min_version) { + default: + // unknown, leave all disabled ++#ifdef TLS1_3_VERSION + // fallthrough + case TlsVersion::TLS_1_3: + opts |= SSL_OP_NO_TLSv1_2; ++#endif + // fallthrough + case TlsVersion::TLS_1_2: + opts |= SSL_OP_NO_TLSv1_1; +@@ -170,8 +172,10 @@ TlsVersion TlsContext::min_version() const { + return TlsVersion::TLS_1_1; + case TLS1_2_VERSION: + return TlsVersion::TLS_1_2; ++#ifdef TLS1_3_VERSION + case TLS1_3_VERSION: + return TlsVersion::TLS_1_3; ++#endif + case 0: + return TlsVersion::AUTO; + default: +@@ -230,7 +234,8 @@ TlsContext::InfoCallback TlsContext::info_callback() const { + } + + int TlsContext::security_level() const { +-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) ++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \ ++ !defined(LIBRESSL_VERSION_NUMBER) + return SSL_CTX_get_security_level(ssl_ctx_.get()); + #else + return 0; +--- a/router/src/http/src/tls_server_context.cc ++++ b/router/src/http/src/tls_server_context.cc +@@ -166,7 +166,8 @@ void TlsServerContext::init_tmp_dh(const std::string &dh_params) { + } + + } else { +-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) ++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \ ++ !defined(LIBRESSL_VERSION_NUMBER) + dh2048.reset(DH_get_2048_256()); + #else + /* +--- a/sql-common/client.cc ++++ b/sql-common/client.cc +@@ -7730,7 +7730,7 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option, + #endif + break; + case MYSQL_OPT_SSL_FIPS_MODE: { +-#if defined(HAVE_OPENSSL) ++#if defined(HAVE_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER) + char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; + ENSURE_EXTENSIONS_PRESENT(&mysql->options); + mysql->options.extension->ssl_fips_mode = *static_cast(arg); +--- a/sql/mysqld.cc ++++ b/sql/mysqld.cc +@@ -4818,7 +4818,7 @@ static int init_thread_environment() { + + static PSI_memory_key key_memory_openssl = PSI_NOT_INSTRUMENTED; + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + #define FILE_LINE_ARGS + #else + #define FILE_LINE_ARGS , const char *, int +@@ -4854,12 +4854,14 @@ static void init_ssl() { + } + + static int init_ssl_communication() { ++#ifndef LIBRESSL_VERSION_NUMBER + char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; + int ret_fips_mode = set_fips_mode(opt_ssl_fips_mode, ssl_err_string); + if (ret_fips_mode != 1) { + LogErr(ERROR_LEVEL, ER_SSL_FIPS_MODE_ERROR, ssl_err_string); + return 1; + } ++#endif + if (SslAcceptorContext::singleton_init(opt_use_ssl)) return 1; + + #if OPENSSL_VERSION_NUMBER < 0x10100000L +--- a/sql/sys_vars.cc ++++ b/sql/sys_vars.cc +@@ -4417,6 +4417,7 @@ static Sys_var_ulong Sys_max_execution_time( + HINT_UPDATEABLE SESSION_VAR(max_execution_time), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1)); + ++#ifndef LIBRESSL_VERSION_NUMBER + static bool update_fips_mode(sys_var *, THD *, enum_var_type) { + char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; + if (set_fips_mode(opt_ssl_fips_mode, ssl_err_string) != 1) { +@@ -4427,15 +4428,30 @@ static bool update_fips_mode(sys_var *, THD *, enum_var_type) { + return false; + } + } ++#endif + ++#if defined(LIBRESSL_VERSION_NUMBER) ++static const char *ssl_fips_mode_names[] = {"OFF", 0}; ++#else + static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0}; ++#endif + static Sys_var_enum Sys_ssl_fips_mode( + "ssl_fips_mode", + "SSL FIPS mode (applies only for OpenSSL); " ++#ifndef LIBRESSL_VERSION_NUMBER + "permitted values are: OFF, ON, STRICT", ++#else ++ "permitted values are: OFF", ++#endif + GLOBAL_VAR(opt_ssl_fips_mode), CMD_LINE(REQUIRED_ARG, OPT_SSL_FIPS_MODE), + ssl_fips_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, +- ON_CHECK(NULL), ON_UPDATE(update_fips_mode), NULL); ++ ON_CHECK(NULL), ++#ifndef LIBRESSL_VERSION_NUMBER ++ ON_UPDATE(update_fips_mode), ++#else ++ ON_UPDATE(NULL), ++#endif ++ NULL); + + #if defined(HAVE_OPENSSL) + static Sys_var_bool Sys_auto_generate_certs( +--- a/vio/viossl.cc ++++ b/vio/viossl.cc +@@ -45,7 +45,7 @@ + BIO_set_callback_ex was added in openSSL 1.1.1 + For older openSSL, use the deprecated BIO_set_callback. + */ +-#if OPENSSL_VERSION_NUMBER >= 0x10101000L ++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER) + #define HAVE_BIO_SET_CALLBACK_EX + #endif + +@@ -637,7 +637,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, + #if !defined(DBUG_OFF) + { + STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; +- ssl_comp_methods = SSL_COMP_get_compression_methods(); ++ ssl_comp_methods = (STACK_OF(SSL_COMP) *)SSL_COMP_get_compression_methods(); + n = sk_SSL_COMP_num(ssl_comp_methods); + DBUG_PRINT("info", ("Available compression methods:\n")); + if (n == 0) +@@ -645,7 +645,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, + else + for (j = 0; j < n; j++) { + SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j); +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + DBUG_PRINT("info", (" %d: %s\n", c->id, c->name)); + #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + DBUG_PRINT("info", +--- a/vio/viosslfactories.cc ++++ b/vio/viosslfactories.cc +@@ -420,6 +420,7 @@ void ssl_start() { + } + } + ++#ifndef LIBRESSL_VERSION_NUMBER + /** + Set fips mode in openssl library, + When we set fips mode ON/STRICT, it will perform following operations: +@@ -473,6 +474,7 @@ EXIT: + @returns openssl current fips mode + */ + uint get_fips_mode() { return FIPS_mode(); } ++#endif + + long process_tls_version(const char *tls_version) { + const char *separator = ","; diff --git a/dev-db/mysql-connector-c/mysql-connector-c-8.0.17-r3.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-8.0.17-r3.ebuild deleted file mode 100644 index 3c047b80fc20..000000000000 --- a/dev-db/mysql-connector-c/mysql-connector-c-8.0.17-r3.ebuild +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake-multilib - -# wrap the config script -MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config ) - -DESCRIPTION="C client library for MariaDB/MySQL" -HOMEPAGE="https://dev.mysql.com/downloads/" -LICENSE="GPL-2" - -SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${PV}.tar.gz" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" - -SLOT="0/21" -IUSE="ldap libressl static-libs" - -RDEPEND=" - >=app-arch/lz4-0_p131:= - sys-libs/zlib:=[${MULTILIB_USEDEP}] - ldap? ( dev-libs/cyrus-sasl:=[${MULTILIB_USEDEP}] ) - libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) - !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) - " -DEPEND="${RDEPEND}" - -# Avoid file collisions, #692580 -RDEPEND+=" ! client/CMakeLists.txt || die - - # Forcefully disable auth plugin - if ! use ldap ; then - sed -i -e '/MYSQL_CHECK_SASL/d' CMakeLists.txt || die - echo > libmysql/authentication_ldap/CMakeLists.txt || die - fi - - cmake-utils_src_prepare -} - -multilib_src_configure() { - local mycmakeargs=( - -DINSTALL_LAYOUT=RPM - -DINSTALL_LIBDIR=$(get_libdir) - -DWITH_DEFAULT_COMPILER_OPTIONS=OFF - -DWITH_DEFAULT_FEATURE_SET=OFF - -DENABLED_LOCAL_INFILE=ON - -DMYSQL_UNIX_ADDR="${EPREFIX}/run/mysqld/mysqld.sock" - -DWITH_ZLIB=system - -DWITH_SSL=system - -DWITH_NUMA=OFF - -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient - -DSHARED_LIB_PATCH_VERSION="0" - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DWITHOUT_SERVER=ON - ) - cmake-utils_src_configure -} - -multilib_src_install() { - cmake-utils_src_install -} - -multilib_src_install_all() { - doman \ - man/my_print_defaults.1 \ - man/perror.1 \ - man/zlib_decompress.1 - - if ! use static-libs ; then - find "${ED}" -name "*.a" -delete || die - fi -} diff --git a/dev-db/mysql-connector-c/mysql-connector-c-8.0.18.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-8.0.18.ebuild deleted file mode 100644 index 6f10fa81b8bf..000000000000 --- a/dev-db/mysql-connector-c/mysql-connector-c-8.0.18.ebuild +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake-multilib - -# wrap the config script -MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config ) - -DESCRIPTION="C client library for MariaDB/MySQL" -HOMEPAGE="https://dev.mysql.com/downloads/" -LICENSE="GPL-2" - -SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${PV}.tar.gz" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" - -SLOT="0/21" -IUSE="ldap libressl static-libs" - -RDEPEND=" - >=app-arch/lz4-0_p131:= - sys-libs/zlib:=[${MULTILIB_USEDEP}] - ldap? ( dev-libs/cyrus-sasl:=[${MULTILIB_USEDEP}] ) - libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) - !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) - " -DEPEND="${RDEPEND}" - -# Avoid file collisions, #692580 -RDEPEND+=" ! client/CMakeLists.txt || die - - # Forcefully disable auth plugin - if ! use ldap ; then - sed -i -e '/MYSQL_CHECK_SASL/d' CMakeLists.txt || die - echo > libmysql/authentication_ldap/CMakeLists.txt || die - fi - - cmake-utils_src_prepare -} - -multilib_src_configure() { - local mycmakeargs=( - -DINSTALL_LAYOUT=RPM - -DINSTALL_LIBDIR=$(get_libdir) - -DWITH_DEFAULT_COMPILER_OPTIONS=OFF - -DWITH_DEFAULT_FEATURE_SET=OFF - -DENABLED_LOCAL_INFILE=ON - -DMYSQL_UNIX_ADDR="${EPREFIX}/run/mysqld/mysqld.sock" - -DWITH_ZLIB=system - -DWITH_SSL=system - -DWITH_NUMA=OFF - -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient - -DSHARED_LIB_PATCH_VERSION="0" - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DWITHOUT_SERVER=ON - ) - cmake-utils_src_configure -} - -multilib_src_install() { - cmake-utils_src_install -} - -multilib_src_install_all() { - doman \ - man/my_print_defaults.1 \ - man/perror.1 \ - man/zlib_decompress.1 - - if ! use static-libs ; then - find "${ED}" -name "*.a" -delete || die - fi -} diff --git a/dev-db/mysql-connector-c/mysql-connector-c-8.0.19.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-8.0.19.ebuild new file mode 100644 index 000000000000..4064f2093f98 --- /dev/null +++ b/dev-db/mysql-connector-c/mysql-connector-c-8.0.19.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake-multilib + +# wrap the config script +MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config ) + +DESCRIPTION="C client library for MariaDB/MySQL" +HOMEPAGE="https://dev.mysql.com/downloads/" +LICENSE="GPL-2" + +SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${PV}.tar.gz" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" + +SLOT="0/21" +IUSE="ldap libressl static-libs" + +RDEPEND=" + >=app-arch/lz4-0_p131:= + sys-libs/zlib:=[${MULTILIB_USEDEP}] + ldap? ( dev-libs/cyrus-sasl:=[${MULTILIB_USEDEP}] ) + libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) + !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) + " +DEPEND="${RDEPEND}" + +# Avoid file collisions, #692580 +RDEPEND+=" ! client/CMakeLists.txt || die + + # Forcefully disable auth plugin + if ! use ldap ; then + sed -i -e '/MYSQL_CHECK_SASL/d' CMakeLists.txt || die + echo > libmysql/authentication_ldap/CMakeLists.txt || die + fi + + cmake-utils_src_prepare +} + +multilib_src_configure() { + local mycmakeargs=( + -DINSTALL_LAYOUT=RPM + -DINSTALL_LIBDIR=$(get_libdir) + -DWITH_DEFAULT_COMPILER_OPTIONS=OFF + -DWITH_DEFAULT_FEATURE_SET=OFF + -DENABLED_LOCAL_INFILE=ON + -DMYSQL_UNIX_ADDR="${EPREFIX}/run/mysqld/mysqld.sock" + -DWITH_ZLIB=system + -DWITH_SSL=system + -DWITH_NUMA=OFF + -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient + -DSHARED_LIB_PATCH_VERSION="0" + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DWITHOUT_SERVER=ON + ) + cmake-utils_src_configure +} + +multilib_src_install() { + cmake-utils_src_install +} + +multilib_src_install_all() { + doman \ + man/my_print_defaults.1 \ + man/perror.1 \ + man/zlib_decompress.1 + + if ! use static-libs ; then + find "${ED}" -name "*.a" -delete || die + fi +} diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest index 62204d424309..0b3957fda50f 100644 --- a/dev-db/mysql/Manifest +++ b/dev-db/mysql/Manifest @@ -8,13 +8,13 @@ DIST mysql-5.6.44.tar.gz 32531507 BLAKE2B 28fbf49f699eb9f43223ffa186671b119d1601 DIST mysql-5.6.45.tar.gz 32525559 BLAKE2B 3c629aed1de808acdea6654c7413e6851507c9c5be939ca4b4f5e2796da317e9b518a749bfc03d2b0ef05bd604b39f72e24b751076b9f206b462d21fa5db4f50 SHA512 f9d8bb72e96cc83f1064fe7df2e5fe8317ca9d44c4e776cf7827a61292fbcfccec716806c80d565958383d78fef93a19d61c726687b57680d5f93299291ff168 DIST mysql-boost-5.7.26.tar.gz 51098338 BLAKE2B 1263cd75814a7293b26b0f44fd2b7d20d983f3c6a62725df9515ecac2ef252f6644810cb4bf0d6f36b98e55317f1c67ea7541228cb38d896dfedc476a5755f26 SHA512 a5f9871dc5a8e5fffc1467c3dd542533a63fe553c029120475f8fd5530d884c76ab0c33ad260daf317faf318ccef01464f6ac2dc3468efceb6bf2b6c06c54cfd DIST mysql-boost-5.7.27.tar.gz 51436383 BLAKE2B 6db64ab5fa659aae9baa3725a0de9465e48c37618ffd69f34809880c06a00ce55dce77f507810c6fa52d86901facfa42d3d1bd8db1914a779fbc88a69be82497 SHA512 573f4555f3d62bcd3dc2228bcfba023518d462bb6689114a3505ccf7c7c3061d2775a8e7a37ec3c8b9dea6e8fbc56ba599610f237abc38cedff58e75799bdc52 -DIST mysql-boost-8.0.18.tar.gz 194953221 BLAKE2B e3622cccd8f60487a5e643e522e9cdc763d63ad2a5eda86a7a7db37f48a4e1288fea88ef7097c6c4b51bd5e8fd8ba26a5b8aea3501ae847180066e2d0aa2b5dc SHA512 180091ad3e74e2afa28ecb914850e6b4e8c92b8981f32b161f53381b92120d87dbd2c2fc073feb2543bb71702bac7368e9fb992821cfd3e3ca888019423b89f5 +DIST mysql-boost-8.0.19.tar.gz 264147972 BLAKE2B 61a5ccbef1a7a675c85e4e6bda8e5285bdb931e6ee14d4710bf13dfd9157d1095200db2886dc93ea7251d3d59245f35c0bef5ba88ba6aac209b1e080f3b07dc4 SHA512 5ffc03f005ab2585694902e926b6cb2b10059b2b030549eccd3949f9c3b2f02626d02529f940dec003f2d69683856fd1c720ff12f89dfbdc48befaf24a9c4d01 DIST mysql-extras-20190817-0024Z.tar.bz2 337793 BLAKE2B dfd51a708654aff5bdbbaf2acad7ef966869a8e3adcba544ee15f217d2ba942827445841e73981bccc6c1f145b6225bfa7245114219f0cf52f0dfb85494a6830 SHA512 c2ff81be1c55636f0a2700033af030149f312f0383217054a4b8c65aef174626299fcb4539eaae967ea7d096a5bb09f5b5122dce344b44b0a135d886ba0fdf28 DIST mysql-extras-20190822-1908Z.tar.bz2 338830 BLAKE2B bc197f8e541206548d8982814e82e028d699ba9c41aec8d5191bcc46581f7880ed2741dbe2206fde44a5e8d8d54bbcf40efbd0709b357636c4c8fdb2ccc3a7bb SHA512 be469e55f7e9966638600d6836a44258c74e5600240fafe2d79eaeebe7d1695b043678184b5d18ee9946f28154bc2529586a7f860b510180a30c82454ed575c8 -DIST mysql-extras-20191016-1722Z.tar.bz2 340442 BLAKE2B fa38fc455693b940cfb96f69a35c190f7edb3fdfa7bf0e3f4e444032843ca1ad1d4767fecaf3b080f7f8885335ffe81f2355e9fe0fdebe77ac90d7fb1a0d2121 SHA512 1b4d3fb1cda63471807e37ecdd6a663672149a9eac9497d6b864a9ecdd57d179950176da2db0668892567994bd2fc1e98ea499f16dc689738331a1e319c9131c +DIST mysql-extras-20200120-1919Z.tar.bz2 342474 BLAKE2B 9c75ec0cb05fc8f86d46bc9308f07c4105c3ab228ef94c0e9e2ab9b83d03362e4ef07c4dac866350ea012c03c111e7012e0b12270b30304a988b9b54bad74864 SHA512 2739c193e9595781b742af9fdb6e0f9c9a5fde87ca652c355d3f630c8c0b45b45967e5c8cf7635fb8615174775e34ae3270b149de7ba8a9d778979c2c66069ef EBUILD mysql-5.6.44-r1.ebuild 27146 BLAKE2B f8afe1efcdaf08bf6529f931486e1ad97aef88169a9ae301ebb25888c173f799cfced4c70569ff9aa565a71c15bf26e5129de8b2e4226e2b1fe6abfe7e010ba5 SHA512 dc5d3e62fe4f47126228594a0b1b79bf191f70c6158a33890e49d0826dadf890512a604968a57cdb4ee9ead4fd9c9c3c10eebea8603f3323bf01aa1b9a1d4608 EBUILD mysql-5.6.45-r2.ebuild 27096 BLAKE2B 4185eba92b1d3455b2c9d718249a55e0a95b45f02f25ae5d65a9c3e01ad5de9bfe66793e63a2f577e3e7a9e295f40d7576070b356f6e2efcf493599f8569817e SHA512 faed98d09a85757cf2cede77fc21d83e059fcee33cfffd739f2dabe34ec905101840244f45c4bdf97f945abd79202c78b40f3b1dcc2f9edf10173741a3ea5b13 EBUILD mysql-5.7.26-r1.ebuild 31733 BLAKE2B d6e6f240727daae94a5d08773f1ec5046831c9b7faa605bcf685aac69c1a23b046a0bfba942e36779d9cbdfb616c9b847a2547b25673af7dcefc8839c6752710 SHA512 6dfe6baf03cf35e006677b7879d4c60705d57dc759608f17ac34eb0c747aa99844f7efe69c8d660dfb9863353d0ef390230972153e5901e7b527b8e59d9b4084 EBUILD mysql-5.7.27-r1.ebuild 31759 BLAKE2B 865bf492634cb00a3a373497501beeda472b477219960f012dcd74d5951e218904390039c17e5ff999a562cc12cb6bd58f0e2b0aa6efdb2e29f203171f04cecc SHA512 c0c7393a70d3be0129cba16694437f3017e97aa5f6cf8db63eb460d62ba06f5d3af8edbcb472d009f560e29ab837038dce4306bf2c2eb94f9ce026cae2204678 -EBUILD mysql-8.0.18.ebuild 36490 BLAKE2B 684a8100b4ea47fea430b5abadded1a9ebfbb4fe147ec22c622a38d5f54d735c8c38620e36da25ac75c203b318d71cce346ec411c978454833031f5996ca4b4b SHA512 3b8a79e99a0e03c557684a840717a6b91c172a9a02642e6ab1ee8e701d9b9551460bc5cafa3bc32c06516e78c2e89b0b7b9c833187a4a8348ffe5ef0fae37d13 +EBUILD mysql-8.0.19.ebuild 36657 BLAKE2B 582e2845f196809ce1561c91c481d824af0d93ea969315ed9f0d89bfe4f21a80d69553d2714ff392bbde4c4ea44cd88581a82f96ab2def19147995c04a34620a SHA512 179a409bc1bad200a6a77a03997a1b576ee0a085637e360596f27d3364f4e795ff9a01bc784cce2450b54781f216f8a9f9971c2672bbdc7a5dbc2e07f22136e0 MISC metadata.xml 1470 BLAKE2B 09754bc9a1cf5584588c4f69700919fd72a860175ae1c045ce90a644a1360d5abccedd5b2649e16fcd189e82df659ceb96fd71ab2aeccdac6256af4f80e46a0d SHA512 d96f6a133611f50b80116221e2586eff899210255efac58d9f6ef7ccd0ee0854a3322b4d4d1db15b3b2e410525f5d73e43f52a833f3ce358f6708b88b3cf00c7 diff --git a/dev-db/mysql/mysql-8.0.18.ebuild b/dev-db/mysql/mysql-8.0.18.ebuild deleted file mode 100644 index 6b067a6f004f..000000000000 --- a/dev-db/mysql/mysql-8.0.18.ebuild +++ /dev/null @@ -1,1117 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -MY_EXTRAS_VER="20191016-1722Z" - -CMAKE_MAKEFILE_GENERATOR=emake - -inherit cmake-utils flag-o-matic linux-info \ - multiprocessing prefix toolchain-funcs check-reqs - -MY_PV="${PV//_pre*}" -MY_P="${PN}-${MY_PV}" - -S="${WORKDIR}/${PN}-${MY_PV}" - -SRC_URI="https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-boost-${MY_PV}.tar.gz - https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-${MY_PV}.tar.gz - http://downloads.mysql.com/archives/MySQL-8.0/${PN}-boost-${MY_PV}.tar.gz" - -# Gentoo patches to MySQL -if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]] ; then - SRC_URI="${SRC_URI} - mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 - https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" -fi - -HOMEPAGE="https://www.mysql.com/" -DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" -LICENSE="GPL-2" -SLOT="0" -IUSE="cjk cracklib debug jemalloc latin1 libressl numa +perl profiling - router selinux +server tcmalloc test" - -# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests -RESTRICT="!test? ( test ) libressl? ( test )" - -REQUIRED_USE="?? ( tcmalloc jemalloc )" - -KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" - -# Shorten the path because the socket path length must be shorter than 107 chars -# and we will run a mysql server during test phase -S="${WORKDIR}/mysql" - -if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then - inherit git-r3 - EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" - EGIT_CHECKOUT_DIR="${WORKDIR}/mysql-extras" - EGIT_CLONE_TYPE=shallow - MY_PATCH_DIR="${WORKDIR}/mysql-extras" -else - MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" -fi - -PATCHES=( - "${MY_PATCH_DIR}"/20001_all_fix-minimal-build-cmake-mysql-8.0.17.patch - "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-8.0.18.patch - "${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-fix-grant_user_lock-a-root.patch - "${MY_PATCH_DIR}"/20018_all_mysql-8.0.18-without-clientlibs-tools.patch - "${MY_PATCH_DIR}"/20018_all_mysql-8.0.17-add-protobuf-3.8+-support.patch - "${MY_PATCH_DIR}"/20018_all_mysql-8.0.18-fix-libressl-support.patch -) - -# Be warned, *DEPEND are version-dependant -# These are used for both runtime and compiletime -COMMON_DEPEND=" - >=app-arch/lz4-0_p131:= - dev-libs/icu:= - dev-libs/libedit - >=dev-libs/protobuf-3.8:= - dev-libs/libevent:= - net-libs/libtirpc:= - >=sys-libs/zlib-1.2.3:0= - cjk? ( app-text/mecab:= ) - jemalloc? ( dev-libs/jemalloc:0= ) - kernel_linux? ( - dev-libs/libaio:0= - sys-process/procps:0= - ) - libressl? ( dev-libs/libressl:0= ) - !libressl? ( >=dev-libs/openssl-1.0.0:0= ) - numa? ( sys-process/numactl ) - tcmalloc? ( dev-util/google-perftools:0= ) -" -DEPEND="${COMMON_DEPEND} - || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) - net-libs/rpcsvc-proto - virtual/yacc - test? ( - acct-group/mysql acct-user/mysql - dev-perl/JSON - ) -" -RDEPEND="${COMMON_DEPEND} - !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster - selinux? ( sec-policy/selinux-mysql ) - !prefix? ( - acct-group/mysql acct-user/mysql - dev-db/mysql-init-scripts - ) -" -# For other stuff to bring us in -# dev-perl/DBD-mysql is needed by some scripts installed by MySQL -PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" - -CHECKREQS_DISK_BUILD="8G" - -mysql_init_vars() { - : ${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"} - : ${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} - : ${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} - : ${MY_LOGDIR="${EPREFIX}/var/log/mysql"} - MY_DATADIR="${MY_LOCALSTATEDIR}" - - export MY_SHAREDSTATEDIR MY_SYSCONFDIR - export MY_LOCALSTATEDIR MY_LOGDIR - export MY_DATADIR -} - -pkg_pretend() { - [[ ${MERGE_TYPE} == binary ]] && return - use server && check-reqs_pkg_pretend -} - -pkg_setup() { - [[ ${MERGE_TYPE} == binary ]] && return - - if has test ${FEATURES} ; then - # Bug #213475 - MySQL _will_ object strenuously if your machine is named - # localhost. Also causes weird failures. - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" - - if ! has userpriv ${FEATURES} ; then - die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." - fi - - local aio_max_nr=$(sysctl -n fs.aio-max-nr 2>/dev/null) - [[ -z "${aio_max_nr}" || ${aio_max_nr} -lt 250000 ]] \ - && die "FEATURES=test will require fs.aio-max-nr=250000 at minimum!" - - if use latin1 ; then - # Upstream only supports tests with default charset - die "Testing with USE=latin1 is not supported." - fi - fi - - if use kernel_linux ; then - if use numa ; then - linux-info_get_any_version - - local CONFIG_CHECK="~NUMA" - - local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;" - WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support" - - check_extra_config - fi - fi - - use server && check-reqs_pkg_setup -} - -src_unpack() { - unpack ${A} - - # Grab the patches - [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack - - mv -f "${WORKDIR}/${MY_P}" "${S}" || die -} - -src_prepare() { - # Avoid rpm call which would trigger sandbox, #692368 - sed -i \ - -e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \ - CMakeLists.txt || die - - if use jemalloc ; then - echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die - fi - - if use tcmalloc ; then - echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die - fi - - # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux - if [[ -d "${S}/support-files/SELinux" ]] ; then - echo > "${S}/support-files/SELinux/CMakeLists.txt" || die - fi - - # Remove man pages for client-lib tools we don't install - rm \ - man/my_print_defaults.1 \ - man/perror.1 \ - man/zlib_decompress.1 \ - || die - - cmake-utils_src_prepare -} - -src_configure(){ - # Bug #114895, bug #110149 - filter-flags "-O" "-O[01]" - - append-cxxflags -felide-constructors - - # bug #283926, with GCC4.4, this is required to get correct behavior. - append-flags -fno-strict-aliasing - - CMAKE_BUILD_TYPE="RelWithDebInfo" - - # debug hack wrt #497532 - mycmakeargs=( - -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" - -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" - -DSYSCONFDIR="${EPREFIX}/etc/mysql" - -DINSTALL_BINDIR=bin - -DINSTALL_DOCDIR=share/doc/${PF} - -DINSTALL_DOCREADMEDIR=share/doc/${PF} - -DINSTALL_INCLUDEDIR=include/mysql - -DINSTALL_INFODIR=share/info - -DINSTALL_LIBDIR=$(get_libdir) - -DINSTALL_MANDIR=share/man - -DINSTALL_MYSQLSHAREDIR=share/mysql - -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin - -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" - -DINSTALL_SBINDIR=sbin - -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" - -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" - -DWITH_UNIT_TESTS=$(usex test ON OFF) - -DWITH_EDITLINE=system - -DWITH_ZLIB=system - -DWITH_SSL=system - -DWITH_LIBWRAP=0 - -DENABLED_LOCAL_INFILE=1 - -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" - -DWITH_DEFAULT_COMPILER_OPTIONS=0 - -DWITH_DEFAULT_FEATURE_SET=0 - # The build forces this to be defined when cross-compiling. We pass it - # all the time for simplicity and to make sure it is actually correct. - -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DWITH_CURL=system - -DWITH_BOOST="${S}/boost" - -DWITH_ROUTER=$(usex router ON OFF) - ) - if use test ; then - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test ) - else - mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) - fi - - mycmakeargs+=( -DWITHOUT_CLIENTLIBS=YES ) - - # client/mysql.cc:1131:16: error: redefinition of ‘struct _hist_entry’ - mycmakeargs+=( - -DUSE_LIBEDIT_INTERFACE=0 - -DUSE_NEW_EDITLINE_INTERFACE=1 - -DHAVE_HIST_ENTRY=1 - ) - - mycmakeargs+=( - -DWITH_ICU=system - -DWITH_LIBEVENT=system - -DWITH_LZ4=system - -DWITH_PROTOBUF=system - -DWITH_MECAB=$(usex cjk system OFF) - -DWITH_NUMA=$(usex numa ON OFF) - # Our dev-libs/rapidjson doesn't carry necessary fixes for std::regex - -DWITH_RAPIDJSON=bundled - ) - - if [[ -n "${MYSQL_DEFAULT_CHARSET}" && -n "${MYSQL_DEFAULT_COLLATION}" ]] ; then - ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" - ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." - ewarn "You MUST file bugs without these variables set." - ewarn "Tests will probably fail!" - - mycmakeargs+=( - -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} - -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} - ) - elif use latin1 ; then - mycmakeargs+=( - -DDEFAULT_CHARSET=latin1 - -DDEFAULT_COLLATION=latin1_swedish_ci - ) - else - mycmakeargs+=( - -DDEFAULT_CHARSET=utf8mb4 - -DDEFAULT_COLLATION=utf8mb4_0900_ai_ci - ) - fi - - if use server ; then - mycmakeargs+=( - -DWITH_EXTRA_CHARSETS=all - -DWITH_DEBUG=$(usex debug) - ) - - if use profiling ; then - # Setting to OFF doesn't work: Once set, profiling options will be added - # to `mysqld --help` output via sql/sys_vars.cc causing - # "main.mysqld--help-notwin" test to fail - mycmakeargs+=( -DENABLED_PROFILING=ON ) - fi - - # Storage engines - mycmakeargs+=( - -DWITH_EXAMPLE_STORAGE_ENGINE=0 - -DWITH_ARCHIVE_STORAGE_ENGINE=1 - -DWITH_BLACKHOLE_STORAGE_ENGINE=1 - -DWITH_CSV_STORAGE_ENGINE=1 - -DWITH_FEDERATED_STORAGE_ENGINE=1 - -DWITH_HEAP_STORAGE_ENGINE=1 - -DWITH_INNOBASE_STORAGE_ENGINE=1 - -DWITH_INNODB_MEMCACHED=0 - -DWITH_MYISAMMRG_STORAGE_ENGINE=1 - -DWITH_MYISAM_STORAGE_ENGINE=1 - ) - else - mycmakeargs+=( - -DWITHOUT_SERVER=1 - -DWITH_SYSTEMD=no - ) - fi - - cmake-utils_src_configure -} - -# Official test instructions: -# ulimit -n 16500 && \ -# USE='perl server' \ -# FEATURES='test userpriv' \ -# ebuild mysql-X.X.XX.ebuild \ -# digest clean package -src_test() { - _disable_test() { - local rawtestname bug reason - rawtestname="${1}" ; shift - bug="${1}" ; shift - reason="${@}" - ewarn "test '${rawtestname}' disabled: '${reason}' (BUG#${bug})" - echo ${rawtestname} : BUG#${bug} ${reason} >> "${T}/disabled.def" - } - - local TESTDIR="${BUILD_DIR}/mysql-test" - local retstatus_unit - local retstatus_tests - - # Run CTest (test-units) - cmake-utils_src_test - retstatus_unit=$? - - # Ensure that parallel runs don't die - export MTR_BUILD_THREAD="$((${RANDOM} % 100))" - - if [[ -z "${MTR_PARALLEL}" ]] ; then - local -x MTR_PARALLEL=$(makeopts_jobs) - - if [[ ${MTR_PARALLEL} -gt 4 ]] ; then - # Running multiple tests in parallel usually require higher ulimit - # and fs.aio-max-nr setting. In addition, tests like main.multi_update - # are known to hit timeout when system is busy. - # To avoid test failure we will limit MTR_PARALLEL to 4 instead of - # using "auto". - local info_msg="Parallel MySQL test suite jobs limited to 4 (MAKEOPTS=${MTR_PARALLEL})" - info_msg+=" to avoid test failures. Set MTR_PARALLEL if you know what you are doing!" - einfo "${info_msg}" - unset info_msg - MTR_PARALLEL=4 - fi - else - einfo "MTR_PARALLEL is set to '${MTR_PARALLEL}'" - fi - - # create directories because mysqladmin might run out of order - mkdir -p "${T}"/var-tests{,/log} || die - - # Run mysql tests - pushd "${TESTDIR}" &>/dev/null || die - - touch "${T}/disabled.def" - - local -a disabled_tests - disabled_tests+=( "auth_sec.keyring_file_data_qa;0;Won't work with user privileges") - disabled_tests+=( "gis.spatial_analysis_functions_buffer;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.gis_bugs_crashes;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.geometry_class_attri_prop;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_utility_function_distance_sphere;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.geometry_property_function_issimple;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_analysis_functions_centroid;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_operators_intersection;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_utility_function_simplify;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_op_testingfunc_mix;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "gis.spatial_analysis_functions_distance;5452;Known rounding error with latest AMD processors (PS)") - disabled_tests+=( "main.window_std_var;0;Known rounding error with latest AMD processors -- no upstream bug yet") - disabled_tests+=( "main.window_std_var_optimized;0;Known rounding error with latest AMD processors -- no upstream bug yet") - disabled_tests+=( "rpl_gtid.rpl_gtid_stm_drop_table;90612;Known test failure" ) - disabled_tests+=( "rpl_gtid.rpl_multi_source_mtr_includes;0;Known failure - no upstream bug yet" ) - disabled_tests+=( "sys_vars.myisam_data_pointer_size_func;87935;Test will fail on slow hardware") - disabled_tests+=( "x.connection;0;Known failure - no upstream bug yet" ) - disabled_tests+=( "main.mysqlpump_basic_lz4;0;Extra tool output causes false positive" ) - - local test_ds - for test_infos_str in "${disabled_tests[@]}" ; do - IFS=';' read -r -a test_infos_arr <<< "${test_infos_str}" - - if [[ ${#test_infos_arr[@]} != 3 ]] ; then - die "Invalid test data set, not matching format: ${test_infos_str}" - fi - - _disable_test "${test_infos_arr[0]}" "${test_infos_arr[1]}" "${test_infos_arr[2]}" - done - unset test_ds test_infos_str test_infos_arr - - # Try to increase file limits to increase test coverage - if ! ulimit -n 16500 1>/dev/null 2>&1 ; then - # Upper limit comes from parts.partition_* tests - ewarn "For maximum test coverage please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager." - - if ! ulimit -n 4162 1>/dev/null 2>&1 ; then - # Medium limit comes from '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)' - ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager." - - if ! ulimit -n 3000 1>/dev/null 2>&1 ; then - ewarn "For minimum test coverage please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager." - else - einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)." - fi - else - einfo "Will run test suite with open file limit set to 4162 (medium test coverage)." - fi - else - einfo "Will run test suite with open file limit set to 16500 (best test coverage)." - fi - - # run mysql-test tests - perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" - retstatus_tests=$? - - popd &>/dev/null || die - - # Cleanup is important for these testcases. - pkill -9 -f "${S}/ndb" 2>/dev/null - pkill -9 -f "${S}/sql" 2>/dev/null - - local failures="" - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" - - [[ -z "$failures" ]] || die "Test failures: $failures" - einfo "Tests successfully completed" -} - -src_install() { - cmake-utils_src_install - - # Make sure the vars are correctly initialized - mysql_init_vars - - # Convenience links - einfo "Making Convenience links for mysqlcheck multi-call binary" - dosym "mysqlcheck" "/usr/bin/mysqlanalyze" - dosym "mysqlcheck" "/usr/bin/mysqlrepair" - dosym "mysqlcheck" "/usr/bin/mysqloptimize" - - # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir - if [[ -d "${ED}/usr/data" ]] ; then - rm -Rf "${ED}/usr/data" || die - fi - - # Unless they explicitly specific USE=test, then do not install the - # testsuite. It DOES have a use to be installed, esp. when you want to do a - # validation of your database configuration after tuning it. - if ! use test ; then - rm -rf "${ED}/${MY_SHAREDSTATEDIR#${EPREFIX}}/mysql-test" - fi - - # Configuration stuff - einfo "Building default configuration ..." - insinto "${MY_SYSCONFDIR#${EPREFIX}}" - [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf - cp "${FILESDIR}/my.cnf-5.7" "${TMPDIR}/my.cnf" || die - eprefixify "${TMPDIR}/my.cnf" - doins "${TMPDIR}/my.cnf" - insinto "${MY_SYSCONFDIR#${EPREFIX}}/mysql.d" - cp "${FILESDIR}/my.cnf-8.0.distro-client" "${TMPDIR}/50-distro-client.cnf" || die - eprefixify "${TMPDIR}/50-distro-client.cnf" - doins "${TMPDIR}/50-distro-client.cnf" - - mycnf_src="my.cnf-8.0.distro-server" - sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ - "${FILESDIR}/${mycnf_src}" \ - > "${TMPDIR}/my.cnf.ok" || die - - if use prefix ; then - sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ - "${TMPDIR}/my.cnf.ok" || die - fi - - if use latin1 ; then - sed -i \ - -e "/character-set/s|utf8mb4|latin1|g" \ - "${TMPDIR}/my.cnf.ok" || die - fi - - eprefixify "${TMPDIR}/my.cnf.ok" - - newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf - - #Remove mytop if perl is not selected - [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" - - if use router ; then - rm -rf \ - "${ED}/usr/LICENSE.router" \ - "${ED}/usr/README.router" \ - "${ED}/usr/run" \ - "${ED}/usr/var" \ - || die - fi - - # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. - find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die -} - -pkg_postinst() { - # Make sure the vars are correctly initialized - mysql_init_vars - - # Create log directory securely if it does not exist - # NOTE: $MY_LOGDIR contains $EPREFIX by default - [[ -d "${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${MY_LOGDIR}" - - # Note about configuration change - einfo - elog "This version of ${PN} reorganizes the configuration from a single my.cnf" - elog "to several files in /etc/mysql/mysql.d." - elog "Please backup any changes you made to /etc/mysql/my.cnf" - elog "and add them as a new file under /etc/mysql/mysql.d with a .cnf extension." - elog "You may have as many files as needed and they are read alphabetically." - elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." - einfo - - if [[ -z "${REPLACING_VERSIONS}" ]] ; then - einfo - elog "You might want to run:" - elog " \"emerge --config =${CATEGORY}/${PF}\"" - elog "if this is a new install." - einfo - else - einfo - elog "Upgrade process for ${PN}-8.x has changed. Please read" - elog "https://dev.mysql.com/doc/refman/8.0/en/upgrade-binary-package.html" - einfo - fi -} - -pkg_config() { - local mysqld_binary="${EROOT}/usr/sbin/mysqld" - if [[ ! -x "${mysqld_binary}" ]] ; then - die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!" - fi - - local mysql_binary="${EROOT}/usr/bin/mysql" - if [[ ! -x "${mysql_binary}" ]] ; then - die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!" - fi - - local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults" - if [[ ! -x "${my_print_defaults_binary}" ]] ; then - die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!" - fi - - if [[ -z "${MYSQL_USER}" ]] ; then - MYSQL_USER=mysql - if use prefix ; then - MYSQL_USER=$(id -u -n 2>/dev/null) - if [[ -z "${MYSQL_USER}" ]] ; then - die "Failed to determine current username!" - fi - fi - fi - - if [[ -z "${MYSQL_GROUP}" ]] ; then - MYSQL_GROUP=mysql - if use prefix ; then - MYSQL_GROUP=$(id -g -n 2>/dev/null) - if [[ -z "${MYSQL_GROUP}" ]] ; then - die "Failed to determine current user groupname!" - fi - fi - fi - - einfo "Will use username '${MYSQL_USER}' and group '${MYSQL_GROUP}' ..." - - _getoptval() { - local section="$1" - local flag="--${2}=" - local extra_options="${3}" - local cmd=( - "${my_print_defaults_binary}" - "${extra_options}" - "${section}" - ) - local results=( $(eval "${cmd[@]}" 2>/dev/null | sed -n "/^${flag}/s,${flag},,gp") ) - - if [[ ${#results[@]} -gt 0 ]] ; then - # When option is set multiple times only return last value - echo "${results[-1]}" - fi - } - - _mktemp_dry() { - # emktemp has no --dry-run option - local template="${1}" - - if [[ -z "${template}" ]] ; then - if [[ -z "${T}" ]] ; then - template="/tmp/XXXXXXX" - else - template="${T}/XXXXXXX" - fi - fi - - local template_wo_X=${template//X/} - local n_X - let n_X=${#template}-${#template_wo_X} - if [[ ${n_X} -lt 3 ]] ; then - echo "${FUNCNAME[0]}: too few X's in template ‘${template}’" >&2 - return - fi - - local attempts=0 - local character tmpfile - while [[ true ]] ; do - let attempts=attempts+1 - - new_file= - while read -n1 character ; do - if [[ "${character}" == "X" ]] ; then - tmpfile+="${RANDOM:0:1}" - else - tmpfile+="${character}" - fi - done < <(echo -n "${template}") - - if [[ ! -f "${tmpfile}" ]] - then - echo "${tmpfile}" - return - fi - - if [[ ${attempts} -ge 100 ]] ; then - echo "${FUNCNAME[0]}: Cannot create temporary file after 100 attempts." >&2 - return - fi - done - } - - # my_print_defaults needs to read stuff in $HOME/.my.cnf - local -x HOME="${EROOT}/root" - - # Make sure the vars are correctly initialized - mysql_init_vars - - # Read currently set data directory - MY_DATADIR="$(_getoptval mysqld datadir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" - - # Bug #213475 - MySQL _will_ object strenously if your machine is named - # localhost. Also causes weird failures. - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" - - if [[ -z "${MY_DATADIR}" ]] ; then - die "Sorry, unable to find MY_DATADIR!" - elif [[ -d "${MY_DATADIR}/mysql" ]] ; then - ewarn "Looks like your data directory '${MY_DATADIR}' is already initialized!" - ewarn "Please rename or delete its content if you wish to initialize a new data directory." - die "${PN} data directory at '${MY_DATADIR}' looks already initialized!" - else - einfo "${PN} data directory detected as '${MY_DATADIR}' ..." - fi - - MYSQL_TMPDIR="$(_getoptval mysqld tmpdir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" - # These are dir+prefix - MYSQL_LOG_BIN="$(_getoptval mysqld log-bin "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" - MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} - MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" - MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - - # Create missing directories. - # Always check if mysql user can write to directory even if we just - # created directory because a parent directory might be not - # accessible for that user. - PID_DIR="${EROOT}/run/mysqld" - if [[ ! -d "${PID_DIR}" ]] ; then - einfo "Creating ${PN} PID directory '${PID_DIR}' ..." - install -d -m 755 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${PID_DIR}" \ - || die "Failed to create PID directory '${PID_DIR}'!" - fi - - local _pid_dir_testfile="$(_mktemp_dry "${PID_DIR}/.pkg_config-access-test.XXXXXXXXX")" - [[ -z "${_pid_dir_testfile}" ]] \ - && die "_mktemp_dry() for '${PID_DIR}/.pkg_config-access-test.XXXXXXXXX' failed!" - - if use prefix ; then - touch "${_pid_dir_testfile}" &>/dev/null - else - su -s /bin/sh -c "touch ${_pid_dir_testfile}" ${MYSQL_USER} &>/dev/null - fi - - if [[ $? -ne 0 ]] ; then - die "${MYSQL_USER} user cannot write into PID dir '${PID_DIR}'!" - else - rm "${_pid_dir_testfile}" || die - unset _pid_dir_testfile - fi - - if [[ ! -d "${MY_DATADIR}" ]] ; then - einfo "Creating ${PN} data directory '${MY_DATADIR}' ..." - install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MY_DATADIR}" \ - || die "Failed to create ${PN} data directory '${MY_DATADIR}'!" - fi - - local _my_datadir_testfile="$(_mktemp_dry "${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX")" - [[ -z "${_my_datadir_testfile}" ]] \ - && die "_mktemp_dry() for '${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX' failed!" - - if use prefix ; then - touch "${_my_datadir_testfile}" &>/dev/null - else - su -s /bin/sh -c "touch ${_my_datadir_testfile}" ${MYSQL_USER} &>/dev/null - fi - - if [[ $? -ne 0 ]]; then - die "${MYSQL_USER} user cannot write into data directory '${MY_DATADIR}'!" - else - rm "${_my_datadir_testfile}" || die - unset _my_datadir_testfile - fi - - if [[ -n "${MYSQL_TMPDIR}" && ! -d "${MYSQL_TMPDIR}" ]] ; then - einfo "Creating ${PN} tmpdir '${MYSQL_TMPDIR}' ..." - install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_TMPDIR}" \ - || die "Failed to create ${PN} tmpdir '${MYSQL_TMPDIR}'!" - fi - - if [[ -n "${MYSQL_TMPDIR}" ]] ; then - local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")" - [[ -z "${_my_tmpdir_testfile}" ]] \ - && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!" - - if use prefix ; then - touch "${_my_tmpdir_testfile}" &>/dev/null - else - su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null - fi - - if [[ $? -ne 0 ]]; then - die "${MYSQL_USER} user cannot write into data directory '${MYSQL_TMPDIR}'!" - else - rm "${_my_tmpdir_testfile}" || die - unset _my_tmpdir_testfile - fi - else - # If no tmpdir is set, mysqld will use default system tmpdir. - # However, we are using tmpdir from package manager at the - # moment which maybe isn't writeable for $MYSQL_USER... - MYSQL_TMPDIR="$(_mktemp_dry "${T}/mysqld-tmp.XXXXXXXXX")" - [[ -z "${MYSQL_TMPDIR}" ]] \ - && die "_mktemp_dry() for '${MYSQL_TMPDIR}' failed!" - - mkdir "${MYSQL_TMPDIR}" || die - chown ${MYSQL_USER} "${MYSQL_TMPDIR}" || die - fi - - if [[ -n "${MYSQL_LOG_BIN}" && ! -d "${MYSQL_LOG_BIN}" ]] ; then - einfo "Creating ${PN} log-bin directory '${MYSQL_LOG_BIN}' ..." - install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_LOG_BIN}" \ - || die "Failed to create ${PN} log-bin directory '${MYSQL_LOG_BIN}'" - fi - - if [[ -n "${MYSQL_LOG_BIN}" ]] ; then - local _my_logbin_testfile="$(_mktemp_dry "${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX")" - [[ -z "${_my_logbin_testfile}" ]] \ - && die "_mktemp_dry() for '${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX' failed!" - - if use prefix ; then - touch "${_my_logbin_testfile}" &>/dev/null - else - su -s /bin/sh -c "touch ${_my_logbin_testfile}" ${MYSQL_USER} &>/dev/null - fi - - if [[ $? -ne 0 ]]; then - die "${MYSQL_USER} user cannot write into log-bin directory '${MYSQL_LOG_BIN}'!" - else - rm "${_my_logbin_testfile}" || die - unset _my_logbin_testfile - fi - fi - - if [[ -n "${MYSQL_RELAY_LOG}" && ! -d "${MYSQL_RELAY_LOG}" ]] ; then - einfo "Creating ${PN} relay-log directory '${MYSQL_RELAY_LOG}' ..." - install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_RELAY_LOG}" \ - || die "Failed to create ${PN} relay-log directory '${MYSQL_RELAY_LOG}'!" - fi - - if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then - local _my_relaylog_testfile="$(_mktemp_dry "${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX")" - [[ -z "${_my_relaylog_testfile}" ]] \ - && die "_mktemp_dry() for '${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX' failed!" - - if use prefix ; then - touch "${_my_relaylog_testfile}" &>/dev/null - else - su -s /bin/sh -c "touch ${_my_relaylog_testfile}" ${MYSQL_USER} &>/dev/null - fi - - if [[ $? -ne 0 ]]; then - die "${MYSQL_USER} user cannot write into relay-log directory '${MYSQL_RELAY_LOG}'!" - else - rm "${_my_relaylog_testfile}" || die - unset _my_relaylog_testfile - fi - fi - - local -a config_files - - local config_file="${EROOT}/etc/mysql/mysql.d/50-distro-client.cnf" - if [[ -f "${config_file}" ]] ; then - config_files+=( "${config_file}" ) - else - ewarn "Client configuration '${config_file}' not found; Skipping configuration of default authentication plugin for client ..." - fi - - config_file="${EROOT}/etc/mysql/mysql.d/50-distro-server.cnf" - if [[ -f "${config_file}" ]] ; then - config_files+=( "${config_file}" ) - else - ewarn "Server configuration '${config_file}' not found; Skipping configuration of default authentication plugin for mysqld ..." - fi - - if [[ ${#config_files[@]} -gt 0 ]] ; then - if [[ -z "${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" ]] ; then - local user_answer - - echo - einfo "Please select default authentication plugin (enter number or plugin name):" - einfo "1) caching_sha2_password [MySQL 8.0 default]" - einfo "2) mysql_native_password [MySQL 5.7 default]" - einfo - einfo "For details see:" - einfo "https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password" - read -p " >" user_answer - echo - - case "${user_answer}" in - 1|caching_sha2_password) - MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=caching_sha2_password - ;; - 2|mysql_native_password) - MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=mysql_native_password - ;; - '') - die "No authentication plugin selected!" - ;; - *) - die "Authentication plugin '${user_answer}' is unknown/unsupported!" - ;; - esac - - unset user_answer - fi - - local cfg_option cfg_option_tabs cfg_section - for config_file in "${config_files[@]}" ; do - cfg_option="default-authentication-plugin" - cfg_section="mysqld" - cfg_option_tabs="\t\t" - if [[ "${config_file}" == *client.cnf ]] ; then - cfg_option="default-auth" - cfg_section="client" - cfg_option_tabs="\t\t\t\t" - fi - - if grep -qE "^(loose-)?${cfg_option}\b.*=" "${config_file}" 2>/dev/null ; then - einfo "Ensuring that ${cfg_option} is set to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..." - sed -i \ - -e "s/^\(loose-\)\?${cfg_option}\b.*=.*/loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}/" \ - "${config_file}" || die "Failed to change ${cfg_option} in '${config_file}'!" - else - einfo "Setting ${cfg_option} to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..." - sed -i \ - -e "/^\[${cfg_section}\]$/a loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" \ - "${config_file}" || die "Failed to add ${cfg_option} to '${config_file}'!" - fi - done - unset cfg_option cfg_option_tabs cfg_section - fi - unset config_files config_file - - echo - - if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then - local tmp_mysqld_password_source= - - for tmp_mysqld_password_source in mysql client ; do - einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" - if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then - if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]] ; then - ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" - MYSQL_ROOT_PASSWORD= - continue - fi - - einfo "Found password in '${tmp_mysqld_password_source}' section!" - break - fi - done - - # Sometimes --show is required to display passwords in some implementations of my_print_defaults - if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]] ; then - MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" - fi - - unset tmp_mysqld_password_source - fi - - if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then - local pwd1="a" - local pwd2="b" - - echo - einfo "No password for mysql 'root' user was specified via environment" - einfo "variable MYSQL_ROOT_PASSWORD and no password was found in config" - einfo "file like '${HOME}/.my.cnf'." - einfo "To continue please provide a password for the mysql 'root' user" - einfo "now on console:" - ewarn "NOTE: Please avoid [\"'\\_%] characters in the password!" - read -rsp " >" pwd1 ; echo - - einfo "Retype the password" - read -rsp " >" pwd2 ; echo - - if [[ "x$pwd1" != "x$pwd2" ]] ; then - die "Passwords are not the same!" - fi - - MYSQL_ROOT_PASSWORD="${pwd1}" - unset pwd1 pwd2 - - echo - fi - - local -a mysqld_options - - # Fix bug 446200. Don't reference host my.cnf, needs to come first, - # see http://bugs.mysql.com/bug.php?id=31312 - use prefix && mysqld_options+=( "--defaults-file='${MY_SYSCONFDIR}/my.cnf'" ) - - # Figure out which options we need to disable to do the setup - local helpfile="${TMPDIR}/mysqld-help" - "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null - - local opt optexp optfull - for opt in host-cache name-resolve networking slave-start \ - federated ssl log-bin relay-log slow-query-log external-locking \ - log-slave-updates \ - ; do - optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" - egrep -sq -- "${optexp}" "${helpfile}" && mysqld_options+=( "${optfull}" ) - done - - # Prepare timezones, see - # https://dev.mysql.com/doc/mysql/en/time-zone-support.html - local tz_sql="${TMPDIR}/tz.sql" - echo "USE mysql;" >"${tz_sql}" - "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" >> "${tz_sql}" 2>/dev/null - if [[ $? -ne 0 ]] ; then - die "mysql_tzinfo_to_sql failed!" - fi - - chown ${MYSQL_USER} "${tz_sql}" || die - - local mysql_install_log="${TMPDIR}/mysql_install_db.log" - touch "${mysql_install_log}" || die - chown ${MYSQL_USER} "${mysql_install_log}" || die - - # --initialize-insecure will not set root password - # --initialize would set a random one in the log which we don't need as we set it ourselves - local cmd=( - "${mysqld_binary}" - "${mysqld_options[@]}" - "--initialize-insecure" - "--init-file='${tz_sql}'" - "--basedir='${EROOT}/usr'" - "--datadir='${MY_DATADIR}'" - "--tmpdir='${MYSQL_TMPDIR}'" - "--log-error='${mysql_install_log}'" - "--user=${MYSQL_USER}" - ) - - einfo "Initializing ${PN} data directory: ${cmd[@]}" - eval "${cmd[@]}" >>"${mysql_install_log}" 2>&1 - - if [[ $? -ne 0 || ! -f "${MY_DATADIR}/mysql.ibd" ]] ; then - grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_install_log}" 1>&2 - die "Failed to initialize ${PN} data directory. Please review '${mysql_install_log}'!" - fi - - local x=${RANDOM} - local socket="${EROOT}/run/mysqld/mysqld${x}.sock" - local pidfile="${EROOT}/run/mysqld/mysqld${x}.pid" - unset x - - local mysqld_logfile="${TMPDIR}/mysqld.log" - touch "${mysqld_logfile}" || die - chown ${MYSQL_USER} "${mysqld_logfile}" || die - - cmd=( - "${mysqld_binary}" - "${mysqld_options[@]}" - "--basedir='${EROOT}/usr'" - "--datadir='${MY_DATADIR}'" - "--tmpdir='${MYSQL_TMPDIR}'" - --max_allowed_packet=8M - --net_buffer_length=16K - "--socket='${socket}'" - "--pid-file='${pidfile}'" - "--log-error='${mysqld_logfile}'" - "--user=${MYSQL_USER}" - ) - - einfo "Starting mysqld to finalize initialization: ${cmd[@]}" - eval "${cmd[@]}" >>"${mysqld_logfile}" 2>&1 & - - echo -n "Waiting for mysqld to accept connections " - local maxtry=15 - while [[ ! -S "${socket}" && "${maxtry}" -gt 1 ]] ; do - maxtry=$((${maxtry}-1)) - echo -n "." - sleep 1 - done - - if [[ -S "${socket}" ]] ; then - # Even with a socket we don't know if mysqld will abort - # start due to an error so just wait a little bit more... - maxtry=5 - while [[ -S "${socket}" && "${maxtry}" -gt 1 ]] ; do - maxtry=$((${maxtry}-1)) - echo -n "." - sleep 1 - done - fi - - echo - - if [[ ! -S "${socket}" ]] ; then - grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysqld_logfile}" 1>&2 - die "mysqld was unable to start from initialized data directory. Please review '${mysqld_logfile}'!" - fi - - local mysql_logfile="${TMPDIR}/set_root_pw.log" - touch "${mysql_logfile}" || die - - ebegin "Setting root password" - # Do this from memory, as we don't want clear text passwords in temp files - local sql="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'" - cmd=( - "${mysql_binary}" - --no-defaults - "--socket='${socket}'" - -hlocalhost - "-e \"${sql}\"" - ) - eval "${cmd[@]}" >"${mysql_logfile}" 2>&1 - local rc=$? - eend ${rc} - - if [[ ${rc} -ne 0 ]] ; then - # Poor man's solution which tries to avoid having password - # in log. NOTE: sed can fail if user didn't follow advice - # and included character which will require escaping... - sed -i -e "s/${MYSQL_ROOT_PASSWORD}/*****/" "${mysql_logfile}" 2>/dev/null - - grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_logfile}" - die "Failed to set ${PN} root password. Please review '${mysql_logfile}'!" - fi - - # Stop the server - if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then - echo -n "Stopping the server " - pkill -F "${pidfile}" &>/dev/null - - maxtry=10 - while [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; do - maxtry=$((${maxtry}-1)) - echo -n "." - sleep 1 - done - - echo - - if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then - # We somehow failed to stop server. - # However, not a fatal error. Just warn the user. - ewarn "WARNING: mysqld[$(cat "${pidfile}")] is still running!" - fi - fi - - einfo "${PN} data directory at '${MY_DATADIR}' successfully initialized!" -} diff --git a/dev-db/mysql/mysql-8.0.19.ebuild b/dev-db/mysql/mysql-8.0.19.ebuild new file mode 100644 index 000000000000..9d486bdb84a2 --- /dev/null +++ b/dev-db/mysql/mysql-8.0.19.ebuild @@ -0,0 +1,1120 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +MY_EXTRAS_VER="20200120-1919Z" + +CMAKE_MAKEFILE_GENERATOR=emake + +inherit cmake-utils flag-o-matic linux-info \ + multiprocessing prefix toolchain-funcs check-reqs + +MY_PV="${PV//_pre*}" +MY_P="${PN}-${MY_PV}" + +S="${WORKDIR}/${PN}-${MY_PV}" + +SRC_URI="https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-boost-${MY_PV}.tar.gz + https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-${MY_PV}.tar.gz + http://downloads.mysql.com/archives/MySQL-8.0/${PN}-boost-${MY_PV}.tar.gz" + +# Gentoo patches to MySQL +if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]] ; then + SRC_URI="${SRC_URI} + mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 + https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" +fi + +HOMEPAGE="https://www.mysql.com/" +DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" +LICENSE="GPL-2" +SLOT="0" +IUSE="cjk cracklib debug jemalloc latin1 libressl numa +perl profiling + router selinux +server tcmalloc test" + +# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests +RESTRICT="!test? ( test ) libressl? ( test )" + +REQUIRED_USE="?? ( tcmalloc jemalloc ) + cjk? ( server ) + jemalloc? ( server ) + numa? ( server ) + profiling? ( server ) + router? ( server ) + tcmalloc? ( server )" + +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" + +# Shorten the path because the socket path length must be shorter than 107 chars +# and we will run a mysql server during test phase +S="${WORKDIR}/mysql" + +if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git" + EGIT_CHECKOUT_DIR="${WORKDIR}/mysql-extras" + EGIT_CLONE_TYPE=shallow + MY_PATCH_DIR="${WORKDIR}/mysql-extras" +else + MY_PATCH_DIR="${WORKDIR}/mysql-extras-${MY_EXTRAS_VER}" +fi + +PATCHES=( + "${MY_PATCH_DIR}"/20001_all_fix-minimal-build-cmake-mysql-8.0.17.patch + "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-8.0.18.patch + "${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-fix-grant_user_lock-a-root.patch + "${MY_PATCH_DIR}"/20018_all_mysql-8.0.19-without-clientlibs-tools.patch + "${MY_PATCH_DIR}"/20018_all_mysql-8.0.19-fix-libressl-support.patch + "${MY_PATCH_DIR}"/20018_all_mysql-8.0.19-fix-events_bugs-test.patch +) + +# Be warned, *DEPEND are version-dependant +# These are used for both runtime and compiletime +COMMON_DEPEND=" + >=app-arch/lz4-0_p131:= + dev-libs/libedit + >=sys-libs/zlib-1.2.3:0= + libressl? ( dev-libs/libressl:0= ) + !libressl? ( >=dev-libs/openssl-1.0.0:0= ) + server? ( + dev-libs/icu:= + dev-libs/libevent:= + >=dev-libs/protobuf-3.8:= + net-libs/libtirpc:= + cjk? ( app-text/mecab:= ) + kernel_linux? ( + dev-libs/libaio:0= + sys-process/procps:0= + ) + numa? ( sys-process/numactl ) + jemalloc? ( dev-libs/jemalloc:0= ) + tcmalloc? ( dev-util/google-perftools:0= ) + ) +" +DEPEND="${COMMON_DEPEND} + || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) + virtual/yacc + server? ( net-libs/rpcsvc-proto ) + test? ( + acct-group/mysql acct-user/mysql + dev-perl/JSON + ) +" +RDEPEND="${COMMON_DEPEND} + !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster + selinux? ( sec-policy/selinux-mysql ) + !prefix? ( + acct-group/mysql acct-user/mysql + dev-db/mysql-init-scripts + ) +" +# For other stuff to bring us in +# dev-perl/DBD-mysql is needed by some scripts installed by MySQL +PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" + +CHECKREQS_DISK_BUILD="8G" + +mysql_init_vars() { + : ${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"} + : ${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} + : ${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} + : ${MY_LOGDIR="${EPREFIX}/var/log/mysql"} + MY_DATADIR="${MY_LOCALSTATEDIR}" + + export MY_SHAREDSTATEDIR MY_SYSCONFDIR + export MY_LOCALSTATEDIR MY_LOGDIR + export MY_DATADIR +} + +pkg_pretend() { + [[ ${MERGE_TYPE} == binary ]] && return + use server && check-reqs_pkg_pretend +} + +pkg_setup() { + [[ ${MERGE_TYPE} == binary ]] && return + + if has test ${FEATURES} ; then + # Bug #213475 - MySQL _will_ object strenuously if your machine is named + # localhost. Also causes weird failures. + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" + + if ! has userpriv ${FEATURES} ; then + die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." + fi + + local aio_max_nr=$(sysctl -n fs.aio-max-nr 2>/dev/null) + [[ -z "${aio_max_nr}" || ${aio_max_nr} -lt 250000 ]] \ + && die "FEATURES=test will require fs.aio-max-nr=250000 at minimum!" + + if use latin1 ; then + # Upstream only supports tests with default charset + die "Testing with USE=latin1 is not supported." + fi + fi + + if use kernel_linux ; then + if use numa ; then + linux-info_get_any_version + + local CONFIG_CHECK="~NUMA" + + local WARNING_NUMA="This package expects NUMA support in kernel which this system does not have at the moment;" + WARNING_NUMA+=" Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support" + + check_extra_config + fi + fi + + use server && check-reqs_pkg_setup +} + +src_unpack() { + unpack ${A} + + # Grab the patches + [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack + + mv -f "${WORKDIR}/${MY_P}" "${S}" || die +} + +src_prepare() { + # Avoid rpm call which would trigger sandbox, #692368 + sed -i \ + -e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \ + CMakeLists.txt || die + + if use jemalloc ; then + echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die + fi + + if use tcmalloc ; then + echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" || die + fi + + # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux + if [[ -d "${S}/support-files/SELinux" ]] ; then + echo > "${S}/support-files/SELinux/CMakeLists.txt" || die + fi + + # Remove man pages for client-lib tools we don't install + rm \ + man/my_print_defaults.1 \ + man/perror.1 \ + man/zlib_decompress.1 \ + || die + + cmake-utils_src_prepare +} + +src_configure(){ + # Bug #114895, bug #110149 + filter-flags "-O" "-O[01]" + + append-cxxflags -felide-constructors + + # bug #283926, with GCC4.4, this is required to get correct behavior. + append-flags -fno-strict-aliasing + + CMAKE_BUILD_TYPE="RelWithDebInfo" + + # debug hack wrt #497532 + mycmakeargs=( + -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" + -DSYSCONFDIR="${EPREFIX}/etc/mysql" + -DINSTALL_BINDIR=bin + -DINSTALL_DOCDIR=share/doc/${PF} + -DINSTALL_DOCREADMEDIR=share/doc/${PF} + -DINSTALL_INCLUDEDIR=include/mysql + -DINSTALL_INFODIR=share/info + -DINSTALL_LIBDIR=$(get_libdir) + -DINSTALL_MANDIR=share/man + -DINSTALL_MYSQLSHAREDIR=share/mysql + -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin + -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" + -DINSTALL_SBINDIR=sbin + -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" + -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" + -DWITH_UNIT_TESTS=$(usex test ON OFF) + -DWITH_EDITLINE=system + -DWITH_ZLIB=system + -DWITH_SSL=system + -DWITH_LIBWRAP=0 + -DENABLED_LOCAL_INFILE=1 + -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" + -DWITH_DEFAULT_COMPILER_OPTIONS=0 + -DWITH_DEFAULT_FEATURE_SET=0 + # The build forces this to be defined when cross-compiling. We pass it + # all the time for simplicity and to make sure it is actually correct. + -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DWITH_CURL=system + -DWITH_BOOST="${S}/boost" + -DWITH_ROUTER=$(usex router ON OFF) + ) + if use test ; then + mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test ) + else + mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' ) + fi + + mycmakeargs+=( -DWITHOUT_CLIENTLIBS=YES ) + + mycmakeargs+=( + -DWITH_ICU=system + -DWITH_LZ4=system + # Our dev-libs/rapidjson doesn't carry necessary fixes for std::regex + -DWITH_RAPIDJSON=bundled + ) + + if [[ -n "${MYSQL_DEFAULT_CHARSET}" && -n "${MYSQL_DEFAULT_COLLATION}" ]] ; then + ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" + ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." + ewarn "You MUST file bugs without these variables set." + ewarn "Tests will probably fail!" + + mycmakeargs+=( + -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} + -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} + ) + elif use latin1 ; then + mycmakeargs+=( + -DDEFAULT_CHARSET=latin1 + -DDEFAULT_COLLATION=latin1_swedish_ci + ) + else + mycmakeargs+=( + -DDEFAULT_CHARSET=utf8mb4 + -DDEFAULT_COLLATION=utf8mb4_0900_ai_ci + ) + fi + + if use server ; then + mycmakeargs+=( + -DWITH_EXTRA_CHARSETS=all + -DWITH_DEBUG=$(usex debug) + -DWITH_MECAB=$(usex cjk system OFF) + -DWITH_LIBEVENT=system + -DWITH_PROTOBUF=system + -DWITH_NUMA=$(usex numa ON OFF) + ) + + if use profiling ; then + # Setting to OFF doesn't work: Once set, profiling options will be added + # to `mysqld --help` output via sql/sys_vars.cc causing + # "main.mysqld--help-notwin" test to fail + mycmakeargs+=( -DENABLED_PROFILING=ON ) + fi + + # Storage engines + mycmakeargs+=( + -DWITH_EXAMPLE_STORAGE_ENGINE=0 + -DWITH_ARCHIVE_STORAGE_ENGINE=1 + -DWITH_BLACKHOLE_STORAGE_ENGINE=1 + -DWITH_CSV_STORAGE_ENGINE=1 + -DWITH_FEDERATED_STORAGE_ENGINE=1 + -DWITH_HEAP_STORAGE_ENGINE=1 + -DWITH_INNOBASE_STORAGE_ENGINE=1 + -DWITH_INNODB_MEMCACHED=0 + -DWITH_MYISAMMRG_STORAGE_ENGINE=1 + -DWITH_MYISAM_STORAGE_ENGINE=1 + ) + else + mycmakeargs+=( + -DWITHOUT_SERVER=1 + -DWITH_SYSTEMD=no + ) + fi + + cmake-utils_src_configure +} + +# Official test instructions: +# ulimit -n 16500 && \ +# USE='perl server' \ +# FEATURES='test userpriv' \ +# ebuild mysql-X.X.XX.ebuild \ +# digest clean package +src_test() { + _disable_test() { + local rawtestname bug reason + rawtestname="${1}" ; shift + bug="${1}" ; shift + reason="${@}" + ewarn "test '${rawtestname}' disabled: '${reason}' (BUG#${bug})" + echo ${rawtestname} : BUG#${bug} ${reason} >> "${T}/disabled.def" + } + + local TESTDIR="${BUILD_DIR}/mysql-test" + local retstatus_unit + local retstatus_tests + + # Run CTest (test-units) + cmake-utils_src_test + retstatus_unit=$? + + # Ensure that parallel runs don't die + export MTR_BUILD_THREAD="$((${RANDOM} % 100))" + + if [[ -z "${MTR_PARALLEL}" ]] ; then + local -x MTR_PARALLEL=$(makeopts_jobs) + + if [[ ${MTR_PARALLEL} -gt 4 ]] ; then + # Running multiple tests in parallel usually require higher ulimit + # and fs.aio-max-nr setting. In addition, tests like main.multi_update + # are known to hit timeout when system is busy. + # To avoid test failure we will limit MTR_PARALLEL to 4 instead of + # using "auto". + local info_msg="Parallel MySQL test suite jobs limited to 4 (MAKEOPTS=${MTR_PARALLEL})" + info_msg+=" to avoid test failures. Set MTR_PARALLEL if you know what you are doing!" + einfo "${info_msg}" + unset info_msg + MTR_PARALLEL=4 + fi + else + einfo "MTR_PARALLEL is set to '${MTR_PARALLEL}'" + fi + + # create directories because mysqladmin might run out of order + mkdir -p "${T}"/var-tests{,/log} || die + + # Run mysql tests + pushd "${TESTDIR}" &>/dev/null || die + + touch "${T}/disabled.def" + + local -a disabled_tests + disabled_tests+=( "auth_sec.keyring_file_data_qa;0;Won't work with user privileges") + disabled_tests+=( "gis.spatial_analysis_functions_buffer;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.gis_bugs_crashes;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.geometry_class_attri_prop;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_utility_function_distance_sphere;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.geometry_property_function_issimple;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_analysis_functions_centroid;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_operators_intersection;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_utility_function_simplify;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_op_testingfunc_mix;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "gis.spatial_analysis_functions_distance;5452;Known rounding error with latest AMD processors (PS)") + disabled_tests+=( "main.window_std_var;0;Known rounding error with latest AMD processors -- no upstream bug yet") + disabled_tests+=( "main.window_std_var_optimized;0;Known rounding error with latest AMD processors -- no upstream bug yet") + disabled_tests+=( "rpl_gtid.rpl_gtid_stm_drop_table;90612;Known test failure" ) + disabled_tests+=( "rpl_gtid.rpl_multi_source_mtr_includes;0;Known failure - no upstream bug yet" ) + disabled_tests+=( "sys_vars.myisam_data_pointer_size_func;87935;Test will fail on slow hardware") + disabled_tests+=( "x.connection;0;Known failure - no upstream bug yet" ) + disabled_tests+=( "main.mysqlpump_basic_lz4;0;Extra tool output causes false positive" ) + disabled_tests+=( "x.message_compressed_payload;0;False positive caused by protobuff-3.11+" ) + disabled_tests+=( "x.message_protobuf_nested;0;False positive caused by protobuff-3.11+" ) + + local test_ds + for test_infos_str in "${disabled_tests[@]}" ; do + IFS=';' read -r -a test_infos_arr <<< "${test_infos_str}" + + if [[ ${#test_infos_arr[@]} != 3 ]] ; then + die "Invalid test data set, not matching format: ${test_infos_str}" + fi + + _disable_test "${test_infos_arr[0]}" "${test_infos_arr[1]}" "${test_infos_arr[2]}" + done + unset test_ds test_infos_str test_infos_arr + + # Try to increase file limits to increase test coverage + if ! ulimit -n 16500 1>/dev/null 2>&1 ; then + # Upper limit comes from parts.partition_* tests + ewarn "For maximum test coverage please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager." + + if ! ulimit -n 4162 1>/dev/null 2>&1 ; then + # Medium limit comes from '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)' + ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager." + + if ! ulimit -n 3000 1>/dev/null 2>&1 ; then + ewarn "For minimum test coverage please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager." + else + einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)." + fi + else + einfo "Will run test suite with open file limit set to 4162 (medium test coverage)." + fi + else + einfo "Will run test suite with open file limit set to 16500 (best test coverage)." + fi + + # run mysql-test tests + perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def" + retstatus_tests=$? + + popd &>/dev/null || die + + # Cleanup is important for these testcases. + pkill -9 -f "${S}/ndb" 2>/dev/null + pkill -9 -f "${S}/sql" 2>/dev/null + + local failures="" + [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" + [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" + + [[ -z "$failures" ]] || die "Test failures: $failures" + einfo "Tests successfully completed" +} + +src_install() { + cmake-utils_src_install + + # Make sure the vars are correctly initialized + mysql_init_vars + + # Convenience links + einfo "Making Convenience links for mysqlcheck multi-call binary" + dosym "mysqlcheck" "/usr/bin/mysqlanalyze" + dosym "mysqlcheck" "/usr/bin/mysqlrepair" + dosym "mysqlcheck" "/usr/bin/mysqloptimize" + + # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir + if [[ -d "${ED}/usr/data" ]] ; then + rm -Rf "${ED}/usr/data" || die + fi + + # Unless they explicitly specific USE=test, then do not install the + # testsuite. It DOES have a use to be installed, esp. when you want to do a + # validation of your database configuration after tuning it. + if ! use test ; then + rm -rf "${ED}/${MY_SHAREDSTATEDIR#${EPREFIX}}/mysql-test" + fi + + # Configuration stuff + einfo "Building default configuration ..." + insinto "${MY_SYSCONFDIR#${EPREFIX}}" + [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf + cp "${FILESDIR}/my.cnf-5.7" "${TMPDIR}/my.cnf" || die + eprefixify "${TMPDIR}/my.cnf" + doins "${TMPDIR}/my.cnf" + insinto "${MY_SYSCONFDIR#${EPREFIX}}/mysql.d" + cp "${FILESDIR}/my.cnf-8.0.distro-client" "${TMPDIR}/50-distro-client.cnf" || die + eprefixify "${TMPDIR}/50-distro-client.cnf" + doins "${TMPDIR}/50-distro-client.cnf" + + mycnf_src="my.cnf-8.0.distro-server" + sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ + "${FILESDIR}/${mycnf_src}" \ + > "${TMPDIR}/my.cnf.ok" || die + + if use prefix ; then + sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ + "${TMPDIR}/my.cnf.ok" || die + fi + + if use latin1 ; then + sed -i \ + -e "/character-set/s|utf8mb4|latin1|g" \ + "${TMPDIR}/my.cnf.ok" || die + fi + + eprefixify "${TMPDIR}/my.cnf.ok" + + newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf + + #Remove mytop if perl is not selected + [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" + + if use router ; then + rm -rf \ + "${ED}/usr/LICENSE.router" \ + "${ED}/usr/README.router" \ + "${ED}/usr/run" \ + "${ED}/usr/var" \ + || die + fi + + # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. + find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die +} + +pkg_postinst() { + # Make sure the vars are correctly initialized + mysql_init_vars + + # Create log directory securely if it does not exist + # NOTE: $MY_LOGDIR contains $EPREFIX by default + [[ -d "${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${MY_LOGDIR}" + + # Note about configuration change + einfo + elog "This version of ${PN} reorganizes the configuration from a single my.cnf" + elog "to several files in /etc/mysql/mysql.d." + elog "Please backup any changes you made to /etc/mysql/my.cnf" + elog "and add them as a new file under /etc/mysql/mysql.d with a .cnf extension." + elog "You may have as many files as needed and they are read alphabetically." + elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." + einfo + + if [[ -z "${REPLACING_VERSIONS}" ]] ; then + einfo + elog "You might want to run:" + elog " \"emerge --config =${CATEGORY}/${PF}\"" + elog "if this is a new install." + einfo + else + einfo + elog "Upgrade process for ${PN}-8.x has changed. Please read" + elog "https://dev.mysql.com/doc/refman/8.0/en/upgrade-binary-package.html" + einfo + fi +} + +pkg_config() { + local mysqld_binary="${EROOT}/usr/sbin/mysqld" + if [[ ! -x "${mysqld_binary}" ]] ; then + die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local mysql_binary="${EROOT}/usr/bin/mysql" + if [[ ! -x "${mysql_binary}" ]] ; then + die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults" + if [[ ! -x "${my_print_defaults_binary}" ]] ; then + die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!" + fi + + if [[ -z "${MYSQL_USER}" ]] ; then + MYSQL_USER=mysql + if use prefix ; then + MYSQL_USER=$(id -u -n 2>/dev/null) + if [[ -z "${MYSQL_USER}" ]] ; then + die "Failed to determine current username!" + fi + fi + fi + + if [[ -z "${MYSQL_GROUP}" ]] ; then + MYSQL_GROUP=mysql + if use prefix ; then + MYSQL_GROUP=$(id -g -n 2>/dev/null) + if [[ -z "${MYSQL_GROUP}" ]] ; then + die "Failed to determine current user groupname!" + fi + fi + fi + + einfo "Will use username '${MYSQL_USER}' and group '${MYSQL_GROUP}' ..." + + _getoptval() { + local section="$1" + local flag="--${2}=" + local extra_options="${3}" + local cmd=( + "${my_print_defaults_binary}" + "${extra_options}" + "${section}" + ) + local results=( $(eval "${cmd[@]}" 2>/dev/null | sed -n "/^${flag}/s,${flag},,gp") ) + + if [[ ${#results[@]} -gt 0 ]] ; then + # When option is set multiple times only return last value + echo "${results[-1]}" + fi + } + + _mktemp_dry() { + # emktemp has no --dry-run option + local template="${1}" + + if [[ -z "${template}" ]] ; then + if [[ -z "${T}" ]] ; then + template="/tmp/XXXXXXX" + else + template="${T}/XXXXXXX" + fi + fi + + local template_wo_X=${template//X/} + local n_X + let n_X=${#template}-${#template_wo_X} + if [[ ${n_X} -lt 3 ]] ; then + echo "${FUNCNAME[0]}: too few X's in template ‘${template}’" >&2 + return + fi + + local attempts=0 + local character tmpfile + while [[ true ]] ; do + let attempts=attempts+1 + + new_file= + while read -n1 character ; do + if [[ "${character}" == "X" ]] ; then + tmpfile+="${RANDOM:0:1}" + else + tmpfile+="${character}" + fi + done < <(echo -n "${template}") + + if [[ ! -f "${tmpfile}" ]] + then + echo "${tmpfile}" + return + fi + + if [[ ${attempts} -ge 100 ]] ; then + echo "${FUNCNAME[0]}: Cannot create temporary file after 100 attempts." >&2 + return + fi + done + } + + # my_print_defaults needs to read stuff in $HOME/.my.cnf + local -x HOME="${EROOT}/root" + + # Make sure the vars are correctly initialized + mysql_init_vars + + # Read currently set data directory + MY_DATADIR="$(_getoptval mysqld datadir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + + # Bug #213475 - MySQL _will_ object strenously if your machine is named + # localhost. Also causes weird failures. + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" + + if [[ -z "${MY_DATADIR}" ]] ; then + die "Sorry, unable to find MY_DATADIR!" + elif [[ -d "${MY_DATADIR}/mysql" ]] ; then + ewarn "Looks like your data directory '${MY_DATADIR}' is already initialized!" + ewarn "Please rename or delete its content if you wish to initialize a new data directory." + die "${PN} data directory at '${MY_DATADIR}' looks already initialized!" + else + einfo "${PN} data directory detected as '${MY_DATADIR}' ..." + fi + + MYSQL_TMPDIR="$(_getoptval mysqld tmpdir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + # These are dir+prefix + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + + # Create missing directories. + # Always check if mysql user can write to directory even if we just + # created directory because a parent directory might be not + # accessible for that user. + PID_DIR="${EROOT}/run/mysqld" + if [[ ! -d "${PID_DIR}" ]] ; then + einfo "Creating ${PN} PID directory '${PID_DIR}' ..." + install -d -m 755 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${PID_DIR}" \ + || die "Failed to create PID directory '${PID_DIR}'!" + fi + + local _pid_dir_testfile="$(_mktemp_dry "${PID_DIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_pid_dir_testfile}" ]] \ + && die "_mktemp_dry() for '${PID_DIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_pid_dir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_pid_dir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into PID dir '${PID_DIR}'!" + else + rm "${_pid_dir_testfile}" || die + unset _pid_dir_testfile + fi + + if [[ ! -d "${MY_DATADIR}" ]] ; then + einfo "Creating ${PN} data directory '${MY_DATADIR}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MY_DATADIR}" \ + || die "Failed to create ${PN} data directory '${MY_DATADIR}'!" + fi + + local _my_datadir_testfile="$(_mktemp_dry "${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_datadir_testfile}" ]] \ + && die "_mktemp_dry() for '${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_datadir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_datadir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]]; then + die "${MYSQL_USER} user cannot write into data directory '${MY_DATADIR}'!" + else + rm "${_my_datadir_testfile}" || die + unset _my_datadir_testfile + fi + + if [[ -n "${MYSQL_TMPDIR}" && ! -d "${MYSQL_TMPDIR}" ]] ; then + einfo "Creating ${PN} tmpdir '${MYSQL_TMPDIR}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_TMPDIR}" \ + || die "Failed to create ${PN} tmpdir '${MYSQL_TMPDIR}'!" + fi + + if [[ -n "${MYSQL_TMPDIR}" ]] ; then + local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_tmpdir_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_tmpdir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]]; then + die "${MYSQL_USER} user cannot write into data directory '${MYSQL_TMPDIR}'!" + else + rm "${_my_tmpdir_testfile}" || die + unset _my_tmpdir_testfile + fi + else + # If no tmpdir is set, mysqld will use default system tmpdir. + # However, we are using tmpdir from package manager at the + # moment which maybe isn't writeable for $MYSQL_USER... + MYSQL_TMPDIR="$(_mktemp_dry "${T}/mysqld-tmp.XXXXXXXXX")" + [[ -z "${MYSQL_TMPDIR}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}' failed!" + + mkdir "${MYSQL_TMPDIR}" || die + chown ${MYSQL_USER} "${MYSQL_TMPDIR}" || die + fi + + if [[ -n "${MYSQL_LOG_BIN}" && ! -d "${MYSQL_LOG_BIN}" ]] ; then + einfo "Creating ${PN} log-bin directory '${MYSQL_LOG_BIN}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_LOG_BIN}" \ + || die "Failed to create ${PN} log-bin directory '${MYSQL_LOG_BIN}'" + fi + + if [[ -n "${MYSQL_LOG_BIN}" ]] ; then + local _my_logbin_testfile="$(_mktemp_dry "${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_logbin_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_logbin_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_logbin_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]]; then + die "${MYSQL_USER} user cannot write into log-bin directory '${MYSQL_LOG_BIN}'!" + else + rm "${_my_logbin_testfile}" || die + unset _my_logbin_testfile + fi + fi + + if [[ -n "${MYSQL_RELAY_LOG}" && ! -d "${MYSQL_RELAY_LOG}" ]] ; then + einfo "Creating ${PN} relay-log directory '${MYSQL_RELAY_LOG}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_RELAY_LOG}" \ + || die "Failed to create ${PN} relay-log directory '${MYSQL_RELAY_LOG}'!" + fi + + if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then + local _my_relaylog_testfile="$(_mktemp_dry "${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_relaylog_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_relaylog_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_relaylog_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]]; then + die "${MYSQL_USER} user cannot write into relay-log directory '${MYSQL_RELAY_LOG}'!" + else + rm "${_my_relaylog_testfile}" || die + unset _my_relaylog_testfile + fi + fi + + local -a config_files + + local config_file="${EROOT}/etc/mysql/mysql.d/50-distro-client.cnf" + if [[ -f "${config_file}" ]] ; then + config_files+=( "${config_file}" ) + else + ewarn "Client configuration '${config_file}' not found; Skipping configuration of default authentication plugin for client ..." + fi + + config_file="${EROOT}/etc/mysql/mysql.d/50-distro-server.cnf" + if [[ -f "${config_file}" ]] ; then + config_files+=( "${config_file}" ) + else + ewarn "Server configuration '${config_file}' not found; Skipping configuration of default authentication plugin for mysqld ..." + fi + + if [[ ${#config_files[@]} -gt 0 ]] ; then + if [[ -z "${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" ]] ; then + local user_answer + + echo + einfo "Please select default authentication plugin (enter number or plugin name):" + einfo "1) caching_sha2_password [MySQL 8.0 default]" + einfo "2) mysql_native_password [MySQL 5.7 default]" + einfo + einfo "For details see:" + einfo "https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password" + read -p " >" user_answer + echo + + case "${user_answer}" in + 1|caching_sha2_password) + MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=caching_sha2_password + ;; + 2|mysql_native_password) + MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=mysql_native_password + ;; + '') + die "No authentication plugin selected!" + ;; + *) + die "Authentication plugin '${user_answer}' is unknown/unsupported!" + ;; + esac + + unset user_answer + fi + + local cfg_option cfg_option_tabs cfg_section + for config_file in "${config_files[@]}" ; do + cfg_option="default-authentication-plugin" + cfg_section="mysqld" + cfg_option_tabs="\t\t" + if [[ "${config_file}" == *client.cnf ]] ; then + cfg_option="default-auth" + cfg_section="client" + cfg_option_tabs="\t\t\t\t" + fi + + if grep -qE "^(loose-)?${cfg_option}\b.*=" "${config_file}" 2>/dev/null ; then + einfo "Ensuring that ${cfg_option} is set to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..." + sed -i \ + -e "s/^\(loose-\)\?${cfg_option}\b.*=.*/loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}/" \ + "${config_file}" || die "Failed to change ${cfg_option} in '${config_file}'!" + else + einfo "Setting ${cfg_option} to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..." + sed -i \ + -e "/^\[${cfg_section}\]$/a loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" \ + "${config_file}" || die "Failed to add ${cfg_option} to '${config_file}'!" + fi + done + unset cfg_option cfg_option_tabs cfg_section + fi + unset config_files config_file + + echo + + if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then + local tmp_mysqld_password_source= + + for tmp_mysqld_password_source in mysql client ; do + einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" + if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then + if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]] ; then + ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!" + MYSQL_ROOT_PASSWORD= + continue + fi + + einfo "Found password in '${tmp_mysqld_password_source}' section!" + break + fi + done + + # Sometimes --show is required to display passwords in some implementations of my_print_defaults + if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]] ; then + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" + fi + + unset tmp_mysqld_password_source + fi + + if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then + local pwd1="a" + local pwd2="b" + + echo + einfo "No password for mysql 'root' user was specified via environment" + einfo "variable MYSQL_ROOT_PASSWORD and no password was found in config" + einfo "file like '${HOME}/.my.cnf'." + einfo "To continue please provide a password for the mysql 'root' user" + einfo "now on console:" + ewarn "NOTE: Please avoid [\"'\\_%] characters in the password!" + read -rsp " >" pwd1 ; echo + + einfo "Retype the password" + read -rsp " >" pwd2 ; echo + + if [[ "x$pwd1" != "x$pwd2" ]] ; then + die "Passwords are not the same!" + fi + + MYSQL_ROOT_PASSWORD="${pwd1}" + unset pwd1 pwd2 + + echo + fi + + local -a mysqld_options + + # Fix bug 446200. Don't reference host my.cnf, needs to come first, + # see http://bugs.mysql.com/bug.php?id=31312 + use prefix && mysqld_options+=( "--defaults-file='${MY_SYSCONFDIR}/my.cnf'" ) + + # Figure out which options we need to disable to do the setup + local helpfile="${TMPDIR}/mysqld-help" + "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null + + local opt optexp optfull + for opt in host-cache name-resolve networking slave-start \ + federated ssl log-bin relay-log slow-query-log external-locking \ + log-slave-updates \ + ; do + optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" + egrep -sq -- "${optexp}" "${helpfile}" && mysqld_options+=( "${optfull}" ) + done + + # Prepare timezones, see + # https://dev.mysql.com/doc/mysql/en/time-zone-support.html + local tz_sql="${TMPDIR}/tz.sql" + echo "USE mysql;" >"${tz_sql}" + "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" >> "${tz_sql}" 2>/dev/null + if [[ $? -ne 0 ]] ; then + die "mysql_tzinfo_to_sql failed!" + fi + + chown ${MYSQL_USER} "${tz_sql}" || die + + local mysql_install_log="${TMPDIR}/mysql_install_db.log" + touch "${mysql_install_log}" || die + chown ${MYSQL_USER} "${mysql_install_log}" || die + + # --initialize-insecure will not set root password + # --initialize would set a random one in the log which we don't need as we set it ourselves + local cmd=( + "${mysqld_binary}" + "${mysqld_options[@]}" + "--initialize-insecure" + "--init-file='${tz_sql}'" + "--basedir='${EROOT}/usr'" + "--datadir='${MY_DATADIR}'" + "--tmpdir='${MYSQL_TMPDIR}'" + "--log-error='${mysql_install_log}'" + "--user=${MYSQL_USER}" + ) + + einfo "Initializing ${PN} data directory: ${cmd[@]}" + eval "${cmd[@]}" >>"${mysql_install_log}" 2>&1 + + if [[ $? -ne 0 || ! -f "${MY_DATADIR}/mysql.ibd" ]] ; then + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_install_log}" 1>&2 + die "Failed to initialize ${PN} data directory. Please review '${mysql_install_log}'!" + fi + + local x=${RANDOM} + local socket="${EROOT}/run/mysqld/mysqld${x}.sock" + local pidfile="${EROOT}/run/mysqld/mysqld${x}.pid" + unset x + + local mysqld_logfile="${TMPDIR}/mysqld.log" + touch "${mysqld_logfile}" || die + chown ${MYSQL_USER} "${mysqld_logfile}" || die + + cmd=( + "${mysqld_binary}" + "${mysqld_options[@]}" + "--basedir='${EROOT}/usr'" + "--datadir='${MY_DATADIR}'" + "--tmpdir='${MYSQL_TMPDIR}'" + --max_allowed_packet=8M + --net_buffer_length=16K + "--socket='${socket}'" + "--pid-file='${pidfile}'" + "--log-error='${mysqld_logfile}'" + "--user=${MYSQL_USER}" + ) + + einfo "Starting mysqld to finalize initialization: ${cmd[@]}" + eval "${cmd[@]}" >>"${mysqld_logfile}" 2>&1 & + + echo -n "Waiting for mysqld to accept connections " + local maxtry=15 + while [[ ! -S "${socket}" && "${maxtry}" -gt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + + if [[ -S "${socket}" ]] ; then + # Even with a socket we don't know if mysqld will abort + # start due to an error so just wait a little bit more... + maxtry=5 + while [[ -S "${socket}" && "${maxtry}" -gt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + fi + + echo + + if [[ ! -S "${socket}" ]] ; then + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysqld_logfile}" 1>&2 + die "mysqld was unable to start from initialized data directory. Please review '${mysqld_logfile}'!" + fi + + local mysql_logfile="${TMPDIR}/set_root_pw.log" + touch "${mysql_logfile}" || die + + ebegin "Setting root password" + # Do this from memory, as we don't want clear text passwords in temp files + local sql="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'" + cmd=( + "${mysql_binary}" + --no-defaults + "--socket='${socket}'" + -hlocalhost + "-e \"${sql}\"" + ) + eval "${cmd[@]}" >"${mysql_logfile}" 2>&1 + local rc=$? + eend ${rc} + + if [[ ${rc} -ne 0 ]] ; then + # Poor man's solution which tries to avoid having password + # in log. NOTE: sed can fail if user didn't follow advice + # and included character which will require escaping... + sed -i -e "s/${MYSQL_ROOT_PASSWORD}/*****/" "${mysql_logfile}" 2>/dev/null + + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_logfile}" + die "Failed to set ${PN} root password. Please review '${mysql_logfile}'!" + fi + + # Stop the server + if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then + echo -n "Stopping the server " + pkill -F "${pidfile}" &>/dev/null + + maxtry=10 + while [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + + echo + + if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then + # We somehow failed to stop server. + # However, not a fatal error. Just warn the user. + ewarn "WARNING: mysqld[$(cat "${pidfile}")] is still running!" + fi + fi + + einfo "${PN} data directory at '${MY_DATADIR}' successfully initialized!" +} -- cgit v1.2.3