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

101 lines
2.8 KiB
Nix
Raw Normal View History

2018-08-04 22:05:42 +01:00
{ stdenv
, a2jmidid
, coreutils
, lib
, libjack2
, fetchpatch
, fetchzip
, jack_capture
2018-08-04 22:05:42 +01:00
, pkgconfig
2020-02-26 16:54:08 +00:00
, pulseaudioFull
2018-08-04 22:05:42 +01:00
, qtbase
, makeWrapper
, mkDerivation
, python3
2018-08-04 22:05:42 +01:00
}:
#ladish missing, claudia can't work.
#pulseaudio needs fixes (patchShebangs .pa ...)
#desktop needs icons and exec fixing.
2018-08-04 22:05:42 +01:00
mkDerivation rec {
2019-12-08 03:13:27 +00:00
version = "0.9.1";
pname = "cadence";
2018-08-04 22:05:42 +01:00
src = fetchzip {
2018-08-04 22:05:42 +01:00
url = "https://github.com/falkTX/Cadence/archive/v${version}.tar.gz";
2019-12-08 03:13:27 +00:00
sha256 = "07z8grnnpkd0nf3y3r6qjlk1jlzrbhdrp9mnhrhhmws54p1bhl20";
2018-08-04 22:05:42 +01:00
};
patches = [
# Fix installation without DESTDIR
(fetchpatch {
url = "https://github.com/falkTX/Cadence/commit/1fd3275e7daf4b75f59ef1f85a9e2e93bd5c0731.patch";
sha256 = "0q791jsh8vmjg678dzhbp1ykq8xrrlxl1mbgs3g8if1ccj210vd8";
})
];
postPatch = ''
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" \
2020-02-26 16:54:08 +00:00
"${lib.makeBinPath[pulseaudioFull]}/pulseaudio"
substituteInPlace ./c++/jackbridge/JackBridge.cpp --replace libjack.so.0 $libjackso
'';
nativeBuildInputs = [
pkgconfig
];
2018-08-04 22:05:42 +01:00
buildInputs = [
qtbase
jack_capture
2020-02-26 16:54:08 +00:00
pulseaudioFull
((python3.withPackages (ps: with ps; [
pyqt5
dbus-python
])))
];
2018-08-04 22:05:42 +01:00
makeFlags = [
"PREFIX=${placeholder "out"}"
"SYSCONFDIR=${placeholder "out"}/etc"
];
2018-08-04 22:05:42 +01:00
dontWrapQtApps = true;
# Replace with our own wrappers. They need to be changed manually since it wouldn't work otherwise.
2019-11-10 07:46:30 +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} \
2020-02-26 16:54:08 +00:00
--prefix PATH : "${lib.makeBinPath [
jack_capture # cadence-render
pulseaudioFull # cadence, cadence-session-start
]}"
'') scriptAndSource;
2018-08-04 22:05:42 +01:00
meta = {
homepage = "https://github.com/falkTX/Cadence/";
2018-08-04 22:05:42 +01:00
description = "Collection of tools useful for audio production";
license = stdenv.lib.licenses.gpl2Plus;
maintainers = with stdenv.lib.maintainers; [ genesis worldofpeace ];
platforms = [ "x86_64-linux" ];
2018-08-04 22:05:42 +01:00
};
}