Skip to content

Commit

Permalink
bitwig-studio: Add wrapper to fix onset and beat detection
Browse files Browse the repository at this point in the history
  • Loading branch information
polygon committed Nov 29, 2024
1 parent 39ae3fa commit e861346
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkgs/applications/audio/bitwig-studio/bitwig-studio5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}:

stdenv.mkDerivation rec {
pname = "bitwig-studio";
pname = "bitwig-studio-unwrapped";
version = "5.2.7";

src = fetchurl {
Expand Down
45 changes: 45 additions & 0 deletions pkgs/applications/audio/bitwig-studio/bitwig-wrapper.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
stdenv,
bindfs,
bubblewrap,
mktemp,
writeShellScript,
bitwig-studio-unwrapped,
}:
stdenv.mkDerivation {
inherit (bitwig-studio-unwrapped) version;

pname = "bitwig-studio";

dontUnpack = true;
dontConfigure = true;
dontBuild = true;
dontPatchELF = true;
dontStrip = true;

installPhase =
let
wrapper = writeShellScript "bitwig-studio" ''
set -e
echo "Creating temporary directory"
TMPDIR=$(${mktemp}/bin/mktemp --directory)
echo "Temporary directory: $TMPDIR"
echo "Copying default Vamp Plugin settings"
cp -r ${bitwig-studio-unwrapped}/libexec/resources/VampTransforms $TMPDIR
echo "Changing permissions to be writable"
chmod -R u+w $TMPDIR/VampTransforms
echo "Starting Bitwig Studio in Bubblewrap Environment"
${bubblewrap}/bin/bwrap --bind / / --bind $TMPDIR/VampTransforms ${bitwig-studio-unwrapped}/libexec/resources/VampTransforms ${bitwig-studio-unwrapped}/bin/bitwig-studio || true
echo "Bitwig exited, removing temporary directory"
rm -rf $TMPDIR
'';
in
''
mkdir -p $out/bin
cp ${wrapper} $out/bin/bitwig-studio
cp -r ${bitwig-studio-unwrapped}/share $out
'';
}
6 changes: 5 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13405,10 +13405,14 @@ with pkgs;
bitwig-studio4 = callPackage ../applications/audio/bitwig-studio/bitwig-studio4.nix {
libjpeg = libjpeg8;
};
bitwig-studio5 = callPackage ../applications/audio/bitwig-studio/bitwig-studio5.nix {
bitwig-studio5-unwrapped = callPackage ../applications/audio/bitwig-studio/bitwig-studio5.nix {
libjpeg = libjpeg8;
};

bitwig-studio5 = callPackage ../applications/audio/bitwig-studio/bitwig-wrapper.nix {
bitwig-studio-unwrapped = bitwig-studio5-unwrapped;
};

bitwig-studio = bitwig-studio5;

blackbox = callPackage ../applications/version-management/blackbox {
Expand Down

0 comments on commit e861346

Please sign in to comment.