blob: 28d30bbcccc5d09e888df2a9873c31ad4b8727ae (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC2154
# The PKGBUILD for SOCI.
# Maintainer: Matheus <matheusgwdl@protonmail.com>
# Contributor: Matheus <matheusgwdl@protonmail.com>
# Contributor: 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>
readonly _pkgname="soci"
declare -r _tag="4963406c41c3402e1b58797cd6787446cf8e7eb8"
pkgname="soci-git"
pkgver="v4.0.1_854_g4963406c"
pkgrel="1"
pkgdesc="C++ database access library."
arch=("x86_64")
url="https://github.com/SOCI/${_pkgname}"
license=("BSL-1.0")
depends=("gcc-libs" "glibc" "mariadb-libs" "postgresql-libs" "sqlite" "unixodbc")
makedepends=("cmake" "git")
optdepends=("libfbclient: Firebird"
"mariadb: MariaDB"
"postgresql: PostgreSQL")
provides=("${_pkgname}")
conflicts=("soci")
source=("${_pkgname}::git+${url}.git#tag=${_tag}")
sha512sums=("c0208367aec04380d79d2cd39c1853afaddf74a88bfb0721d52b22237638f2eb614164063630cd45e44eccedacc7cfdf4b240fafe09531ac230f79bdc24c8550")
_compile()
{
cmake -B "${srcdir}"/"${_pkgname}"/build/ \
-D CMAKE_BUILD_TYPE=None \
-D CMAKE_INSTALL_PREFIX=/usr/ \
-D SOCI_ASAN=OFF \
-D SOCI_DB2_SKIP_TESTS=ON \
-D SOCI_FIREBIRD_SKIP_TESTS=ON \
-D SOCI_LTO=ON \
-D SOCI_MYSQL_SKIP_TESTS=ON \
-D SOCI_ODBC_SKIP_TESTS=ON \
-D SOCI_ORACLE_SKIP_TESTS=ON \
-D SOCI_POSTGRESQL_SKIP_TESTS=ON \
-D SOCI_SHARED=ON \
-D SOCI_TESTS="$1" \
-D SOCI_UBSAN=OFF \
-S "${srcdir}"/"${_pkgname}"/ \
-Wno-dev
cmake --build "${srcdir}"/"${_pkgname}"/build/
}
pkgver()
{
cd "${srcdir}"/"${_pkgname}"/ || exit 1
git describe --long --tags | sed "s/-/_/g" || true
}
build()
{
for build_tests in "OFF" "ON"; do
_compile "${build_tests}"
done
}
check()
{
_compile "ON"
ctest --output-on-failure --test-dir "${srcdir}"/"${_pkgname}"/build/
_compile "OFF"
}
package()
{
# Assure that the directories exist.
mkdir -p "${pkgdir}"/usr/share/doc/"${pkgname}"/
# Install the software.
DESTDIR="${pkgdir}"/ cmake --install "${srcdir}"/"${_pkgname}"/build/
# Install the documentation.
install -Dm644 "${srcdir}"/"${_pkgname}"/README.md "${pkgdir}"/usr/share/doc/"${pkgname}"/
cp -r "${srcdir}"/"${_pkgname}"/docs/* "${pkgdir}"/usr/share/doc/"${pkgname}"/
find "${pkgdir}"/usr/share/doc/"${pkgname}"/ -type d -exec chmod 755 {} +
find "${pkgdir}"/usr/share/doc/"${pkgname}"/ -type f -exec chmod 644 {} +
}
|