diff options
Diffstat (limited to 'pkgs/tools/audio/opl3bankeditor/common.nix')
-rw-r--r-- | pkgs/tools/audio/opl3bankeditor/common.nix | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/tools/audio/opl3bankeditor/common.nix b/pkgs/tools/audio/opl3bankeditor/common.nix new file mode 100644 index 00000000000..9f6972ce954 --- /dev/null +++ b/pkgs/tools/audio/opl3bankeditor/common.nix @@ -0,0 +1,69 @@ +{ pname, chip, version, sha256, extraPatches ? [] }: + +{ mkDerivation +, stdenv +, lib +, fetchFromGitHub +, dos2unix +, cmake +, pkg-config +, qttools +, qtbase +, qwt +, rtaudio +, rtmidi +}: + +let + binname = "${chip} Bank Editor"; + mainProgram = "${lib.strings.toLower chip}_bank_editor"; +in +mkDerivation rec { + inherit pname version; + + src = fetchFromGitHub { + owner = "Wohlstand"; + repo = pname; + rev = "v${version}"; + inherit sha256; + }; + + prePatch = '' + dos2unix CMakeLists.txt + ''; + + patches = extraPatches; + + nativeBuildInputs = [ + dos2unix + cmake + pkg-config + qttools + ]; + + buildInputs = [ + qtbase + qwt + rtaudio + rtmidi + ]; + + postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir $out/{bin,Applications} + mv "${binname}.app" $out/Applications/ + + install_name_tool -change {,${qwt}/lib/}libqwt.6.dylib "$out/Applications/${binname}.app/Contents/MacOS/${binname}" + wrapQtApp "$out/Applications/${binname}.app/Contents/MacOS/${binname}" + + ln -s "$out/Applications/${binname}.app/Contents/MacOS/${binname}" $out/bin/${mainProgram} + ''; + + meta = with lib; { + inherit mainProgram; + description = "A small cross-platform editor of the ${chip} FM banks of different formats"; + homepage = src.meta.homepage; + license = licenses.gpl3Plus; + platforms = platforms.all; + maintainers = with maintainers; [ OPNA2608 ]; + }; +} |