Unverified Commit 0d5f6044 authored by Cosima Neidahl's avatar Cosima Neidahl Committed by GitHub
Browse files

{opn2,opl3}bankeditor: migrate to by-name (#494872)

parents 5c0f50f4 ce5dcbf1
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 (finalAttrs: {
  pname = "opl3bankeditor";
  version = "1.5.1";

  src = fetchFromGitHub {
    owner = "Wohlstand";
    repo = "opl3bankeditor";
    tag = "v${finalAttrs.version}";
    hash = "sha256-So9g+BDgTvJnEK4DIweEaJoK4uOmmSmyiIfV12lfeSI=";
  };

  prePatch = ''
    dos2unix CMakeLists.txt
  '';

  patches = [
    ./0001-opl3bankeditor-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 "OPL3 Bank Editor.app" $out/Applications/

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

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

  meta = {
    mainProgram = "opl3_bank_editor";
    description = "Small cross-platform editor of the OPL3 FM banks of different formats";
    homepage = "https://github.com/Wohlstand/opl3bankeditor";
    license = lib.licenses.gpl3Plus;
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ OPNA2608 ];
  };
})
+0 −0

File moved.

+69 −0
Original line number Diff line number Diff line
{
  pname,
  chip,
  version,
  sha256,
  extraPatches ? [ ],
}:

{
  mkDerivation,
  stdenv,
  lib,
  fetchFromGitHub,
  dos2unix,
  cmake,
  pkg-config,
  qttools,
  qtbase,
  qwt6_1,
  libsForQt5,
  rtaudio,
  rtmidi,
}:

let
  binname = "${chip} Bank Editor";
  mainProgram = "${lib.strings.toLower chip}_bank_editor";
in
mkDerivation rec {
  inherit pname version;
stdenv.mkDerivation (finalAttrs: {
  pname = "opn2bankeditor";
  version = "1.3";

  src = fetchFromGitHub {
    owner = "Wohlstand";
    repo = pname;
    rev = "v${version}";
    inherit sha256;
    repo = "opn2bankeditor";
    tag = "v${finalAttrs.version}";
    hash = "sha256-YigxCgGIjOrwDxNgcIwiW8d3qHlDyA7o0vUUb5SpKlo=";
  };

  prePatch = ''
    dos2unix CMakeLists.txt
  '';

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

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

  buildInputs = [
    qtbase
    qwt6_1
    libsForQt5.qtbase
    libsForQt5.qwt6_1
    rtaudio
    rtmidi
  ];
@@ -62,19 +51,19 @@ mkDerivation rec {

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

    install_name_tool -change {,${qwt6_1}/lib/}libqwt.6.dylib "$out/Applications/${binname}.app/Contents/MacOS/${binname}"
    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/${binname}.app/Contents/MacOS/${binname}" $out/bin/${mainProgram}
    ln -s "$out/Applications/OPN2 Bank Editor.app/Contents/MacOS/OPN2 Bank Editor" $out/bin/opn2_bank_editor
  '';

  meta = {
    inherit mainProgram;
    description = "Small cross-platform editor of the ${chip} FM banks of different formats";
    homepage = src.meta.homepage;
    mainProgram = "opn2_bank_editor";
    description = "Small cross-platform editor of the OPN2 FM banks of different formats";
    homepage = "https://github.com/Wohlstand/opn2bankeditor";
    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 = "opl3bankeditor";
  chip = "OPL3";
  version = "1.5.1";
  sha256 = "08krbxlxgmc7i2r2k6d6wgi0m6k8hh3j60xf21kz4kp023w613sa";
  extraPatches = [
    ./0001-opl3bankeditor-Look-for-system-installed-Rt-libs.patch
  ];
}
Loading