nixpkgs/pkgs/applications/audio/bambootracker/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.9 KiB
Nix
Raw Normal View History

2023-02-06 16:40:45 +00:00
{ stdenv
2021-02-11 19:33:38 +00:00
, lib
2020-07-31 19:45:35 +00:00
, fetchFromGitHub
2021-02-11 19:33:38 +00:00
, pkg-config
2023-02-06 16:40:45 +00:00
, qmake
2023-02-06 16:48:17 +00:00
, qt5compat ? null
2021-02-11 19:33:38 +00:00
, qtbase
2023-02-06 16:40:45 +00:00
, qttools
2021-02-11 19:33:38 +00:00
, rtaudio
, rtmidi
2023-02-06 16:40:45 +00:00
, wrapQtAppsHook
2020-07-31 19:45:35 +00:00
}:
2023-02-06 16:48:17 +00:00
assert lib.versionAtLeast qtbase.version "6.0" -> qt5compat != null;
2023-02-06 16:40:45 +00:00
stdenv.mkDerivation rec {
2020-07-31 19:45:35 +00:00
pname = "bambootracker";
2023-02-06 16:40:45 +00:00
version = "0.6.1";
2020-07-31 19:45:35 +00:00
src = fetchFromGitHub {
2021-08-01 18:35:05 +00:00
owner = "BambooTracker";
2020-07-31 19:45:35 +00:00
repo = "BambooTracker";
rev = "v${version}";
2021-08-01 18:35:05 +00:00
fetchSubmodules = true;
2023-02-06 16:40:45 +00:00
hash = "sha256-Ymi1tjJCgStF0Rtseelq/YuTtBs2PrbF898TlbjyYUw=";
2020-07-31 19:45:35 +00:00
};
2023-02-06 16:48:17 +00:00
postPatch = lib.optionalString (lib.versionAtLeast qtbase.version "6.0") ''
# Work around lrelease finding in qmake being broken by using pre-Qt5.12 code path
# https://github.com/NixOS/nixpkgs/issues/214765
substituteInPlace BambooTracker/lang/lang.pri \
--replace 'equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12)' 'if(true)'
'';
2023-02-06 16:40:45 +00:00
nativeBuildInputs = [
pkg-config
qmake
qttools
wrapQtAppsHook
];
2020-07-31 19:45:35 +00:00
2023-02-06 16:40:45 +00:00
buildInputs = [
qtbase
rtaudio
rtmidi
2023-02-06 16:48:17 +00:00
] ++ lib.optionals (lib.versionAtLeast qtbase.version "6.0") [
qt5compat
2023-02-06 16:40:45 +00:00
];
2020-07-31 19:45:35 +00:00
2023-02-06 16:40:45 +00:00
qmakeFlags = [
"CONFIG+=system_rtaudio"
"CONFIG+=system_rtmidi"
];
2020-07-31 19:45:35 +00:00
2021-02-11 19:33:38 +00:00
postConfigure = "make qmake_all";
2020-07-31 19:45:35 +00:00
2023-02-06 16:40:45 +00:00
# Wrapping the inside of the app bundles, avoiding double-wrapping
dontWrapQtApps = stdenv.hostPlatform.isDarwin;
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
2021-08-01 18:35:05 +00:00
mkdir -p $out/Applications
mv $out/{bin,Applications}/BambooTracker.app
ln -s $out/{Applications/BambooTracker.app/Contents/MacOS,bin}/BambooTracker
2023-02-06 16:40:45 +00:00
wrapQtApp $out/Applications/BambooTracker.app/Contents/MacOS/BambooTracker
'';
meta = with lib; {
2020-07-31 19:45:35 +00:00
description = "A tracker for YM2608 (OPNA) which was used in NEC PC-8801/9801 series computers";
2021-08-01 18:35:05 +00:00
homepage = "https://bambootracker.github.io/BambooTracker/";
license = licenses.gpl2Plus;
2020-07-31 19:45:35 +00:00
platforms = platforms.all;
maintainers = with maintainers; [ OPNA2608 ];
};
}