32 stdenv.mkDerivation rec {
33 pname = "bitwig-studio-unwrapped";
37 name = "bitwig-studio-${version}.deb";
38 url = "https://www.bitwig.com/dl/Bitwig%20Studio/${version}/installer_linux/";
39 hash = "sha256-Tyi7qYhTQ5i6fRHhrmz4yHXSdicd4P4iuF9FRKRhkMI=";
49 dontWrapGApps = true; # we only want $gappsWrapperArgs here
51 buildInputs = with xorg; [
62 # libjpeg8 is required for converting jpeg's to colour palettes
73 (lib.getLib stdenv.cc.cc)
85 cp -r opt/bitwig-studio $out/libexec
86 ln -s $out/libexec/bitwig-studio $out/bin/bitwig-studio
87 cp -r usr/share $out/share
89 # Bitwig includes a copy of libxcb-imdkit.
90 # Removing it will force it to use our version.
91 rm $out/libexec/lib/bitwig-studio/libxcb-imdkit.so.1
93 substitute usr/share/applications/com.bitwig.BitwigStudio.desktop \
94 $out/share/applications/com.bitwig.BitwigStudio.desktop \
95 --replace /usr/bin/bitwig-studio $out/bin/bitwig-studio
101 # patchelf fails to set rpath on BitwigStudioEngine, so we use
102 # the LD_LIBRARY_PATH way
104 find $out -type f -executable \
105 -not -name '*.so.*' \
108 -not -name 'jspawnhelper' \
109 -not -path '*/resources/*' | \
110 while IFS= read -r f ; do
111 patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $f
112 # make xdg-open overrideable at runtime
114 "''${gappsWrapperArgs[@]}" \
115 --prefix PATH : "${lib.makeBinPath [ ffmpeg ]}" \
116 --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \
117 --suffix LD_LIBRARY_PATH : "${lib.strings.makeLibraryPath buildInputs}"
120 find $out -type f -executable -name 'jspawnhelper' | \
121 while IFS= read -r f ; do
122 patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $f
127 description = "Digital audio workstation";
129 Bitwig Studio is a multi-platform music-creation system for
130 production, performance and DJing, with a focus on flexible
131 editing tools and a super-fast workflow.
133 homepage = "https://www.bitwig.com/";
134 license = licenses.unfree;
135 platforms = [ "x86_64-linux" ];
136 maintainers = with maintainers; [
141 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];