From 65db75774bcbbd64afe58147e70191003bd3d504 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Wed, 2 Mar 2022 01:12:26 +0100 Subject: [PATCH] mmlgui: init at unstable-2022-05-24 --- pkgs/applications/audio/mmlgui/default.nix | 87 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 11 +++ 2 files changed, 98 insertions(+) create mode 100644 pkgs/applications/audio/mmlgui/default.nix diff --git a/pkgs/applications/audio/mmlgui/default.nix b/pkgs/applications/audio/mmlgui/default.nix new file mode 100644 index 000000000000..0a29b7aad939 --- /dev/null +++ b/pkgs/applications/audio/mmlgui/default.nix @@ -0,0 +1,87 @@ +{ stdenv +, lib +, fetchFromGitHub +, unstableGitUpdater +, pkg-config +, glfw +, libvgm +, libX11 +, libXau +, libXdmcp +, Carbon +, Cocoa +, cppunit +}: + +stdenv.mkDerivation rec { + pname = "mmlgui"; + version = "unstable-2022-05-24"; + + src = fetchFromGitHub { + owner = "superctr"; + repo = "mmlgui"; + rev = "fe2b298c1eddae4cc38096f6c1ba1ccaed562cf1"; + fetchSubmodules = true; + sha256 = "Q34zzZthdThMbduXcc/qMome89mAMrn1Vinr073u4zo="; + }; + + postPatch = '' + # Actually wants pkgconf but that seems abit broken: + # https://github.com/NixOS/nixpkgs/pull/147503#issuecomment-1055943897 + # Removing a pkgconf-specific option makes it work with pkg-config + substituteInPlace libvgm.mak \ + --replace '--with-path=/usr/local/lib/pkgconfig' "" + substituteInPlace Makefile \ + --replace 'all: $(MMLGUI_BIN) test' 'all: $(MMLGUI_BIN)' + ''; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + glfw + libvgm + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXau + libXdmcp + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + Carbon + Cocoa + ]; + + checkInputs = [ + cppunit + ]; + + makeFlags = [ + "RELEASE=1" + ]; + + enableParallelBuilding = true; + + doCheck = true; + + installPhase = '' + runHook preInstall + + install -Dm755 {,$out/}bin/mmlgui + mkdir -p $out/share/ctrmml + mv ctrmml/sample $out/share/ctrmml/ + + runHook postInstall + ''; + + passthru.updateScript = unstableGitUpdater { + url = "https://github.com/superctr/mmlgui.git"; + }; + + meta = with lib; { + homepage = "https://github.com/superctr/mmlgui"; + description = "MML (Music Macro Language) editor and compiler GUI, powered by the ctrmml framework"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 465f72ca18db..5a1a4dcc18ba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28153,6 +28153,17 @@ with pkgs; }; }; + mmlgui = callPackage ../applications/audio/mmlgui { + inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; + libvgm = libvgm.override { + withAllEmulators = false; + emulators = [ + "_PRESET_SMD" + ]; + enableLibplayer = false; + }; + }; + mmsd = callPackage ../tools/networking/mmsd { }; mmtc = callPackage ../applications/audio/mmtc { };