biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / misc / lenmus / default.nix
blob6736f342e89a8a23e4418f975779ee87436f5376
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 , pkg-config
7 , makeWrapper
8 , boost
9 , portmidi
10 , sqlite
11 , freetype
12 , libpng
13 , pngpp
14 , zlib
15 , wxGTK32
16 , wxsqlite3
17 , fluidsynth
18 , fontconfig
19 , darwin
20 , soundfont-fluid
21 , openlilylib-fonts
24 let
25   inherit (darwin.apple_sdk.frameworks) Cocoa;
27 stdenv.mkDerivation rec {
28   pname = "lenmus";
29   version = "6.0.1";
31   src = fetchFromGitHub {
32     owner = "lenmus";
33     repo = "lenmus";
34     rev = "Release_${version}";
35     sha256 = "sha256-qegOAc6vs2+6VViDHVjv0q+qjLZyTT7yPF3hFpTt5zE=";
36   };
38   postPatch = ''
39     substituteInPlace CMakeLists.txt \
40       --replace "/usr" "${placeholder "out"}"
41     sed -i 's/fixup_bundle.*")/")/g' CMakeLists.txt
42   '';
44   nativeBuildInputs = [
45     cmake
46     pkg-config
47   ] ++ lib.optionals stdenv.isDarwin [
48     makeWrapper
49   ];
51   buildInputs = [
52     boost
53     portmidi
54     sqlite
55     freetype
56     libpng
57     pngpp
58     zlib
59     wxGTK32
60     wxsqlite3
61     fluidsynth
62     fontconfig
63   ] ++ lib.optionals stdenv.isDarwin [
64     Cocoa
65   ];
67   preConfigure = ''
68     mkdir res/fonts
69     ln -s ${openlilylib-fonts.bravura}/share/lilypond/*/fonts/otf/Bravura.otf res/fonts/Bravura.otf
70     ln -s ${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 res/sounds/FluidR3_GM.sf2
71   '';
73   cmakeFlags = [
74     "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
75     "-DLENMUS_INSTALL_SOUNDFONT=ON"
76     "-DMAN_INSTALL_DIR=${placeholder "out"}/share/man"
77   ];
79   postInstall = lib.optionalString stdenv.isDarwin ''
80     mkdir -p $out/{Applications,bin}
81     mv $out/lenmus.app $out/Applications
82     mv $out/Resources $out/Applications/lenmus.app/Contents
83     makeWrapper $out/{Applications/lenmus.app/Contents/MacOS,bin}/lenmus
84   '';
86   meta = with lib; {
87     description = "LenMus Phonascus is a program for learning music";
88     longDescription = ''
89       LenMus Phonascus is a free open source program (GPL v3) for learning music.
90       It allows you to focus on specific skills and exercises, on both theory and aural training.
91       The different activities can be customized to meet your needs
92     '';
93     homepage = "http://www.lenmus.org/";
94     license = licenses.gpl3Plus;
95     maintainers = with maintainers;  [ ramkromberg ];
96     platforms = with platforms; unix;
97     mainProgram = "lenmus";
98   };