aboutsummaryrefslogtreecommitdiff
blob: 7ca706863bb5f0a64776872f8a0f5fdc73aa7749 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

CMAKE_MAKEFILE_GENERATOR="emake"
CMAKE_BINARY=cmake
CMAKE_MAKEFILE_GENERATOR=emake

inherit cmake

MYPV="${PV/_beta/-beta}"
MYPN="${PN}"
MYP="${MYPN}-${MYPV}"

DESCRIPTION="API Generator for Database access"
HOMEPAGE="https://github.com/azaeldevel/apidb"
if [[ ${PV} == 9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/azaeldevel/apidb.git"
else
	SRC_URI="https://github.com/azaeldevel/${PN}/archive/${MYPV}.tar.gz"
	KEYWORDS="~amd64"
fi

LICENSE="GPL-3"
SLOT="0"

IUSE="+mariadb postgresql commands gtk +corelibs"

RDEPEND="
	dev-libs/libxml2
	dev-libs/boost
	dev-libs/octetos-coreutils
	dev-libs/octetos-db-abstract
	gtk? ( x11-libs/gtk+:3 )
	dev-libs/libtar
	mariadb? ( dev-libs/octetos-db-maria )
	postgresql? ( dev-libs/octetos-db-postgresql )
	gnome-base/librsvg
"
DEPEND="${RDEPEND}
	sys-devel/bison
	sys-devel/flex
"

S="${WORKDIR}/${PN}-${MYPV}"

src_prepare() {
	sed -i 's/lib/${LIBDIR}/' src/CMakeLists.txt || die
	sed -i 's/lib/${LIBDIR}/' src/mysql-reader-c++/CMakeLists.txt  || die
	sed -i 's/lib/${LIBDIR}/' src/mariadb-reader-c++/CMakeLists.txt  || die
	sed -i 's/lib/${LIBDIR}/' src/postgresql-reader-c++/CMakeLists.txt  || die

	cmake_src_prepare
}

src_configure() {
	APIDBBUILD="CORE"
	APIDBINSTALL=""
	if use corelibs ;then
		APIDBINSTALL="CORE"
	fi
	if use mariadb ;then
		APIDBBUILD="$APIDBBUILD;MARIADB"
		APIDBINSTALL="$APIDBINSTALL;DRIVERS"
	fi
	if use postgresql ;then
		APIDBBUILD="$APIDBBUILD;POSTGRESQL"
		APIDBINSTALL="$APIDBINSTALL;DRIVERS"
	fi
	if use commands ;then
		APIDBINSTALL="$APIDBINSTALL;COMMANDS"
	fi
	if use gtk ;then
		APIDBINSTALL="$APIDBINSTALL;GTK3"
	fi
	local mycmakeargs=(-DAPIDB_VERSION_STAGE=alpha -DPLATFORM=LINUX_GENTOO -DAPIDBBUILD=$APIDBBUILD -DAPIDBINSTALL=$APIDBINSTALL)
	cmake_src_configure
}