summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 176e70d4a1e5cda2446a94338224103db79eef2d (plain)
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
# Maintainer: Miguel Revilla <yo at miguelrevilla dot com>

pkgname=libodb-mysql
pkgver=2.5.0b17
pkgrel=1
pkgdesc="The ODB MySQL runtime library"
arch=('i686' 'x86_64')
url="https://www.codesynthesis.com/products/odb/"
depends=('build2' 'mariadb-libs')
options=('!libtool')
license=('GPL3')

build() {
	cd "${srcdir}"
	mkdir -p "${srcdir}/${pkgname}-${pkgver}"
	cd "${srcdir}/${pkgname}-${pkgver}"

	GPPVER="$(g++ --version | grep 'g++ (GCC)' | sed 's/g++ (GCC) //')"

	bpkg create -d gcc-${GPPVER} cc \
	config.cxx=g++ \
	config.cc.coptions="-O3 -DLIBODB_MYSQL_MARIADB" \
	config.bin.lib=shared \
	config.install.root=${pkgdir}/usr

	cd gcc-${GPPVER}
	bpkg add https://pkg.cppget.org/1/beta
	bpkg fetch --trust-yes
	bpkg build --trust-yes ${pkgname} ?sys:libmysqlclient ?sys:libodb
}

package() {

	GPPVER="$(g++ --version | grep 'g++ (GCC)' | sed 's/g++ (GCC) //')"
	cd "${srcdir}/${pkgname}-${pkgver}/gcc-${GPPVER}"

	bpkg install ${pkgname}

	for f in ${pkgdir}/usr/lib/pkgconfig/*.pc; do sed -i "s|${pkgdir}||" ${f}; done

	mkdir -p ${pkgdir}/usr/share/licenses/${pkgname}/
	mv ${pkgdir}/usr/share/doc/${pkgname}/LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/
}