2023-02-09 11:40:11 +00:00
|
|
|
{ stdenv
|
2021-02-13 14:23:35 +00:00
|
|
|
, lib
|
2020-08-20 17:08:02 +00:00
|
|
|
, fetchFromGitHub
|
2021-02-13 14:23:35 +00:00
|
|
|
, pkg-config
|
2023-02-09 11:40:11 +00:00
|
|
|
, qmake
|
|
|
|
, qt5compat ? null
|
2021-02-13 14:23:35 +00:00
|
|
|
, qtbase
|
2023-02-09 11:40:11 +00:00
|
|
|
, qttools
|
2021-02-13 14:23:35 +00:00
|
|
|
, rtaudio
|
|
|
|
, rtmidi
|
2023-02-09 11:40:11 +00:00
|
|
|
, wrapQtAppsHook
|
2020-08-20 17:08:02 +00:00
|
|
|
}:
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
assert lib.versionAtLeast qtbase.version "6.0" -> qt5compat != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "bambootracker";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "0.6.1";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-08-08 23:34:03 +00:00
|
|
|
owner = "BambooTracker";
|
2020-08-20 17:08:02 +00:00
|
|
|
repo = "BambooTracker";
|
|
|
|
rev = "v${version}";
|
2021-08-08 23:34:03 +00:00
|
|
|
fetchSubmodules = true;
|
2023-02-09 11:40:11 +00:00
|
|
|
hash = "sha256-Ymi1tjJCgStF0Rtseelq/YuTtBs2PrbF898TlbjyYUw=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +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)'
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
qmake
|
|
|
|
qttools
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
|
|
|
rtaudio
|
|
|
|
rtmidi
|
|
|
|
] ++ lib.optionals (lib.versionAtLeast qtbase.version "6.0") [
|
|
|
|
qt5compat
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
qmakeFlags = [
|
|
|
|
"CONFIG+=system_rtaudio"
|
|
|
|
"CONFIG+=system_rtmidi"
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
postConfigure = "make qmake_all";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
# Wrapping the inside of the app bundles, avoiding double-wrapping
|
|
|
|
dontWrapQtApps = stdenv.hostPlatform.isDarwin;
|
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2021-08-08 23:34:03 +00:00
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv $out/{bin,Applications}/BambooTracker.app
|
|
|
|
ln -s $out/{Applications/BambooTracker.app/Contents/MacOS,bin}/BambooTracker
|
2023-02-09 11:40:11 +00:00
|
|
|
wrapQtApp $out/Applications/BambooTracker.app/Contents/MacOS/BambooTracker
|
2021-03-23 19:22:30 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-08-20 17:08:02 +00:00
|
|
|
description = "A tracker for YM2608 (OPNA) which was used in NEC PC-8801/9801 series computers";
|
2021-08-08 23:34:03 +00:00
|
|
|
homepage = "https://bambootracker.github.io/BambooTracker/";
|
|
|
|
license = licenses.gpl2Plus;
|
2020-08-20 17:08:02 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
|
|
|
};
|
|
|
|
}
|