2024-05-15 15:35:15 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, writeTextFile, cmake, alsa-lib, OpenAL, CoreAudioKit, freepats }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
let
|
|
|
|
defaultCfgPath = "${placeholder "out"}/etc/wildmidi/wildmidi.cfg";
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "wildmidi";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.4.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Mindwerks";
|
|
|
|
repo = "wildmidi";
|
|
|
|
rev = "${pname}-${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-syjs8y75M2ul7whiZxnWMSskRJd0ixFqnep7qsTbiDE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
buildInputs = lib.optionals stdenv.buildPlatform.isLinux [
|
|
|
|
alsa-lib stdenv.cc.libc/*couldn't find libm*/
|
|
|
|
] ++ lib.optionals stdenv.buildPlatform.isDarwin [
|
2024-05-15 15:35:15 +00:00
|
|
|
OpenAL CoreAudioKit
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
2022-09-30 11:47:45 +00:00
|
|
|
# https://github.com/Mindwerks/wildmidi/issues/236
|
|
|
|
substituteInPlace src/wildmidi.pc.in \
|
|
|
|
--replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
|
|
|
|
--replace '$'{exec_prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DWILDMIDI_CFG=${defaultCfgPath}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = let
|
|
|
|
defaultCfg = writeTextFile {
|
|
|
|
name = "wildmidi.cfg";
|
|
|
|
text = ''
|
|
|
|
dir ${freepats}
|
|
|
|
source ${freepats}/freepats.cfg
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in ''
|
|
|
|
mkdir -p "$(dirname ${defaultCfgPath})"
|
|
|
|
ln -s ${defaultCfg} ${defaultCfgPath}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Software MIDI player and library";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "wildmidi";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
WildMIDI is a simple software midi player which has a core softsynth
|
|
|
|
library that can be use with other applications.
|
|
|
|
'';
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://wildmidi.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
# The library is LGPLv3, the wildmidi executable is GPLv3
|
|
|
|
license = licenses.lgpl3;
|
2023-08-04 22:07:22 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|