2018-01-02 06:10:41 +01:00
|
|
|
|
{ stdenv, fetchurl, alsaLib, bzip2, cairo, dpkg, freetype, gdk_pixbuf
|
|
|
|
|
, glib, gtk2, harfbuzz, jdk, lib, xorg
|
|
|
|
|
, libbsd, libjack2, libpng
|
|
|
|
|
, libxkbcommon
|
|
|
|
|
, makeWrapper, pixman
|
2016-08-17 13:23:48 +02:00
|
|
|
|
, xdg_utils, zenity, zlib }:
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
name = "bitwig-studio-${version}";
|
2018-01-02 06:10:41 +01:00
|
|
|
|
version = "1.3.16";
|
2016-08-17 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-01-02 06:10:41 +01:00
|
|
|
|
url = "https://downloads.bitwig.com/stable/${version}/bitwig-studio-${version}.deb";
|
|
|
|
|
sha256 = "0n0fxh9gnmilwskjcayvjsjfcs3fz9hn00wh7b3gg0cv3qqhich8";
|
2016-08-17 13:23:48 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ dpkg makeWrapper ];
|
|
|
|
|
|
|
|
|
|
unpackCmd = "mkdir root ; dpkg-deb -x $curSrc root";
|
|
|
|
|
|
2018-01-02 06:10:41 +01:00
|
|
|
|
dontBuild = true;
|
2016-08-17 13:23:48 +02:00
|
|
|
|
dontPatchELF = true;
|
2018-01-02 06:10:41 +01:00
|
|
|
|
dontStrip = true;
|
2016-08-17 13:23:48 +02:00
|
|
|
|
|
2018-01-02 06:10:41 +01:00
|
|
|
|
libPath = with xorg; lib.makeLibraryPath [
|
|
|
|
|
alsaLib bzip2.out cairo freetype gdk_pixbuf glib gtk2 harfbuzz libX11 libXau
|
|
|
|
|
libXcursor libXdmcp libXext libXfixes libXrender libbsd libjack2 libpng libxcb
|
|
|
|
|
libxkbfile pixman xcbutil xcbutilwm zlib
|
2016-08-17 13:23:48 +02:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
binPath = lib.makeBinPath [
|
2018-01-02 06:10:41 +01:00
|
|
|
|
xdg_utils zenity
|
2016-08-17 13:23:48 +02: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
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
patchelf \
|
|
|
|
|
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
|
|
|
|
|
$f && \
|
|
|
|
|
wrapProgram $f \
|
|
|
|
|
--prefix PATH : "${binPath}" \
|
|
|
|
|
--prefix LD_LIBRARY_PATH : "${libPath}" \
|
|
|
|
|
--set LD_PRELOAD "${libxkbcommon.out}/lib/libxkbcommon.so" || true
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
ln -s $out/libexec/bitwig-studio $out/bin/bitwig-studio
|
|
|
|
|
|
|
|
|
|
cp -r usr/share $out/share
|
2017-08-04 20:18:02 +02:00
|
|
|
|
substitute usr/share/applications/bitwig-studio.desktop \
|
|
|
|
|
$out/share/applications/bitwig-studio.desktop \
|
|
|
|
|
--replace /usr/bin/bitwig-studio $out/bin/bitwig-studio
|
2016-08-17 13:23:48 +02:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
|
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.
|
|
|
|
|
'';
|
|
|
|
|
homepage = http://www.bitwig.com/;
|
|
|
|
|
license = licenses.unfree;
|
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2018-01-02 06:10:41 +01:00
|
|
|
|
maintainers = with maintainers; [ michalrus mrVanDalo ];
|
2016-08-17 13:23:48 +02:00
|
|
|
|
};
|
|
|
|
|
}
|