lenmus: 5.4.2 -> 6.0.1

This commit is contained in:
Weijia Wang 2023-01-02 23:24:16 +01:00
parent 1ca08d4c63
commit 68fcd4d1a9

View file

@ -1,9 +1,10 @@
{ lib { lib
, stdenv , stdenv
, pkg-config
, fetchFromGitHub , fetchFromGitHub
, fetchpatch , fetchpatch
, cmake , cmake
, pkg-config
, makeWrapper
, boost , boost
, portmidi , portmidi
, sqlite , sqlite
@ -11,40 +12,40 @@
, libpng , libpng
, pngpp , pngpp
, zlib , zlib
, wxGTK30 , wxGTK32
, wxsqlite3 , wxsqlite3
, fluidsynth
, fontconfig
, darwin
, soundfont-fluid
, openlilylib-fonts
}: }:
let
inherit (darwin.apple_sdk.frameworks) Cocoa;
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "lenmus"; pname = "lenmus";
version = "5.4.2"; version = "6.0.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "lenmus"; owner = "lenmus";
repo = "lenmus"; repo = "lenmus";
rev = "Release_${version}"; rev = "Release_${version}";
sha256 = "1n639xr1qxx6rhqs0c6sjxp3bv8cwkmw1vfk1cji7514gj2a9v3p"; sha256 = "sha256-qegOAc6vs2+6VViDHVjv0q+qjLZyTT7yPF3hFpTt5zE=";
}; };
patches = [ postPatch = ''
(fetchpatch { substituteInPlace CMakeLists.txt \
url = "https://github.com/lenmus/lenmus/commit/421760d84694a0e6e72d0e9b1d4fd30a7e129c6f.patch"; --replace "/usr" "${placeholder "out"}"
sha256 = "1z1wwh0pcr8w1zlr8swx99si9y2kxx5bmavgwvy6bvdhxgm58yqs"; sed -i 's/fixup_bundle.*")/")/g' CMakeLists.txt
}) '';
(fetchpatch {
url = "https://github.com/lenmus/lenmus/commit/6613d20d4051effc782203c9c6d92962a3f66b5f.patch";
sha256 = "01vvzzpamv90jpqbbq1f2m2b4gb9xab9z70am8i41d90nqvg6agn";
})
(fetchpatch {
url = "https://github.com/lenmus/lenmus/commit/37ee8ac9c8faff65a14e8f7ed2bc22e6dc48d91f.patch";
includes = [ "src/app/lenmus_midi_wizard.cpp" ];
sha256 = "sha256-nlT6ZbSCIXUk2Ufv/SDn2A0Rt+s/7m+7l9HOoQmaIhc=";
})
];
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
pkg-config pkg-config
] ++ lib.optionals stdenv.isDarwin [
makeWrapper
]; ];
buildInputs = [ buildInputs = [
@ -55,10 +56,33 @@ stdenv.mkDerivation rec {
libpng libpng
pngpp pngpp
zlib zlib
wxGTK30 wxGTK32
wxsqlite3 wxsqlite3
fluidsynth
fontconfig
] ++ lib.optionals stdenv.isDarwin [
Cocoa
]; ];
preConfigure = ''
mkdir res/fonts
ln -s ${openlilylib-fonts.bravura}/share/lilypond/*/fonts/otf/Bravura.otf res/fonts/Bravura.otf
ln -s ${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 res/sounds/FluidR3_GM.sf2
'';
cmakeFlags = [
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
"-DLENMUS_INSTALL_SOUNDFONT=ON"
"-DMAN_INSTALL_DIR=${placeholder "out"}/share/man"
];
postInstall = lib.optionalString stdenv.isDarwin ''
mkdir -p $out/{Applications,bin}
mv $out/lenmus.app $out/Applications
mv $out/Resources $out/Applications/lenmus.app/Contents
makeWrapper $out/{Applications/lenmus.app/Contents/MacOS,bin}/lenmus
'';
meta = with lib; { meta = with lib; {
description = "LenMus Phonascus is a program for learning music"; description = "LenMus Phonascus is a program for learning music";
longDescription = '' longDescription = ''
@ -69,6 +93,6 @@ stdenv.mkDerivation rec {
homepage = "http://www.lenmus.org/"; homepage = "http://www.lenmus.org/";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
maintainers = with maintainers; [ ramkromberg ]; maintainers = with maintainers; [ ramkromberg ];
platforms = with platforms; linux; platforms = with platforms; unix;
}; };
} }