diff --git a/.SRCINFO b/.SRCINFO index 3a0be0ad7442..c5bb921bcf4b 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,63 +1,64 @@ pkgbase = sonic-pi pkgdesc = The Live Coding Music Synth for Everyone - pkgver = 3.3.1 - pkgrel = 5 + pkgver = 4.6.0 + pkgrel = 1 url = https://sonic-pi.net/ arch = x86_64 groups = pro-audio - license = CCPL - license = LGPL2.1 - license = GPL2 - license = GPL3 + license = CC-BY-SA-4.0 + license = LGPL-2.1-only + license = GPL-2.0-only + license = GPL-3.0-only license = MIT + license = CC0-1.0 + license = BSL-1.0 + license = Ruby + license = Apache-2.0 + license = BSD-3-Clause + license = custom:ISC checkdepends = ruby-rake - makedepends = boost + makedepends = base-devel + makedepends = chrpath makedepends = cmake - makedepends = erlang-nox + makedepends = erlang-headless makedepends = gendesk + makedepends = git + makedepends = licenses makedepends = lua - makedepends = qt5-tools + makedepends = m4 + makedepends = ninja + makedepends = qt6-tools makedepends = ruby-bundler + depends = boost>=1.74.0 + depends = alsa-lib depends = aubio - depends = gcc-libs - depends = glibc - depends = jack-example-tools - depends = osmid - depends = qt5-base - depends = qscintilla-qt5 + depends = elixir + depends = erlang + depends = erlang-xmerl + depends = libpng + depends = libx11 + depends = libxkbcommon + depends = openssl + depends = pipewire-jack + depends = qt6-base + depends = qt6-svg + depends = qt6-wayland + depends = qscintilla-qt6 + depends = rtmidi depends = ruby - depends = ruby-activesupport - depends = ruby-ffi - depends = ruby-gettext - depends = ruby-i18n - depends = ruby-kramdown - depends = ruby-locale - depends = ruby-minitest - depends = ruby-mocha - depends = ruby-multi_json - depends = ruby-polyglot - depends = ruby-rouge - depends = ruby-rugged - depends = ruby-sys-proctable - depends = ruby-text - depends = ruby-treetop + depends = ruby-erb + depends = ruby-prime + depends = ruby-racc + depends = ruby-rexml depends = sc3-plugins depends = supercollider + depends = wayland optdepends = sox: for further effects - source = sonic-pi-3.3.1.tar.gz::https://github.com/samaaron/sonic-pi/archive/v3.3.1.tar.gz - source = sonic-pi-3.2.0-gui_paths.patch - source = sonic-pi-3.3.1-devendor_qscintilla-qt5.patch - source = sonic-pi-3.3.1-devendor_boost.patch - source = sonic-pi-3.3.1-ruby_paths.patch - sha512sums = ccddbc247b9952592dea6f5edf670382e95f87cf5020c5aa30e57ba47a36614171d4e9b6e75556b419eb3918ca6c0d3b257001bff6afdd088d52676bb3667622 - sha512sums = e530cc13cb6674dca2ace2a8da566ce28263a15197cf7fccd5d3e58b676c08ce860bc6264a95d26569ff1f923020a40ece1e05841c955c5db16e61c30938f1c0 - sha512sums = 7046d9a18b4ced21a80b0fb79d8fa522f3d3a08b5f4de6deda3548e82e14187f06b2656b1d80b6897318729948252122e5c37e3c93831a16ec7de89fbd9ba186 - sha512sums = 36f09861690be41bcb0b5bb627d93eddbcd6820f9a019e46313b13058772a34f0c1d8268b9f553678e1afdcc9a87403987f7f0f7dfb446d7402f099b611e2b06 - sha512sums = 3e085d9548ca35b8ccf62985b95111072d9b13bd8b32340ae6412d376e0e6a13a87d6c8a192ab3d2439b4cab61b6cdecc29f7a5dba021e93ad0307641c59ab61 - b2sums = 2198b1918f22ef3ae554a6a1cab5d4cb0e2b4edaf6c8c8f67ba07f1750131e57fd2d973b17875cb6e99dce98df005fe949c337c85c5ea5b7a9905e2d808221d6 - b2sums = b155e8d0bfc3a56ac176a8cbbb11fd27d926af2df54d71a77fab0909187457c73842027f88b452481bc339d55779506a58017ebc79de33c41bffa3e1a8bd204a - b2sums = 7e297f7fda3d5aa10eddba011d18cae813e5c3bfd29f99d19b527669abe9c71a2d4cdc8104c135c2026a57365ff941b39a7a674f0f1a35a25b0176147b8d2764 - b2sums = 909cde9e799f47f8f9e15182a5a21df197d389df50811f14d433c006154ce0483f856760e1707c94c66ea526f126bd0ab3424e1bc638b14be16ec1f270c0eed6 - b2sums = 610f6e8d9b7df50edd17ba4e9f587055b61e9330eea1b959d1112b6c9864e53d82e66018d5f136e92afe4245fd4ad5c4a58774c3785615e6e952fb94280e5388 + source = sonic-pi-4.6.0.tar.gz::https://github.com/sonic-pi-net/sonic-pi/archive/refs/tags/v4.6.0.tar.gz + source = sonic-pi-4.6.0-gui_paths.patch + source = sonic-pi-4.6.0-ruby_paths.patch + sha512sums = d99d25bbb2e8b556156252140484502ce5bf2869f846b7aff69dae549812d18769b8cd6d9c474be36819d7a831b170553690906d89ece74cd9df2f80289d5892 + sha512sums = 625b08cd7b1bbe93f898e36183badafed5e056b18df8d923b2ddb964fe358060501fcf63b9c8a05b95a5d9ab8d6dfb0419a7ed519b511c8e1612a7698df3f44a + sha512sums = fa091666d493f302b507a8c8ccaf1992ee64214ec0f45b92198f724fce2b1cee718204afeba4de5ab6d2849a1e9a1933b623054fc459227a15529146d9937d7e pkgname = sonic-pi diff --git a/PKGBUILD b/PKGBUILD index 5d911e595b3e..47ac242e0138 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,38 +1,35 @@ -# Maintainer: David Runge +# Maintainer: Nathan Pilkington pkgname=sonic-pi -pkgver=3.3.1 -pkgrel=5 +pkgver=4.6.0 +pkgrel=1 pkgdesc="The Live Coding Music Synth for Everyone" arch=(x86_64) url="https://sonic-pi.net/" -license=(CCPL LGPL2.1 GPL2 GPL3 MIT) +license=(CC-BY-SA-4.0 LGPL-2.1-only GPL-2.0-only GPL-3.0-only MIT CC0-1.0 BSL-1.0 Ruby Apache-2.0 BSD-3-Clause custom:ISC) groups=(pro-audio) -depends=(aubio gcc-libs glibc jack-example-tools osmid qt5-base qscintilla-qt5 -ruby ruby-activesupport ruby-ffi ruby-gettext ruby-i18n ruby-kramdown -ruby-locale ruby-minitest ruby-mocha ruby-multi_json ruby-polyglot ruby-rouge -ruby-rugged ruby-sys-proctable ruby-text ruby-treetop sc3-plugins -supercollider) -makedepends=(boost cmake erlang-nox gendesk lua qt5-tools ruby-bundler) +depends=( + 'boost>=1.74.0' # match vendored version + alsa-lib aubio elixir erlang erlang-xmerl libpng libx11 libxkbcommon + openssl pipewire-jack qt6-base qt6-svg qt6-wayland qscintilla-qt6 rtmidi + ruby ruby-erb ruby-prime ruby-racc ruby-rexml sc3-plugins supercollider wayland +) +makedepends=( + base-devel chrpath cmake erlang-headless gendesk git licenses lua m4 ninja qt6-tools + ruby-bundler +) checkdepends=(ruby-rake) optdepends=('sox: for further effects') source=( - $pkgname-$pkgver.tar.gz::https://github.com/samaaron/${pkgname}/archive/v${pkgver}.tar.gz - $pkgname-3.2.0-gui_paths.patch - $pkgname-3.3.1-devendor_qscintilla-qt5.patch - $pkgname-3.3.1-devendor_boost.patch - $pkgname-3.3.1-ruby_paths.patch + $pkgname-$pkgver.tar.gz::https://github.com/sonic-pi-net/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz + $pkgname-$pkgver-gui_paths.patch + $pkgname-$pkgver-ruby_paths.patch +) +sha512sums=( + 'd99d25bbb2e8b556156252140484502ce5bf2869f846b7aff69dae549812d18769b8cd6d9c474be36819d7a831b170553690906d89ece74cd9df2f80289d5892' + '625b08cd7b1bbe93f898e36183badafed5e056b18df8d923b2ddb964fe358060501fcf63b9c8a05b95a5d9ab8d6dfb0419a7ed519b511c8e1612a7698df3f44a' + 'fa091666d493f302b507a8c8ccaf1992ee64214ec0f45b92198f724fce2b1cee718204afeba4de5ab6d2849a1e9a1933b623054fc459227a15529146d9937d7e' ) -sha512sums=('ccddbc247b9952592dea6f5edf670382e95f87cf5020c5aa30e57ba47a36614171d4e9b6e75556b419eb3918ca6c0d3b257001bff6afdd088d52676bb3667622' - 'e530cc13cb6674dca2ace2a8da566ce28263a15197cf7fccd5d3e58b676c08ce860bc6264a95d26569ff1f923020a40ece1e05841c955c5db16e61c30938f1c0' - '7046d9a18b4ced21a80b0fb79d8fa522f3d3a08b5f4de6deda3548e82e14187f06b2656b1d80b6897318729948252122e5c37e3c93831a16ec7de89fbd9ba186' - '36f09861690be41bcb0b5bb627d93eddbcd6820f9a019e46313b13058772a34f0c1d8268b9f553678e1afdcc9a87403987f7f0f7dfb446d7402f099b611e2b06' - '3e085d9548ca35b8ccf62985b95111072d9b13bd8b32340ae6412d376e0e6a13a87d6c8a192ab3d2439b4cab61b6cdecc29f7a5dba021e93ad0307641c59ab61') -b2sums=('2198b1918f22ef3ae554a6a1cab5d4cb0e2b4edaf6c8c8f67ba07f1750131e57fd2d973b17875cb6e99dce98df005fe949c337c85c5ea5b7a9905e2d808221d6' - 'b155e8d0bfc3a56ac176a8cbbb11fd27d926af2df54d71a77fab0909187457c73842027f88b452481bc339d55779506a58017ebc79de33c41bffa3e1a8bd204a' - '7e297f7fda3d5aa10eddba011d18cae813e5c3bfd29f99d19b527669abe9c71a2d4cdc8104c135c2026a57365ff941b39a7a674f0f1a35a25b0176147b8d2764' - '909cde9e799f47f8f9e15182a5a21df197d389df50811f14d433c006154ce0483f856760e1707c94c66ea526f126bd0ab3424e1bc638b14be16ec1f270c0eed6' - '610f6e8d9b7df50edd17ba4e9f587055b61e9330eea1b959d1112b6c9864e53d82e66018d5f136e92afe4245fd4ad5c4a58774c3785615e6e952fb94280e5388') prepare() { cd $pkgname-$pkgver @@ -41,85 +38,57 @@ prepare() { --pkgdesc "$pkgdesc" \ --name "Sonic Pi" \ --categories "AudioVideo;Audio" - rm -rvf app/server/native + + # not sure what this is for - comment for now + # rm -rvf app/server/native + # patch app/gui/qt/{model/sonicpitheme,mainwindow}.cpp to set path to # external components in /usr/{lib,share}/sonic-pi printf "Apply patch to set FHS compliant GUI paths\n" - patch -Np1 -i "../${pkgname}-3.2.0-gui_paths.patch" - # devendor qscintilla-qt5: https://github.com/samaaron/sonic-pi/issues/2278 - printf "Apply patch to devendor qscintilla-qt5\n" - patch -Np1 -i "../${pkgname}-3.3.1-devendor_qscintilla-qt5.patch" - printf "Apply patch to devendor boost\n" - patch -Np1 -i "../${pkgname}-3.3.1-devendor_boost.patch" + patch -Np1 -i "../$pkgname-$pkgver-gui_paths.patch" - # TODO: devendor ast-2.0.0 - # TODO: devendor atomic (bin) - # TODO: devendor benchmark-ips-2.3.0 - # TODO: devendor blankslate - # TODO: devendor interception (bin) - # TODO: devendor memoist-0.16.2 - # TODO: devendor metaclass-0.0.4 - # TODO: devendor rubame - # TODO: devendor ruby-beautify - # TODO: devendor ruby-prof-0.15.8 - # TODO: devendor thread_safe - # TODO: devendor tomlrb-2.0.0 - # TODO: devendor wavefile-0.8.1 - # TODO: devendor websocket-ruby-1.2.8 +# Commented out all this devendoring stuff for now, will address later +# # devendor qscintilla-qt5: https://github.com/samaaron/sonic-pi/issues/2278 +# printf "Apply patch to devendor qscintilla-qt5\n" +# patch -Np1 -i "../${pkgname}-3.3.1-devendor_qscintilla-qt5.patch" +# printf "Apply patch to devendor boost\n" +# patch -Np1 -i "../${pkgname}-3.3.1-devendor_boost.patch" - # devendor gems requiring compilation: - # ffi, ruby-prof, rugged - sed -e '/rugged/d' \ - -e '/ffi/d' \ - -e '/ruby-prof/d' \ - -i app/server/ruby/bin/compile-extensions.rb - # remove unrequired gems, so we don't create any doc for them - rm -rvf app/server/ruby/vendor/{activesupport,ffi,gettext,i18n,kramdown,locale,minitest,mocha,multi_json,polyglot,rouge,rugged,sys-proctable,text,treetop}* - rm -rvf app/server/ruby/vendor/{narray,ruby-coreaudio,ruby-prof,rake-compiler}* +# # TODO: devendor ast-2.0.0 +# # TODO: devendor atomic (bin) +# # TODO: devendor benchmark-ips-2.3.0 +# # TODO: devendor blankslate +# # TODO: devendor interception (bin) +# # TODO: devendor memoist-0.16.2 +# # TODO: devendor metaclass-0.0.4 +# # TODO: devendor rubame +# # TODO: devendor ruby-beautify +# # TODO: devendor ruby-prof-0.15.8 +# # TODO: devendor thread_safe +# # TODO: devendor tomlrb-2.0.0 +# # TODO: devendor wavefile-0.8.1 +# # TODO: devendor websocket-ruby-1.2.8 + +# # devendor gems requiring compilation: +# # ffi, ruby-prof, rugged +# sed -e '/rugged/d' \ +# -e '/ffi/d' \ +# -e '/ruby-prof/d' \ +# -i app/server/ruby/bin/compile-extensions.rb +# # remove unrequired gems, so we don't create any doc for them +# rm -rvf app/server/ruby/vendor/{activesupport,ffi,gettext,i18n,kramdown,locale,minitest,mocha,multi_json,polyglot,rouge,rugged,sys-proctable,text,treetop}* +# rm -rvf app/server/ruby/vendor/{narray,ruby-coreaudio,ruby-prof,rake-compiler}* } build() { cd "$pkgname-$pkgver" + ./app/linux-build-all.sh - ( - # OSC and pi_server - cd app/server/erlang/sonic_pi_server/src - erlc {osc/osc,pi_server/pi_server,sp_midi/sp_midi}.erl - ) - - ( - # ruby extensions - cd app/server/ruby/bin - ./compile-extensions.rb - ./i18n-tool.rb -t - ) - - ( - # GUI - cd app/gui/qt/ - # help template - cp -vf utils/ruby_help.{tmpl,h} - ../../server/ruby/bin/qt-doc.rb -o utils/ruby_help.h - # generating translations - lrelease lang/*.ts - # compiling GUI - ) - ( - cd app - cmake -DCMAKE_INSTALL_PREFIX=/usr \ - -B build \ - -Wno-dev \ - -S . - make VERBOSE=1 -C build - ) - - ( - # patch app/server/ruby/lib/sonicpi/util.rb to set proper paths to external components - # NOTE: this can only be done after running - # app/server/ruby/bin/compile-extensions.rb, as ruby-wavefile uses a - # hardcoded location of a file (move to prepare() after devendoring more ruby gems) - patch -Np1 -i ../$pkgname-3.3.1-ruby_paths.patch - ) + # patch app/server/ruby/lib/sonicpi/util.rb to set proper paths to external components + # NOTE: this can only be done after running + # app/server/ruby/bin/compile-extensions.rb, as ruby-wavefile uses a + # hardcoded location of a file (move to prepare() after devendoring more ruby gems) + patch -Np1 -i "../$pkgname-$pkgver-ruby_paths.patch" } ## tests fail: https://github.com/samaaron/sonic-pi/issues/1865 @@ -130,27 +99,37 @@ build() { #} package() { - cd "$pkgname-$pkgver" - # GUI executable - install -vDm 755 "app/build/gui/qt/$pkgname" -t "$pkgdir/usr/bin/" + cd "$pkgname-$pkgver"/app + + # Install with correct prefix + DESTDIR="$pkgdir" cmake --install build --prefix /usr + + # Install GUI executable + install -vDm 755 build/gui/$pkgname "$pkgdir/usr/bin/$pkgname" + + cd .. + + # Install generated desktop file + install -vDm 644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop" # book - install -vDm 644 app/gui/qt/book/*.html -t "$pkgdir/usr/share/$pkgname/book/" + install -vDm 644 app/gui/book/*.html -t "$pkgdir/usr/share/$pkgname/book/" # i18n - install -vDm 644 app/gui/qt/lang/*.qm -t "$pkgdir/usr/share/$pkgname/lang/" + install -vDm 644 app/gui/lang/*.qm -t "$pkgdir/usr/share/$pkgname/lang/" # help - install -vDm 644 app/gui/qt/help/*.html -t "$pkgdir/usr/share/$pkgname/help/" + install -vDm 644 app/gui/help/*.html -t "$pkgdir/usr/share/$pkgname/help/" # html - install -vDm 644 app/gui/qt/html/*.html -t "$pkgdir/usr/share/$pkgname/html/" + install -vDm 644 app/gui/html/*.html -t "$pkgdir/usr/share/$pkgname/html/" # images - install -vDm 644 app/gui/qt/images/*.png -t "$pkgdir/usr/share/$pkgname/images/" - install -vDm 644 app/gui/qt/images/coreteam/*.png -t "$pkgdir/usr/share/$pkgname/images/coreteam/" - install -vDm 644 app/gui/qt/images/toolbar/default/*.png -t "$pkgdir/usr/share/$pkgname/images/toolbar/default/" - install -vDm 644 app/gui/qt/images/toolbar/pro/*.png -t "$pkgdir/usr/share/$pkgname/images/toolbar/pro/" + install -vDm 644 app/gui/images/*.png -t "$pkgdir/usr/share/$pkgname/images/" + install -vDm 644 app/gui/images/coreteam/*.png -t "$pkgdir/usr/share/$pkgname/images/coreteam/" + install -vDm 644 app/gui/images/toolbar/default/*.png -t "$pkgdir/usr/share/$pkgname/images/toolbar/default/" + install -vDm 644 app/gui/images/toolbar/pro/*.png -t "$pkgdir/usr/share/$pkgname/images/toolbar/pro/" install -vDm 644 etc/doc/images/tutorial/*.png -t "$pkgdir/usr/share/$pkgname/images/tutorial/" # theme - install -vDm 644 app/gui/qt/theme/app.qss -t "$pkgdir/usr/share/$pkgname/theme/" - install -vDm 644 app/gui/qt/theme/dark/doc-styles.css -t "$pkgdir/usr/share/$pkgname/theme/dark/" - install -vDm 644 app/gui/qt/theme/light/doc-styles.css -t "$pkgdir/usr/share/$pkgname/theme/light/" + install -vDm 644 app/gui/theme/app.qss -t "$pkgdir/usr/share/$pkgname/theme/" + install -vDm 644 app/gui/theme/dark/doc-styles.css -t "$pkgdir/usr/share/$pkgname/theme/dark/" + install -vDm 644 app/gui/theme/light/doc-styles.css -t "$pkgdir/usr/share/$pkgname/theme/light/" + install -vDm 644 app/gui/theme/high_contrast/doc-styles.css -t "$pkgdir/usr/share/$pkgname/theme/high_contrast/" # samples install -vDm 644 etc/samples/*.{flac,md} -t "$pkgdir/usr/share/$pkgname/samples/" # snippets @@ -178,16 +157,18 @@ package() { install -vDm 644 etc/examples/magician/*.rb -t "$pkgdir/usr/share/doc/$pkgname/examples/magician/" install -vDm 644 etc/examples/sorcerer/*.rb -t "$pkgdir/usr/share/doc/$pkgname/examples/sorcerer/" install -vDm 644 etc/examples/wizard/*.rb -t "$pkgdir/usr/share/doc/$pkgname/examples/wizard/" - # erlang - install -vDm 755 app/server/erlang/sonic_pi_server/src/*.beam -t "$pkgdir/usr/lib/$pkgname/" # ruby install -vdm 755 "$pkgdir/usr/lib/$pkgname" - cp -av app/server/ruby "$pkgdir/usr/lib/$pkgname/server" + cp -av app/server "$pkgdir/usr/lib/$pkgname/" find "$pkgdir/usr/lib/$pkgname/server" -type f \( -iname "*.o" -or -iname "*.c" -or -iname "*Rakefile" \) -delete - # xdg + + # # xdg install -vDm 644 $pkgname.desktop -t "$pkgdir/usr/share/applications/" - install -vDm 644 app/gui/qt/images/icon-smaller.png "$pkgdir/usr/share/pixmaps/$pkgname.png" + install -vDm 644 app/gui/images/icon-smaller.png "$pkgdir/usr/share/pixmaps/$pkgname.png" # license install -vDm 644 LICENSE.md -t "$pkgdir/usr/share/licenses/$pkgname/" + + # fix /build path vulnerability + chrpath -d "$pkgdir/usr/bin/$pkgname" } diff --git a/sonic-pi-4.6.0-gui_paths.patch b/sonic-pi-4.6.0-gui_paths.patch new file mode 100644 index 000000000000..60b26a5be1f1 --- /dev/null +++ b/sonic-pi-4.6.0-gui_paths.patch @@ -0,0 +1,74 @@ +diff -ruN a/app/gui/model/sonicpitheme.cpp b/app/gui/model/sonicpitheme.cpp +--- a/app/gui/model/sonicpitheme.cpp 2024-01-01 00:00:00.000000000 +0000 ++++ b/app/gui/model/sonicpitheme.cpp 2025-10-14 00:00:00.000000000 +0000 +@@ -26,9 +26,9 @@ + this->customSettingsFilename = customSettingsFilename; + this->rootPath = rootPath; + +- qt_app_theme_path = QDir::toNativeSeparators(rootPath + "/app/gui/theme/app.qss"); ++ qt_app_theme_path = QDir::toNativeSeparators(rootPath + "/usr/share/sonic-pi/theme/app.qss"); + +- qt_browser_dark_css = QDir::toNativeSeparators(rootPath + "/app/gui/theme/dark/doc-styles.css"); +- qt_browser_light_css = QDir::toNativeSeparators(rootPath + "/app/gui/theme/light/doc-styles.css"); +- qt_browser_hc_css = QDir::toNativeSeparators(rootPath + "/app/gui/theme/high_contrast/doc-styles.css"); ++ qt_browser_dark_css = QDir::toNativeSeparators(rootPath + "/usr/share/sonic-pi/theme/dark/doc-styles.css"); ++ qt_browser_light_css = QDir::toNativeSeparators(rootPath + "/usr/share/sonic-pi/theme/light/doc-styles.css"); ++ qt_browser_hc_css = QDir::toNativeSeparators(rootPath + "/usr/share/sonic-pi/theme/high_contrast/doc-styles.css"); + + loadToolBarIcons(); +diff -ruN a/app/gui/mainwindow.cpp b/app/gui/mainwindow.cpp +--- a/app/gui/mainwindow.cpp 2024-01-01 00:00:00.000000000 +0000 ++++ b/app/gui/mainwindow.cpp 2025-10-14 00:00:00.000000000 +0000 +@@ -298,9 +298,9 @@ + + QString root_path = rootPath(); + +- qt_app_theme_path = QDir::toNativeSeparators(root_path + "/app/gui/theme/app.qss"); +- qt_browser_dark_css = QDir::toNativeSeparators(root_path + "/app/gui/theme/dark/doc-styles.css"); +- qt_browser_light_css = QDir::toNativeSeparators(root_path + "/app/gui/theme/light/doc-styles.css"); +- qt_browser_hc_css = QDir::toNativeSeparators(root_path + "/app/gui/theme/high_contrast/doc-styles.css"); ++ qt_app_theme_path = QDir::toNativeSeparators(root_path + "/usr/share/sonic-pi/theme/app.qss"); ++ qt_browser_dark_css = QDir::toNativeSeparators(root_path + "/usr/share/sonic-pi/theme/dark/doc-styles.css"); ++ qt_browser_light_css = QDir::toNativeSeparators(root_path + "/usr/share/sonic-pi/theme/light/doc-styles.css"); ++ qt_browser_hc_css = QDir::toNativeSeparators(root_path + "/usr/share/sonic-pi/theme/high_contrast/doc-styles.css"); + } + + void MainWindow::checkForStudioMode() +@@ -1331,7 +1331,7 @@ + // On Mac, we have the app bundle + return QCoreApplication::applicationDirPath() + "/../../../../.."; + #elif defined(Q_OS_WIN) +- // On Windows, ++ // On Windows + return QCoreApplication::applicationDirPath() + "/../../.."; + #else +- // On linux, CMake builds app into the build folder +- return QCoreApplication::applicationDirPath() + "/../../../.."; ++ // On Linux, installed to /usr ++ return QCoreApplication::applicationDirPath() + "/../.."; + #endif +diff -ruN a/app/api/src/sonicpi_api.cpp b/app/api/src/sonicpi_api.cpp +--- a/app/api/src/sonicpi_api.cpp 2024-01-01 00:00:00.000000000 +0000 ++++ b/app/api/src/sonicpi_api.cpp 2025-10-15 00:00:00.000000000 +0000 +@@ -764,9 +764,9 @@ + } + + // Set Ruby script paths +- m_paths[SonicPiPath::BootDaemonPath] = m_paths[SonicPiPath::RootPath] / "app/server/ruby/bin/daemon.rb"; +- m_paths[SonicPiPath::FetchUrlPath] = m_paths[SonicPiPath::RootPath] / "app/server/ruby/bin/fetch-url.rb"; +- m_paths[SonicPiPath::ClearLogsPath] = m_paths[SonicPiPath::RootPath] / "app/server/ruby/bin/clear-logs.rb"; ++ m_paths[SonicPiPath::BootDaemonPath] = "/usr/lib/sonic-pi/server/ruby/bin/daemon.rb"; ++ m_paths[SonicPiPath::FetchUrlPath] = "/usr/lib/sonic-pi/server/ruby/bin/fetch-url.rb"; ++ m_paths[SonicPiPath::ClearLogsPath] = "/usr/lib/sonic-pi/server/ruby/bin/clear-logs.rb"; + + + +@@ -779,7 +779,7 @@ + m_paths[SonicPiPath::GUILogPath] = m_paths[SonicPiPath::LogPath] / "gui.log"; + + // Set built-in samples path +- m_paths[SonicPiPath::SamplePath] = m_paths[SonicPiPath::RootPath] / "etc/samples/"; ++ m_paths[SonicPiPath::SamplePath] = "/usr/share/sonic-pi/samples/"; + + // Set Config paths + m_paths[SonicPiPath::ConfigPath] = m_paths[SonicPiPath::UserPath] / "config"; \ No newline at end of file diff --git a/sonic-pi-4.6.0-ruby_paths.patch b/sonic-pi-4.6.0-ruby_paths.patch new file mode 100644 index 000000000000..4debcba33b52 --- /dev/null +++ b/sonic-pi-4.6.0-ruby_paths.patch @@ -0,0 +1,84 @@ +diff -ruN a/app/server/ruby/core.rb b/app/server/ruby/core.rb +--- a/app/server/ruby/core.rb 2024-12-16 00:00:00.000000000 +0000 ++++ b/app/server/ruby/core.rb 2024-12-16 00:00:00.000000000 +0000 +@@ -127,7 +127,7 @@ + # define this helper first so we can set the constants below + def self.wav_from_buffer_file(filename) + ::WaveFile::Reader.new( +- File.expand_path("../../../../etc/buffers/#{filename}", __FILE__), ++ File.expand_path("/usr/share/sonic-pi/buffers/#{filename}"), + ::WaveFile::Format.new(:mono, :float, 44100) + ).read(441000).samples.freeze + end +diff -ruN a/app/server/ruby/paths.rb b/app/server/ruby/paths.rb +--- a/app/server/ruby/paths.rb 2024-12-16 00:00:00.000000000 +0000 ++++ b/app/server/ruby/paths.rb 2024-12-16 00:00:00.000000000 +0000 +@@ -47,11 +47,11 @@ + end + + def self.root_path +- File.absolute_path("#{File.dirname(__FILE__)}/../../../") ++ File.absolute_path("/usr/share/sonic-pi") + end + + def self.etc_path +- File.absolute_path("#{root_path}/etc") ++ File.absolute_path("#{root_path}") + end + def self.snippets_path + File.absolute_path("#{etc_path}/snippets") +@@ -58,7 +58,7 @@ + end + + def self.doc_path +- File.absolute_path("#{etc_path}/doc") ++ File.absolute_path("/usr/share/doc/sonic-pi") + end + + def self.docs_generated_path +@@ -133,7 +133,7 @@ + end + + def self.tmp_path +- File.absolute_path("#{root_path}/tmp") ++ File.absolute_path("/tmp") + end + + def self.synthdef_path +@@ -153,7 +153,7 @@ + end + + def self.app_path +- File.absolute_path("#{root_path}/app") ++ File.absolute_path("/usr/lib/sonic-pi") + end + + def self.html_public_path +@@ -165,11 +165,11 @@ + end + + def self.qt_gui_utils_path +- File.absolute_path("#{app_path}/gui/utils") ++ File.absolute_path("/usr/share/sonic-pi/gui/utils") + end + + def self.examples_path +- File.absolute_path("#{etc_path}/examples") ++ File.absolute_path("#{doc_path}/examples") + end + + def self.server_path +@@ -211,10 +211,5 @@ + end + + def self.sox_path +- case os +- when :windows +- File.absolute_path("#{native_path}/sox/sox.exe") +- else +- File.absolute_path("#{native_path}/sox/sox") +- end ++ File.absolute_path("/usr/bin/sox") + end + + def self.scsynth_log_path