wildmidi: Enable on Darwin, refactor config
- enable on Darwin (uses OpenAL framework there) - refactor default config - use WriteTextFile and symlink instead of echoing together - set WILDMIDI_CFG cmake variable instead of patching its default value - correct config location - default (and now explicitly-set) location is actually /etc/wildmidi/wildmidi.cfg
This commit is contained in:
parent
29f96cc801
commit
134f4d0a9a
|
@ -1,5 +1,8 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, cmake, alsa-lib, freepats }:
|
{ lib, stdenv, fetchFromGitHub, writeTextFile, cmake, alsa-lib, OpenAL, freepats }:
|
||||||
|
|
||||||
|
let
|
||||||
|
defaultCfgPath = "${placeholder "out"}/etc/wildmidi/wildmidi.cfg";
|
||||||
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "wildmidi";
|
pname = "wildmidi";
|
||||||
version = "0.4.5";
|
version = "0.4.5";
|
||||||
|
@ -13,21 +16,34 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
buildInputs = [ alsa-lib stdenv.cc.libc/*couldn't find libm*/ ];
|
buildInputs = lib.optionals stdenv.buildPlatform.isLinux [
|
||||||
|
alsa-lib stdenv.cc.libc/*couldn't find libm*/
|
||||||
|
] ++ lib.optionals stdenv.buildPlatform.isDarwin [
|
||||||
|
OpenAL
|
||||||
|
];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
substituteInPlace CMakeLists.txt \
|
|
||||||
--replace /etc/wildmidi $out/etc
|
|
||||||
# https://github.com/Mindwerks/wildmidi/issues/236
|
# https://github.com/Mindwerks/wildmidi/issues/236
|
||||||
substituteInPlace src/wildmidi.pc.in \
|
substituteInPlace src/wildmidi.pc.in \
|
||||||
--replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
|
--replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
|
||||||
--replace '$'{exec_prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
--replace '$'{exec_prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
cmakeFlags = [
|
||||||
mkdir "$out"/etc
|
"-DWILDMIDI_CFG=${defaultCfgPath}"
|
||||||
echo "dir ${freepats}" > "$out"/etc/wildmidi.cfg
|
];
|
||||||
echo "source ${freepats}/freepats.cfg" >> "$out"/etc/wildmidi.cfg
|
|
||||||
|
postInstall = let
|
||||||
|
defaultCfg = writeTextFile {
|
||||||
|
name = "wildmidi.cfg";
|
||||||
|
text = ''
|
||||||
|
dir ${freepats}
|
||||||
|
source ${freepats}/freepats.cfg
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in ''
|
||||||
|
mkdir -p "$(dirname ${defaultCfgPath})"
|
||||||
|
ln -s ${defaultCfg} ${defaultCfgPath}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -39,7 +55,7 @@ stdenv.mkDerivation rec {
|
||||||
homepage = "https://wildmidi.sourceforge.net/";
|
homepage = "https://wildmidi.sourceforge.net/";
|
||||||
# The library is LGPLv3, the wildmidi executable is GPLv3
|
# The library is LGPLv3, the wildmidi executable is GPLv3
|
||||||
license = licenses.lgpl3;
|
license = licenses.lgpl3;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.unix;
|
||||||
maintainers = [ maintainers.bjornfor ];
|
maintainers = [ maintainers.bjornfor ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -25059,7 +25059,9 @@ with pkgs;
|
||||||
|
|
||||||
whereami = callPackage ../development/libraries/whereami { };
|
whereami = callPackage ../development/libraries/whereami { };
|
||||||
|
|
||||||
wildmidi = callPackage ../development/libraries/wildmidi { };
|
wildmidi = callPackage ../development/libraries/wildmidi {
|
||||||
|
inherit (darwin.apple_sdk.frameworks) OpenAL;
|
||||||
|
};
|
||||||
|
|
||||||
wiredtiger = callPackage ../development/libraries/wiredtiger { };
|
wiredtiger = callPackage ../development/libraries/wiredtiger { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue