2015-11-15 21:16:00 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
2017-10-05 16:44:59 +02:00
|
|
|
, fftwSinglePrec
|
2015-11-15 21:16:00 +01:00
|
|
|
, ruby
|
2017-10-05 16:44:59 +02:00
|
|
|
, libffi
|
|
|
|
, aubio
|
2015-11-15 21:16:00 +01:00
|
|
|
, cmake
|
|
|
|
, pkgconfig
|
2017-10-05 16:44:59 +02:00
|
|
|
, qt5
|
|
|
|
, libsForQt5
|
|
|
|
, boost
|
2015-11-15 21:16:00 +01:00
|
|
|
, bash
|
|
|
|
, makeWrapper
|
2017-10-05 16:44:59 +02:00
|
|
|
, jack2Full
|
2015-11-15 21:16:00 +01:00
|
|
|
}:
|
|
|
|
|
2017-10-05 16:44:59 +02:00
|
|
|
let
|
|
|
|
supercollider = libsForQt5.callPackage ../../../development/interpreters/supercollider {
|
|
|
|
fftw = fftwSinglePrec;
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
version = "3.0.1";
|
2015-11-15 21:16:00 +01:00
|
|
|
name = "sonic-pi-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samaaron";
|
|
|
|
repo = "sonic-pi";
|
|
|
|
rev = "v${version}";
|
2017-10-05 16:44:59 +02:00
|
|
|
sha256 = "1l1892hijp1dj2h799sfjr699q6xp660n0siibab5kv238521a81";
|
2015-11-15 21:16:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bash
|
2016-03-04 15:19:44 +01:00
|
|
|
cmake
|
2015-11-15 21:16:00 +01:00
|
|
|
makeWrapper
|
2016-03-04 15:19:44 +01:00
|
|
|
pkgconfig
|
2017-10-05 16:44:59 +02:00
|
|
|
qt5.qtbase
|
|
|
|
libsForQt5.qscintilla
|
|
|
|
libsForQt5.qwt
|
2016-03-04 15:19:44 +01:00
|
|
|
ruby
|
2017-10-05 16:44:59 +02:00
|
|
|
libffi
|
|
|
|
aubio
|
2016-03-04 15:19:44 +01:00
|
|
|
supercollider
|
2017-10-05 16:44:59 +02:00
|
|
|
boost
|
2015-11-15 21:16:00 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2016-03-04 15:19:44 +01:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
substituteInPlace app/gui/qt/mainwindow.cpp \
|
|
|
|
--subst-var-by ruby "${ruby}/bin/ruby" \
|
|
|
|
--subst-var out
|
|
|
|
'';
|
|
|
|
|
2015-11-15 21:16:00 +01:00
|
|
|
buildPhase = ''
|
2017-10-05 16:44:59 +02:00
|
|
|
export SONIC_PI_HOME=$TMPDIR
|
|
|
|
export AUBIO_LIB=${aubio}/lib/libaubio.so
|
|
|
|
|
2015-11-15 21:16:00 +01:00
|
|
|
pushd app/server/bin
|
2016-03-04 15:19:44 +01:00
|
|
|
./compile-extensions.rb
|
2017-10-05 16:44:59 +02:00
|
|
|
./i18n-tool.rb -t
|
2015-11-15 21:16:00 +01:00
|
|
|
popd
|
|
|
|
|
|
|
|
pushd app/gui/qt
|
2017-10-05 16:44:59 +02:00
|
|
|
cp -f ruby_help.tmpl ruby_help.h
|
|
|
|
../../server/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
|
2015-11-15 21:16:00 +01:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2017-10-05 16:44:59 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2015-11-15 21:16:00 +01:00
|
|
|
cp -r . $out
|
2017-10-05 16:44:59 +02:00
|
|
|
wrapProgram $out/bin/sonic-pi \
|
|
|
|
--prefix PATH : ${ruby}/bin:${bash}/bin:${supercollider}/bin:${jack2Full}/bin \
|
|
|
|
--set AUBIO_LIB "${aubio}/lib/libaubio.so"
|
|
|
|
|
|
|
|
runHook postInstall
|
2015-11-15 21:16:00 +01:00
|
|
|
'';
|
2017-10-05 16:44:59 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://sonic-pi.net/;
|
|
|
|
description = "Free live coding synth for everyone originally designed to support computing and music lessons within schools";
|
|
|
|
license = stdenv.lib.licenses.mit;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ Phlogistique kamilchm ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
2015-11-15 21:16:00 +01:00
|
|
|
}
|