You are not logged in.

#1 2014-09-03 15:20:19

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

Non-trivial update of mysql-connector-c++

I'm trying to update mysql-connector-c++ to version 1.1.4, so I updated the PKGBUILD to

pkgname=mysql-connector-c++
pkgver=1.1.4
pkgrel=1
pkgdesc="A MySQL database connector for C++"
arch=('i686' 'x86_64')
url="http://dev.mysql.com/downloads/connector/cpp/"
license=('GPL')
depends=('libmysqlclient' 'boost-libs')
makedepends=('cmake' 'boost')
source=("http://dev.mysql.com/get/Downloads/Connector-C++/${pkgname}-${pkgver}.tar.gz")
md5sums=('7239a4430efd4d0189c4f24df67f08e5')

build() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  cmake . -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DMYSQLCPPCONN_BUILD_EXAMPLES=OFF
  make
}

package() {
  cd "${srcdir}"/${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install

  rm "${pkgdir}"/usr/{ANNOUNCEMENT,COPYING,README,INSTALL,Licenses_for_Third-Party_Components.txt}
}

However, this gives the error message

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MYSQL_LIB

I found this variable when issuing cmake -L and in CMakeCache.txt, so I edited the latter to read

MYSQL_LIB:FILEPATH=/usr/lib64/libmysqlclient_r.so

(the same library as MYSQLCPPCONN_DYNLOAD_MYSQL_LIB points to, which is the same as /usr/lib/libmysqlclient.so).

Now, how do I retrieve the path of this library file and set MYSQL_LIB in my PKGBUILD?

After changing CMakeCache.txt, make starts to run, but the compiler errors on different issues, regarding the MySQL build you use: when using MariaDB 10.0.13, I get the following error:

Linking CXX executable driver_test
../driver/libmysqlcppconn.so.7.1.1.4: undefined reference to `mysql_options4'
collect2: error: ld returned 1 exit status

I already searched for this, but couldn't find how to resolve this error.

When using Oracle's MySQL 5.6.20 in AUR, I get the following error:

/…/src/mysql-connector-c++-1.1.4/driver/mysql_metadata.cpp:1216:74: error: ‘dynamic_cast’ not permitted with -fno-rtti
    connection(dynamic_cast< MySQL_Connection * >(service->getConnection())),
                                                                          ^

How do I remove this option from the compiler command line when building with makepkg?

And: for which build of MySQL should I prepare this package? Arch's MariaDB? Or the "official" MySQL provided by Oracle?

Offline

Board footer

Powered by FluxBB