2020-04-24 23:36:52 +00:00
|
|
|
{ mkDerivation
|
|
|
|
, lib
|
|
|
|
, qtbase
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fftwSinglePrec
|
|
|
|
, ruby
|
|
|
|
, aubio
|
|
|
|
, cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, boost
|
|
|
|
, bash
|
2021-04-05 15:23:46 +00:00
|
|
|
, jack2
|
2020-04-24 23:36:52 +00:00
|
|
|
, supercollider
|
|
|
|
, qwt
|
|
|
|
, osmid
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
supercollider_single_prec = supercollider.override { fftw = fftwSinglePrec; };
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
mkDerivation rec {
|
2020-06-18 07:06:33 +00:00
|
|
|
version = "3.2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "sonic-pi";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samaaron";
|
|
|
|
repo = "sonic-pi";
|
|
|
|
rev = "v${version}";
|
2020-06-18 07:06:33 +00:00
|
|
|
sha256 = "1nlkpkpg9iz2hvf5pymvk6lqhpdpjbdrvr0hrnkc3ymj7llvf1cm";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bash
|
|
|
|
cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
qtbase
|
|
|
|
qwt
|
|
|
|
ruby
|
|
|
|
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
|
|
|
|
export OSMID_DIR=app/server/native/osmid
|
|
|
|
|
|
|
|
mkdir -p $OSMID_DIR
|
|
|
|
cp ${osmid}/bin/{m2o,o2m} $OSMID_DIR
|
|
|
|
|
|
|
|
pushd app/server/ruby/bin
|
|
|
|
./compile-extensions.rb
|
|
|
|
./i18n-tool.rb -t
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd app/gui/qt
|
2020-06-18 07:06:33 +00:00
|
|
|
cp -f utils/ruby_help.tmpl utils/ruby_help.h
|
|
|
|
../../server/ruby/bin/qt-doc.rb -o utils/ruby_help.h
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
lrelease lang/*.ts
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
mkdir build
|
|
|
|
pushd build
|
|
|
|
cmake -G "Unix Makefiles" ..
|
|
|
|
make
|
|
|
|
popd
|
2020-04-24 23:36:52 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2020-06-18 07:06:33 +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
|
|
|
|
|
2020-04-24 23:36:52 +00: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-04-05 15:23:46 +00:00
|
|
|
--prefix PATH : ${ruby}/bin:${bash}/bin:${supercollider}/bin:${jack2}/bin \
|
2020-04-24 23:36:52 +00:00
|
|
|
--set AUBIO_LIB "${aubio}/lib/libaubio.so"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://sonic-pi.net/";
|
|
|
|
description = "Free live coding synth for everyone originally designed to support computing and music lessons within schools";
|
|
|
|
license = lib.licenses.mit;
|
2020-06-18 07:06:33 +00:00
|
|
|
maintainers = with lib.maintainers; [ Phlogistique kamilchm c0deaddict ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|