spack/var/spack/repos/builtin/packages/root/find-mysql.patch
Chris Green 1b2817ee0a root: new versions, variants and patches (#11215)
* root: new versions, variants and patches to bring in to line with FNAL's use.

* Support MySQL.
* Patches:
    * Bigger stringbuf.
    * Find MySQL even when it's called mariadb-c-client.
    * Honor external provision of unuran.
    * Properly handle the ROOT7 web GUI for 6.16/00.
* `memstat` variant is now default-OFF due to version-related constraints.
* Add missing dependencies.
* Propagate `python` to `libxml2`.
* Handle external FTGL dependency with X / OpenGL: depends on PR ####
* Force `SPACK_INCLUDE_DIRS` to avoid warning.
* New `gminimal` variant default ON per discussion with Javier Cervantes.

* Style fixes per flake8.

* Remove redundant `PATH_SUFFIX` per https://github.com/root-project/root/pull/1993#discussion_r276840329

* Comment patches per https://github.com/spack/spack/pull/11215#discussion_r276887199.

* Reflect the fact that MariaDB support patch is now upstream.

* Restore ncurses dependency for libtinfo.
2019-04-24 08:48:52 +02:00

61 lines
2.0 KiB
Diff

diff --git a/cmake/modules/FindMySQL.cmake b/cmake/modules/FindMySQL.cmake
index c818f5a..755da92 100644
--- a/cmake/modules/FindMySQL.cmake
+++ b/cmake/modules/FindMySQL.cmake
@@ -10,11 +10,18 @@ if(MYSQL_INCLUDE_DIR OR MYSQL_)
endif()
if(NOT WIN32)
- find_program(MYSQL_CONFIG_EXECUTABLE mysql_config
- /usr/bin/
- /usr/local/bin
- ${MYSQL_DIR}/bin $ENV{MYSQL_DIR}/bin
- )
+ # Split into two find_program invocations to avoid user-specified
+ # mariadb_config being overridden by system mysql_config.
+ find_program(MYSQL_CONFIG_EXECUTABLE NAMES mysql_config mariadb_config
+ PATH_SUFFIXES bin
+ NO_DEFAULT_PATH
+ HINTS ${MYSQL_DIR} $ENV{MYSQL_DIR}
+ )
+ # Will not overwrite if MYSQL_CONFIG_EXECUTABLE is already set.
+ find_program(MYSQL_CONFIG_EXECUTABLE NAMES mysql_config mariadb_config
+ PATH_SUFFIXES bin
+ PATHS /usr/local /usr
+ )
endif()
if(MYSQL_CONFIG_EXECUTABLE)
@@ -26,17 +33,22 @@ if(MYSQL_CONFIG_EXECUTABLE)
execute_process(COMMAND ${MYSQL_CONFIG_EXECUTABLE} --libs OUTPUT_VARIABLE MYSQL_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
find_path(MYSQL_INCLUDE_DIR mysql.h
- /usr/local/mysql/include
- /usr/local/include/mysql
- /usr/local/include
- /usr/include/mysql
- /usr/include
- /usr/mysql/include
- $ENV{MYSQL_DIR}/include
- )
+ PATH_SUFFIXES include/mysql include/mariadb
+ HINTS ${MYSQL_DIR} $ENV{MYSQL_DIR}
+ NO_DEFAULT_PATH
+ )
+ if (NOT MYSQL_INCLUDE_DIR)
+ find_path(MYSQL_INCLUDE_DIR mysql.h
+ PATH_SUFFIXES include/mysql include/mariadb
+ PATHS /usr/local/mysql /usr/local /usr
+ )
+ endif()
set(MYSQL_NAMES mysqlclient mysqlclient_r)
find_library(MYSQL_LIBRARY NAMES ${MYSQL_NAMES}
- PATHS /usr/local/mysql/lib /usr/local/lib /usr/lib $ENV{MYSQL_DIR}/lib $ENV{MYSQL_DIR}/lib/opt
+ PATH_SUFFIXES lib lib/mariadb lib/mysql
+ lib/opt lib/opt/mariadb lib/opt/mysql
+ HINTS ${MYSQL_DIR} $ENV{MYSQL_DIR}
+ PATHS /usr/local/mysql /usr/local /usr
)
set(MYSQL_LIBRARIES ${MYSQL_LIBRARY})
endif()