summaryrefslogtreecommitdiffstats
path: root/sonic-pi
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2022-09-03 18:32:18 +0000
committer Eric Hameleers <alien@slackware.com>2022-09-03 18:32:18 +0000
commitf719ffc75999e578e44878e209b0dac44e32342e (patch)
tree77e3817f0eb06c07abb4c886678784607eecace2 /sonic-pi
parent42724e51ff7fd49c3a975ca9d4e211f614f59f19 (diff)
downloadasb-f719ffc75999e578e44878e209b0dac44e32342e.tar.gz
asb-f719ffc75999e578e44878e209b0dac44e32342e.tar.xz
sonic-pi: update to 4.1.0
Diffstat (limited to 'sonic-pi')
-rwxr-xr-xsonic-pi/build/sonic-pi.SlackBuild237
1 files changed, 132 insertions, 105 deletions
diff --git a/sonic-pi/build/sonic-pi.SlackBuild b/sonic-pi/build/sonic-pi.SlackBuild
index 3c325d5b..acd389db 100755
--- a/sonic-pi/build/sonic-pi.SlackBuild
+++ b/sonic-pi/build/sonic-pi.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
# $Id$
-# Copyright 2020, 2021 Eric Hameleers, Eindhoven, NL
+# Copyright 2020, 2021, 2022 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -28,8 +28,8 @@
# For: sonic-pi
# Descr: live coding music performance tool
# URL: https://sonic-pi.net/
-# Build needs: erlang-otp
-# Needs: aubio rtmidi sc3-plugins supercollider
+# Build needs: elixir erlang-otp
+# Needs: aubio jack2 jack-example-tools sc3-plugins supercollider
# Changelog:
# 3.2.2-1: 21/Jul/2020 by Eric Hameleers <alien@slackware.com>
# * Initial build.
@@ -37,6 +37,8 @@
# * Add 'X-DAW' category to the desktop file (for liveslak).
# 3.3.1-1: 11/mar/2021 by Eric Hameleers <alien@slackware.com>
# * Update.
+# 4.1.0-1: 30/aug/2022 by Eric Hameleers <alien@slackware.com>
+# * Update.
#
# Run 'sh sonic-pi.SlackBuild' to build a Slackware package.
# The package (.t?z) and .txt file as well as build logs are created in /tmp .
@@ -45,14 +47,15 @@
# -----------------------------------------------------------------------------
PRGNAM=sonic-pi
-VERSION=${VERSION:-3.3.1}
+VERSION=${VERSION:-4.1.0}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:-" -j$(nproc) "}
TAG=${TAG:-alien}
-DOCS="BUILD-LINUX.md CHANGELOG.md COMMUNITY.md CONTRIBUTORS.md FAQ.md \
- HOW-TO-CONTRIBUTE.md LICENSE.md README.md SYNTH_DESIGN.md \
- TESTING.md TRANSLATION-WORKFLOW.md TRANSLATION.md"
+DOCS="*.md CORETEAM.html FUNDING.yml appveyor.yml"
+
+# Found in app/linux-pre-vcpkg.sh:
+VCPKG_BRANCH=${VCPKG_BRANCH:-2022.06.16.1}
# Where do we look for sources?
SRCDIR=$(cd $(dirname $0); pwd)
@@ -155,11 +158,8 @@ cd $TMP/tmp-$PRGNAM
echo "Extracting the source archive(s) for $PRGNAM..."
tar -xvf ${SOURCE}
cd ${PRGNAM}-${VERSION}
-APPROOT=$(pwd)
-
-# Use the system version of QScintilla (qt5 libraries):
-cat $SRCDIR/patches/sonic-pi_system_qscintilla.patch | patch -p1 --verbose \
- 2>&1 | tee $OUTPUT/patch-$PRGNAM.log
+PIROOT=$(pwd)
+APPROOT=${PIROOT}/app
chown -R root:root .
chmod -R u+w,go+r-w,a+rX-st .
@@ -170,120 +170,147 @@ export CXXFLAGS="$SLKCFLAGS"
export CFLAGS="$SLKCFLAGS"
# Mostly do what these embedded scripts do:
+# app/linux-pre-vcpkg.sh
# app/linux-prebuild.sh
-# app/external/linux_build_externals.sh
+# app/linux-pre-translations.sh
# app/linux-config.sh
-
-# Build external dependencies:
-cd $APPROOT/app/external/
-mkdir build
-cd build
- ERLANG_INCLUDE_PATH=`erl -noinput -eval 'io:format("~s~n", [filename:join([lists:concat([code:root_dir(), "/erts-", erlang:system_info(version)]), "include"])]), init:stop(0).'`
- cmake .. \
- -G "Unix Makefiles" \
- -DERLANG_INCLUDE_PATH=${ERLANG_INCLUDE_PATH}
- # Build sp_midi:
- cmake --build . --target sp_midi
- #cmake --build . --target aubio
+# app/linux-build-gui.sh
+# app/linux-post-tau-prod-release.sh
+# app/linux-release.sh
+
+# Compile vspkg and use it to compile several internal dependent libraries:
+mkdir -p ${APPROOT}/vcpkg
+cd ${APPROOT}/vcpkg
+ git clone --depth 1 --branch ${VCPKG_BRANCH} \
+ https://github.com/microsoft/vcpkg.git .
+ ./bootstrap-vcpkg.sh -disableMetrics
+ ./vcpkg install \
+ libsndfile[core,external-libs] kissfft fmt crossguid sdl2[x11] gl3w \
+ reproc gsl-lite concurrentqueue platform-folders catch2 \
+ --recurse
cd - 1>/dev/null
-# Install dependencies to server:
-mkdir -p ${APPROOT}/app/server/erlang/sonic_pi_server/priv/
-cp ${APPROOT}/app/external/build/sp_midi-prefix/src/sp_midi-build/*.so ${APPROOT}/app/server/erlang/sonic_pi_server/priv/
-mkdir -p ${APPROOT}/app/server/native/osmid
-#cp ${APPROOT}/app/external/build/aubio-prefix/src/aubio-build/aubio_onset ${APPROOT}/app/server/native/
-ln -s /usr/bin/aubioonset ${APPROOT}/app/server/native/aubio_onset
-
# Compile native ruby extensions:
-ruby ${APPROOT}/app/server/ruby/bin/compile-extensions.rb
+ruby ${APPROOT}/server/ruby/bin/compile-extensions.rb
-# Translate tutorial:
-ruby ${APPROOT}/app/server/ruby/bin/i18n-tool.rb -t
+# Translate the tutorial:
+ruby ${APPROOT}/server/ruby/bin/i18n-tool.rb -t
# Generate docs for the Qt GUI:
-cp ${APPROOT}/app/gui/qt/utils/ruby_help.tmpl ${APPROOT}/app/gui/qt/utils/ruby_help.h
-ruby ${APPROOT}/app/server/ruby/bin/qt-doc.rb -o ${APPROOT}/app/gui/qt/utils/ruby_help.h
-
-# Update GUI translation files:
-lrelease ${APPROOT}/app/gui/qt/lang/*.ts
-
-# Compile erlang files:
-cd ${APPROOT}/app/server/erlang/sonic_pi_server
- erl -make
- cp src/sonic_pi_server.app.src ebin/sonic_pi_server.app
+cp ${APPROOT}/gui/qt/utils/ruby_help.tmpl ${APPROOT}/gui/qt/utils/ruby_help.h
+ruby ${APPROOT}/server/ruby/bin/qt-doc.rb -o ${APPROOT}/gui/qt/utils/ruby_help.h
+
+# Compile the GUI:
+mkdir ${APPROOT}/build
+cd ${APPROOT}/build
+ cmake -G "Unix Makefiles" \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DBUILD_IMGUI_INTERFACE=false \
+ -DUSE_SYSTEM_LIBS=false \
+ ..
+ cmake --build . --config Release
cd - 1>/dev/null
-# Compile the Qt5 GUI:
-cd ${APPROOT}/app/
-mkdir build
-cd build
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
- cmake --build . --config Release
+# Compile Erlang/Elixir files:
+mix local.hex --force
+cd ${APPROOT}/server/beam/tau
+ # Compiling fails, so we will download the deps instead:
+ #MIX_ENV=prod mix deps.compile
+ #MIX_ENV=prod mix release --overwrite --no-deps-check
+ MIX_ENV=prod mix local.hex --force
+ MIX_ENV=prod mix local.rebar --force
+ MIX_ENV=prod mix deps.get
+ MIX_ENV=prod mix release --overwrite
cd - 1>/dev/null
# Install the lot into the package dir.
-# Use standard locations rather than those that the program expects,
-# and apply symlinks liberally to tie it all together.
+# Use standard locations, and apply symlinks to tie it all together.
# Create directories:
-cd ${APPROOT}
-mkdir -p $PKG/usr/libexec/sonic-pi/app/build/gui/qt
-mkdir -p $PKG/usr/libexec/sonic-pi/app/gui/qt/{images,lang}
-mkdir -p $PKG/usr/libexec/sonic-pi/app/server/erlang/sonic_pi_server/{ebin,priv}
-mkdir -p $PKG/usr/libexec/sonic-pi/etc/synthdefs/graphviz
-
-# Copy the GUI programs:
-cp -a ${APPROOT}/bin $PKG/usr/libexec/sonic-pi/
-cp -a ${APPROOT}/app/build/gui/qt/sonic-pi $PKG/usr/libexec/sonic-pi/app/build/gui/qt/
-
-# All the other stuff needed by the GUI:
-cp -a ${APPROOT}/app/gui/qt/fonts $PKG/usr/libexec/sonic-pi/app/gui/qt/
-cd ${APPROOT}/app/gui/qt/images
- find . -name "*.png" | xargs -I '{}' cp -a --parents '{}' $PKG/usr/libexec/sonic-pi/app/gui/qt/images/
-cd - 1>/dev/null
-cp -a ${APPROOT}/app/gui/qt/lang/*.qm $PKG/usr/libexec/sonic-pi/app/gui/qt/lang/
-cp -a ${APPROOT}/app/gui/qt/theme $PKG/usr/libexec/sonic-pi/app/gui/qt/
-
-# Audio data:
-cp -a ${APPROOT}/etc/buffers $PKG/usr/libexec/sonic-pi/etc/
-cp -a ${APPROOT}/etc/samples $PKG/usr/libexec/sonic-pi/etc/
-cp -a ${APPROOT}/etc/snippets $PKG/usr/libexec/sonic-pi/etc/
-cd ${APPROOT}/etc/synthdefs
- find . -name "*.scsyndef" -o -name "*.clj" -o -name "*.md" \
- | xargs -I '{}' cp -a --parents '{}' $PKG/usr/libexec/sonic-pi/etc/synthdefs/
-cd - 1>/dev/null
+cd ${PIROOT}
+mkdir -p ${PKG}/usr/libexec/sonic-pi
+
+# Copy distributable files:
+cp -r ${PIROOT}/{bin,etc} ${PKG}/usr/libexec/sonic-pi/
+
+# Copy example configs:
+mkdir -p ${PKG}/usr/libexec/sonic-pi/app
+cp -r ${APPROOT}/config ${PKG}/usr/libexec/sonic-pi/app/
+
+# Copy server natives:
+mkdir -p ${PKG}/usr/libexec/sonic-pi/app/server
+cp -r ${APPROOT}/server/native ${PKG}/usr/libexec/sonic-pi/app/server/
+
+# Copy Spider (Ruby) server:
+mkdir -p ${PKG}/usr/libexec/sonic-pi/app/server
+cp -r ${APPROOT}/server/ruby ${PKG}/usr/libexec/sonic-pi/app/server/
+
+# Copy built Tau (BEAM) server:
+mkdir -p ${PKG}/usr/libexec/sonic-pi/app/server/beam/tau/_build/prod
+cp -r ${APPROOT}/server/beam/tau/_build/prod/rel \
+ ${PKG}/usr/libexec/sonic-pi/app/server/beam/tau/_build/prod/
+cp ${APPROOT}/server/beam/tau/boot-lin.sh \
+ ${PKG}/usr/libexec/sonic-pi/app/server/beam/tau/
+
+# Copy only necessary files for the Qt GUI:
+mkdir -p ${PKG}/usr/libexec/sonic-pi/app/gui/qt
+cp -r ${APPROOT}/gui/qt/{lang,theme} \
+ ${PKG}/usr/libexec/sonic-pi/app/gui/qt/
+
+# Copy Qt GUI binary:
+mkdir -p ${PKG}/usr/libexec/sonic-pi/app/build/gui/qt
+cp ${APPROOT}/build/gui/qt/sonic-pi \
+ ${PKG}/usr/libexec/sonic-pi/app/build/gui/qt/sonic-pi
+
+if [ -x ${APPROOT}/build/gui/imgui/sonic-pi-imgui ]; then
+ # Copy ImGui files:
+ mkdir -p ${PKG}/usr/libexec/sonic-pi/app/gui/imgui/res
+ cp -r ${APPROOT}/gui/imgui/res/Cousine-Regular.ttf \
+ ${PKG}/usr/libexec/sonic-pi/app/gui/imgui/res/
+
+ # Copy ImGui binary:
+ mkdir -p ${PKG}/usr/libexec/sonic-pi/app/build/gui/imgui
+ cp ${APPROOT}/build/gui/imgui/sonic-pi-imgui \
+ ${PKG}/usr/libexec/sonic-pi/app/build/gui/imgui/sonic-pi-imgui
+fi
-# The erlang files:
-cp -a ${APPROOT}/app/server/erlang/sonic_pi_server/ebin/*.beam ${APPROOT}/app/server/erlang/sonic_pi_server/ebin/*.app $PKG/usr/libexec/sonic-pi/app/server/erlang/sonic_pi_server/ebin/
-cp -a ${APPROOT}/app/server/erlang/*.md $PKG/usr/libexec/sonic-pi/app/server/erlang/
+# Remove non-essential files from vendored Ruby gems:
+for file in ${PKG}/usr/libexec/sonic-pi/app/server/ruby/vendor/*/*; do
+ if [ "$(basename "$file")" != "lib" ]; then
+ rm -rf "$file"
+ fi
+done
-# sp_midi:
-cp -a ${APPROOT}/app/server/erlang/sonic_pi_server/priv/*.so $PKG/usr/libexec/sonic-pi/app/server/erlang/sonic_pi_server/priv/
+# Remove unnecessary Erlang artifacts:
+rm ${PKG}/usr/libexec/sonic-pi/app/server/beam/tau/_build/prod/rel/tau/bin/tau.bat
-# Ruby files - there's a lot of crap in there that I can not really assess:
-cp -a ${APPROOT}/app/server/ruby $PKG/usr/libexec/sonic-pi/app/server/
-# Remove unused bloat that I recognize:
-find $PKG/usr/libexec/sonic-pi/app/server/ruby -name libgit2 -type d | xargs rm -rf
-find $PKG/usr/libexec/sonic-pi/app/server/ruby -name test -type d | xargs rm -rf
-# We do not want these either:
-find $PKG/usr/libexec/sonic-pi/app/server/ruby -name Rakefile | xargs rm -f
-find $PKG/usr/libexec/sonic-pi/app/server/ruby -name "*.c" | xargs rm -rf
-find $PKG/usr/libexec/sonic-pi/app/server/ruby -name "*.o" | xargs rm -rf
-find $PKG/usr/libexec/sonic-pi/app/server/ruby -name ".git*" | xargs rm -rf
+# Strip Erlang BEAMs:
+erl -noinput -eval \
+ 'lists:foreach(fun(F) -> beam_lib:strip(F) end, filelib:wildcard("build/linux_dist/app/server/beam/tau/**/*.beam"))' \
+ -s init stop
# The documentation:
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a ${APPROOT}/app/gui/qt/book $PKG/usr/doc/$PRGNAM-$VERSION/
-ln -s /usr/doc/$PRGNAM-$VERSION/book $PKG/usr/libexec/sonic-pi/app/gui/qt/
-cp -a ${APPROOT}/app/gui/qt/help $PKG/usr/doc/$PRGNAM-$VERSION/
-ln -s /usr/doc/$PRGNAM-$VERSION/help $PKG/usr/libexec/sonic-pi/app/gui/qt/
-cp -a ${APPROOT}/app/gui/qt/html $PKG/usr/doc/$PRGNAM-$VERSION/
-ln -s /usr/doc/$PRGNAM-$VERSION/html $PKG/usr/libexec/sonic-pi/app/gui/qt/
-cp -a ${APPROOT}/etc/doc/{cheatsheets,images,lang,tutorial} $PKG/usr/doc/$PRGNAM-$VERSION/
+# For the GUI:
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/gui
+cp -a ${APPROOT}/gui/qt/book $PKG/usr/doc/$PRGNAM-$VERSION/gui/
+ln -s /usr/doc/$PRGNAM-$VERSION/gui/book $PKG/usr/libexec/sonic-pi/app/gui/qt/
+cp -a ${APPROOT}/gui/qt/help $PKG/usr/doc/$PRGNAM-$VERSION/gui/
+ln -s /usr/doc/$PRGNAM-$VERSION/gui/help $PKG/usr/libexec/sonic-pi/app/gui/qt/
+cp -a ${APPROOT}/gui/qt/html $PKG/usr/doc/$PRGNAM-$VERSION/gui/
+ln -s /usr/doc/$PRGNAM-$VERSION/gui/html $PKG/usr/libexec/sonic-pi/app/gui/qt/
+mv $PKG/usr/libexec/sonic-pi/etc/doc/* $PKG/usr/doc/$PRGNAM-$VERSION/
+rmdir $PKG/usr/libexec/sonic-pi/etc/doc
ln -s /usr/doc/$PRGNAM-$VERSION $PKG/usr/libexec/sonic-pi/etc/doc
+# For the synthdefs:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/synthdefs
-cp -a ${APPROOT}/etc/synthdefs/graphviz/pdf $PKG/usr/doc/$PRGNAM-$VERSION/synthdefs/
+mv $PKG/usr/libexec/sonic-pi/etc/synthdefs/graphviz/{dot,pdf} $PKG/usr/doc/$PRGNAM-$VERSION/synthdefs/
+ln -s /usr/doc/$PRGNAM-$VERSION/synthdefs/dot $PKG/usr/libexec/sonic-pi/etc/synthdefs/graphviz/
ln -s /usr/doc/$PRGNAM-$VERSION/synthdefs/pdf $PKG/usr/libexec/sonic-pi/etc/synthdefs/graphviz/
-cp -a ${APPROOT}/etc/examples $PKG/usr/doc/$PRGNAM-$VERSION/
+# Also move the examples into the docdir:
+mv $PKG/usr/libexec/sonic-pi/etc/examples $PKG/usr/doc/$PRGNAM-$VERSION/
ln -s /usr/doc/$PRGNAM-$VERSION/examples $PKG/usr/libexec/sonic-pi/etc/
# Create a program wrapper:
@@ -297,7 +324,7 @@ chmod 755 $PKG/usr/bin/sonic-pi
# Install a desktop file:
mkdir -p $PKG/usr/share/pixmaps
-cp -a ${APPROOT}/app/gui/qt/images/icon-smaller.png \
+cp -a ${APPROOT}/gui/qt/images/icon-smaller.png \
$PKG/usr/share/pixmaps/sonic-pi.png
mkdir -p $PKG/usr/share/applications
cat <<EOT > $PKG/usr/share/applications/$PRGNAM.desktop