aboutsummaryrefslogblamecommitdiffstats
path: root/main/mariadb-connector-c/APKBUILD
blob: 5a65e20a09154bde21ded93c5b3411ad5fffa537 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                   
             
        
                                                      
                          
          
                           
                                  
                                
                               

                              
                                                                                                              


                                                  


                                                                                          

                                                                                     
               
                                         

                                             
                                           

                                                    

                                     
                                                             


                                          
                                



            















                                                                           
                                                                                                                                                                                    
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mariadb-connector-c
pkgver=3.1.11
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"
options="!check" # no testsuite
replaces="mariadb-client-libs"
subpackages="$pkgname-dev"
source="https://downloads.mariadb.org/interstitial/connector-c-$pkgver/mariadb-connector-c-$pkgver-src.tar.gz"
builddir="$srcdir/mariadb-connector-c-$pkgver-src"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi

	# INSTALL_LIBDIR and INSTALL_INCLUDEDIR are relative to CMAKE_INSTALL_PREFIX.
	cmake \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DINSTALL_LIBDIR=lib \
		-DINSTALL_INCLUDEDIR=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() {
	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="2da3a5e438037dde2b9fafb07c084c742983ff4ce18f06cf7a34836aace5317cdb2ddb1bca63143367f5ae827c988d99ee20e8f598fabdb06190d9e2191eb3f4  mariadb-connector-c-3.1.11-src.tar.gz"