2019-09-08 14:20:34 +02:00
|
|
|
{ mkDerivation
|
|
|
|
, lib
|
|
|
|
, qtbase
|
2015-11-15 21:16:00 +01:00
|
|
|
, 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
|
|
|
, boost
|
2015-11-15 21:16:00 +01:00
|
|
|
, bash
|
2017-10-05 16:44:59 +02:00
|
|
|
, jack2Full
|
2019-09-08 14:20:34 +02:00
|
|
|
, supercollider
|
|
|
|
, qscintilla
|
|
|
|
, qwt
|
2019-09-21 10:22:08 +02:00
|
|
|
, osmid
|
2015-11-15 21:16:00 +01:00
|
|
|
}:
|
|
|
|
|
2017-10-05 16:44:59 +02:00
|
|
|
let
|
|
|
|
|
2019-09-08 14:20:34 +02:00
|
|
|
supercollider_single_prec = supercollider.override { fftw = fftwSinglePrec; };
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
mkDerivation rec {
|
2018-10-13 13:46:30 +02:00
|
|
|
version = "3.1.0";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "sonic-pi";
|
2015-11-15 21:16:00 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samaaron";
|
|
|
|
repo = "sonic-pi";
|
|
|
|
rev = "v${version}";
|
2018-10-13 13:46:30 +02:00
|
|
|
sha256 = "0gi4a73szaa8iz5q1gxgpsnyvhhghcfqm6bfwwxbix4m5csbfgh9";
|
2015-11-15 21:16:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bash
|
2016-03-04 15:19:44 +01:00
|
|
|
cmake
|
|
|
|
pkgconfig
|
2019-09-08 14:20:34 +02:00
|
|
|
qtbase
|
|
|
|
qscintilla
|
|
|
|
qwt
|
2016-03-04 15:19:44 +01:00
|
|
|
ruby
|
2017-10-05 16:44:59 +02:00
|
|
|
libffi
|
|
|
|
aubio
|
2019-09-08 14:20:34 +02:00
|
|
|
supercollider_single_prec
|
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
|
2019-09-21 10:22:08 +02:00
|
|
|
export OSMID_DIR=app/server/native/osmid
|
|
|
|
|
|
|
|
mkdir -p $OSMID_DIR
|
|
|
|
cp ${osmid}/bin/{m2o,o2m} $OSMID_DIR
|
2017-10-05 16:44:59 +02:00
|
|
|
|
2018-10-13 13:46:30 +02:00
|
|
|
pushd app/server/ruby/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
|
2018-10-13 13:46:30 +02:00
|
|
|
../../server/ruby/bin/qt-doc.rb -o ruby_help.h
|
2017-10-05 16:44:59 +02:00
|
|
|
|
|
|
|
substituteInPlace SonicPi.pro \
|
|
|
|
--replace "LIBS += -lrt -lqt5scintilla2" \
|
|
|
|
"LIBS += -lrt -lqscintilla2 -lqwt"
|
|
|
|
|
|
|
|
lrelease SonicPi.pro
|
2018-10-13 13:46:30 +02:00
|
|
|
qmake SonicPi.pro
|
2017-10-05 16:44:59 +02:00
|
|
|
|
|
|
|
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
|
2019-09-08 14:20:34 +02:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
# $out/bin/sonic-pi is a shell script, and wrapQtAppsHook doesn't wrap them.
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
preFixup = ''
|
|
|
|
wrapQtApp "$out/bin/sonic-pi" \
|
2017-10-05 16:44:59 +02:00
|
|
|
--prefix PATH : ${ruby}/bin:${bash}/bin:${supercollider}/bin:${jack2Full}/bin \
|
|
|
|
--set AUBIO_LIB "${aubio}/lib/libaubio.so"
|
2015-11-15 21:16:00 +01:00
|
|
|
'';
|
2017-10-05 16:44:59 +02:00
|
|
|
|
|
|
|
meta = {
|
2019-09-21 10:22:08 +02:00
|
|
|
homepage = "https://sonic-pi.net/";
|
2017-10-05 16:44:59 +02:00
|
|
|
description = "Free live coding synth for everyone originally designed to support computing and music lessons within schools";
|
2019-09-08 14:20:34 +02:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ Phlogistique kamilchm ];
|
|
|
|
platforms = lib.platforms.linux;
|
2019-12-28 12:29:24 +01:00
|
|
|
# sonic-pi depends on ruby 2.4 which we don't support anymore
|
|
|
|
broken = true;
|
2017-10-05 16:44:59 +02:00
|
|
|
};
|
2015-11-15 21:16:00 +01:00
|
|
|
}
|