2021-06-10 02:57:09 +00:00
|
|
|
|
{ stdenv, fetchurl, alsa-lib, bzip2, cairo, dpkg, freetype, gdk-pixbuf
|
2019-01-27 15:15:54 +00:00
|
|
|
|
, wrapGAppsHook, gtk2, gtk3, harfbuzz, jdk, lib, xorg
|
2021-04-30 14:02:05 +00:00
|
|
|
|
, libbsd, libjack2, libpng, ffmpeg
|
2018-01-02 05:10:41 +00:00
|
|
|
|
, libxkbcommon
|
2019-01-06 09:04:08 +00:00
|
|
|
|
, makeWrapper, pixman, autoPatchelfHook
|
2021-02-01 08:05:09 +00:00
|
|
|
|
, xdg-utils, zenity, zlib }:
|
2016-08-17 11:23:48 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
|
pname = "bitwig-studio";
|
2018-01-02 05:10:41 +00:00
|
|
|
|
version = "1.3.16";
|
2016-08-17 11:23:48 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-01-02 05:10:41 +00:00
|
|
|
|
url = "https://downloads.bitwig.com/stable/${version}/bitwig-studio-${version}.deb";
|
|
|
|
|
sha256 = "0n0fxh9gnmilwskjcayvjsjfcs3fz9hn00wh7b3gg0cv3qqhich8";
|
2016-08-17 11:23:48 +00:00
|
|
|
|
};
|
|
|
|
|
|
2019-01-27 15:15:54 +00:00
|
|
|
|
nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook wrapGAppsHook ];
|
2016-08-17 11:23:48 +00:00
|
|
|
|
|
|
|
|
|
unpackCmd = "mkdir root ; dpkg-deb -x $curSrc root";
|
|
|
|
|
|
2018-01-02 05:10:41 +00:00
|
|
|
|
dontBuild = true;
|
2019-01-27 15:15:54 +00:00
|
|
|
|
dontWrapGApps = true; # we only want $gappsWrapperArgs here
|
2016-08-17 11:23:48 +00:00
|
|
|
|
|
2019-01-06 09:04:08 +00:00
|
|
|
|
buildInputs = with xorg; [
|
2021-06-10 02:57:09 +00:00
|
|
|
|
alsa-lib bzip2.out cairo freetype gdk-pixbuf gtk2 gtk3 harfbuzz libX11 libXau
|
2018-01-02 05:10:41 +00:00
|
|
|
|
libXcursor libXdmcp libXext libXfixes libXrender libbsd libjack2 libpng libxcb
|
|
|
|
|
libxkbfile pixman xcbutil xcbutilwm zlib
|
2016-08-17 11:23:48 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
|
mkdir -p $out
|
|
|
|
|
cp -r opt/bitwig-studio $out/libexec
|
|
|
|
|
|
|
|
|
|
# Use NixOS versions of these libs instead of the bundled ones.
|
|
|
|
|
(
|
|
|
|
|
cd $out/libexec/lib/bitwig-studio
|
|
|
|
|
rm libbz2.so* libxkbfile.so* libXcursor.so* libXau.so* \
|
|
|
|
|
libXdmcp.so* libpng16.so* libxcb*.so* libharfbuzz.so* \
|
|
|
|
|
libcairo.so* libfreetype.so*
|
|
|
|
|
ln -s ${bzip2.out}/lib/libbz2.so.1.0.6 libbz2.so.1.0
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Use our OpenJDK instead of Bitwig’s bundled—and commercial!—one.
|
|
|
|
|
rm -rf $out/libexec/lib/jre
|
|
|
|
|
ln -s ${jdk.home}/jre $out/libexec/lib/jre
|
|
|
|
|
|
2019-01-30 07:47:12 +00:00
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
ln -s $out/libexec/bitwig-studio $out/bin/bitwig-studio
|
|
|
|
|
|
|
|
|
|
cp -r usr/share $out/share
|
|
|
|
|
substitute usr/share/applications/bitwig-studio.desktop \
|
|
|
|
|
$out/share/applications/bitwig-studio.desktop \
|
|
|
|
|
--replace /usr/bin/bitwig-studio $out/bin/bitwig-studio
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
postFixup = ''
|
2016-08-17 11:23:48 +00:00
|
|
|
|
# Bitwig’s `libx11-windowing-system.so` has several problems:
|
|
|
|
|
#
|
|
|
|
|
# • has some old version of libxkbcommon linked statically (ಠ_ಠ),
|
|
|
|
|
#
|
|
|
|
|
# • hardcodes path to `/usr/share/X11/xkb`,
|
|
|
|
|
#
|
|
|
|
|
# • even if we redirected it with libredirect (after adding
|
|
|
|
|
# `eaccess()` to libredirect!), their version of libxkbcommon
|
|
|
|
|
# is unable to parse our xkeyboardconfig. Been there, done that.
|
|
|
|
|
#
|
|
|
|
|
# However, it suffices to override theirs with our libxkbcommon
|
|
|
|
|
# in LD_PRELOAD. :-)
|
|
|
|
|
|
|
|
|
|
find $out -type f -executable \
|
|
|
|
|
-not -name '*.so.*' \
|
|
|
|
|
-not -name '*.so' \
|
|
|
|
|
-not -path '*/resources/*' | \
|
|
|
|
|
while IFS= read -r f ; do
|
|
|
|
|
wrapProgram $f \
|
2022-07-11 23:23:52 +00:00
|
|
|
|
--suffix PATH : "${lib.makeBinPath [ ffmpeg zenity ]}" \
|
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ xdg-utils ]}" \
|
2019-01-27 15:15:54 +00:00
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
2016-08-17 11:23:48 +00:00
|
|
|
|
--set LD_PRELOAD "${libxkbcommon.out}/lib/libxkbcommon.so" || true
|
|
|
|
|
done
|
|
|
|
|
'';
|
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
|
meta = with lib; {
|
2016-08-17 11:23:48 +00:00
|
|
|
|
description = "A digital audio workstation";
|
|
|
|
|
longDescription = ''
|
|
|
|
|
Bitwig Studio is a multi-platform music-creation system for
|
|
|
|
|
production, performance and DJing, with a focus on flexible
|
|
|
|
|
editing tools and a super-fast workflow.
|
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
|
homepage = "https://www.bitwig.com/";
|
2016-08-17 11:23:48 +00:00
|
|
|
|
license = licenses.unfree;
|
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2018-01-02 05:10:41 +00:00
|
|
|
|
maintainers = with maintainers; [ michalrus mrVanDalo ];
|
2016-08-17 11:23:48 +00:00
|
|
|
|
};
|
|
|
|
|
}
|