media-gfx/photoqt: Stabilize 4.7-r1 amd64, #948000
[gentoo/gentoo.git] / media-libs / phonon / phonon-4.12.0-r4.ebuild
blob545735c8389514df1bc3094b86fad4d2f5f1c115
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit cmake desktop flag-o-matic kde.org multibuild
8 DESCRIPTION="KDE multimedia abstraction library"
9 HOMEPAGE="https://community.kde.org/Phonon"
11 if [[ ${KDE_BUILD_TYPE} = release ]]; then
12         SRC_URI="mirror://kde/stable/phonon/${PV}/${P}.tar.xz"
13         KEYWORDS="amd64 ~arm arm64 ~loong ppc64 ~riscv x86"
16 LICENSE="|| ( LGPL-2.1 LGPL-3 ) !pulseaudio? ( || ( GPL-2 GPL-3 ) )"
17 SLOT="0"
18 IUSE="debug designer minimal pulseaudio +qt5 qt6"
19 REQUIRED_USE="|| ( qt5 qt6 )"
21 DEPEND="
22         pulseaudio? (
23                 dev-libs/glib:2
24                 media-libs/libpulse[glib]
25         )
26         qt5? (
27                 dev-qt/qtcore:5
28                 dev-qt/qtgui:5
29                 dev-qt/qtwidgets:5
30                 designer? ( dev-qt/designer:5 )
31         )
32         qt6? (
33                 dev-qt/qt5compat:6
34                 dev-qt/qtbase:6[gui,widgets]
35                 designer? ( dev-qt/qttools:6[designer] )
36         )
38 RDEPEND="${DEPEND}
39         !media-libs/phonon-gstreamer
40         || (
41                 kde-frameworks/breeze-icons:*
42                 kde-frameworks/oxygen-icons:*
43         )
45 BDEPEND="
46         dev-libs/libpcre2:*
47         >=kde-frameworks/extra-cmake-modules-5.115.0:*
48         virtual/pkgconfig
49         qt5? ( dev-qt/linguist-tools:5 )
50         qt6? ( dev-qt/qttools:6[linguist] )
52 PDEPEND="!minimal? ( >=media-libs/phonon-vlc-0.12.0[qt5?,qt6?] )"
54 PATCHES=( "${FILESDIR}/${P}-cmake.patch" ) # bug 938315
56 pkg_setup() {
57         MULTIBUILD_VARIANTS=( $(usev qt5) $(usev qt6) )
60 src_configure() {
61         use debug || append-cppflags -DQT_NO_DEBUG
63         myconfigure() {
64                 local mycmakeargs=(
65                         -DQT_MAJOR_VERSION=${MULTIBUILD_VARIANT/qt/}
66                         -DPHONON_BUILD_${MULTIBUILD_VARIANT^^}=ON
67                         -DKDE_INSTALL_USE_QT_SYS_PATHS=ON # ecm.eclass
68                         -DKDE_INSTALL_DOCBUNDLEDIR="${EPREFIX}/usr/share/help" # ecm.eclass
69                         -DPHONON_BUILD_DESIGNER_PLUGIN=$(usex designer)
70                         -DCMAKE_DISABLE_FIND_PACKAGE_GLIB2=$(usex !pulseaudio)
71                         -DCMAKE_DISABLE_FIND_PACKAGE_PulseAudio=$(usex !pulseaudio)
72                 )
74                 if [[ ${MULTIBUILD_VARIANT} == qt6 ]]; then
75                         mycmakeargs+=(
76                                 -DPHONON_BUILD_QT5=OFF
77                                 -DPHONON_BUILD_SETTINGS=ON
78                         )
79                 else
80                         mycmakeargs+=(
81                                 -DPHONON_BUILD_QT6=OFF
82                                 -DPHONON_BUILD_SETTINGS=$(usex !qt6)
83                         )
84                 fi
86                 cmake_src_configure
87         }
89         multibuild_foreach_variant myconfigure
92 src_compile() {
93         multibuild_foreach_variant cmake_src_compile
96 src_install() {
97         multibuild_foreach_variant cmake_src_install
98         make_desktop_entry "${PN}settings" \
99                 "Phonon Audio and Video" preferences-desktop-sound