nixpkgs/pkgs/applications/misc/lenmus/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.2 KiB
Nix
Raw Normal View History

2022-10-30 03:06:09 +00:00
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
2023-01-02 22:24:16 +00:00
, pkg-config
, makeWrapper
2022-10-30 03:06:09 +00:00
, boost
, portmidi
, sqlite
, freetype
, libpng
, pngpp
, zlib
2023-01-02 22:24:16 +00:00
, wxGTK32
2022-10-30 03:06:09 +00:00
, wxsqlite3
2023-01-02 22:24:16 +00:00
, fluidsynth
, fontconfig
, darwin
, soundfont-fluid
, openlilylib-fonts
2016-07-07 12:46:26 +00:00
}:
2023-01-02 22:24:16 +00:00
let
inherit (darwin.apple_sdk.frameworks) Cocoa;
in
2016-07-07 12:46:26 +00:00
stdenv.mkDerivation rec {
pname = "lenmus";
2023-01-02 22:24:16 +00:00
version = "6.0.1";
2016-07-07 12:46:26 +00:00
src = fetchFromGitHub {
owner = "lenmus";
repo = "lenmus";
rev = "Release_${version}";
2023-01-02 22:24:16 +00:00
sha256 = "sha256-qegOAc6vs2+6VViDHVjv0q+qjLZyTT7yPF3hFpTt5zE=";
2016-07-07 12:46:26 +00:00
};
2023-01-02 22:24:16 +00:00
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "/usr" "${placeholder "out"}"
sed -i 's/fixup_bundle.*")/")/g' CMakeLists.txt
'';
2022-10-30 03:06:09 +00:00
nativeBuildInputs = [
cmake
pkg-config
2023-01-02 22:24:16 +00:00
] ++ lib.optionals stdenv.isDarwin [
makeWrapper
2017-09-04 13:05:51 +00:00
];
2016-07-07 12:46:26 +00:00
buildInputs = [
boost
2022-10-30 03:06:09 +00:00
portmidi
sqlite
freetype
libpng
pngpp
zlib
2023-01-02 22:24:16 +00:00
wxGTK32
2022-10-30 03:06:09 +00:00
wxsqlite3
2023-01-02 22:24:16 +00:00
fluidsynth
fontconfig
] ++ lib.optionals stdenv.isDarwin [
Cocoa
2016-07-07 12:46:26 +00:00
];
2023-01-02 22:24:16 +00:00
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; {
2016-07-07 12:46:26 +00:00
description = "LenMus Phonascus is a program for learning music";
longDescription = ''
LenMus Phonascus is a free open source program (GPL v3) for learning music.
It allows you to focus on specific skills and exercises, on both theory and aural training.
The different activities can be customized to meet your needs
'';
homepage = "http://www.lenmus.org/";
2016-07-07 12:46:26 +00:00
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ramkromberg ];
2023-01-02 22:24:16 +00:00
platforms = with platforms; unix;
2016-07-07 12:46:26 +00:00
};
}