2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, unstableGitUpdater
|
|
|
|
, pkg-config
|
|
|
|
, glfw
|
|
|
|
, libvgm
|
|
|
|
, libX11
|
|
|
|
, libXau
|
|
|
|
, libXdmcp
|
|
|
|
, Carbon
|
|
|
|
, Cocoa
|
|
|
|
, cppunit
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mmlgui";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "unstable-2023-11-16";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "superctr";
|
|
|
|
repo = "mmlgui";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "627bfc7b67d4d87253517ba71df2d699a8acdd10";
|
2022-06-16 17:23:12 +00:00
|
|
|
fetchSubmodules = true;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-d/QLRlSfCrrcvzIhwEBKB5chK+XqO/R8xJ5VfagDi4U=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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' ""
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# Use correct pkg-config
|
|
|
|
substituteInPlace {imgui,libvgm}.mak \
|
|
|
|
--replace 'pkg-config' "\''$(PKG_CONFIG)"
|
|
|
|
|
|
|
|
# Don't force building tests
|
2022-06-16 17:23:12 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace 'all: $(MMLGUI_BIN) test' 'all: $(MMLGUI_BIN)'
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glfw
|
|
|
|
libvgm
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
libX11
|
|
|
|
libXau
|
|
|
|
libXdmcp
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
Carbon
|
|
|
|
Cocoa
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
checkInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
cppunit
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"RELEASE=1"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|