From 447adb305fa00a1ab64ba5d51ed31ce914cfc833 Mon Sep 17 00:00:00 2001 From: Florian Friesdorf Date: Thu, 23 Oct 2014 20:03:22 +0200 Subject: [PATCH] cygwin: mysql patches --- pkgs/servers/sql/mysql/5.5.17-cygwin.patch | 44 +++++++++++++++++++ .../sql/mysql/5.5.17-export-symbols.patch | 22 ++++++++++ pkgs/servers/sql/mysql/5.5.x.nix | 5 +++ 3 files changed, 71 insertions(+) create mode 100644 pkgs/servers/sql/mysql/5.5.17-cygwin.patch create mode 100644 pkgs/servers/sql/mysql/5.5.17-export-symbols.patch diff --git a/pkgs/servers/sql/mysql/5.5.17-cygwin.patch b/pkgs/servers/sql/mysql/5.5.17-cygwin.patch new file mode 100644 index 000000000000..f5178cd3f390 --- /dev/null +++ b/pkgs/servers/sql/mysql/5.5.17-cygwin.patch @@ -0,0 +1,44 @@ +--- mysql-5.5.17/cmake/install_macros.cmake 2011-10-12 07:10:24.000000000 -0500 ++++ mysql-5.5.17/cmake/install_macros.cmake 2011-11-07 23:19:35.772837800 -0600 +@@ -230,7 +230,13 @@ FUNCTION(MYSQL_INSTALL_TARGETS) + IF(ARG_COMPONENT) + SET(COMP COMPONENT ${ARG_COMPONENT}) + ENDIF() +- INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) ++ IF(${ARG_DESTINATION} STREQUAL "${INSTALL_LIBDIR}") ++ INSTALL(TARGETS ${TARGETS} LIBRARY DESTINATION ${ARG_DESTINATION} ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION ${ARG_DESTINATION} ${COMP}) ++ ELSE() ++ INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) ++ ENDIF() + SET(INSTALL_LOCATION ${ARG_DESTINATION} ) + INSTALL_DEBUG_SYMBOLS("${TARGETS}") + SET(INSTALL_LOCATION) +--- mysql-5.5.17/libmysql/CMakeLists.txt 2011-10-12 07:10:24.000000000 -0500 ++++ mysql-5.5.17/libmysql/CMakeLists.txt 2011-11-08 03:19:31.379219300 -0600 +@@ -214,6 +214,7 @@ IF(NOT DISABLE_SHARED) + SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1) + SET_TARGET_PROPERTIES(libmysql PROPERTIES CLEAN_DIRECT_OUTPUT 1) + ++ IF(NOT CYGWIN) + # Install links to libmysqlclient.so (client_r) + GET_VERSIONED_LIBNAME( + "${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r" +@@ -231,5 +232,6 @@ IF(NOT DISABLE_SHARED) + linkname) + INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries) + ENDFOREACH() ++ ENDIF(NOT CYGWIN) + ENDIF() + ENDIF() +--- mysql-5.5.17/strings/dtoa.c 2011-10-12 07:10:25.000000000 -0500 ++++ mysql-5.5.17/strings/dtoa.c 2011-11-07 20:38:05.064690100 -0600 +@@ -36,6 +36,7 @@ + + ***************************************************************/ + ++#define __STRICT_ANSI__ + #include /* for EOVERFLOW on Windows */ + #include + #include /* for memcpy and NOT_FIXED_DEC */ diff --git a/pkgs/servers/sql/mysql/5.5.17-export-symbols.patch b/pkgs/servers/sql/mysql/5.5.17-export-symbols.patch new file mode 100644 index 000000000000..edc93c44dfe3 --- /dev/null +++ b/pkgs/servers/sql/mysql/5.5.17-export-symbols.patch @@ -0,0 +1,22 @@ +--- mysql-5.5.17/libmysql/CMakeLists.txt 2011-10-12 07:10:24.000000000 -0500 ++++ mysql-5.5.17/libmysql/CMakeLists.txt 2011-11-08 03:19:31.379219300 -0600 +@@ -25,6 +25,11 @@ INCLUDE_DIRECTORIES( + ADD_DEFINITIONS(${SSL_DEFINES}) + + SET(CLIENT_API_FUNCTIONS ++dynstr_free ++dynstr_append_mem ++dynstr_append_os_quoted ++dynstr_realloc ++init_dynamic_string + get_tty_password + handle_options + load_defaults +@@ -131,6 +136,7 @@ mysql_server_end + mysql_set_character_set + mysql_get_character_set_info + mysql_stmt_next_result ++strfill + + CACHE INTERNAL "Functions exported by client API" + diff --git a/pkgs/servers/sql/mysql/5.5.x.nix b/pkgs/servers/sql/mysql/5.5.x.nix index d25882b826ee..778e2f58eb7c 100644 --- a/pkgs/servers/sql/mysql/5.5.x.nix +++ b/pkgs/servers/sql/mysql/5.5.x.nix @@ -11,6 +11,11 @@ stdenv.mkDerivation rec { sha256 = "0jn7py2wsq78rwi7vfihxs6z3h5hr338b9g46fl3z2g4ddki4yw8"; }; + patches = if stdenv.isCygwin then [ + ./5.5.17-cygwin.patch + ./5.5.17-export-symbols.patch + ] else null; + preConfigure = stdenv.lib.optional stdenv.isDarwin '' ln -s /bin/ps $TMPDIR/ps export PATH=$PATH:$TMPDIR