Created
August 17, 2014 18:09
-
-
Save ant32/ad40af3b5fec652f335b to your computer and use it in GitHub Desktop.
mingw-w64-mariadbclient
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-mariadbclient | |
pkgver=2.0.0 | |
pkgrel=1 | |
pkgdesc="MariaDB Client Library for C (mingw-w64)" | |
arch=(any) | |
url="https://mariadb.org" | |
license=("LGPL") | |
depends=('mingw-w64-crt' 'mingw-w64-zlib' 'mingw-w64-libiconv') | |
makedepends=('mingw-w64-cmake') | |
#optdepends=() | |
options=('!strip' '!buildflags' 'staticlibs') | |
source=("http://ftp.osuosl.org/pub/mariadb/client-native-${pkgver}/src/mariadb_client-${pkgver}-src.tar.gz") | |
sha256sums=('fd2f751dea049c1907735eb236aeace1d811d6a8218118b00bbaa9b84dc5cd60') | |
_architectures="i686-w64-mingw32 x86_64-w64-mingw32" | |
prepare() { | |
sed -e 's|IF(NOT WIN32)|IF(WIN32)|g' -i "${srcdir}/mariadb_client-$pkgver-src/CMakeLists.txt" | |
sed -e 's|IF(NOT WIN32)|IF(WIN32)|g' -i "${srcdir}/mariadb_client-$pkgver-src/libmariadb/CMakeLists.txt" | |
sed -e 's|IF(NOT WIN32 AND WITH_MYSQLCOMPAT)|IF(WIN32 AND WITH_MYSQLCOMPAT)|g' -i "${srcdir}/mariadb_client-$pkgver-src/libmariadb/CMakeLists.txt" | |
} | |
build() { | |
unset LDFLAGS | |
cd "$srcdir/mariadb_client-$pkgver-src/" | |
for _arch in ${_architectures}; do | |
mkdir -p build-${_arch} && pushd build-${_arch} | |
${_arch}-cmake \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
.. | |
make | |
popd | |
done | |
} | |
package() { | |
for _arch in ${_architectures}; do | |
cd "${srcdir}/mariadb_client-$pkgver-src/build-${_arch}" | |
make DESTDIR="${pkgdir}" install | |
mkdir -p "$pkgdir/usr/${_arch}/bin" | |
mv "$pkgdir/usr/${_arch}/lib/mariadb/"* "$pkgdir/usr/${_arch}/lib/" | |
rmdir "$pkgdir/usr/${_arch}/lib/mariadb" | |
cp "$pkgdir/usr/${_arch}/lib/"*.dll "$pkgdir/usr/${_arch}/bin/" | |
${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll | |
${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The sed commands in the prepare function is a dirty hack to cause it to make symlinks which probably would be better to do manually. Also with the sed it will use the external openssl (or I think it does I didn't spend much time.)