summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 18f967e807b2bb991715ef48ec6e35271e0ae72f (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
44
45
46
47
48
49
50
# Maintainer: Guillaume Horel <guillaume.horel@gmail.com>
# Contributor:  Marcin (CTRL) Wieczorek <marcin@marcin.co>
# Contributor: Daniel Nagy <danielnagy at gmx de>
# Contributor: Mika Fischer <mika.fischer@zoopnet.de>

pkgname=soci-git
pkgname_=soci
pkgver=4.0.1.r0.g334cc55d
pkgrel=1
pkgdesc="Database access library for C++"
arch=('x86_64')
url="http://soci.sf.net"
license=('custom:boost')
depends=('postgresql-libs' 'sqlite3' 'unixodbc')
makedepends=('cmake')
optdepends=('instantclient-basic: support for oracle databases'
            'libmysqlclient: support for mysql databases'
            'postgresql-libs: support for postgresql databases'
            'sqlite3: support for sqlite databases'
            'unixodbc: support for ODBC databases')
provides=("soci=$pkgver")
conflicts=('soci')
source=("git+https://github.com/SOCI/soci.git#branch=release/4.0")
sha1sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname_}"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/; s/-/./g'
}

build() {
    cmake -B build "${pkgname_}" \
        -DSOCI_TESTS=OFF \
        -DCMAKE_INSTALL_PREFIX="/usr" \
        -DCMAKE_CXX_FLAGS="-Wno-format-overflow" \
        -DSOCI_CXX11=ON \
        -Wno-dev
    make -C build
}

package() {
    make DESTDIR="${pkgdir}" -C build install

    # For some reason -DLIBDIR=lib causes libsoci_empty.so to disappear
    if [ -e "${pkgdir}/usr/lib64" ]; then
        mv "${pkgdir}/usr/lib64" "${pkgdir}/usr/lib"
    fi
    install -Dm0644 "${srcdir}/${pkgname_}/LICENSE_1_0.txt" \
        "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}