nixpkgs/pkgs/applications/audio/sonic-pi/default.nix
Linus Heckemann 5aa4b19946 treewide: mark some broken packages as broken
Refs:
e6754980264fe927320d5ff2dbd24ca4fac9a160
1e9cc5b9844ef603fe160e9f671178f96200774f
793a2fe1e8bb886ca2096c5904e1193dc3268b6d
c19cf65261639f749012454932a532aa7c681e4b
f6544d618f30fae0bc4798c4387a8c7c9c047a7c
2019-10-08 17:14:26 +02:00

106 lines
2.1 KiB
Nix

{ mkDerivation
, lib
, qtbase
, fetchFromGitHub
, fftwSinglePrec
, ruby
, libffi
, aubio
, cmake
, pkgconfig
, boost
, bash
, jack2Full
, supercollider
, qscintilla
, qwt
}:
let
supercollider_single_prec = supercollider.override { fftw = fftwSinglePrec; };
in
mkDerivation rec {
version = "3.1.0";
pname = "sonic-pi";
src = fetchFromGitHub {
owner = "samaaron";
repo = "sonic-pi";
rev = "v${version}";
sha256 = "0gi4a73szaa8iz5q1gxgpsnyvhhghcfqm6bfwwxbix4m5csbfgh9";
};
buildInputs = [
bash
cmake
pkgconfig
qtbase
qscintilla
qwt
ruby
libffi
aubio
supercollider_single_prec
boost
];
dontUseCmakeConfigure = true;
preConfigure = ''
patchShebangs .
substituteInPlace app/gui/qt/mainwindow.cpp \
--subst-var-by ruby "${ruby}/bin/ruby" \
--subst-var out
'';
buildPhase = ''
export SONIC_PI_HOME=$TMPDIR
export AUBIO_LIB=${aubio}/lib/libaubio.so
pushd app/server/ruby/bin
./compile-extensions.rb
./i18n-tool.rb -t
popd
pushd app/gui/qt
cp -f ruby_help.tmpl ruby_help.h
../../server/ruby/bin/qt-doc.rb -o ruby_help.h
substituteInPlace SonicPi.pro \
--replace "LIBS += -lrt -lqt5scintilla2" \
"LIBS += -lrt -lqscintilla2 -lqwt"
lrelease SonicPi.pro
qmake SonicPi.pro
make
popd
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
# $out/bin/sonic-pi is a shell script, and wrapQtAppsHook doesn't wrap them.
dontWrapQtApps = true;
preFixup = ''
wrapQtApp "$out/bin/sonic-pi" \
--prefix PATH : ${ruby}/bin:${bash}/bin:${supercollider}/bin:${jack2Full}/bin \
--set AUBIO_LIB "${aubio}/lib/libaubio.so"
'';
meta = {
homepage = http://sonic-pi.net/;
description = "Free live coding synth for everyone originally designed to support computing and music lessons within schools";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ Phlogistique kamilchm ];
platforms = lib.platforms.linux;
broken = true;
};
}