x11-terms/ghostty: add missing depend dev-libs/oniguruma
[gentoo-zh.git] / media-sound / amarok / amarok-3.1.0.ebuild
blob947205aa37bbbba12da988e9ec135a7c68b0b4c3
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 EAPI=8
8 ECM_HANDBOOK="optional"
9 ECM_TEST="true"
10 KFMIN=6.5.0
11 QTMIN=6.7.2
12 inherit ecm gear.kde.org
14 DESCRIPTION="KDE calculator"
15 HOMEPAGE="https://apps.kde.org/amarok/"
17 LICENSE="GPL-2" # TODO: CHECK
18 SLOT="6"
19 KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
20 IUSE="ipod lastfm mtp +mariadb wikipedia qt5 qt6 podcast"
22 RESTRICT="mirror"
24 REQUIRED_USE="^^ ( qt5 qt6 )"
26 SRC_URI="https://invent.kde.org/multimedia/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.bz2"
28 DEPEND="
30 virtual/mysql
31 media-libs/taglib-extras
32 media-libs/taglib
33 media-libs/phonon[qt5?,qt6?]
35 qt6? (
36 dev-qt/qttools:6
37 dev-qt/qt5compat:6
38 >=dev-qt/qtbase-${QTMIN}:6[gui,widgets,xml]
39 dev-qt/qtdeclarative:6
40 >=kde-frameworks/karchive-${KFMIN}:6
41 >=kde-frameworks/kcodecs-${KFMIN}:6
42 >=kde-frameworks/kconfig-${KFMIN}:6
43 >=kde-frameworks/kconfigwidgets-${KFMIN}:6
44 >=kde-frameworks/kcoreaddons-${KFMIN}:6
45 >=kde-frameworks/kcrash-${KFMIN}:6
46 >=kde-frameworks/kdbusaddons-${KFMIN}:6
47 >=kde-frameworks/kdeclarative-${KFMIN}:6
48 >=kde-frameworks/kdnssd-${KFMIN}:6
49 >=kde-frameworks/kdoctools-${KFMIN}:6
50 >=kde-frameworks/kglobalaccel-${KFMIN}:6
51 >=kde-frameworks/kguiaddons-${KFMIN}:6
52 >=kde-frameworks/ki18n-${KFMIN}:6
53 >=kde-frameworks/kiconthemes-${KFMIN}:6
54 >=kde-frameworks/kcmutils-${KFMIN}:6
55 >=kde-frameworks/kio-${KFMIN}:6
56 >=kde-frameworks/knotifications-${KFMIN}:6
57 >=kde-frameworks/kpackage-${KFMIN}:6
58 >=kde-frameworks/solid-${KFMIN}:6
59 >=kde-frameworks/ktexteditor-${KFMIN}:6
60 >=kde-frameworks/threadweaver-${KFMIN}:6
61 >=kde-frameworks/kwidgetsaddons-${KFMIN}:6
62 >=kde-frameworks/kwindowsystem-${KFMIN}:6
64 kde-frameworks/kcolorscheme:6
65 kde-frameworks/kirigami:6
66 kde-frameworks/kstatusnotifieritem:6
69 qt5? (
71 dev-qt/linguist-tools
72 dev-qt/qtcore:5
73 dev-qt/qtdeclarative:5
74 dev-qt/qtgui:5
75 dev-qt/qtwidgets:5
76 dev-qt/qtxml:5
77 dev-qt/qtsql:5
79 kde-frameworks/karchive:5
80 kde-frameworks/kcodecs:5
81 kde-frameworks/kconfig:5
82 kde-frameworks/kconfigwidgets:5
83 kde-frameworks/kcoreaddons:5
84 kde-frameworks/kcrash:5
85 kde-frameworks/kdbusaddons:5
86 kde-frameworks/kdeclarative:5
87 kde-frameworks/kdnssd:5
88 kde-frameworks/kdoctools:5
89 kde-frameworks/kglobalaccel:5
90 kde-frameworks/kguiaddons:5
91 kde-frameworks/ki18n:5
92 kde-frameworks/kiconthemes:5
93 kde-frameworks/kcmutils:5
94 kde-frameworks/kio:5
95 kde-frameworks/knotifications:5
96 kde-frameworks/kpackage:5
97 kde-frameworks/solid:5
98 kde-frameworks/ktexteditor:5
99 kde-frameworks/threadweaver:5
100 kde-frameworks/kwidgetsaddons:5
101 kde-frameworks/kwindowsystem:5
103 kde-frameworks/kirigami:5
105 ipod? ( media-libs/libmygpo-qt )
109 RDEPEND="${DEPEND}"
111 RDEPEND="${DEPEND}
112 media-video/ffmpeg
115 S="${WORKDIR}/${PN}-v${PV}"
117 src_configure() {
118 local mycmakeargs=(
119 -DBUILD_WITH_QT6=$(usex qt6)
120 -DWITH_MP3Tunes=OFF
121 -DWITH_PLAYER=ON
122 -DWITH_UTILITIES=ON
123 -DCMAKE_DISABLE_FIND_PACKAGE_Googlemock=ON
124 -DCMAKE_DISABLE_FIND_PACKAGE_LibOFA=ON
125 -DCMAKE_DISABLE_FIND_PACKAGE_MySQLe=ON
126 -DWITH_IPOD=$(usex ipod)
127 -DWITH_GPODDER=OFF
128 $(cmake_use_find_package lastfm LibLastFm)
129 # $(cmake_use_find_package !mariadb MySQL)
130 $(cmake_use_find_package mtp Mtp)
131 $(cmake_use_find_package wikipedia Qt6WebEngineWidgets)
133 use ipod && mycmakeargs+=( DWITH_GDKPixBuf=ON )
134 use qt5 && use podcast && mycmakeargs+=( $(cmake_use_find_package podcast Mygpo-qt5) )
136 ecm_src_configure
139 pkg_postinst() {
140 ecm_pkg_postinst
142 pkg_is_installed() {
143 echo "${1} ($(has_version ${1} || echo "not ")installed)"
146 db_name() {
147 use mariadb && echo "MariaDB" || echo "MySQL"
150 optfeature "Audio CD support" "kde-apps/audiocd-kio:6"
152 if [[ -z ${REPLACING_VERSIONS} ]]; then
153 elog "You must configure ${PN} to use an external database server."
154 elog " 1. Make sure either MySQL or MariaDB is installed and configured"
155 elog " Checking local system:"
156 elog " $(pkg_is_installed dev-db/mariadb)"
157 elog " $(pkg_is_installed dev-db/mysql)"
158 elog " For preliminary configuration of $(db_name) Server refer to"
159 elog " https://wiki.gentoo.org/wiki/$(db_name)#Configuration"
160 elog " 2. Ensure 'mysql' service is started and run:"
161 elog " # emerge --config amarok"
162 elog " 3. Run ${PN} and go to 'Configure Amarok - Database' menu page"
163 elog " Check 'Use external MySQL database' and press OK"
164 elog
165 elog "For more information please read:"
166 elog " https://community.kde.org/Amarok/Community/MySQL"
170 pkg_config() {
171 # Create external mysql database with amarok default user/password
172 local AMAROK_DB_NAME="amarokdb"
173 local AMAROK_DB_USER_NAME="amarokuser"
174 local AMAROK_DB_USER_PWD="password"
176 einfo "Initializing ${PN} MySQL database 'amarokdb':"
177 einfo "If prompted for a password, please enter your MySQL root password."
178 einfo
180 if [[ -e "${EROOT}"/usr/bin/mysql ]]; then
181 "${EROOT}"/usr/bin/mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS ${AMAROK_DB_NAME}; GRANT ALL PRIVILEGES ON ${AMAROK_DB_NAME}.* TO '${AMAROK_DB_USER_NAME}' IDENTIFIED BY '${AMAROK_DB_USER_PWD}'; FLUSH PRIVILEGES;"
183 einfo "${PN} MySQL database 'amarokdb' successfully initialized!"