2019-09-08 13:20:34 +01:00
|
|
|
{ mkDerivation
|
|
|
|
, lib
|
|
|
|
, qtbase
|
2015-11-15 20:16:00 +00:00
|
|
|
, fetchFromGitHub
|
2017-10-05 15:44:59 +01:00
|
|
|
, fftwSinglePrec
|
2015-11-15 20:16:00 +00:00
|
|
|
, ruby
|
2017-10-05 15:44:59 +01:00
|
|
|
, aubio
|
2015-11-15 20:16:00 +00:00
|
|
|
, cmake
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2017-10-05 15:44:59 +01:00
|
|
|
, boost
|
2015-11-15 20:16:00 +00:00
|
|
|
, bash
|
2021-03-14 16:03:47 +00:00
|
|
|
, jack2
|
2019-09-08 13:20:34 +01:00
|
|
|
, supercollider
|
|
|
|
, qwt
|
2019-09-21 09:22:08 +01:00
|
|
|
, osmid
|
2015-11-15 20:16:00 +00:00
|
|
|
}:
|
|
|
|
|
2017-10-05 15:44:59 +01:00
|
|
|
let
|
|
|
|
|
2019-09-08 13:20:34 +01:00
|
|
|
supercollider_single_prec = supercollider.override { fftw = fftwSinglePrec; };
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
mkDerivation rec {
|
2020-03-08 11:16:05 +00:00
|
|
|
version = "3.2.2";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "sonic-pi";
|
2015-11-15 20:16:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samaaron";
|
|
|
|
repo = "sonic-pi";
|
|
|
|
rev = "v${version}";
|
2020-03-08 11:16:05 +00:00
|
|
|
sha256 = "1nlkpkpg9iz2hvf5pymvk6lqhpdpjbdrvr0hrnkc3ymj7llvf1cm";
|
2015-11-15 20:16:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bash
|
2016-03-04 14:19:44 +00:00
|
|
|
cmake
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2019-09-08 13:20:34 +01:00
|
|
|
qtbase
|
|
|
|
qwt
|
2016-03-04 14:19:44 +00:00
|
|
|
ruby
|
2017-10-05 15:44:59 +01:00
|
|
|
aubio
|
2019-09-08 13:20:34 +01:00
|
|
|
supercollider_single_prec
|
2017-10-05 15:44:59 +01:00
|
|
|
boost
|
2015-11-15 20:16:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2016-03-04 14:19:44 +00:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
substituteInPlace app/gui/qt/mainwindow.cpp \
|
|
|
|
--subst-var-by ruby "${ruby}/bin/ruby" \
|
|
|
|
--subst-var out
|
|
|
|
'';
|
|
|
|
|
2015-11-15 20:16:00 +00:00
|
|
|
buildPhase = ''
|
2017-10-05 15:44:59 +01:00
|
|
|
export SONIC_PI_HOME=$TMPDIR
|
|
|
|
export AUBIO_LIB=${aubio}/lib/libaubio.so
|
2019-09-21 09:22:08 +01:00
|
|
|
export OSMID_DIR=app/server/native/osmid
|
|
|
|
|
|
|
|
mkdir -p $OSMID_DIR
|
|
|
|
cp ${osmid}/bin/{m2o,o2m} $OSMID_DIR
|
2017-10-05 15:44:59 +01:00
|
|
|
|
2018-10-13 12:46:30 +01:00
|
|
|
pushd app/server/ruby/bin
|
2016-03-04 14:19:44 +00:00
|
|
|
./compile-extensions.rb
|
2017-10-05 15:44:59 +01:00
|
|
|
./i18n-tool.rb -t
|
2015-11-15 20:16:00 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
pushd app/gui/qt
|
2020-03-08 11:16:05 +00:00
|
|
|
cp -f utils/ruby_help.tmpl utils/ruby_help.h
|
|
|
|
../../server/ruby/bin/qt-doc.rb -o utils/ruby_help.h
|
2017-10-05 15:44:59 +01:00
|
|
|
|
2020-03-08 11:16:05 +00:00
|
|
|
lrelease lang/*.ts
|
2017-10-05 15:44:59 +01:00
|
|
|
|
2020-03-08 11:16:05 +00:00
|
|
|
mkdir build
|
|
|
|
pushd build
|
|
|
|
cmake -G "Unix Makefiles" ..
|
|
|
|
make
|
|
|
|
popd
|
2015-11-15 20:16:00 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2017-10-05 15:44:59 +01:00
|
|
|
runHook preInstall
|
2020-03-08 11:16:05 +00:00
|
|
|
|
|
|
|
mkdir $out
|
|
|
|
cp -r {bin,etc} $out/
|
|
|
|
|
|
|
|
# Copy server whole.
|
|
|
|
mkdir -p $out/app
|
|
|
|
cp -r app/server $out/app/
|
|
|
|
|
|
|
|
# Copy only necessary files for the gui app.
|
|
|
|
mkdir -p $out/app/gui/qt/build
|
|
|
|
cp -r app/gui/qt/{book,fonts,help,html,images,image_source,info,lang,theme} $out/app/gui/qt/
|
|
|
|
cp app/gui/qt/build/sonic-pi $out/app/gui/qt/build/sonic-pi
|
|
|
|
|
2019-09-08 13:20:34 +01: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" \
|
2021-08-25 18:38:43 +01:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ bash jack2 ruby supercollider ] } \
|
|
|
|
--set AUBIO_LIB "${aubio}/lib/libaubio.so"
|
|
|
|
makeWrapper \
|
|
|
|
$out/app/server/ruby/bin/sonic-pi-server.rb \
|
|
|
|
$out/bin/sonic-pi-server \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ bash jack2 ruby supercollider ] } \
|
2017-10-05 15:44:59 +01:00
|
|
|
--set AUBIO_LIB "${aubio}/lib/libaubio.so"
|
2015-11-15 20:16:00 +00:00
|
|
|
'';
|
2017-10-05 15:44:59 +01:00
|
|
|
|
|
|
|
meta = {
|
2019-09-21 09:22:08 +01:00
|
|
|
homepage = "https://sonic-pi.net/";
|
2017-10-05 15:44:59 +01:00
|
|
|
description = "Free live coding synth for everyone originally designed to support computing and music lessons within schools";
|
2019-09-08 13:20:34 +01:00
|
|
|
license = lib.licenses.mit;
|
2020-03-08 11:16:05 +00:00
|
|
|
maintainers = with lib.maintainers; [ Phlogistique kamilchm c0deaddict ];
|
2019-09-08 13:20:34 +01:00
|
|
|
platforms = lib.platforms.linux;
|
2017-10-05 15:44:59 +01:00
|
|
|
};
|
2015-11-15 20:16:00 +00:00
|
|
|
}
|