pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/databases/mariadb55-client Fix build with clang and li...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c2ab65a7e481
branches:  trunk
changeset: 358028:c2ab65a7e481
user:      roy <roy%pkgsrc.org@localhost>
date:      Fri Feb 03 16:20:18 2017 +0000

description:
Fix build with clang and libedit.

diffstat:

 databases/mariadb55-client/Makefile.common                    |  10 +-
 databases/mariadb55-client/distinfo                           |   6 +-
 databases/mariadb55-client/patches/patch-client_mysql.cc      |  31 +++-
 databases/mariadb55-client/patches/patch-cmake_readline.cmake |  87 +----------
 4 files changed, 36 insertions(+), 98 deletions(-)

diffs (217 lines):

diff -r b529766713eb -r c2ab65a7e481 databases/mariadb55-client/Makefile.common
--- a/databases/mariadb55-client/Makefile.common        Fri Feb 03 15:38:07 2017 +0000
+++ b/databases/mariadb55-client/Makefile.common        Fri Feb 03 16:20:18 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.4 2016/09/13 19:15:13 maya Exp $
+# $NetBSD: Makefile.common,v 1.5 2017/02/03 16:20:18 roy Exp $
 #
 # used by databases/mariadb55-client/Makefile
 # used by databases/mariadb55-server/Makefile
@@ -63,7 +63,6 @@
 CMAKE_ARGS+=           -DMYSQL_DATADIR=${MYSQL_DATADIR}
 
 # always use our own readline, not MySQL bundled one
-CMAKE_ARGS+=           -DWITH_LIBEDIT=OFF
 CMAKE_ARGS+=           -DWITH_READLINE=OFF
 CMAKE_ARGS+=           -DDEFAULT_CHARSET=${MYSQL_CHARSET:Q}
 CMAKE_ARGS+=           -DDEFAULT_COLLATION=${MYSQL_COLLATION:Q}
@@ -120,12 +119,9 @@
 
 .include "../../mk/readline.buildlink3.mk"
 .if !empty(READLINE_TYPE:Mreadline)
-CMAKE_ARGS+=   -DREADLINE_FOUND=system
-LDFLAGS+=      -lreadline
+CMAKE_ARGS+=    -DREADLINE_INCLUDE_DIR=${BUILDLINK_PREFIX.editlinereadline}/include/readline
 .else
-CMAKE_ARGS+=   -DLIBEDIT_FOUND=system
-LDFLAGS+=      -ledit
+CMAKE_ARGS+=    -DLIBEDIT_INCLUDE_DIR=${BUILDLINK_PREFIX.editlinereadline}/include/readline
 .endif
-CMAKE_ARGS+=   -DREADLINE_INCLUDE_DIR=${BUILDLINK_PREFIX.editlinereadline}/include/readline
 
 .include "../../devel/zlib/buildlink3.mk"
diff -r b529766713eb -r c2ab65a7e481 databases/mariadb55-client/distinfo
--- a/databases/mariadb55-client/distinfo       Fri Feb 03 15:38:07 2017 +0000
+++ b/databases/mariadb55-client/distinfo       Fri Feb 03 16:20:18 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2016/09/13 19:15:13 maya Exp $
+$NetBSD: distinfo,v 1.6 2017/02/03 16:20:18 roy Exp $
 
 SHA1 (mariadb-5.5.52.tar.gz) = bbedcc0eba7580d1ef16f2dfe4868cf9f31a636d
 RMD160 (mariadb-5.5.52.tar.gz) = fcad9e40ecd29b341a8cdc42afc18aa83b85e60c
@@ -11,14 +11,14 @@
 SHA1 (patch-BUILD_compile-pentium-gcov) = 02b414235a2cdfc1d5c95946010e0cdbada76c5d
 SHA1 (patch-CMakeLists.txt) = 9c56523626837ab83ecef26f1c0609e084976fa7
 SHA1 (patch-client_completion_hash.cc) = 810dab31e17a19804323059d38f5ec7f0d55c3ab
-SHA1 (patch-client_mysql.cc) = bb50cbd627ce71bcc792ad285016e0269dbc741c
+SHA1 (patch-client_mysql.cc) = e2f1ef8325d08c8bc68ea0849f0cc8d49f9a69a1
 SHA1 (patch-client_mysqladmin.cc) = ab05c6944d50c9b22365426656f0b61a5906d632
 SHA1 (patch-client_mysqlbinlog.cc) = 00146dfd7d0a6e0bb1a8c30395bc707af3b4a6c7
 SHA1 (patch-client_mysqlshow.c) = 82ddfb98ab85b3e96e56b5ecc0df25cc315b8dbc
 SHA1 (patch-cmake_dtrace.cmake) = 460799dee4d7f9d6c1e3b2dbf0412f8576297991
 SHA1 (patch-cmake_libutils.cmake) = 0c3f25f8e73ab0a062b539a8d551342a6ddf57c4
 SHA1 (patch-cmake_plugin.cmake) = b7566d25c80c2492a96c5617b96f9b6212b0fe93
-SHA1 (patch-cmake_readline.cmake) = eeadad96a6c8f042c82134b5488956f8094ba4ac
+SHA1 (patch-cmake_readline.cmake) = 4652c45743919857a888fa216fc6bd0a6567d9c9
 SHA1 (patch-config.h.cmake) = 75d4c09eb34353057c6a8e36523f55d1bfdace59
 SHA1 (patch-include_CMakeLists.txt) = 9ce9db088fda6ed76039b818c27b74d584bae151
 SHA1 (patch-include_my__context.h) = 16e9f69c35243967e5b95022b0350b36c02725da
diff -r b529766713eb -r c2ab65a7e481 databases/mariadb55-client/patches/patch-client_mysql.cc
--- a/databases/mariadb55-client/patches/patch-client_mysql.cc  Fri Feb 03 15:38:07 2017 +0000
+++ b/databases/mariadb55-client/patches/patch-client_mysql.cc  Fri Feb 03 16:20:18 2017 +0000
@@ -1,6 +1,6 @@
-$NetBSD: patch-client_mysql.cc,v 1.2 2015/05/07 12:45:29 fhajny Exp $
+$NetBSD: patch-client_mysql.cc,v 1.3 2017/02/03 16:20:18 roy Exp $
 
---- client/mysql.cc.orig       2015-02-13 12:07:00.000000000 +0000
+--- client/mysql.cc.orig       2016-09-12 14:54:54.000000000 +0000
 +++ client/mysql.cc
 @@ -89,7 +89,7 @@ extern "C" {
  #if defined(__WIN__)
@@ -11,9 +11,26 @@
  #define HAVE_READLINE
  #define USE_POPEN
  #endif
-@@ -2640,7 +2640,11 @@ static void initialize_readline (char *n
-   rl_completion_entry_function= &no_completion;
-   rl_add_defun("magic-space", (Function*)&fake_magic_space, -1);
+@@ -2634,20 +2634,20 @@ static void initialize_readline (char *n
+   rl_readline_name = name;
+ 
+   /* Tell the completer that we want a crack first. */
+-#if defined(USE_NEW_READLINE_INTERFACE)
++#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
++#if defined(USE_LIBEDIT_INTERFACE) && defined(HAVE_LOCALE_H)
++  setlocale(LC_ALL,""); /* so as libedit use isprint */
++#endif
+   rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion;
+   rl_completion_entry_function= (rl_compentry_func_t*)&no_completion;
+ 
+   rl_add_defun("magic-space", (rl_command_func_t *)&fake_magic_space, -1);
+-#elif defined(USE_LIBEDIT_INTERFACE)
+-#ifdef HAVE_LOCALE_H
+-  setlocale(LC_ALL,""); /* so as libedit use isprint */
+-#endif
+-  rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
+-  rl_completion_entry_function= &no_completion;
+-  rl_add_defun("magic-space", (Function*)&fake_magic_space, -1);
  #else
 +# if defined(USE_READLINE_V6)
 +  rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion;
@@ -23,12 +40,12 @@
    rl_completion_entry_function= &no_completion;
  #endif
  }
-@@ -2657,7 +2661,7 @@ static char **new_mysql_completion(const
+@@ -2664,7 +2664,7 @@ static char **new_mysql_completion(const
                                     int end __attribute__((unused)))
  {
    if (!status.batch && !quick)
 -#if defined(USE_NEW_READLINE_INTERFACE)
-+#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_READLINE_V6)
++#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE) || defined(USE_READLINE_V6)
      return rl_completion_matches(text, new_command_generator);
  #else
      return completion_matches((char *)text, (CPFunction *)new_command_generator);
diff -r b529766713eb -r c2ab65a7e481 databases/mariadb55-client/patches/patch-cmake_readline.cmake
--- a/databases/mariadb55-client/patches/patch-cmake_readline.cmake     Fri Feb 03 15:38:07 2017 +0000
+++ b/databases/mariadb55-client/patches/patch-cmake_readline.cmake     Fri Feb 03 16:20:18 2017 +0000
@@ -1,92 +1,17 @@
-$NetBSD: patch-cmake_readline.cmake,v 1.2 2015/05/07 12:45:29 fhajny Exp $
+$NetBSD: patch-cmake_readline.cmake,v 1.3 2017/02/03 16:20:18 roy Exp $
 
-Fix cmake's check build error. Borrowed from mysql56's readline.cmake.
-Fi build with pkgsrc readline>=6 that removed some deprecated symbols.
---- cmake/readline.cmake.orig  2015-02-13 12:07:00.000000000 +0000
+--- cmake/readline.cmake.orig  2016-09-12 14:54:54.000000000 +0000
 +++ cmake/readline.cmake
-@@ -132,7 +132,7 @@ MACRO (MYSQL_FIND_SYSTEM_READLINE)
-     SET(CMAKE_REQUIRED_INCLUDES ${READLINE_INCLUDE_DIR})
-     CHECK_CXX_SOURCE_COMPILES("
-     #include <stdio.h>
--    #include <readline.h>
-+    #include <readline/readline.h>
-     int main(int argc, char **argv)
-     {
-       rl_completion_func_t *func1= (rl_completion_func_t*)0;
-@@ -142,7 +142,7 @@ MACRO (MYSQL_FIND_SYSTEM_READLINE)
- 
-     CHECK_C_SOURCE_COMPILES("
-     #include <stdio.h>
--    #include <readline.h>
-+    #include <readline/readline.h>
-     #if RL_VERSION_MAJOR > 5
-     #error
-     #endif
-@@ -152,6 +152,19 @@ MACRO (MYSQL_FIND_SYSTEM_READLINE)
-     }"
-     READLINE_V5)
- 
-+    CHECK_C_SOURCE_COMPILES("
-+    #include <stdio.h>
-+    #include <readline/readline.h>
-+    #if RL_VERSION_MAJOR < 6
-+    #error
-+    #endif
-+    int main(int argc, char **argv)
-+    {
-+      return 0;
-+    }"
-+    READLINE_V6)
-+    SET(USE_READLINE_V6 ${READLINE_V6})
-+
-     IF(NEW_READLINE_INTERFACE)
-       IF (READLINE_V5)
-         SET(USE_NEW_READLINE_INTERFACE 1)
-@@ -180,8 +193,11 @@ MACRO (MYSQL_FIND_SYSTEM_LIBEDIT)
+@@ -180,8 +180,11 @@ MACRO (MYSQL_FIND_SYSTEM_LIBEDIT)
      #include <readline.h>
      int main(int argc, char **argv)
      {
 -      int res= (*rl_completion_entry_function)(0,0);
-+      typedef int MYFunction(const char*, int);
++      typedef char * MYFunction(const char*, int);
 +      MYFunction* myf= rl_completion_entry_function;
-+      int res= (myf)(NULL, 0);
++      char * res= (myf)(NULL, 0);
        completion_matches(0,0);
-+      return res;
++      return 0;
      }"
      LIBEDIT_INTERFACE)
      SET(USE_LIBEDIT_INTERFACE ${LIBEDIT_INTERFACE})
-@@ -195,32 +211,13 @@ MACRO (MYSQL_CHECK_READLINE)
-     SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline")
-     FIND_CURSES()
- 
--    IF(WITH_READLINE)
--      MYSQL_USE_BUNDLED_READLINE()
--    ELSE()
--      # OSX includes incompatible readline lib
--      IF (NOT APPLE)
--        MYSQL_FIND_SYSTEM_READLINE()
--      ENDIF()
--      IF(USE_NEW_READLINE_INTERFACE)
--        SET(MY_READLINE_INCLUDE_DIR ${READLINE_INCLUDE_DIR})
--        SET(MY_READLINE_LIBRARY ${READLINE_LIBRARY} ${CURSES_LIBRARY})
--      ELSE()
--        MYSQL_FIND_SYSTEM_LIBEDIT()
--        IF(USE_LIBEDIT_INTERFACE)
--          SET(MY_READLINE_INCLUDE_DIR ${LIBEDIT_INCLUDE_DIR})
--          SET(MY_READLINE_LIBRARY ${LIBEDIT_LIBRARY} ${CURSES_LIBRARY})
--        ELSE()
--          MYSQL_USE_BUNDLED_READLINE()
--        ENDIF()
--      ENDIF()
--    ENDIF()
-+    MYSQL_FIND_SYSTEM_READLINE()
- 
-     SET(CMAKE_REQUIRED_LIBRARIES ${MY_READLINE_LIBRARY})
-     SET(CMAKE_REQUIRED_INCLUDES ${MY_READLINE_INCLUDE_DIR})
-     CHECK_CXX_SOURCE_COMPILES("
-     #include <stdio.h>
--    #include <readline.h>
-+    #include <readline/readline.h>
-     int main(int argc, char **argv)
-     {
-        HIST_ENTRY entry;



Home | Main Index | Thread Index | Old Index