2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2020-02-26 07:05:56 +00:00
|
|
|
, libjack2
|
2019-12-29 20:01:34 +00:00
|
|
|
, fetchpatch
|
2021-11-02 10:00:43 +00:00
|
|
|
, fetchFromGitHub
|
2020-02-26 07:05:56 +00:00
|
|
|
, jack_capture
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2020-02-26 16:54:08 +00:00
|
|
|
, pulseaudioFull
|
2018-08-04 21:05:42 +00:00
|
|
|
, qtbase
|
2020-02-26 07:05:56 +00:00
|
|
|
, mkDerivation
|
|
|
|
, python3
|
2018-08-04 21:05:42 +00:00
|
|
|
}:
|
2020-02-26 07:05:56 +00:00
|
|
|
#ladish missing, claudia can't work.
|
|
|
|
#pulseaudio needs fixes (patchShebangs .pa ...)
|
|
|
|
#desktop needs icons and exec fixing.
|
2018-08-04 21:05:42 +00:00
|
|
|
|
2020-02-26 07:05:56 +00:00
|
|
|
mkDerivation rec {
|
2019-12-08 03:13:27 +00:00
|
|
|
version = "0.9.1";
|
2018-11-04 23:32:52 +00:00
|
|
|
pname = "cadence";
|
2018-08-04 21:05:42 +00:00
|
|
|
|
2021-11-02 10:00:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "falkTX";
|
|
|
|
repo = "Cadence";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-QFC4wiVF8wphhrammxtc+VMZJpXY5OGHs6DNa21+6B8=";
|
2018-08-04 21:05:42 +00:00
|
|
|
};
|
|
|
|
|
2019-12-29 20:01:34 +00:00
|
|
|
patches = [
|
|
|
|
# Fix installation without DESTDIR
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/falkTX/Cadence/commit/1fd3275e7daf4b75f59ef1f85a9e2e93bd5c0731.patch";
|
|
|
|
sha256 = "0q791jsh8vmjg678dzhbp1ykq8xrrlxl1mbgs3g8if1ccj210vd8";
|
|
|
|
})
|
2020-12-07 00:05:59 +00:00
|
|
|
# Fix build with Qt 5.15
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/falkTX/Cadence/commit/c167f35fbb76c4246c730b29262a59da73010412.patch";
|
|
|
|
sha256 = "1gm9q6gx03sla5vcnisznc95pjdi2703f8b3mj2kby9rfx2pylyh";
|
|
|
|
})
|
2019-12-29 20:01:34 +00:00
|
|
|
];
|
|
|
|
|
2020-02-26 07:05:56 +00:00
|
|
|
postPatch = ''
|
2021-11-02 10:00:43 +00:00
|
|
|
libjackso=$(realpath ${lib.makeLibraryPath [libjack2]}/libjack.so.0);
|
|
|
|
substituteInPlace ./src/jacklib.py --replace libjack.so.0 $libjackso
|
|
|
|
substituteInPlace ./src/cadence.py --replace "/usr/bin/pulseaudio" \
|
|
|
|
"${lib.makeBinPath[pulseaudioFull]}/pulseaudio"
|
|
|
|
substituteInPlace ./c++/jackbridge/JackBridge.cpp --replace libjack.so.0 $libjackso
|
2020-02-26 07:05:56 +00:00
|
|
|
'';
|
|
|
|
|
2019-11-10 07:41:14 +00:00
|
|
|
nativeBuildInputs = [
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2019-11-10 07:41:14 +00:00
|
|
|
];
|
2018-08-04 21:05:42 +00:00
|
|
|
|
2019-11-10 07:41:14 +00:00
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
2020-02-26 07:05:56 +00:00
|
|
|
jack_capture
|
2020-02-26 16:54:08 +00:00
|
|
|
pulseaudioFull
|
2021-11-02 10:00:43 +00:00
|
|
|
(
|
|
|
|
(python3.withPackages (ps: with ps; [
|
|
|
|
pyqt5
|
|
|
|
dbus-python
|
|
|
|
]))
|
|
|
|
)
|
2019-11-10 07:41:14 +00:00
|
|
|
];
|
2018-08-04 21:05:42 +00:00
|
|
|
|
2019-11-10 07:41:14 +00:00
|
|
|
makeFlags = [
|
2019-12-29 20:01:34 +00:00
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
"SYSCONFDIR=${placeholder "out"}/etc"
|
2019-11-10 07:41:14 +00:00
|
|
|
];
|
2018-08-04 21:05:42 +00:00
|
|
|
|
2019-11-10 07:41:14 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
|
|
|
# Replace with our own wrappers. They need to be changed manually since it wouldn't work otherwise.
|
2021-11-02 10:00:43 +00:00
|
|
|
preFixup =
|
|
|
|
let
|
|
|
|
outRef = placeholder "out";
|
|
|
|
prefix = "${outRef}/share/cadence/src";
|
|
|
|
scriptAndSource = lib.mapAttrs'
|
|
|
|
(script: source:
|
|
|
|
lib.nameValuePair ("${outRef}/bin/" + script) ("${prefix}/" + source)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
"cadence" = "cadence.py";
|
|
|
|
"claudia" = "claudia.py";
|
|
|
|
"catarina" = "catarina.py";
|
|
|
|
"catia" = "catia.py";
|
|
|
|
"cadence-jacksettings" = "jacksettings.py";
|
|
|
|
"cadence-aloop-daemon" = "cadence_aloop_daemon.py";
|
|
|
|
"cadence-logs" = "logs.py";
|
|
|
|
"cadence-render" = "render.py";
|
|
|
|
"claudia-launcher" = "claudia_launcher.py";
|
|
|
|
"cadence-session-start" = "cadence_session_start.py";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
lib.mapAttrsToList
|
|
|
|
(script: source: ''
|
|
|
|
rm -f ${script}
|
|
|
|
makeQtWrapper ${source} ${script} \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [
|
|
|
|
jack_capture # cadence-render
|
|
|
|
pulseaudioFull # cadence, cadence-session-start
|
|
|
|
]}"
|
|
|
|
'')
|
|
|
|
scriptAndSource;
|
2018-08-04 21:05:42 +00:00
|
|
|
|
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/falkTX/Cadence/";
|
2018-08-04 21:05:42 +00:00
|
|
|
description = "Collection of tools useful for audio production";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-05-05 09:25:45 +00:00
|
|
|
maintainers = with lib.maintainers; [ ];
|
2018-11-25 19:14:34 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2018-08-04 21:05:42 +00:00
|
|
|
};
|
|
|
|
}
|