overlays-personal/pkgs/reaper/default.nix

83 lines
2.2 KiB
Nix
Raw Normal View History

2021-07-19 01:34:21 +02:00
{ config, lib, stdenv
, fetchurl
, autoPatchelfHook
, makeWrapper
, alsa-lib
, gtk3
, lame
, ffmpeg
, vlc
, xdg-utils
, which
, jackSupport ? true, libjack2
, pulseaudioSupport ? config.pulseaudio or true, libpulseaudio
2019-05-14 20:54:45 +02:00
}:
stdenv.mkDerivation rec {
2021-07-19 01:34:21 +02:00
pname = "reaper";
2021-12-19 22:48:43 +01:00
version = "6.42";
2019-05-14 20:54:45 +02:00
src = fetchurl {
2021-07-19 01:34:21 +02:00
url = "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_${stdenv.targetPlatform.qemuArch}.tar.xz";
2021-12-19 22:48:43 +01:00
sha256 = "5WG7J3/FC8s4GGh4q622NTRPIFUkXk6tXbripPIzkUo=";
2019-05-14 20:54:45 +02:00
};
2021-07-19 01:34:21 +02:00
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
xdg-utils # Required for desktop integration
which
];
2019-05-14 20:54:45 +02:00
buildInputs = [
2021-07-19 01:34:21 +02:00
alsa-lib
stdenv.cc.cc.lib # reaper and libSwell need libstdc++.so.6
gtk3
2019-05-14 20:54:45 +02:00
];
runtimeDependencies = [
2021-07-19 01:34:21 +02:00
gtk3 # libSwell needs libgdk-3.so.0
]
++ lib.optional jackSupport libjack2
++ lib.optional pulseaudioSupport libpulseaudio;
2019-05-14 20:54:45 +02:00
dontBuild = true;
installPhase = ''
2021-07-19 01:34:21 +02:00
runHook preInstall
HOME="$out/share" XDG_DATA_HOME="$out/share" ./install-reaper.sh \
2019-05-14 20:54:45 +02:00
--install $out/opt \
--integrate-user-desktop
rm $out/opt/REAPER/uninstall-reaper.sh
2021-07-19 01:34:21 +02:00
# Dynamic loading of plugin dependencies does not adhere to rpath of
# reaper executable that gets modified with runtimeDependencies.
# Patching each plugin with DT_NEEDED is cumbersome and requires
# hardcoding of API versions of each dependency.
# Setting the rpath of the plugin shared object files does not
# seem to have an effect for some plugins.
# We opt for wrapping the executable with LD_LIBRARY_PATH prefix.
2019-05-14 20:54:45 +02:00
wrapProgram $out/opt/REAPER/reaper \
2021-07-19 01:34:21 +02:00
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ lame ffmpeg vlc ]}"
2020-04-11 15:38:30 +02:00
cp -rv ${./jsfx}/* $out/opt/REAPER/InstallData/Effects/
2019-05-14 20:54:45 +02:00
mkdir $out/bin
ln -s $out/opt/REAPER/reaper $out/bin/
ln -s $out/opt/REAPER/reamote-server $out/bin/
2021-07-19 01:34:21 +02:00
runHook postInstall
2019-05-14 20:54:45 +02:00
'';
2021-02-27 08:40:08 +01:00
meta = with lib; {
2019-05-14 20:54:45 +02:00
description = "Digital audio workstation";
homepage = "https://www.reaper.fm/";
2019-05-14 20:54:45 +02:00
license = licenses.unfree;
2021-07-19 01:34:21 +02:00
platforms = [ "x86_64-linux" "aarch64-linux" ];
maintainers = with maintainers; [ jfrankenau ilian ];
2019-05-14 20:54:45 +02:00
};
}