git: d2a73d268202 - main - audio/musescore: update to 4.2.1, latest upstream

From: Adriaan de Groot <adridg_at_FreeBSD.org>
Date: Tue, 27 Feb 2024 18:40:54 UTC
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d2a73d268202c9d49a5258cf09e1285b96e50bae

commit d2a73d268202c9d49a5258cf09e1285b96e50bae
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2024-02-06 12:26:24 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2024-02-27 18:40:50 +0000

    audio/musescore: update to 4.2.1, latest upstream
    
    While here, add a .desktop file as requested in PR 275314 .
---
 audio/musescore/Makefile                           | 30 +++++++++++-----------
 audio/musescore/distinfo                           |  6 ++---
 audio/musescore/files/mscore.desktop               | 19 ++++++++++++++
 audio/musescore/files/patch-CMakeLists.txt         |  6 ++---
 .../files/patch-build_cmake_GetPlatformInfo.cmake  | 10 ++++++++
 .../files/patch-src_framework_ui_CMakeLists.txt    | 11 ++++++++
 ...ui_internal_platform_stub_stubplatformtheme.cpp | 17 ++++++++++++
 ...k_ui_internal_platform_stub_stubplatformtheme.h | 10 ++++++++
 ...export_musicxml_internal_musicxml_exportxml.cpp | 24 +++++++++++++++++
 ...rt_musicxml_internal_musicxml_importmxmlpass1.h | 11 ++++++++
 ..._musicxml_internal_musicxml_musicxmlsupport.cpp | 11 ++++++++
 .../patch-src_project_internal_exporttype.cpp      | 11 ++++++++
 .../files/patch-src_project_internal_exporttype.h  | 13 ++++++++++
 audio/musescore/pkg-plist                          | 22 +++++++++++++++-
 14 files changed, 179 insertions(+), 22 deletions(-)

diff --git a/audio/musescore/Makefile b/audio/musescore/Makefile
index 439eab86a158..97c44adbacbe 100644
--- a/audio/musescore/Makefile
+++ b/audio/musescore/Makefile
@@ -1,30 +1,27 @@
 PORTNAME=	${GH_PROJECT:tl}
 DISTVERSIONPREFIX=	v
-DISTVERSION=	4.1.1
+DISTVERSION=	4.2.1
 CATEGORIES=	audio
 
 MAINTAINER=	adridg@FreeBSD.org
 COMMENT=	Free music composition & notation software
 WWW=		https://musescore.org/
 
-LICENSE=	GPLv2
-LICENSE_FILE=	${WRKSRC}/LICENSE.GPL
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-LIB_DEPENDS=	libmp3lame.so:audio/lame \
-		libsndfile.so:audio/libsndfile \
-		libvorbis.so:audio/libvorbis \
-		libogg.so:audio/libogg \
+LIB_DEPENDS=	libsndfile.so:audio/libsndfile \
 		libasound.so:audio/alsa-lib \
-		libasound_module_pcm_oss.so:audio/alsa-plugins \
-		libfreetype.so:print/freetype2
+		libasound_module_pcm_oss.so:audio/alsa-plugins
 
-USES=		cmake compiler:c++11-lib localbase \
-		pkgconfig qt:5
+USES=		cmake compiler:c++11-lib desktop-file-utils localbase \
+		pkgconfig qt:5 shared-mime-info
 USE_QT=		concurrent core dbus declarative designer graphicaleffects gui \
-		help location network networkauth opengl printsupport \
-		quickcontrols quickcontrols2 scripttools sql svg testlib \
-		webchannel widgets x11extras xml xmlpatterns \
-		buildtools:build linguisttools:build qmake:build uitools:build
+		network networkauth opengl printsupport \
+		quickcontrols quickcontrols2 svg \
+		widgets x11extras xml xmlpatterns \
+		buildtools:build linguisttools:build qmake:build testlib:build \
+		uitools:build
 
 USE_GITHUB=	yes
 GH_PROJECT=	MuseScore
@@ -61,5 +58,8 @@ post-stage:
 		${STAGEDIR}${PREFIX}/lib/cmake/GTest \
 		${STAGEDIR}${PREFIX}/lib/cmake/KDDockWidgets \
 		${STAGEDIR}${PREFIX}/lib/cmake
+	${INSTALL_DATA} ${FILESDIR}/mscore.desktop ${STAGEDIR}${PREFIX}/share/applications/
+	${INSTALL_DATA} ${WRKSRC}/share/icons/AppIcon/MS4_AppIcon_48x48.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/48x48/apps/mscore.png
+
 
 .include <bsd.port.mk>
diff --git a/audio/musescore/distinfo b/audio/musescore/distinfo
index 2116ae3f6857..3dd42479163c 100644
--- a/audio/musescore/distinfo
+++ b/audio/musescore/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1694947674
-SHA256 (musescore-MuseScore-v4.1.1_GH0.tar.gz) = 3e53ce88b98c08422c8f8dc8c71c6e31d1038c2b263649f6647de6fa4269ce9b
-SIZE (musescore-MuseScore-v4.1.1_GH0.tar.gz) = 131007032
+TIMESTAMP = 1707166162
+SHA256 (musescore-MuseScore-v4.2.1_GH0.tar.gz) = 9636b303afdb44228dc6d64dbc14773b60840dec7225602d79b126d97f555680
+SIZE (musescore-MuseScore-v4.2.1_GH0.tar.gz) = 136655690
diff --git a/audio/musescore/files/mscore.desktop b/audio/musescore/files/mscore.desktop
new file mode 100644
index 000000000000..fa147186e624
--- /dev/null
+++ b/audio/musescore/files/mscore.desktop
@@ -0,0 +1,19 @@
+[Desktop Entry]
+Version=1.0
+Name=MuseScore 4.2
+GenericName=Music notation
+GenericName[de]=Notensatz
+GenericName[fr]=Notation musicale
+Comment=Create, play and print sheet music
+Comment[ru]=Визуальный редактор нотных партитур
+Comment[fr]=Gravure de partitions musicales
+Exec=mscore %F
+Icon=mscore
+StartupNotify=true
+StartupWMClass=mscore
+Terminal=false
+Type=Application
+Categories=Qt;Audio;Sequencer;Midi;AudioVideoEditing;Music;AudioVideo;
+Keywords=music;notation;composition;composing;arranging;making;sheet music;music notation software;lead sheet;leadsheet;score;full score;scorewriter;MIDI;musicxml;playback;instrument;
+Keywords[de]=Musik;Noten;Musiknoten;Komposition;Komponieren;Arrangieren;Notenblatt;Notenblätter;Notationsprogramm;Musiknotationsprogramm;Musiknotation;Tabulatur;MIDI;musicxml;Instrument;
+MimeType=application/x-musescore;application/x-musescore+xml;application/vnd.recordare.musicxml;application/vnd.recordare.musicxml+xml;audio/midi;application/x-bww;application/x-biab;application/x-capella;audio/x-gtp;application/x-musedata;application/x-overture;audio/x-ptb;application/x-sf2;application/x-sf3;
diff --git a/audio/musescore/files/patch-CMakeLists.txt b/audio/musescore/files/patch-CMakeLists.txt
index b8b623e3141f..c5d6bebc1720 100644
--- a/audio/musescore/files/patch-CMakeLists.txt
+++ b/audio/musescore/files/patch-CMakeLists.txt
@@ -1,6 +1,6 @@
---- CMakeLists.txt.orig	2023-07-11 13:58:04.000000000 +0000
-+++ CMakeLists.txt	2023-07-26 01:16:10.541419000 +0000
-@@ -46,7 +46,7 @@
+--- CMakeLists.txt.orig	2024-01-23 09:35:14 UTC
++++ CMakeLists.txt
+@@ -48,7 +48,7 @@ set(MUSESCORE_BUILD_CONFIGURATION "app" CACHE STRING "
  # - vtest           - for visual tests (for CI)
  # - utest           - for unit tests (for CI)
  
diff --git a/audio/musescore/files/patch-build_cmake_GetPlatformInfo.cmake b/audio/musescore/files/patch-build_cmake_GetPlatformInfo.cmake
new file mode 100644
index 000000000000..916fa67f98ae
--- /dev/null
+++ b/audio/musescore/files/patch-build_cmake_GetPlatformInfo.cmake
@@ -0,0 +1,10 @@
+--- build/cmake/GetPlatformInfo.cmake.orig	2024-02-06 21:53:14 UTC
++++ build/cmake/GetPlatformInfo.cmake
+@@ -29,6 +29,7 @@ elseif(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
+ elseif(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
+     set(OS_IS_LIN 1)
+ elseif(${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD")
++    set(OS_IS_LIN 1)
+     set(OS_IS_FBSD 1)
+ elseif(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
+     set(OS_IS_MAC 1)
diff --git a/audio/musescore/files/patch-src_framework_ui_CMakeLists.txt b/audio/musescore/files/patch-src_framework_ui_CMakeLists.txt
new file mode 100644
index 000000000000..d120f1ba985d
--- /dev/null
+++ b/audio/musescore/files/patch-src_framework_ui_CMakeLists.txt
@@ -0,0 +1,11 @@
+--- src/framework/ui/CMakeLists.txt.orig	2024-02-08 21:39:07 UTC
++++ src/framework/ui/CMakeLists.txt
+@@ -48,6 +48,8 @@ elseif(OS_IS_LIN)
+     set(PLATFORM_THEME_SRC
+         ${CMAKE_CURRENT_LIST_DIR}/internal/platform/linux/linuxplatformtheme.cpp
+         ${CMAKE_CURRENT_LIST_DIR}/internal/platform/linux/linuxplatformtheme.h
++        ${CMAKE_CURRENT_LIST_DIR}/internal/platform/stub/stubplatformtheme.cpp
++        ${CMAKE_CURRENT_LIST_DIR}/internal/platform/stub/stubplatformtheme.h
+     )
+ else()
+     set(PLATFORM_THEME_SRC
diff --git a/audio/musescore/files/patch-src_framework_ui_internal_platform_stub_stubplatformtheme.cpp b/audio/musescore/files/patch-src_framework_ui_internal_platform_stub_stubplatformtheme.cpp
new file mode 100644
index 000000000000..39ae4afe33a6
--- /dev/null
+++ b/audio/musescore/files/patch-src_framework_ui_internal_platform_stub_stubplatformtheme.cpp
@@ -0,0 +1,17 @@
+--- src/framework/ui/internal/platform/stub/stubplatformtheme.cpp.orig	2024-02-08 19:49:06 UTC
++++ src/framework/ui/internal/platform/stub/stubplatformtheme.cpp
+@@ -25,6 +25,8 @@
+ using namespace mu::ui;
+ using namespace mu::async;
+ 
++namespace mu::ui {
++StubPlatformTheme::~StubPlatformTheme() = default;
+ void StubPlatformTheme::startListening()
+ {
+ }
+@@ -59,4 +61,5 @@ void StubPlatformTheme::applyPlatformStyleOnAppForThem
+ 
+ void StubPlatformTheme::applyPlatformStyleOnWindowForTheme(QWindow*, const ThemeCode&)
+ {
++}
+ }
diff --git a/audio/musescore/files/patch-src_framework_ui_internal_platform_stub_stubplatformtheme.h b/audio/musescore/files/patch-src_framework_ui_internal_platform_stub_stubplatformtheme.h
new file mode 100644
index 000000000000..fd1127ff7dde
--- /dev/null
+++ b/audio/musescore/files/patch-src_framework_ui_internal_platform_stub_stubplatformtheme.h
@@ -0,0 +1,10 @@
+--- src/framework/ui/internal/platform/stub/stubplatformtheme.h.orig	2024-02-08 19:49:29 UTC
++++ src/framework/ui/internal/platform/stub/stubplatformtheme.h
+@@ -29,6 +29,7 @@ namespace mu::ui {
+ class StubPlatformTheme : public IPlatformTheme
+ {
+ public:
++    ~StubPlatformTheme() override;
+     void startListening() override;
+     void stopListening() override;
+ 
diff --git a/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_exportxml.cpp b/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_exportxml.cpp
new file mode 100644
index 000000000000..0a74b5101d82
--- /dev/null
+++ b/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_exportxml.cpp
@@ -0,0 +1,24 @@
+--- src/importexport/musicxml/internal/musicxml/exportxml.cpp.orig	2024-02-05 22:14:10 UTC
++++ src/importexport/musicxml/internal/musicxml/exportxml.cpp
+@@ -3624,8 +3624,8 @@ static void writeBeam(XmlWriter& xml, ChordRest* const
+         // TODO: correctly handle Beam::Mode::AUTO
+         // when equivalent to BEGIN32 or BEGIN64
+         if ((blp < i && bln >= i)
+-            || bmc == BeamMode::BEGIN16 && i > 1
+-            || bmc == BeamMode::BEGIN32 && i > 2) {
++            || (bmc == BeamMode::BEGIN16 && i > 1)
++            || (bmc == BeamMode::BEGIN32 && i > 2)) {
+             text = "begin";
+         } else if (blp < i && bln < i) {
+             if (bln > 0) {
+@@ -3634,8 +3634,8 @@ static void writeBeam(XmlWriter& xml, ChordRest* const
+                 text = "backward hook";
+             }
+         } else if ((blp >= i && bln < i)
+-                   || bmn == BeamMode::BEGIN16 && i > 1
+-                   || bmn == BeamMode::BEGIN32 && i > 2) {
++                   || (bmn == BeamMode::BEGIN16 && i > 1)
++                   || (bmn == BeamMode::BEGIN32 && i > 2)) {
+             text = "end";
+         } else if (blp >= i && bln >= i) {
+             text = "continue";
diff --git a/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_importmxmlpass1.h b/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_importmxmlpass1.h
new file mode 100644
index 000000000000..981fcbdfce7d
--- /dev/null
+++ b/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_importmxmlpass1.h
@@ -0,0 +1,11 @@
+--- src/importexport/musicxml/internal/musicxml/importmxmlpass1.h.orig	2024-02-05 22:17:12 UTC
++++ src/importexport/musicxml/internal/musicxml/importmxmlpass1.h
+@@ -179,7 +179,7 @@ class MusicXMLParserPass1 (public)
+     bool hasBeamingInfo() const { return _hasBeamingInfo; }
+     bool isVocalStaff(const QString& id) const { return _parts[id].isVocalStaff(); }
+     static VBox* createAndAddVBoxForCreditWords(Score* const score, const int miny = 0, const int maxy = 75);
+-    const int maxDiff() { return _maxDiff; }
++    int maxDiff() const { return _maxDiff; }
+     void insertAdjustedDuration(Fraction key, Fraction value) { _adjustedDurations.insert(key, value); }
+     QMap<Fraction, Fraction>& adjustedDurations() { return _adjustedDurations; }
+     void insertSeenDenominator(int val) { _seenDenominators.emplace(val); }
diff --git a/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_musicxmlsupport.cpp b/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_musicxmlsupport.cpp
new file mode 100644
index 000000000000..4e019cc2fc82
--- /dev/null
+++ b/audio/musescore/files/patch-src_importexport_musicxml_internal_musicxml_musicxmlsupport.cpp
@@ -0,0 +1,11 @@
+--- src/importexport/musicxml/internal/musicxml/musicxmlsupport.cpp.orig	2024-02-05 22:18:41 UTC
++++ src/importexport/musicxml/internal/musicxml/musicxmlsupport.cpp
+@@ -34,6 +34,8 @@
+ 
+ #include "log.h"
+ 
++#include <QXmlStreamReader>
++
+ using AccidentalType = mu::engraving::AccidentalType;
+ using SymId = mu::engraving::SymId;
+ const static QMap<QString, AccidentalType> smuflAccidentalTypes {
diff --git a/audio/musescore/files/patch-src_project_internal_exporttype.cpp b/audio/musescore/files/patch-src_project_internal_exporttype.cpp
new file mode 100644
index 000000000000..1034c87b3122
--- /dev/null
+++ b/audio/musescore/files/patch-src_project_internal_exporttype.cpp
@@ -0,0 +1,11 @@
+--- src/project/internal/exporttype.cpp.orig	2024-02-27 16:37:17 UTC
++++ src/project/internal/exporttype.cpp
+@@ -21,6 +21,8 @@
+  */
+ #include "exporttype.h"
+ 
++#include <QVariantList>
++
+ using namespace mu::project;
+ 
+ ExportTypeList::ExportTypeList()
diff --git a/audio/musescore/files/patch-src_project_internal_exporttype.h b/audio/musescore/files/patch-src_project_internal_exporttype.h
new file mode 100644
index 000000000000..7a1328924b72
--- /dev/null
+++ b/audio/musescore/files/patch-src_project_internal_exporttype.h
@@ -0,0 +1,13 @@
+--- src/project/internal/exporttype.h.orig	2024-01-23 09:35:14 UTC
++++ src/project/internal/exporttype.h
+@@ -26,6 +26,10 @@
+ 
+ #include "containers.h"
+ 
++#include <QList>
++#include <QString>
++#include <QVariantList>
++
+ namespace mu::project {
+ struct ExportType;
+ class ExportTypeList : public QList<ExportType>
diff --git a/audio/musescore/pkg-plist b/audio/musescore/pkg-plist
index afc888604a76..35723dfc6321 100644
--- a/audio/musescore/pkg-plist
+++ b/audio/musescore/pkg-plist
@@ -1,5 +1,20 @@
 bin/mscore
-bin/musescore
+share/applications/mscore.desktop
+share/applications/org.musescore.MuseScore.desktop
+share/icons/hicolor/128x128/apps/mscore.png
+share/icons/hicolor/16x16/apps/mscore.png
+share/icons/hicolor/24x24/apps/mscore.png
+share/icons/hicolor/32x32/apps/mscore.png
+share/icons/hicolor/48x48/apps/mscore.png
+share/icons/hicolor/512x512/apps/mscore.png
+share/icons/hicolor/512x512/mimetypes/application-x-musescore+xml.png
+share/icons/hicolor/512x512/mimetypes/application-x-musescore.png
+share/icons/hicolor/64x64/apps/mscore.png
+share/icons/hicolor/96x96/apps/mscore.png
+share/man/man1/mscore.1.gz
+share/man/man1/musescore.1.gz
+share/metainfo/org.musescore.MuseScore.appdata.xml
+share/mime/packages/musescore.xml
 %%DATADIR%%/autobotscripts/TC1.1_CreateSimpleScore.js
 %%DATADIR%%/autobotscripts/TC1.2_CreateSimpleScoreWithRandomInstruments.js
 %%DATADIR%%/autobotscripts/TC2_CreateSimpleScoreByTemplate.js
@@ -20,6 +35,7 @@ bin/musescore
 %%DATADIR%%/autobotscripts/steps/Score.js
 %%DATADIR%%/instruments/instruments.xml
 %%DATADIR%%/instruments/orders.xml
+%%DATADIR%%/instruments/string_tunings_presets.json
 %%DATADIR%%/locale/instruments_af.qm
 %%DATADIR%%/locale/instruments_ar.qm
 %%DATADIR%%/locale/instruments_ar_DZ.qm
@@ -36,6 +52,7 @@ bin/musescore
 %%DATADIR%%/locale/instruments_da.qm
 %%DATADIR%%/locale/instruments_de.qm
 %%DATADIR%%/locale/instruments_el.qm
+%%DATADIR%%/locale/instruments_en.qm
 %%DATADIR%%/locale/instruments_en_GB.qm
 %%DATADIR%%/locale/instruments_en_US.qm
 %%DATADIR%%/locale/instruments_eo.qm
@@ -66,6 +83,7 @@ bin/musescore
 %%DATADIR%%/locale/instruments_lv.qm
 %%DATADIR%%/locale/instruments_ml.qm
 %%DATADIR%%/locale/instruments_mn_MN.qm
+%%DATADIR%%/locale/instruments_mt.qm
 %%DATADIR%%/locale/instruments_nb.qm
 %%DATADIR%%/locale/instruments_nl.qm
 %%DATADIR%%/locale/instruments_nn.qm
@@ -105,6 +123,7 @@ bin/musescore
 %%DATADIR%%/locale/musescore_da.qm
 %%DATADIR%%/locale/musescore_de.qm
 %%DATADIR%%/locale/musescore_el.qm
+%%DATADIR%%/locale/musescore_en.qm
 %%DATADIR%%/locale/musescore_en_GB.qm
 %%DATADIR%%/locale/musescore_en_US.qm
 %%DATADIR%%/locale/musescore_eo.qm
@@ -135,6 +154,7 @@ bin/musescore
 %%DATADIR%%/locale/musescore_lv.qm
 %%DATADIR%%/locale/musescore_ml.qm
 %%DATADIR%%/locale/musescore_mn_MN.qm
+%%DATADIR%%/locale/musescore_mt.qm
 %%DATADIR%%/locale/musescore_nb.qm
 %%DATADIR%%/locale/musescore_nl.qm
 %%DATADIR%%/locale/musescore_nn.qm