View | Details | Raw Unified | Return to bug 246342 | Differences between
and this patch

Collapse All | Expand All

(-)audio/strawberry/Makefile (+107 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	strawberry
4
DISTVERSION=	0.6.11
5
CATEGORIES=	audio
6
MASTER_SITES=	https://files.jkvinge.net/packages/strawberry/
7
8
MAINTAINER=	menelkir@itroll.org
9
COMMENT=	Fork of clementine with many features
10
11
LICENSE=	GPLv3
12
LICENSE_FILE=	${WRKSRC}/COPYING
13
14
BUILD_DEPENDS=	boost-libs>0:devel/boost-libs
15
16
LIB_DEPENDS=	libgnutls.so:security/gnutls \
17
		libprotobuf.so:devel/protobuf \
18
		libtag.so:audio/taglib
19
20
USES=		compiler:c++11-lang cmake desktop-file-utils gnome pkgconfig \
21
		qt:5 sqlite pkgconfig tar:xz xorg
22
USE_GNOME=	glib20
23
USE_QT=		buildtools_build concurrent core dbus gui network qmake_build \
24
		sql testlib_build widgets x11extras
25
USE_XORG=	ice sm x11 xcb xext
26
INSTALLS_ICONS=	yes
27
28
CMAKE_ARGS=	-DUSE_SYSTEM_TAGLIB=ON -DENABLE_UDISKS2=OFF -DENABLE_XINE=OFF
29
30
TEST_TARGET=	strawberry_test
31
32
OPTIONS_DEFINE=	APPLEDEV AUDIOCD IPOD MOODBAR MTPDEV MUSICBRAINZ NLS SUBSONIC \
33
		TEST TIDAL
34
APPLEDEV_IMPLIES=	IPOD
35
MOODBAR_IMPLIES=	GSTREAMER
36
OPTIONS_DEFAULT=	GSTREAMER PULSEAUDIO
37
38
BACKEND_DESC=	Multimedia backend(s)
39
40
OPTIONS_MULTI=	BACKEND SOUND
41
OPTIONS_MULTI_BACKEND=	GSTREAMER VLC
42
OPTIONS_MULTI_SOUND=	ALSA PULSEAUDIO
43
44
APPLEDEV_DESC=		Enable support for more recent Apple devices
45
AUDIOCD_DESC=		Enable support for Audio CDs
46
IPOD_DESC=		Enable support for iPod Classic
47
MTPDEV_DESC=		Enable support for Media Transport Protocol
48
MOODBAR_DESC=		Enable moodbar
49
MUSICBRAINZ_DESC=	Enable tag fetching from MusicBrainz
50
NLS_DESC=		Enable translations
51
SUBSONIC_DESC=		Enable support for Subsonic music streamer
52
TIDAL_DESC=		Enable support for TIDAL music service
53
VLC_DESC=		Multimedia support via (lib)vlc
54
55
APPLEDEV_CMAKE_BOOL=	ENABLE_IMOBILEDEVICE
56
APPLEDEV_LIB_DEPENDS=	libimobiledevice.so:comms/libimobiledevice \
57
			libplist.so:devel/libplist \
58
			libusbmuxd.so:comms/libusbmuxd
59
60
ALSA_CMAKE_BOOL=	ENABLE_ALSA
61
ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
62
63
AUDIOCD_CMAKE_BOOL=	ENABLE_AUDIOCD
64
ALSA_LIB_DEPENDS=	libcdio.so:sysutils/libcdio
65
66
IPOD_CMAKE_BOOL=	ENABLE_LIBGPOD
67
IPOD_LIB_DEPENDS=	libgpod.so:audio/libgpod
68
69
MTPDEV_CMAKE_BOOL=	ENABLE_LIBMTP
70
MTPDEV_LIB_DEPENDS=	libmtp.so:multimedia/libmtp
71
72
MOODBAR_CMAKE_BOOL=	ENABLE_MOODBAR
73
MOODBAR_LIB_DEPENDS=	libfftw3.so:math/fftw3
74
75
MUSICBRAINZ_CMAKE_BOOL=	ENABLE_CHROMAPRINT
76
MUSICBRAINZ_LIB_DEPENDS=	libchromaprint.so:audio/chromaprint
77
78
PULSEAUDIO_CMAKE_BOOL=	ENABLE_PULSE
79
PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
80
81
SUBSONIC_CMAKE_BOOL=	ENABLE_SUBSONIC
82
83
TIDAL_CMAKE_BOOL=	ENABLE_TIDAL
84
85
TEST_LIB_DEPENDS=	libgtest.so:devel/googletest
86
87
VLC_CMAKE_BOOL=		ENABLE_VLC
88
VLC_LIB_DEPENDS=	libvlc.so:multimedia/vlc
89
90
.include <bsd.port.options.mk>
91
92
.if ${PORT_OPTIONS:MGSTREAMER}
93
USE_GSTREAMER1=		yes
94
CMAKE_ARGS+=		-DUSE_GSTREAMER=ON
95
.else
96
CMAKE_ARGS+=		-DUSE_GSTREAMER=OFF
97
.endif
98
99
.if ${PORT_OPTIONS:MNLS}
100
USES+=			gettext-runtime gettext-tools iconv
101
USE_QT+=		linguisttools
102
CMAKE_ARGS+=		-DUSE_TRANSLATIONS=ON
103
.else
104
CMAKE_ARGS+=		-DUSE_TRANSLATIONS=OFF
105
.endif
106
107
.include <bsd.port.mk>
(-)audio/strawberry/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1589641083
2
SHA256 (strawberry-0.6.11.tar.xz) = 84b71b33b5f80b7e86682e49f15289c2c00ab89d47e3722f762dda0d6965a201
3
SIZE (strawberry-0.6.11.tar.xz) = 9295808
(-)audio/strawberry/files/patch-src_collection_collectionmodel.cpp (+84 lines)
Line 0 Link Here
1
--- src/collection/collectionmodel.cpp.orig	2020-05-16 18:39:26 UTC
2
+++ src/collection/collectionmodel.cpp
3
@@ -119,12 +119,14 @@ CollectionModel::CollectionModel(CollectionBackend *ba
4
   }
5
 
6
   QIcon nocover = IconLoader::Load("cdcase");
7
-  no_cover_icon_ = nocover.pixmap(nocover.availableSizes().last()).scaled(kPrettyCoverSize, kPrettyCoverSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
8
-  //no_cover_icon_ = QPixmap(":/pictures/noalbumart.png").scaled(kPrettyCoverSize, kPrettyCoverSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
9
+  if (!nocover.isNull()) {
10
+    no_cover_icon_ = nocover.pixmap(nocover.availableSizes().last()).scaled(kPrettyCoverSize, kPrettyCoverSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
11
+  }
12
 
13
-  if (sIconCache == nullptr) {
14
+  if (app_ && !sIconCache) {
15
     sIconCache = new QNetworkDiskCache(this);
16
     sIconCache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + kPixmapDiskCacheDir);
17
+    connect(app_, SIGNAL(ClearPixmapDiskCache()), SLOT(ClearDiskCache()));
18
   }
19
 
20
   connect(backend_, SIGNAL(SongsDiscovered(SongList)), SLOT(SongsDiscovered(SongList)));
21
@@ -139,8 +141,6 @@ CollectionModel::CollectionModel(CollectionBackend *ba
22
   backend_->UpdateTotalArtistCountAsync();
23
   backend_->UpdateTotalAlbumCountAsync();
24
 
25
-  connect(app_, SIGNAL(ClearPixmapDiskCache()), SLOT(ClearDiskCache()));
26
-
27
   ReloadSettings();
28
 
29
 }
30
@@ -189,7 +189,9 @@ void CollectionModel::ReloadSettings() {
31
 
32
   QPixmapCache::setCacheLimit(MaximumCacheSize(&s, CollectionSettingsPage::kSettingsCacheSize, CollectionSettingsPage::kSettingsCacheSizeUnit, CollectionSettingsPage::kSettingsCacheSizeDefault) / 1024);
33
 
34
-  sIconCache->setMaximumCacheSize(MaximumCacheSize(&s, CollectionSettingsPage::kSettingsDiskCacheSize, CollectionSettingsPage::kSettingsDiskCacheSizeUnit, CollectionSettingsPage::kSettingsDiskCacheSizeDefault));
35
+  if (sIconCache) {
36
+    sIconCache->setMaximumCacheSize(MaximumCacheSize(&s, CollectionSettingsPage::kSettingsDiskCacheSize, CollectionSettingsPage::kSettingsDiskCacheSizeUnit, CollectionSettingsPage::kSettingsDiskCacheSizeDefault));
37
+  }
38
 
39
   s.endGroup();
40
 
41
@@ -510,7 +512,7 @@ void CollectionModel::SongsDeleted(const SongList &son
42
       // Remove from pixmap cache
43
       const QString cache_key = AlbumIconPixmapCacheKey(ItemToIndex(node));
44
       QPixmapCache::remove(cache_key);
45
-      if (use_disk_cache_) sIconCache->remove(QUrl(cache_key));
46
+      if (use_disk_cache_ && sIconCache) sIconCache->remove(QUrl(cache_key));
47
       if (pending_cache_keys_.contains(cache_key)) {
48
         pending_cache_keys_.remove(cache_key);
49
       }
50
@@ -585,7 +587,7 @@ QVariant CollectionModel::AlbumIcon(const QModelIndex 
51
   }
52
 
53
   // Try to load it from the disk cache
54
-  if (use_disk_cache_) {
55
+  if (use_disk_cache_ && sIconCache) {
56
     std::unique_ptr<QIODevice> cache(sIconCache->data(QUrl(cache_key)));
57
     if (cache) {
58
       QImage cached_image;
59
@@ -637,7 +639,7 @@ void CollectionModel::AlbumCoverLoaded(const quint64 i
60
   }
61
 
62
   // If we have a valid cover not already in the disk cache
63
-  if (use_disk_cache_) {
64
+  if (use_disk_cache_ && sIconCache) {
65
     std::unique_ptr<QIODevice> cached_img(sIconCache->data(QUrl(cache_key)));
66
     if (!cached_img && !result.image_scaled.isNull()) {
67
       QNetworkCacheMetaData item_metadata;
68
@@ -1556,6 +1558,7 @@ int CollectionModel::MaximumCacheSize(QSettings *s, co
69
   } while (unit > 0);
70
 
71
   return size;
72
+
73
 }
74
 
75
 void CollectionModel::GetChildSongs(CollectionItem *item, QList<QUrl> *urls, SongList *songs, QSet<int> *song_ids) const {
76
@@ -1686,7 +1689,7 @@ void CollectionModel::TotalAlbumCountUpdatedSlot(const
77
 }
78
 
79
 void CollectionModel::ClearDiskCache() {
80
-  sIconCache->clear();
81
+  if (sIconCache) sIconCache->clear();
82
 }
83
 
84
 QDataStream &operator<<(QDataStream &s, const CollectionModel::Grouping &g) {
(-)audio/strawberry/files/patch-src_organise_organiseformat.cpp (+33 lines)
Line 0 Link Here
1
--- src/organise/organiseformat.cpp.orig	2020-04-27 23:42:16 UTC
2
+++ src/organise/organiseformat.cpp
3
@@ -35,6 +35,7 @@
4
 #include <QPalette>
5
 #include <QValidator>
6
 #include <QTextEdit>
7
+#include <QTextDocument>
8
 #include <QTextFormat>
9
 
10
 #include "core/arraysize.h"
11
@@ -44,8 +45,6 @@
12
 
13
 #include "organiseformat.h"
14
 
15
-class QTextDocument;
16
-
17
 const char *OrganiseFormat::kTagPattern = "\\%([a-zA-Z]*)";
18
 const char *OrganiseFormat::kBlockPattern = "\\{([^{}]+)\\}";
19
 const QStringList OrganiseFormat::kKnownTags = QStringList() << "title"
20
@@ -145,7 +144,12 @@ QString OrganiseFormat::GetFilenameForSong(const Song 
21
 
22
   QFileInfo info(filename);
23
   QString extension = info.suffix();
24
-  QString filepath = info.path() + "/" + info.completeBaseName();
25
+  QString filepath;
26
+  if (!info.path().isEmpty() && info.path() != ".") {
27
+    filepath.append(info.path());
28
+    filepath.append("/");
29
+  }
30
+  filepath.append(info.completeBaseName());
31
 
32
   // Fix any parts of the path that start with dots.
33
   QStringList parts_old = filepath.split("/");
(-)audio/strawberry/files/patch-tests_CMakeLists.txt (+10 lines)
Line 0 Link Here
1
--- tests/CMakeLists.txt.orig	2020-04-27 23:42:17 UTC
2
+++ tests/CMakeLists.txt
3
@@ -87,7 +87,6 @@ if(Qt5Test_FOUND AND GTEST_FOUND AND GMOCK_LIBRARY)
4
   add_test_file(src/song_test.cpp false)
5
   add_test_file(src/collectionbackend_test.cpp false)
6
   add_test_file(src/collectionmodel_test.cpp true)
7
-  add_test_file(src/playlist_test.cpp true)
8
   add_test_file(src/songplaylistitem_test.cpp false)
9
   add_test_file(src/organiseformat_test.cpp false)
10
 
(-)audio/strawberry/files/patch-tests_src_collectionmodel__test.cpp (+29 lines)
Line 0 Link Here
1
--- tests/src/collectionmodel_test.cpp.orig	2020-04-27 23:42:17 UTC
2
+++ tests/src/collectionmodel_test.cpp
3
@@ -75,6 +75,8 @@ class CollectionModelTest : public ::testing::Test {
4
   Song AddSong(const QString& title, const QString& artist, const QString& album, int length) {
5
     Song song;
6
     song.Init(title, artist, album, length);
7
+    song.set_mtime(0);
8
+    song.set_ctime(0);
9
     return AddSong(song);
10
   }
11
 
12
@@ -111,6 +113,8 @@ TEST_F(CollectionModelTest, CompilationAlbums) {
13
   Song song;
14
   song.Init("Title", "Artist", "Album", 123);
15
   song.set_compilation(true);
16
+  song.set_mtime(0);
17
+  song.set_ctime(0);
18
 
19
   AddSong(song);
20
   model_->Init(false);
21
@@ -200,6 +204,8 @@ TEST_F(CollectionModelTest, VariousArtistSongs) {
22
     QString n = QString::number(i+1);
23
     Song song;
24
     song.Init("Title " + n, "Artist " + n, "Album", 0);
25
+    song.set_mtime(0);
26
+    song.set_ctime(0);
27
     songs << song;
28
   }
29
 
(-)audio/strawberry/files/patch-tests_src_organiseformat__test.cpp (+24 lines)
Line 0 Link Here
1
--- tests/src/organiseformat_test.cpp.orig	2019-06-29 18:18:34 UTC
2
+++ tests/src/organiseformat_test.cpp
3
@@ -59,6 +59,7 @@ TEST_F(OrganiseFormatTest, BasicReplace) {
4
   format_.set_format("%album %albumartist %artist %bitrate %comment %composer %performer %grouping %disc %genre %length %samplerate %bitdepth %title %track %year");
5
 
6
   ASSERT_TRUE(format_.IsValid());
7
+
8
   EXPECT_EQ("album_albumartist_artist_123_comment_composer_performer_grouping_789_genre_987_654_32_title_321_2010", format_.GetFilenameForSong(song_));
9
 
10
 }
11
@@ -135,11 +136,12 @@ TEST_F(OrganiseFormatTest, ReplaceNonAscii) {
12
 
13
   format_.set_remove_non_ascii(false);
14
   EXPECT_EQ(QString::fromUtf8("Röyksopp"), format_.GetFilenameForSong(song_));
15
+
16
   format_.set_remove_non_ascii(true);
17
   EXPECT_EQ("Royksopp", format_.GetFilenameForSong(song_));
18
 
19
   song_.set_artist(QString::fromUtf8("Владимир Высоцкий"));
20
-  EXPECT_EQ("_________________", format_.GetFilenameForSong(song_));
21
+  EXPECT_EQ("????????_????????", format_.GetFilenameForSong(song_));
22
 
23
 }
24
 
(-)audio/strawberry/files/patch-tests_src_playlist__test.cpp (+31 lines)
Line 0 Link Here
1
--- tests/src/playlist_test.cpp.orig	2020-04-27 23:42:17 UTC
2
+++ tests/src/playlist_test.cpp
3
@@ -53,15 +53,15 @@ class PlaylistTest : public ::testing::Test {
4
     Song metadata;
5
     metadata.Init(title, artist, album, length);
6
 
7
-    //MockPlaylistItem* ret = new MockPlaylistItem;
8
+    MockPlaylistItem *ret = new MockPlaylistItem;
9
     //EXPECT_CALL(*ret, Metadata()).WillRepeatedly(Return(metadata));
10
 
11
-    //return ret;
12
+    return ret;
13
     return nullptr;
14
   }
15
 
16
-  std::shared_ptr<PlaylistItem> MakeMockItemP(const QString& title, const QString& artist = QString(), const QString& album = QString(), int length = 123) const {
17
-    return std::shared_ptr<PlaylistItem>(MakeMockItem(title, artist, album, length));
18
+  PlaylistItemPtr MakeMockItemP(const QString& title, const QString& artist = QString(), const QString& album = QString(), int length = 123) const {
19
+    return PlaylistItemPtr(MakeMockItem(title, artist, album, length));
20
   }
21
 
22
   Playlist playlist_;
23
@@ -76,7 +76,7 @@ TEST_F(PlaylistTest, Basic) {
24
 TEST_F(PlaylistTest, InsertItems) {
25
 
26
   MockPlaylistItem* item = MakeMockItem("Title", "Artist", "Album", 123);
27
-  std::shared_ptr<PlaylistItem> item_ptr(item);
28
+  PlaylistItemPtr item_ptr(item);
29
 
30
   // Insert the item
31
   EXPECT_EQ(0, playlist_.rowCount(QModelIndex()));
(-)audio/strawberry/pkg-descr (+3 lines)
Line 0 Link Here
1
Strawberry is a fork of clementine with many features.
2
3
WWW: https://www.strawberrymusicplayer.org/
(-)audio/strawberry/pkg-plist (+9 lines)
Line 0 Link Here
1
bin/strawberry
2
bin/strawberry-tagreader
3
share/applications/org.strawberrymusicplayer.strawberry.desktop
4
share/icons/hicolor/128x128/apps/strawberry.png
5
share/icons/hicolor/48x48/apps/strawberry.png
6
share/icons/hicolor/64x64/apps/strawberry.png
7
share/man/man1/strawberry-tagreader.1.gz
8
share/man/man1/strawberry.1.gz
9
share/metainfo/org.strawberrymusicplayer.strawberry.appdata.xml

Return to bug 246342