summaryrefslogtreecommitdiff
path: root/net-libs/accounts-qml/accounts-qml-9999.ebuild
blob: f04e0f0b77696a4e4df3b94d674e0569b6280504 (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
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit qmake-utils multibuild

if [[ ${PV} = *9999* ]] ; then
	EGIT_REPO_URI="https://gitlab.com/accounts-sso/accounts-qml-module.git/"
	inherit git-r3
else
	SRC_URI="https://gitlab.com/accounts-sso/${PN}-module/-/archive/VERSION_${PV}/${PN}-module-VERSION_${PV}.tar.gz
		https://dev.gentoo.org/~asturm/distfiles/${P}-patches-1.tar.xz"
	S="${WORKDIR}/${PN}-module-VERSION_${PV}"
	KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
fi

DESCRIPTION="QML bindings for accounts-qt and signond"
HOMEPAGE="https://accounts-sso.gitlab.io/"

LICENSE="LGPL-2.1"
SLOT="0"
IUSE="doc +qt5 qt6 test"

# dbus problems
RESTRICT="test"

RDEPEND="
	qt5? (
		dev-qt/qtcore:5
		dev-qt/qtdeclarative:5
	)
	qt6? (
		dev-qt/qtbase:6
		dev-qt/qtdeclarative:6
	)
	>=net-libs/accounts-qt-1.16-r1[qt5?,qt6?]
	>=net-libs/signond-8.61-r1[qt5?,qt6?]
"
DEPEND="${RDEPEND}
	test? (
		qt5? (
			dev-qt/qtgui:5
			dev-qt/qttest:5
		)
		qt6? ( dev-qt/qtbase:6[gui,test] )
	)
"
BDEPEND="
	doc? (
		app-doc/doxygen
		|| (
			( dev-qt/qttools:6[assistant,qdoc] )
			(
				dev-qt/qdoc:5
				dev-qt/qthelp:5
			)
		)
	)
"

DOCS=( README.md )

pkg_setup() {
	MULTIBUILD_VARIANTS=( $(usev qt5) $(usev qt6) )
}

src_prepare() {
	default
	rm -v doc/html/.gitignore || die
	multibuild_copy_sources
}

src_configure() {
	my_src_configure() {
		cd "${BUILD_DIR}" || die

		local myqmakeargs=(
			CONFIG+=no_docs \
			PREFIX="${EPREFIX}"/usr
		)

		if [[ ${MULTIBUILD_VARIANT} == qt6 ]]; then
			eqmake6 "${myqmakeargs[@]}"
		else
			eqmake5 "${myqmakeargs[@]}"
		fi
	}

	multibuild_foreach_variant my_src_configure
}

src_compile() {
	my_src_compile() {
		emake -C "${BUILD_DIR}"
	}

	multibuild_foreach_variant my_src_compile

	if use doc; then
		local qtanybindir
		if has_version "dev-qt/qttools:6[qdoc]"; then
			qtanybindir="$(qt6_get_libdir)"
		elif has_version "dev-qt/qdoc:5"; then
			qtanybindir="$(qt5_get_bindir)"
		else
			eerror "dev-qt/qttools:6[qdoc] nor dev-qt/qdoc:5 available even though in deps(?)"
		fi
		${qtanybindir}/qdoc doc/accounts-qml-module.qdocconf || die
	fi
}

src_install() {
	my_src_install() {
		emake -C "${BUILD_DIR}" INSTALL_ROOT="${D}" install_subtargets
	}

	multibuild_foreach_variant my_src_install
	use doc && local HTML_DOCS=( doc/html )
	einstalldocs
}