summaryrefslogtreecommitdiff
path: root/dev-cpp/wt/wt-4.13.1.ebuild
blob: c6889117bfa4b59c072bc2cf5d727a4149df931d (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Copyright 2025-2026 Liguros Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8

inherit cmake flag-o-matic

DESCRIPTION="Wt, C++ Web Toolkit"
HOMEPAGE="https://www.webtoolkit.eu/wt https://github.com/emweb/wt"
SRC_URI="https://github.com/emweb/wt/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="doc +graphicsmagick libressl mariadb opengl +pango pdf postgres +sqlite ssl wttest"
REQUIRED_USE="
	pango? ( || ( graphicsmagick pdf ) )
	opengl? ( graphicsmagick )
"
# TODO: auto-test with wttest
RESTRICT="test"

DEPEND="
	dev-libs/boost:=
	sys-libs/zlib
	graphicsmagick? ( media-gfx/graphicsmagick:=[jpeg,png] )
	mariadb? (
		dev-db/mariadb
		dev-db/mariadb-connector-c
	)
	opengl? (
		media-libs/glew:=
		media-libs/libglvnd[X]
	)
	pango? (
		dev-libs/glib:2
		media-libs/fontconfig
		x11-libs/pango
	)
	pdf? ( media-libs/libharu:= )
	postgres? ( dev-db/postgresql )
	sqlite? ( dev-db/sqlite:3 )
	ssl? (
		!libressl? ( dev-libs/openssl:= )
		libressl? ( dev-libs/libressl:= )
	)
"
RDEPEND="${DEPEND}"
BDEPEND="
	doc? (
		app-text/doxygen
		dev-qt/qttools:6[assistant]
		dev-ruby/asciidoctor
		media-gfx/graphviz[cairo]
	)
	virtual/pkgconfig
"

PATCHES=( "${FILESDIR}/wt-no-rundir.patch" )

src_prepare() {
	cmake_src_prepare

	# remove bundled sqlite
	rm -r src/Wt/Dbo/backend/amalgamation || die

	if use doc; then
		doxygen -u Doxyfile 2>/dev/null || die
		doxygen -u examples/Doxyfile 2>/dev/null || die
		sed -e "/^QHG_LOCATION/s|qhelpgenerator|/usr/$(get_libdir)/qt6/libexec/&|" \
			-i Doxyfile || die
	fi
}

src_configure() {
	local mycmakeargs=(
		-DLIB_INSTALL_DIR=$(get_libdir)
		-DBUILD_EXAMPLES=OFF
		-DBUILD_TESTS=OFF
		-DDOCUMENTATION_DESTINATION="share/doc/${PF}"
		-DINSTALL_DOCUMENTATION=$(usex doc)
		# will be deprecated
		-DCONNECTOR_FCGI=OFF
		-DCONNECTOR_HTTP=ON
		-DENABLE_SSL=$(usex ssl)
		-DENABLE_HARU=$(usex pdf)
		-DENABLE_PANGO=$(usex pango)
		-DENABLE_SQLITE=$(usex sqlite)
		-DENABLE_POSTGRES=$(usex postgres)
		-DENABLE_MYSQL=$(usex mariadb)
		-DENABLE_FIREBIRD=OFF
		-DENABLE_LIBWTTEST=$(usex wttest)
		# QT is only required for examples
		-DENABLE_QT4=OFF
		-DENABLE_QT5=OFF
		-DENABLE_QT6=OFF
		# requires shibboleth and opensaml, not in tree
		-DENABLE_SAML=OFF
		-DENABLE_OPENGL=$(usex opengl)
		-DWT_WRASTERIMAGE_IMPLEMENTATION=$(usex graphicsmagick GraphicsMagick none)
	)

	if use mariadb || use postgres || use sqlite; then
		mycmakeargs+=( -DENABLE_LIBWTDBO=ON )
		if use sqlite; then
			mycmakeargs+=( -DUSE_SYSTEM_SQLITE3=ON )
			# DboTest.C: In member function ‘void Sqlite3_Test_Suite::dbo_precision_test2::test_method()’
			if use wttest; then
			append-flags -fno-strict-aliasing
			filter-lto
			fi
		fi
	else
		mycmakeargs+=( -DENABLE_LIBWTDBO=OFF )
	fi

	cmake_src_configure
}

src_install() {
	cmake_src_install

	if use doc; then
		find "${ED}" \( \
			-iname '*.map' -o \
			-iname '*.md5' \
			\) -delete || die

		docompress -x /usr/share/doc/${PF}/{examples,reference,tutorial}
	fi
}