pianobooster: 1.0.0 -> 1.0.0-unstable-2023-01-22; add ulysseszhan as maintainer (#502407)
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
From aba8b1570051e17e9568cfcc2a2b0ed316e90075 Mon Sep 17 00:00:00 2001
|
||||
From: Adrian Bunk <bunk@debian.org>
|
||||
Date: Sat, 11 Oct 2025 15:39:08 +0300
|
||||
Subject: [PATCH] Bump cmake_minimum_required to support CMake 4
|
||||
|
||||
---
|
||||
CMakeLists.txt | 2 +-
|
||||
src/CMakeLists.txt | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 8432a843..c4bbe56e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmake_minimum_required(VERSION 2.4)
|
||||
+cmake_minimum_required(VERSION 3.5)
|
||||
if(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 02867c8f..23bc9eff 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -10,7 +10,7 @@ else()
|
||||
option(USE_BUNDLED_RTMIDI "Build with bundled rtmidi" ON)
|
||||
endif()
|
||||
|
||||
-cmake_minimum_required(VERSION 2.4)
|
||||
+cmake_minimum_required(VERSION 3.5)
|
||||
if(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
@@ -1,79 +1,100 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
replaceVars,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
pkg-config,
|
||||
alsa-lib,
|
||||
ftgl,
|
||||
freetype,
|
||||
libGLU,
|
||||
rtmidi,
|
||||
libjack2,
|
||||
fluidsynth,
|
||||
soundfont-fluid,
|
||||
soundFonts ? [ soundfont-fluid ],
|
||||
dejavu_fonts,
|
||||
unzip,
|
||||
libsForQt5,
|
||||
qt6,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "pianobooster";
|
||||
version = "1.0.0";
|
||||
version = "1.0.0-unstable-2023-01-22"; # use unstable version for Qt 6 support
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pianobooster";
|
||||
repo = "PianoBooster";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-1WOlAm/HXSL6QK0Kd1mnFEZxxpMseTG+6WzgMNWt+RA=";
|
||||
rev = "6dafdcbdfc5d35d12cecb051c30632d0f5be5806";
|
||||
hash = "sha256-ZOgTgN1CWiPHe9of8NjgoPP5xzAY1k2v9xSAY1m2Bu0=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Bump cmake_minimum_required to support CMake 4
|
||||
# https://github.com/pianobooster/PianoBooster/pull/349
|
||||
./bump-cmake-minimum-required-version.patch
|
||||
# more sensible soundfont discovery
|
||||
(replaceVars ./soundfont.patch {
|
||||
possibleSoundFontFolders = lib.concatMapStringsSep ", " (
|
||||
p: "\"${p}/share/soundfonts\", \"${p}/share/sounds/sf2\""
|
||||
) soundFonts;
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/Settings.cpp src/GuiMidiSetupDialog.cpp \
|
||||
--replace "/usr/share/soundfonts" "${soundfont-fluid}/share/soundfonts" \
|
||||
--replace "FluidR3_GM.sf2" "FluidR3_GM2-2.sf2"
|
||||
substituteInPlace src/CMakeLists.txt --replace-fail "ADD_DEFINITIONS(-std=c++11)" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
]
|
||||
++ (with libsForQt5; [
|
||||
qttools
|
||||
wrapQtAppsHook
|
||||
]);
|
||||
qt6.qttools
|
||||
qt6.wrapQtAppsHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
alsa-lib
|
||||
ftgl
|
||||
freetype # required by ftgl; somehow qt provides freetype on linux but not on darwin
|
||||
libGLU
|
||||
libsForQt5.qtbase
|
||||
qt6.qtbase
|
||||
qt6.qt5compat
|
||||
rtmidi
|
||||
libjack2
|
||||
fluidsynth
|
||||
];
|
||||
]
|
||||
++ lib.optional stdenv.hostPlatform.isLinux alsa-lib;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DOpenGL_GL_PREFERENCE=GLVND"
|
||||
"-DUSE_JACK=ON"
|
||||
(lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5")
|
||||
(lib.cmakeFeature "OpenGL_GL_PREFERENCE" "GLVND")
|
||||
(lib.cmakeFeature "QT_PACKAGE_NAME" "Qt6")
|
||||
(lib.cmakeBool "WITH_MAN" true)
|
||||
(lib.cmakeBool "USE_BUNDLED_RTMIDI" false)
|
||||
(lib.cmakeBool "USE_JACK" true)
|
||||
(lib.cmakeBool "USE_SYSTEM_FONT" true)
|
||||
(lib.cmakeFeature "MACOSX_BUNDLE_GUI_IDENTIFIER" "pianobooster")
|
||||
(lib.cmakeFeature "MACOSX_BUNDLE_SHORT_VERSION_STRING" finalAttrs.version)
|
||||
(lib.cmakeFeature "MACOSX_BUNDLE_BUNDLE_VERSION" finalAttrs.version)
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
qtWrapperArgs+=(
|
||||
--prefix PATH : "${lib.makeBinPath [ unzip ]}"
|
||||
)
|
||||
qtWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ unzip ]}")
|
||||
''
|
||||
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
||||
mkdir -p $out/share/games/pianobooster/fonts
|
||||
# use readlink to avoid referencing dejavu-fonts but dejavu-fonts-minimal instead
|
||||
ln -s $(readlink -f ${dejavu_fonts}/share/fonts/truetype/DejaVuSans.ttf) $out/share/games/pianobooster/fonts/DejaVuSans.ttf
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
mkdir -p $out/{Applications,bin}
|
||||
cp -r build/pianobooster.app $out/Applications
|
||||
ln -s $out/Applications/pianobooster.app/Contents/MacOS/pianobooster $out/bin/pianobooster
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "MIDI file player that teaches you how to play the piano";
|
||||
mainProgram = "pianobooster";
|
||||
homepage = "https://github.com/pianobooster/PianoBooster";
|
||||
homepage = "https://www.pianobooster.org";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = [ ];
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ ulysseszhan ];
|
||||
};
|
||||
})
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
diff --git a/src/GuiMidiSetupDialog.cpp b/src/GuiMidiSetupDialog.cpp
|
||||
index 64d6538..2756611 100644
|
||||
--- a/src/GuiMidiSetupDialog.cpp
|
||||
+++ b/src/GuiMidiSetupDialog.cpp
|
||||
@@ -286,12 +286,7 @@ void GuiMidiSetupDialog::on_fluidLoadButton_clicked ( bool checked )
|
||||
|
||||
lastSoundFont = QDir::homePath();
|
||||
|
||||
- QStringList possibleSoundFontFolders;
|
||||
-#if defined (Q_OS_LINUX) || defined (Q_OS_UNIX)
|
||||
- possibleSoundFontFolders.push_back("/usr/share/soundfonts");
|
||||
- possibleSoundFontFolders.push_back("/usr/share/sounds/sf2");
|
||||
-#endif
|
||||
- for (const QString &soundFontFolder : possibleSoundFontFolders){
|
||||
+ for (const QString &soundFontFolder : {@possibleSoundFontFolders@}){
|
||||
if (QDir(soundFontFolder).exists()){
|
||||
lastSoundFont=soundFontFolder;
|
||||
break;
|
||||
diff --git a/src/Settings.cpp b/src/Settings.cpp
|
||||
index 0bfc649..9b9ea3b 100644
|
||||
--- a/src/Settings.cpp
|
||||
+++ b/src/Settings.cpp
|
||||
@@ -568,7 +568,7 @@ void CSettings::setupDefaultSoundFont(){
|
||||
#if defined (Q_OS_LINUX) || defined (Q_OS_UNIX)
|
||||
if (!defaultSoundFont.isFile())
|
||||
{
|
||||
- QStringList possibleSoundFontFolders = {"/usr/share/soundfonts","/usr/share/sounds/sf2"};
|
||||
+ QStringList possibleSoundFontFolders = {@possibleSoundFontFolders@};
|
||||
for (QString soundFontFolder:possibleSoundFontFolders)
|
||||
{
|
||||
// fluid-soundfont-gm Fluid (R3) General MIDI SoundFont (GM) package
|
||||
Reference in New Issue
Block a user