overlays-personal/pkgs/surge/default.nix
EEva (JPotier) 9127329f4e Surge: bump
2020-02-09 14:52:28 +02:00

84 lines
1.8 KiB
Nix

{ stdenv
, cmake
, fetchFromGitHub
, ncurses
, which
, getopt
, python3
, pkg-config
, premake5
, libxkbcommon
, xorg
, cairo
, rsync
}:
let
_version = "1.6.5";
in stdenv.mkDerivation {
pname = "surge";
version = _version;
src = fetchFromGitHub {
owner = "surge-synthesizer";
repo = "surge";
rev = "release_${_version}";
sha256 = "1gajlncl3pcxw9xii55sn29hf2bwcn6gs7npi4l664pkihnba0mx";
fetchSubmodules = true;
};
nativeBuildInputs = [
ncurses
which
getopt
python3
premake5
pkg-config
cmake
rsync
];
buildInputs = [
cairo
libxkbcommon
xorg.libxcb
xorg.xcbutilcursor
xorg.xcbutilkeysyms
];
patchPhase = ''
patchShebangs ./build-linux.sh
sed -i "s+/usr+$out+" build-linux.sh
sed -i "s+/usr+$out+" src/common/SurgeStorage.cpp
./build-linux.sh --help
'';
buildPhase = ''
# mkdir build
# cmake . -Bbuild
# make -j surge-headless -C build
# premake5 --cc=gcc --os=linux gmake2
# make -j config=release_x64 surge-vst3 surge-lv2 surge-vst2
# These appear to be the only supported projects
# https://github.com/surge-synthesizer/surge/blob/master/azure-pipelines.yml#L29
./build-linux.sh build --project=vst3
./build-linux.sh build --project=lv2
'';
installPhase = ''
mkdir -p $out/share/Surge $out/lib/vst3 $out/lib/lv2
cp -r resources/data/* $out/share/Surge/
cp -r target/vst3/Release/Surge.so $out/lib/vst3/
cp -r target/lv2/Release/Surge.lv2 $out/lib/lv2/
'';
meta = with stdenv.lib; {
description = "Synthesizer plug-in originally by Claes Johanson";
homepage = "https://surge-synthesizer.github.io";
license = licenses.gpl3;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ jpotier ];
};
}