Advertisement
Guest User

mysql-5.7.15.ebuild

a guest
Oct 18th, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.58 KB | None | 0 0
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Id$
  4.  
  5. EAPI="5"
  6.  
  7. MY_EXTRAS_VER="live"
  8. MY_PV="${PV//_alpha_pre/-m}"
  9. MY_PV="${MY_PV//_/-}"
  10. HAS_TOOLS_PATCH="1"
  11. SUBSLOT="20"
  12.  
  13. inherit mysql-multilib-r1
  14. # only to make repoman happy. it is really set in the eclass
  15. IUSE="$IUSE"
  16.  
  17. # REMEMBER: also update eclass/mysql*.eclass before committing!
  18. KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
  19.  
  20. # When MY_EXTRAS is bumped, the index should be revised to exclude these.
  21. EPATCH_EXCLUDE=''
  22.  
  23. DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
  24. >=dev-libs/boost-1.59:=
  25. >=app-arch/lz4-0_p131:="
  26. RDEPEND="${RDEPEND}"
  27.  
  28. # Please do not add a naive src_unpack to this ebuild
  29. # If you want to add a single patch, copy the ebuild to an overlay
  30. # and create your own mysql-extras tarball, looking at 000_index.txt
  31.  
  32. src_prepare() {
  33. mysql-multilib-r1_src_prepare
  34. if use libressl ; then
  35. sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
  36. "${S}/cmake/ssl.cmake" || die
  37. fi
  38. }
  39.  
  40. src_configure() {
  41. local MYSQL_CMAKE_NATIVE_DEFINES=(
  42. -DWITH_LZ4=system
  43. -DWITH_NUMA=OFF
  44. )
  45. mysql-multilib-r1_src_configure
  46. }
  47.  
  48. # Official test instructions:
  49. # USE='server embedded extraengine perl openssl static-libs' \
  50. # FEATURES='test userpriv -usersandbox' \
  51. # ebuild mysql-X.X.XX.ebuild \
  52. # digest clean package
  53. multilib_src_test() {
  54.  
  55. if ! multilib_is_native_abi ; then
  56. einfo "Server tests not available on non-native abi".
  57. return 0;
  58. fi
  59.  
  60. local TESTDIR="${BUILD_DIR}/mysql-test"
  61. local retstatus_unit
  62. local retstatus_tests
  63.  
  64. # Bug #213475 - MySQL _will_ object strenously if your machine is named
  65. # localhost. Also causes weird failures.
  66. [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
  67.  
  68. if use server ; then
  69.  
  70. if [[ $UID -eq 0 ]]; then
  71. die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
  72. fi
  73. has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
  74.  
  75. einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
  76. addpredict /this-dir-does-not-exist/t9.MYI
  77.  
  78. # Run CTest (test-units)
  79. cmake-utils_src_test
  80. retstatus_unit=$?
  81. [[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
  82.  
  83. # Ensure that parallel runs don't die
  84. export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
  85. # Enable parallel testing, auto will try to detect number of cores
  86. # You may set this by hand.
  87. # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
  88. export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
  89.  
  90. # create directories because mysqladmin might right out of order
  91. mkdir -p "${T}"/var-tests{,/log}
  92.  
  93. # create symlink for the tests to find mysql_tzinfo_to_sql
  94. ln -s "${BUILD_DIR}/sql/mysql_tzinfo_to_sql" "${S}/sql/"
  95.  
  96. # These are failing in MySQL 5.5/5.6 for now and are believed to be
  97. # false positives:
  98. #
  99. # main.information_schema, binlog.binlog_statement_insert_delayed,
  100. # funcs_1.is_triggers funcs_1.is_tables_mysql,
  101. # funcs_1.is_columns_mysql, binlog.binlog_mysqlbinlog_filter,
  102. # perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt,
  103. # mysqld--help-notwin, funcs_1.is_triggers, funcs_1.is_tables_mysql, funcs_1.is_columns_mysql
  104. # perfschema.binlog_edge_stmt, perfschema.binlog_edge_mix, binlog.binlog_mysqlbinlog_filter
  105. # fails due to USE=-latin1 / utf8 default
  106. #
  107. # main.mysql_client_test:
  108. # segfaults at random under Portage only, suspect resource limits.
  109. #
  110. # rpl.rpl_plugin_load
  111. # fails due to included file not listed in expected result
  112. # appears to be poor planning
  113. #
  114. # main.mysqlhotcopy_archive main.mysqlhotcopy_myisam
  115. # fails due to bad cleanup of previous tests when run in parallel
  116. # The tool is deprecated anyway
  117. # Bug 532288
  118. for t in \
  119. binlog.binlog_mysqlbinlog_filter \
  120. binlog.binlog_statement_insert_delayed \
  121. funcs_1.is_columns_mysql \
  122. funcs_1.is_tables_mysql \
  123. funcs_1.is_triggers \
  124. main.information_schema \
  125. main.mysql_client_test \
  126. main.mysqld--help-notwin \
  127. perfschema.binlog_edge_mix \
  128. perfschema.binlog_edge_stmt \
  129. rpl.rpl_plugin_load \
  130. main.mysqlhotcopy_archive main.mysqlhotcopy_myisam \
  131. ; do
  132. mysql-multilib-r1_disable_test "$t" "False positives in Gentoo"
  133. done
  134.  
  135. if ! use extraengine ; then
  136. # bug 401673, 530766
  137. for t in federated.federated_plugin ; do
  138. mysql-multilib-r1_disable_test "$t" "Test $t requires USE=extraengine (Need federated engine)"
  139. done
  140. fi
  141.  
  142. # Run mysql tests
  143. pushd "${TESTDIR}"
  144.  
  145. # Set file limits higher so tests run
  146. # ulimit -n 3000
  147.  
  148. # run mysql-test tests
  149. perl mysql-test-run.pl --force --vardir="${T}/var-tests" \
  150. --suite-timeout=5000 --reorder
  151. retstatus_tests=$?
  152. [[ $retstatus_tests -eq 0 ]] || eerror "tests failed"
  153. has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
  154.  
  155. popd
  156.  
  157. # Cleanup is important for these testcases.
  158. pkill -9 -f "${S}/ndb" 2>/dev/null
  159. pkill -9 -f "${S}/sql" 2>/dev/null
  160.  
  161. failures=""
  162. [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
  163. [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
  164. has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
  165.  
  166. [[ -z "$failures" ]] || die "Test failures: $failures"
  167. einfo "Tests successfully completed"
  168.  
  169. else
  170. einfo "Skipping server tests due to minimal build."
  171. fi
  172. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement