summaryrefslogtreecommitdiff
path: root/dev-libs/log4cxx/log4cxx-1.0.0.ebuild
blob: a84ed0eb82f718a97a77e686a1f975bf15282881 (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
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

MY_P=apache-${P}
DESCRIPTION="Library of C++ classes for logging to files, syslog and other destinations"
HOMEPAGE="https://logging.apache.org/log4cxx/"
SRC_URI="mirror://apache/logging/${PN}/${PV}/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"

LICENSE="Apache-2.0"
SLOT="0/15"
KEYWORDS="amd64 ~arm ~hppa"
IUSE="odbc smtp test"
RESTRICT="!test? ( test )"

RDEPEND="
	dev-libs/apr:1=
	dev-libs/apr-util:1=
	dev-libs/libfmt:=
	odbc? ( dev-db/unixODBC )
	smtp? ( net-libs/libesmtp )
"
DEPEND="${RDEPEND}"
BDEPEND="
	test? (
		app-alternatives/gzip
		app-arch/zip
	)
"

src_prepare() {
	# https://github.com/apache/logging-log4cxx/issues/189
	if ! use odbc ; then
		sed -i -e 's:pkg_check_modules( odbc QUIET odbc ):pkg_check_modules( odbc QUIET odbcDoNotFindMe ):' src/main/include/CMakeLists.txt || die
	fi

	if ! use smtp ; then
		sed -i -e 's:CHECK_LIBRARY_EXISTS(esmtp smtp_create_session "" HAS_LIBESMTP):CHECK_LIBRARY_EXISTS(esmtpDoNotFindMe smtp_create_session "" HAS_LIBESMTP):' src/main/include/CMakeLists.txt || die
	fi

	cmake_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DENABLE_FMT_LAYOUT=ON
		-DLOG4CXX_QT_SUPPORT=OFF
	)

	cmake_src_configure
}