media-sound/apulse: version bump
[gentoo.git] / media-sound / clementine / clementine-1.3.1_p20190127.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PLOCALES="af ar be bg bn br bs ca cs cy da de el en en_CA en_GB eo es et eu fa fi fr ga gl he he_IL hi hr hu hy ia id is it ja ka kk ko lt lv mk_MK mr ms my nb nl oc pa pl pt pt_BR ro ru si_LK sk sl sr sr@latin sv te tr tr_TR uk uz vi zh_CN zh_TW"
7
8 MY_P="${P/_}"
9 if [[ ${PV} == *9999* ]]; then
10         EGIT_BRANCH="qt5"
11         EGIT_REPO_URI="https://github.com/clementine-player/Clementine.git"
12         inherit git-r3
13 else
14         COMMIT=610566d25271c67d1625fd62041f6a27435b0a9d
15         SRC_URI="https://github.com/${PN}-player/${PN^}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
16         KEYWORDS="amd64 x86"
17 fi
18 inherit cmake flag-o-matic l10n virtualx xdg
19
20 DESCRIPTION="Modern music player and library organizer based on Amarok 1.4 and Qt"
21 HOMEPAGE="https://www.clementine-player.org https://github.com/clementine-player/Clementine"
22
23 LICENSE="GPL-3"
24 SLOT="0"
25 IUSE="box cdda +dbus debug dropbox googledrive ipod lastfm mms moodbar mtp projectm pulseaudio seafile skydrive test +udisks wiimote"
26
27 REQUIRED_USE="
28         udisks? ( dbus )
29         wiimote? ( dbus )
30 "
31
32 BDEPEND="
33         >=dev-cpp/gtest-1.8.0
34         dev-qt/linguist-tools:5
35         sys-devel/gettext
36         virtual/pkgconfig
37         test? (
38                 dev-qt/qttest:5
39                 gnome-base/gsettings-desktop-schemas
40         )
41 "
42 COMMON_DEPEND="
43         app-crypt/qca:2[qt5(+)]
44         dev-db/sqlite:=
45         dev-libs/crypto++:=[asm]
46         dev-libs/glib:2
47         dev-libs/libxml2
48         dev-libs/protobuf:=
49         dev-qt/qtconcurrent:5
50         dev-qt/qtcore:5
51         dev-qt/qtgui:5
52         dev-qt/qtnetwork:5[ssl]
53         dev-qt/qtsql:5[sqlite]
54         dev-qt/qtwidgets:5
55         media-libs/chromaprint:=
56         media-libs/gstreamer:1.0
57         media-libs/gst-plugins-base:1.0
58         >=media-libs/libmygpo-qt-1.0.9[qt5(+)]
59         >=media-libs/taglib-1.11.1_p20181028
60         sys-libs/zlib
61         virtual/glu
62         x11-libs/libX11
63         cdda? ( dev-libs/libcdio:= )
64         dbus? ( dev-qt/qtdbus:5 )
65         ipod? ( >=media-libs/libgpod-0.8.0 )
66         lastfm? ( >=media-libs/liblastfm-1.1.0_pre20150206 )
67         moodbar? ( sci-libs/fftw:3.0 )
68         mtp? ( >=media-libs/libmtp-1.0.0 )
69         projectm? (
70                 media-libs/glew:=
71                 >=media-libs/libprojectm-1.2.0:=
72                 virtual/opengl
73         )
74 "
75 # Note: sqlite driver of dev-qt/qtsql is bundled, so no sqlite use is required; check if this can be overcome someway;
76 # Libprojectm-1.2 seems to work fine, so no reason to use bundled version; check clementine's patches:
77 # https://github.com/clementine-player/Clementine/tree/master/3rdparty/libprojectm/patches
78 # Still possibly essential but not applied yet patches are:
79 # 06-fix-numeric-locale.patch
80 # 08-stdlib.h-for-rand.patch
81 RDEPEND="${COMMON_DEPEND}
82         media-plugins/gst-plugins-meta:1.0
83         media-plugins/gst-plugins-soup:1.0
84         media-plugins/gst-plugins-taglib:1.0
85         mms? ( media-plugins/gst-plugins-libmms:1.0 )
86         mtp? ( gnome-base/gvfs[mtp] )
87         udisks? ( sys-fs/udisks:2 )
88 "
89 DEPEND="${COMMON_DEPEND}
90         dev-libs/boost
91         dev-qt/qtopengl:5
92         dev-qt/qtx11extras:5
93         dev-qt/qtxml:5
94         box? ( dev-cpp/sparsehash )
95         dropbox? ( dev-cpp/sparsehash )
96         googledrive? ( dev-cpp/sparsehash )
97         pulseaudio? ( media-sound/pulseaudio )
98         seafile? ( dev-cpp/sparsehash )
99         skydrive? ( dev-cpp/sparsehash )
100 "
101
102 RESTRICT="test"
103
104 S="${WORKDIR}/${PN^}-${COMMIT}"
105
106 DOCS=( Changelog README.md )
107
108 src_prepare() {
109         l10n_find_plocales_changes "src/translations" "" ".po"
110
111         cmake_src_prepare
112         # some tests fail or hang
113         sed -i \
114                 -e '/add_test_file(translations_test.cpp/d' \
115                 tests/CMakeLists.txt || die
116
117         if ! use test; then
118                 sed -e "/find_package.*Qt5/s:\ Test::" -i CMakeLists.txt || die
119                 cmake_comment_add_subdirectory tests
120         fi
121
122         rm -r 3rdparty/{libmygpo-qt,libmygpo-qt5,taglib} || die
123 }
124
125 src_configure() {
126         # spotify is not in portage
127         local mycmakeargs=(
128                 -DBUILD_WERROR=OFF
129                 # force to find crypto++ see bug #548544
130                 -DCRYPTOPP_LIBRARIES="cryptopp"
131                 -DCRYPTOPP_FOUND=ON
132                 # avoid automagically enabling of ccache (bug #611010)
133                 -DCCACHE_EXECUTABLE=OFF
134                 -DENABLE_BREAKPAD=OFF  #< disable crash reporting
135                 -DENABLE_DEVICEKIT=OFF
136                 -DENABLE_GIO=ON
137                 -DENABLE_SPOTIFY_BLOB=OFF
138                 -DUSE_SYSTEM_GMOCK=ON
139                 -DUSE_SYSTEM_PROJECTM=ON
140                 -DBUNDLE_PROJECTM_PRESETS=OFF
141                 -DLINGUAS="$(l10n_get_locales)"
142                 -DENABLE_BOX="$(usex box)"
143                 -DENABLE_AUDIOCD="$(usex cdda)"
144                 -DCMAKE_DISABLE_FIND_PACKAGE_Qt5DBus=$(usex !dbus)
145                 -DENABLE_DROPBOX="$(usex dropbox)"
146                 -DENABLE_GOOGLE_DRIVE="$(usex googledrive)"
147                 -DENABLE_LIBGPOD="$(usex ipod)"
148                 -DENABLE_LIBLASTFM="$(usex lastfm)"
149                 -DENABLE_MOODBAR="$(usex moodbar)"
150                 -DENABLE_LIBMTP="$(usex mtp)"
151                 -DENABLE_VISUALISATIONS="$(usex projectm)"
152                 -DENABLE_SEAFILE="$(usex seafile)"
153                 -DENABLE_SKYDRIVE="$(usex skydrive)"
154                 -DENABLE_LIBPULSE="$(usex pulseaudio)"
155                 -DENABLE_UDISKS2="$(usex udisks)"
156                 -DENABLE_WIIMOTEDEV="$(usex wiimote)"
157         )
158
159         use !debug && append-cppflags -DQT_NO_DEBUG_OUTPUT
160
161         cmake_src_configure
162 }
163
164 src_test() {
165         cd "${CMAKE_BUILD_DIR}" || die
166         virtx emake test
167 }
168
169 pkg_postinst() {
170         xdg_pkg_postinst
171
172         elog "Note that list of supported formats is controlled by media-plugins/gst-plugins-meta "
173         elog "USE flags. You may be interested in setting aac, flac, mp3, ogg or wavpack USE flags "
174         elog "depending on your preferences"
175 }