From 7525a3c89f09ad3f8f314b72d39b23b641f117f8 Mon Sep 17 00:00:00 2001 From: Kamil Chmielewski Date: Thu, 5 Oct 2017 16:44:59 +0200 Subject: [PATCH] sonic-pi: 2.9.0 -> 3.0.1 --- pkgs/applications/audio/sonic-pi/default.nix | 72 +++++++++++++------ .../audio/sonic-pi/fixed-prefixes.patch | 36 ---------- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 52 insertions(+), 58 deletions(-) delete mode 100644 pkgs/applications/audio/sonic-pi/fixed-prefixes.patch diff --git a/pkgs/applications/audio/sonic-pi/default.nix b/pkgs/applications/audio/sonic-pi/default.nix index 3c7be51554d8..d1c48ce44ed8 100644 --- a/pkgs/applications/audio/sonic-pi/default.nix +++ b/pkgs/applications/audio/sonic-pi/default.nix @@ -1,24 +1,33 @@ { stdenv , fetchFromGitHub -, qscintilla -, supercollider +, fftwSinglePrec , ruby +, libffi +, aubio , cmake , pkgconfig -, qt48Full +, qt5 +, libsForQt5 +, boost , bash , makeWrapper +, jack2Full }: -stdenv.mkDerivation rec { - version = "2.9.0"; +let + supercollider = libsForQt5.callPackage ../../../development/interpreters/supercollider { + fftw = fftwSinglePrec; + }; + +in stdenv.mkDerivation rec { + version = "3.0.1"; name = "sonic-pi-${version}"; src = fetchFromGitHub { owner = "samaaron"; repo = "sonic-pi"; rev = "v${version}"; - sha256 = "19db5dxrf6h1v2w3frds5g90nb6izd9ppp7cs2xi6i0m67l6jrwb"; + sha256 = "1l1892hijp1dj2h799sfjr699q6xp660n0siibab5kv238521a81"; }; buildInputs = [ @@ -26,24 +35,18 @@ stdenv.mkDerivation rec { cmake makeWrapper pkgconfig - qscintilla - qt48Full + qt5.qtbase + libsForQt5.qscintilla + libsForQt5.qwt ruby + libffi + aubio supercollider + boost ]; - 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 = [ stdenv.lib.maintainers.Phlogistique ]; - platforms = stdenv.lib.platforms.linux; - }; - dontUseCmakeConfigure = true; - patches = [ ./fixed-prefixes.patch ]; - preConfigure = '' patchShebangs . substituteInPlace app/gui/qt/mainwindow.cpp \ @@ -52,18 +55,45 @@ stdenv.mkDerivation rec { ''; buildPhase = '' + export SONIC_PI_HOME=$TMPDIR + export AUBIO_LIB=${aubio}/lib/libaubio.so + pushd app/server/bin ./compile-extensions.rb + ./i18n-tool.rb -t popd pushd app/gui/qt - ./rp-build-app + 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 popd ''; installPhase = '' + runHook preInstall + cp -r . $out - wrapProgram $out/bin/sonic-pi --prefix PATH : \ - ${ruby}/bin:${bash}/bin + wrapProgram $out/bin/sonic-pi \ + --prefix PATH : ${ruby}/bin:${bash}/bin:${supercollider}/bin:${jack2Full}/bin \ + --set AUBIO_LIB "${aubio}/lib/libaubio.so" + + runHook postInstall ''; + + 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; + }; } diff --git a/pkgs/applications/audio/sonic-pi/fixed-prefixes.patch b/pkgs/applications/audio/sonic-pi/fixed-prefixes.patch deleted file mode 100644 index 7b045a41cba1..000000000000 --- a/pkgs/applications/audio/sonic-pi/fixed-prefixes.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/app/gui/qt/mainwindow.cpp b/app/gui/qt/mainwindow.cpp -index 0af6cf7..97c17ad 100644 ---- a/app/gui/qt/mainwindow.cpp -+++ b/app/gui/qt/mainwindow.cpp -@@ -677,28 +677,9 @@ void MainWindow::startServer(){ - - serverProcess = new QProcess(); - -- QString root = rootPath(); -- -- #if defined(Q_OS_WIN) -- QString prg_path = root + "/app/server/native/windows/ruby/bin/ruby.exe"; -- QString prg_arg = root + "/app/server/bin/sonic-pi-server.rb"; -- sample_path = root + "/etc/samples"; -- #elif defined(Q_OS_MAC) -- QString prg_path = root + "/server/native/osx/ruby/bin/ruby"; -- QString prg_arg = root + "/server/bin/sonic-pi-server.rb"; -- sample_path = root + "/etc/samples"; -- #else -- //assuming Raspberry Pi -- QString prg_path = root + "/app/server/native/raspberry/ruby/bin/ruby"; -- QFile file(prg_path); -- if(!file.exists()) { -- // use system ruby if bundled ruby doesn't exist -- prg_path = "/usr/bin/ruby"; -- } -- -- QString prg_arg = root + "/app/server/bin/sonic-pi-server.rb"; -- sample_path = root + "/etc/samples"; -- #endif -+ QString prg_path = "@ruby@"; -+ QString prg_arg = "@out@/app/server/bin/sonic-pi-server.rb"; -+ sample_path = "@out@/etc/samples"; - - prg_path = QDir::toNativeSeparators(prg_path); - prg_arg = QDir::toNativeSeparators(prg_arg); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a5e106a014ff..97c2bbea8885 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16376,7 +16376,7 @@ with pkgs; viber = callPackage ../applications/networking/instant-messengers/viber { }; sonic-pi = callPackage ../applications/audio/sonic-pi { - ruby = ruby_2_2; + ruby = ruby_2_3; }; st = callPackage ../applications/misc/st {