From 7e63e254a1557075b3deaecfb38c9c778718204b Mon Sep 17 00:00:00 2001 From: Bignaux Ronan Date: Wed, 26 Feb 2020 08:05:56 +0100 Subject: [PATCH 1/2] cadence: fix dbus,libjack and missing dependancies --- pkgs/applications/audio/cadence/default.nix | 37 +++++++++++++++------ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/audio/cadence/default.nix b/pkgs/applications/audio/cadence/default.nix index 52f5a6540e8b..3cde3d9009ce 100644 --- a/pkgs/applications/audio/cadence/default.nix +++ b/pkgs/applications/audio/cadence/default.nix @@ -1,15 +1,23 @@ { stdenv -, mkDerivation +, a2jmidid +, coreutils , lib +, libjack2 , fetchpatch , fetchzip +, jack_capture , pkgconfig +, pulseaudio , qtbase , makeWrapper -, python3Packages +, mkDerivation +, python3 }: +#ladish missing, claudia can't work. +#pulseaudio needs fixes (patchShebangs .pa ...) +#desktop needs icons and exec fixing. - mkDerivation rec { +mkDerivation rec { version = "0.9.1"; pname = "cadence"; @@ -26,12 +34,25 @@ }) ]; + 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" \ + "${lib.makeBinPath[pulseaudio]}/pulseaudio" + substituteInPlace ./c++/jackbridge/JackBridge.cpp --replace libjack.so.0 $libjackso + ''; + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ qtbase + jack_capture + ((python3.withPackages (ps: with ps; [ + pyqt5 + dbus-python + ]))) ]; makeFlags = [ @@ -39,10 +60,6 @@ "SYSCONFDIR=${placeholder "out"}/etc" ]; - propagatedBuildInputs = with python3Packages; [ - pyqt5_with_qtwebkit - ]; - dontWrapQtApps = true; # Replace with our own wrappers. They need to be changed manually since it wouldn't work otherwise. @@ -65,10 +82,8 @@ }; in lib.mapAttrsToList (script: source: '' rm -f ${script} - makeWrapper ${python3Packages.python.interpreter} ${script} \ - --set PYTHONPATH "$PYTHONPATH:${outRef}/share/cadence" \ - ''${qtWrapperArgs[@]} \ - --add-flags "-O ${source}" + makeQtWrapper ${source} ${script} \ + --prefix PATH : "${lib.makeBinPath [jack_capture]}" '') scriptAndSource; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dbe63bdee2dd..295e44549442 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18286,7 +18286,7 @@ in azpainter = callPackage ../applications/graphics/azpainter { }; - cadence = libsForQt5.callPackage ../applications/audio/cadence { }; + cadence = qt5.callPackage ../applications/audio/cadence { }; milkytracker = callPackage ../applications/audio/milkytracker { }; From 368c8ae3980fffda8eda3d39e0c358f1b8acd031 Mon Sep 17 00:00:00 2001 From: Bignaux Ronan Date: Wed, 26 Feb 2020 17:54:08 +0100 Subject: [PATCH 2/2] cadence: fix pulseaudio bridge --- pkgs/applications/audio/cadence/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/audio/cadence/default.nix b/pkgs/applications/audio/cadence/default.nix index 3cde3d9009ce..7aa2872224d7 100644 --- a/pkgs/applications/audio/cadence/default.nix +++ b/pkgs/applications/audio/cadence/default.nix @@ -7,7 +7,7 @@ , fetchzip , jack_capture , pkgconfig -, pulseaudio +, pulseaudioFull , qtbase , makeWrapper , mkDerivation @@ -38,7 +38,7 @@ mkDerivation rec { 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[pulseaudio]}/pulseaudio" + "${lib.makeBinPath[pulseaudioFull]}/pulseaudio" substituteInPlace ./c++/jackbridge/JackBridge.cpp --replace libjack.so.0 $libjackso ''; @@ -49,6 +49,7 @@ mkDerivation rec { buildInputs = [ qtbase jack_capture + pulseaudioFull ((python3.withPackages (ps: with ps; [ pyqt5 dbus-python @@ -83,7 +84,10 @@ mkDerivation rec { in lib.mapAttrsToList (script: source: '' rm -f ${script} makeQtWrapper ${source} ${script} \ - --prefix PATH : "${lib.makeBinPath [jack_capture]}" + --prefix PATH : "${lib.makeBinPath [ + jack_capture # cadence-render + pulseaudioFull # cadence, cadence-session-start + ]}" '') scriptAndSource; meta = {