adlplug,opnplug: Add maintainer, refactor
This commit is contained in:
parent
5a409e8d4a
commit
b6cebef234
|
@ -1,19 +1,48 @@
|
|||
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libjack2, alsa-lib
|
||||
, freetype, libX11, libXrandr, libXinerama, libXext, libXcursor
|
||||
, fetchpatch, fmt
|
||||
, adlplugChip ? "-DADLplug_CHIP=OPL3"
|
||||
, pname ? "ADLplug" }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, cmake
|
||||
, pkg-config
|
||||
, fmt
|
||||
, liblo
|
||||
, alsa-lib
|
||||
, freetype
|
||||
, libX11
|
||||
, libXrandr
|
||||
, libXinerama
|
||||
, libXext
|
||||
, libXcursor
|
||||
, libobjc
|
||||
, Cocoa
|
||||
, CoreServices
|
||||
, WebKit
|
||||
, DiscRecording
|
||||
|
||||
# Enabling JACK requires a JACK server at runtime, no fallback mechanism
|
||||
, withJack ? false, jack
|
||||
|
||||
, type ? "ADL"
|
||||
}:
|
||||
|
||||
assert lib.assertOneOf "type" type [ "ADL" "OPN" ];
|
||||
let
|
||||
chip = {
|
||||
ADL = "OPL3";
|
||||
OPN = "OPN2";
|
||||
}.${type};
|
||||
mainProgram = "${type}plug";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
inherit pname;
|
||||
pname = "${lib.strings.toLower type}plug";
|
||||
version = "1.0.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jpcima";
|
||||
repo = "ADLplug";
|
||||
rev = "v${version}";
|
||||
sha256 = "0mqx4bzri8s880v7jwd24nb93m5i3aklqld0b3h0hjnz0lh2qz0f";
|
||||
fetchSubmodules = true;
|
||||
sha256 = "0mqx4bzri8s880v7jwd24nb93m5i3aklqld0b3h0hjnz0lh2qz0f";
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
@ -25,19 +54,52 @@ stdenv.mkDerivation rec {
|
|||
})
|
||||
];
|
||||
|
||||
cmakeFlags = [ adlplugChip "-DADLplug_USE_SYSTEM_FMT=ON" ];
|
||||
cmakeFlags = [
|
||||
"-DADLplug_CHIP=${chip}"
|
||||
"-DADLplug_USE_SYSTEM_FMT=ON"
|
||||
"-DADLplug_Jack=${if withJack then "ON" else "OFF"}"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
|
||||
"-isystem ${CoreServices}/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers"
|
||||
]);
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libjack2 alsa-lib freetype libX11 libXrandr libXinerama libXext
|
||||
fmt
|
||||
liblo
|
||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
alsa-lib
|
||||
freetype
|
||||
libX11
|
||||
libXrandr
|
||||
libXinerama
|
||||
libXext
|
||||
libXcursor
|
||||
];
|
||||
nativeBuildInputs = [ cmake pkg-config fmt ];
|
||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
libobjc
|
||||
Cocoa
|
||||
CoreServices
|
||||
WebKit
|
||||
DiscRecording
|
||||
] ++ lib.optional withJack jack;
|
||||
|
||||
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
mkdir $out/Applications
|
||||
mv $out/bin/${mainProgram}.app $out/Applications/
|
||||
ln -s $out/{Applications/${mainProgram}.app/Contents/MacOS,bin}/${mainProgram}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "OPL3 and OPN2 FM Chip Synthesizer";
|
||||
inherit mainProgram;
|
||||
description = "${chip} FM Chip Synthesizer";
|
||||
homepage = src.meta.homepage;
|
||||
license = licenses.boost;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ ];
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ OPNA2608 ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -765,15 +765,17 @@ in
|
|||
|
||||
adafruit-ampy = callPackage ../tools/misc/adafruit-ampy { };
|
||||
|
||||
adlplug = callPackage ../applications/audio/adlplug { };
|
||||
adlplug = callPackage ../applications/audio/adlplug {
|
||||
inherit (darwin) libobjc;
|
||||
inherit (darwin.apple_sdk.frameworks) Cocoa CoreServices WebKit DiscRecording;
|
||||
jack = libjack2;
|
||||
};
|
||||
opnplug = adlplug.override {
|
||||
type = "OPN";
|
||||
};
|
||||
|
||||
arc_unpacker = callPackage ../tools/archivers/arc_unpacker { };
|
||||
|
||||
opnplug = callPackage ../applications/audio/adlplug {
|
||||
adlplugChip = "-DADLplug_CHIP=OPN2";
|
||||
pname = "OPNplug";
|
||||
};
|
||||
|
||||
adminer = callPackage ../servers/adminer { };
|
||||
|
||||
advancecomp = callPackage ../tools/compression/advancecomp {};
|
||||
|
|
Loading…
Reference in New Issue
Block a user