Unverified Commit 6f5cef5c authored by Guy Chronister's avatar Guy Chronister
Browse files

opn2bankeditor: migrate to by-name, hardcode values

parent d97f4dd2
Loading
Loading
Loading
Loading
+0 −0

File moved.

+69 −0
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  fetchFromGitHub,
  dos2unix,
  cmake,
  pkg-config,
  libsForQt5,
  rtaudio,
  rtmidi,
}:

stdenv.mkDerivation rec {
  pname = "opn2bankeditor";
  version = "1.3";

  src = fetchFromGitHub {
    owner = "Wohlstand";
    repo = "opn2bankeditor";
    rev = "v${version}";
    sha256 = "0niam6a6y57msbl0xj23g6l7gisv4a670q0k1zqfm34804532a32";
  };

  prePatch = ''
    dos2unix CMakeLists.txt
  '';

  patches = [
    ./0001-opn2bankeditor-Look-for-system-installed-Rt-libs.patch
  ];

  nativeBuildInputs = [
    dos2unix
    cmake
    pkg-config
    libsForQt5.qttools
    libsForQt5.wrapQtAppsHook
  ];

  buildInputs = [
    libsForQt5.qtbase
    libsForQt5.qwt6_1
    rtaudio
    rtmidi
  ];

  postPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace-fail "cmake_minimum_required(VERSION 3.2)" "cmake_minimum_required(VERSION 3.10)"
  '';

  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
    mkdir $out/{bin,Applications}
    mv "OPN2 Bank Editor.app" $out/Applications/

    install_name_tool -change {,${libsForQt5.qwt6_1}/lib/}libqwt.6.dylib "$out/Applications/OPN2 Bank Editor.app/Contents/MacOS/OPN2 Bank Editor"

    ln -s "$out/Applications/OPN2 Bank Editor.app/Contents/MacOS/OPN2 Bank Editor" $out/bin/opn2_bank_editor
  '';

  meta = {
    mainProgram = "opn2_bank_editor";
    description = "Small cross-platform editor of the OPN2 FM banks of different formats";
    homepage = src.meta.homepage;
    license = lib.licenses.gpl3Plus;
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ OPNA2608 ];
  };
}
+0 −9
Original line number Diff line number Diff line
import ./common.nix {
  pname = "opn2bankeditor";
  chip = "OPN2";
  version = "1.3";
  sha256 = "0niam6a6y57msbl0xj23g6l7gisv4a670q0k1zqfm34804532a32";
  extraPatches = [
    ./0001-opn2bankeditor-Look-for-system-installed-Rt-libs.patch
  ];
}
+0 −2
Original line number Diff line number Diff line
@@ -3180,8 +3180,6 @@ with pkgs;

  optifine = optifinePackages.optifine-latest;

  opn2bankeditor = libsForQt5.callPackage ../tools/audio/opl3bankeditor/opn2bankeditor.nix { };

  p4c = callPackage ../development/compilers/p4c {
    protobuf = protobuf_21;
  };