biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / audio / mmlgui / default.nix
blobaab0acb25019d5f160335793d5224693e8e83b4e
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , unstableGitUpdater
5 , pkg-config
6 , glfw
7 , libvgm
8 , libX11
9 , libXau
10 , libXdmcp
11 , Carbon
12 , Cocoa
13 , cppunit
16 stdenv.mkDerivation rec {
17   pname = "mmlgui";
18   version = "unstable-2023-11-16";
20   src = fetchFromGitHub {
21     owner = "superctr";
22     repo = "mmlgui";
23     rev = "627bfc7b67d4d87253517ba71df2d699a8acdd10";
24     fetchSubmodules = true;
25     hash = "sha256-d/QLRlSfCrrcvzIhwEBKB5chK+XqO/R8xJ5VfagDi4U=";
26   };
28   postPatch = ''
29     # Actually wants pkgconf but that seems abit broken:
30     # https://github.com/NixOS/nixpkgs/pull/147503#issuecomment-1055943897
31     # Removing a pkgconf-specific option makes it work with pkg-config
32     substituteInPlace libvgm.mak \
33       --replace '--with-path=/usr/local/lib/pkgconfig' ""
35     # Use correct pkg-config
36     substituteInPlace {imgui,libvgm}.mak \
37       --replace 'pkg-config' "\''$(PKG_CONFIG)"
39     # Don't force building tests
40     substituteInPlace Makefile \
41       --replace 'all: $(MMLGUI_BIN) test' 'all: $(MMLGUI_BIN)'
43     # Breaking change in libvgm
44     substituteInPlace src/emu_player.cpp \
45       --replace 'Resmpl_SetVals(&resmpl, 0xff' 'Resmpl_SetVals(&resmpl, RSMODE_LINEAR'
46   '';
48   strictDeps = true;
50   nativeBuildInputs = [
51     pkg-config
52   ];
54   buildInputs = [
55     glfw
56     libvgm
57   ] ++ lib.optionals stdenv.hostPlatform.isLinux [
58     libX11
59     libXau
60     libXdmcp
61   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
62     Carbon
63     Cocoa
64   ];
66   checkInputs = [
67     cppunit
68   ];
70   makeFlags = [
71     "RELEASE=1"
72   ];
74   enableParallelBuilding = true;
76   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
78   installPhase = ''
79     runHook preInstall
81     install -Dm755 {,$out/}bin/mmlgui
82     mkdir -p $out/share/ctrmml
83     mv ctrmml/sample $out/share/ctrmml/
85     runHook postInstall
86   '';
88   passthru.updateScript = unstableGitUpdater {
89     url = "https://github.com/superctr/mmlgui.git";
90   };
92   meta = with lib; {
93     homepage = "https://github.com/superctr/mmlgui";
94     description = "MML (Music Macro Language) editor and compiler GUI, powered by the ctrmml framework";
95     license = licenses.gpl2Only;
96     maintainers = with maintainers; [ OPNA2608 ];
97     platforms = platforms.all;
98     mainProgram = "mmlgui";
99   };