aboutsummaryrefslogtreecommitdiffstats
path: root/main/mariadb-connector-c/APKBUILD
blob: 0d01de5763f0d1a2f204886361f7ac833125acb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mariadb-connector-c
pkgver=3.0.8
pkgrel=0
pkgdesc="The MariaDB Native Client library (C driver)"
url="https://mariadb.org/"
arch="all"
license="LGPL-2.1-or-later"
depends_dev="openssl-dev zlib-dev"
makedepends="$depends_dev cmake"
replaces="mariadb-client-libs"
subpackages="$pkgname-dev"
source="https://downloads.mariadb.org/interstitial/connector-c-$pkgver/mariadb-connector-c-$pkgver-src.tar.gz
	cmake.patch
	fix-ucontext-header.patch
	"
builddir="$srcdir/mariadb-connector-c-$pkgver-src"

build() {
	cd "$builddir"
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DINSTALL_LIBDIR=/usr/lib \
		-DINSTALL_INCLUDEDIR=/usr/include/mysql \
		\
		-DMARIADB_PORT=3306 \
		-DMARIADB_UNIX_ADDR=/run/mysqld/mysqld.sock \
		-DWITH_EXTERNAL_ZLIB=YES \
		-DWITH_MYSQLCOMPAT=ON \
		-DWITH_SSL=OPENSSL \
		${CMAKE_CROSSOPTS}
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install

	# purge static libs
	rm "$pkgdir"/usr/lib/*.a

	# compat symlinks
	ln -s mariadb_config "$pkgdir"/usr/bin/mysql_config
	ln -s mariadb_version.h "$pkgdir"/usr/include/mysql/mysql_version.h
}

dev() {
	default_dev
	replaces="mariadb-dev"
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="d9f970c7ac164ef7d8dd748bf2f749cc1f877a9c8f68a1d57e9ff62d95046bb9505619feca1f1d0d1cdefc1ac49489742aadf4ad9e47c8e6a9b8b40c56eed788  mariadb-connector-c-3.0.8-src.tar.gz
027a9d383ce27a527b77ac06b9505709cad8fe0173455863590f502996966300fedea87687630113d74e5b9be5349217b18206c2dbb89f7064129cb5417e44cf  cmake.patch
ad52cccb5517d11838bf16aee5aff63d87075e9ef5787e726d8bfea2854d3e2b5fa7aa94c0e93b1f7e7e21f48d21b1b6fcdd161fadb9999dcc7a3a5b8e12d883  fix-ucontext-header.patch"