Last active
August 29, 2015 14:14
-
-
Save ant32/22bb5850de9ff5de15ac to your computer and use it in GitHub Desktop.
mingw-w64-mariadb-connector 2.1.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- libmariadb/CMakeLists.txt.orig 2015-02-02 23:21:16.388220607 -0700 | |
+++ libmariadb/CMakeLists.txt 2015-02-02 23:22:32.749520395 -0700 | |
@@ -372,24 +372,25 @@ | |
ADD_LIBRARY(mariadbclient STATIC $<TARGET_OBJECTS:mariadb_obj> ${EXPORT_LINK}) | |
TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS}) | |
-ADD_LIBRARY(libmariadb SHARED $<TARGET_OBJECTS:mariadb_obj> ${EXPORT_LINK}) | |
-TARGET_LINK_LIBRARIES(libmariadb ${SYSTEM_LIBS}) | |
+ADD_LIBRARY(mariadb SHARED $<TARGET_OBJECTS:mariadb_obj> ${EXPORT_LINK}) | |
+TARGET_LINK_LIBRARIES(mariadb ${SYSTEM_LIBS}) | |
IF(UNIX) | |
- SET_TARGET_PROPERTIES(libmariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") | |
+ SET_TARGET_PROPERTIES(mariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") | |
ENDIF() | |
IF(CMAKE_SYSTEM_NAME MATCHES "Linux") | |
- TARGET_LINK_LIBRARIES (libmariadb "-Wl,--no-undefined") | |
- TARGET_LINK_LIBRARIES (libmariadb "-Wl,--version-script=${EXPORT_FILE}") | |
+ TARGET_LINK_LIBRARIES (mariadb "-Wl,--no-undefined") | |
+ TARGET_LINK_LIBRARIES (mariadb "-Wl,--version-script=${EXPORT_FILE}") | |
TARGET_LINK_LIBRARIES (mariadbclient "-Wl,--no-undefined") | |
TARGET_LINK_LIBRARIES (mariadbclient "-Wl,--version-script=${EXPORT_FILE}") | |
ENDIF() | |
-SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "") | |
+SET_TARGET_PROPERTIES(mariadb PROPERTIES PREFIX "") | |
-SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION | |
+SET_TARGET_PROPERTIES(mariadb PROPERTIES VERSION | |
${CPACK_PACKAGE_VERSION_MAJOR} | |
- SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}) | |
+ SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR} | |
+ RUNTIME_OUTPUT_NAME libmariadb) | |
# | |
# Installation | |
@@ -398,7 +399,7 @@ | |
# There are still several projects which don't make use | |
# of the config program. To make sure these programs can | |
# use mariadb client library we provide libmysql symlinks | |
-IF(NOT WIN32 AND WITH_MYSQLCOMPAT) | |
+IF(WITH_MYSQLCOMPAT) | |
ADD_CUSTOM_COMMAND(OUTPUT "libmysql${CMAKE_SHARED_LIBRARY_SUFFIX}" | |
"libmysqlclient${CMAKE_SHARED_LIBRARY_SUFFIX}" | |
"libmysqlclient_r${CMAKE_SHARED_LIBRARY_SUFFIX}" | |
@@ -425,17 +426,17 @@ | |
INSTALL(TARGETS | |
- libmariadb mariadbclient | |
- RUNTIME DESTINATION "${LIB_INSTALL_DIR}/${SUFFIX_INSTALL_DIR}" | |
- LIBRARY DESTINATION "${LIB_INSTALL_DIR}/${SUFFIX_INSTALL_DIR}" | |
- ARCHIVE DESTINATION "${LIB_INSTALL_DIR}/${SUFFIX_INSTALL_DIR}") | |
+ mariadb mariadbclient | |
+ RUNTIME DESTINATION "${BIN_INSTALL_DIR}" | |
+ LIBRARY DESTINATION "${LIB_INSTALL_DIR}" | |
+ ARCHIVE DESTINATION "${LIB_INSTALL_DIR}") | |
-IF(NOT WIN32 AND WITH_MYSQLCOMPAT) | |
+IF(WITH_MYSQLCOMPAT) | |
INSTALL(FILES "${CMAKE_BINARY_DIR}/libmariadb/libmysql${CMAKE_SHARED_LIBRARY_SUFFIX}" | |
"${CMAKE_BINARY_DIR}/libmariadb/libmysqlclient${CMAKE_SHARED_LIBRARY_SUFFIX}" | |
"${CMAKE_BINARY_DIR}/libmariadb/libmysqlclient_r${CMAKE_SHARED_LIBRARY_SUFFIX}" | |
"${CMAKE_BINARY_DIR}/libmariadb/libmysqlclient${CMAKE_STATIC_LIBRARY_SUFFIX}" | |
- DESTINATION ${LIB_INSTALL_DIR}/mariadb) | |
+ DESTINATION ${LIB_INSTALL_DIR}) | |
ENDIF() | |
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- include/mysql.h.orig 2015-02-03 12:34:33.527518619 -0700 | |
+++ include/mysql.h 2015-02-03 12:34:41.327637274 -0700 | |
@@ -80,7 +80,7 @@ | |
extern unsigned int mysql_port; | |
extern char *mysql_unix_port; | |
-extern uint mariadb_deinitialize_ssl; | |
+extern unsigned int mariadb_deinitialize_ssl; | |
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) | |
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- include/my_global.h.orig 2015-02-02 22:18:57.873440040 -0700 | |
+++ include/my_global.h 2015-02-02 22:17:45.125574689 -0700 | |
@@ -451,7 +451,7 @@ | |
#define NO_PISAM /* Not needed anymore */ | |
#define NO_MISAM /* Not needed anymore */ | |
#define NO_HASH /* Not needed anymore */ | |
-#ifdef _WIN32 | |
+#if defined(_WIN32) && !defined(__MINGW32__) | |
#define NO_DIR_LIBRARY /* Not standar dir-library */ | |
#define USE_MY_STAT_STRUCT /* For my_lib */ | |
#ifdef _SIZE_T_DEFINED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: ant32 <antreimer@gmail.com> | |
pkgname=mingw-w64-libmariadbclient #mingw-w64-mariadb-connector-c | |
epoch=2 | |
pkgver=2.1.0 | |
pkgrel=1 | |
pkgdesc="MariaDB Client Library for C (mingw-w64)" #"Connect applications developed in C/C++ to MariaDB and MySQL databases (mingw-w64)" | |
arch=(any) | |
url="https://mariadb.com/kb/en/mariadb/about-mariadb-connector-c/" | |
license=("LGPL") | |
#replaces=('mingw-w64-libmariadbclient') | |
#conflicts=('mingw-w64-libmariadbclient') | |
depends=('mingw-w64-crt' 'mingw-w64-openssl' 'mingw-w64-zlib') | |
makedepends=('mingw-w64-cmake') | |
options=('!strip' '!buildflags' 'staticlibs') | |
source=("https://downloads.mariadb.org/interstitial/connector-c-${pkgver}/source-tgz/mariadb-connector-c-${pkgver}-src.tar.gz" | |
'fix-libnames-mingw-2.1.0.patch' | |
'use_fopen_for_xp_compatibility.patch' | |
'fix-size-t-defined.patch' | |
'fix-qt5-uint-error.patch') | |
md5sums=('c026525ad2cec882b00070ba92fa0bc1' | |
'817369f07dd7a1280f9d5be70b95e0d3' | |
'f1624e949933b2a774c116d46192a4ec' | |
'0a202d91993cbedcc03f10fdfe2720a0' | |
'e493a22d3e0f6de2bdedb7974c631101') | |
_architectures="i686-w64-mingw32 x86_64-w64-mingw32" | |
prepare() { | |
cd "$srcdir/mariadb-connector-c-$pkgver-src/" | |
patch -p0 -i ../fix-libnames-mingw-2.1.0.patch | |
patch -p0 -i ../use_fopen_for_xp_compatibility.patch | |
patch -p0 -i ../fix-size-t-defined.patch | |
patch -p0 -i ../fix-qt5-uint-error.patch | |
} | |
build() { | |
unset LDFLAGS | |
cd "$srcdir/mariadb-connector-c-$pkgver-src/" | |
for _arch in ${_architectures}; do | |
mkdir -p build-${_arch} && pushd build-${_arch} | |
${_arch}-cmake \ | |
-DCMAKE_BUILD_TYPE=RELEASE \ | |
-DWITH_EXTERNAL_ZLIB=ON \ | |
-DWITH_SQLITE=OFF \ | |
-DWITH_OPENSSL=ON \ | |
-DWITH_MYSQLCOMPAT=ON \ | |
.. | |
make | |
popd | |
done | |
} | |
package() { | |
for _arch in ${_architectures}; do | |
cd "${srcdir}/mariadb-connector-c-$pkgver-src/build-${_arch}" | |
make DESTDIR="${pkgdir}" install | |
mv "$pkgdir"/usr/${_arch}/lib/*.dll "$pkgdir"/usr/${_arch}/bin/ | |
ln -s mariadb "$pkgdir"/usr/${_arch}/include/mysql | |
ln -s libmariadb.dll.a "$pkgdir"/usr/${_arch}/lib/libmysql.dll.a | |
${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll | |
${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a | |
done | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- libmariadb/dbug.c 2014-04-04 04:21:01.000000000 -0600 | |
+++ libmariadb/dbug.c 2015-01-24 16:47:13.316693150 -0700 | |
@@ -2050,11 +2050,7 @@ | |
} | |
else | |
{ | |
-#ifdef _WIN32 | |
- if (fopen_s(&fp, name, append ? "a+" : "w")) | |
-#else | |
if (!(fp= fopen(name, append ? "a+" : "w"))) | |
-#endif | |
{ | |
(void) fprintf(stderr, ERR_OPEN, cs->process, name); | |
perror(""); | |
--- libmariadb/my_fopen.c 2014-04-04 04:21:01.000000000 -0600 | |
+++ libmariadb/my_fopen.c 2015-01-24 16:46:10.735766900 -0700 | |
@@ -36,11 +36,7 @@ | |
FileName, Flags, MyFlags)); | |
make_ftype(type,Flags); | |
-#ifdef _WIN32 | |
- if (fopen_s(&fd, FileName, type) == 0) | |
-#else | |
if ((fd = fopen(FileName, type)) != 0) | |
-#endif | |
{ | |
/* | |
The test works if MY_NFILE < 128. The problem is that fileno() is char |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment