From 58fc0af435bbfcb7066269ddd4dd318dd66afbad Mon Sep 17 00:00:00 2001 From: Nicolas Porcel Date: Sun, 26 Feb 2023 21:26:34 +0000 Subject: [PATCH] new package: sonic-pi --- common/shlibs | 4 + .../patches/add_missing_include.patch | 12 +++ srcpkgs/crossguid-git/template | 27 +++++++ srcpkgs/gl3w-git/template | 20 +++++ srcpkgs/kissfft-devel | 1 + srcpkgs/kissfft/template | 31 +++++++ srcpkgs/platform_folders-devel | 1 + srcpkgs/platform_folders/template | 25 ++++++ srcpkgs/reproc++ | 1 + srcpkgs/reproc++-devel | 1 + srcpkgs/reproc-devel | 1 + srcpkgs/reproc/template | 41 ++++++++++ srcpkgs/sonic-pi/files/sonic-pi | 3 + srcpkgs/sonic-pi/template | 81 +++++++++++++++++++ 14 files changed, 249 insertions(+) create mode 100644 srcpkgs/crossguid-git/patches/add_missing_include.patch create mode 100644 srcpkgs/crossguid-git/template create mode 100644 srcpkgs/gl3w-git/template create mode 120000 srcpkgs/kissfft-devel create mode 100644 srcpkgs/kissfft/template create mode 120000 srcpkgs/platform_folders-devel create mode 100644 srcpkgs/platform_folders/template create mode 120000 srcpkgs/reproc++ create mode 120000 srcpkgs/reproc++-devel create mode 120000 srcpkgs/reproc-devel create mode 100644 srcpkgs/reproc/template create mode 100644 srcpkgs/sonic-pi/files/sonic-pi create mode 100644 srcpkgs/sonic-pi/template diff --git a/common/shlibs b/common/shlibs index 4fe3b26a2e0378..60f33e285ace6b 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4305,3 +4305,7 @@ libmsgraph-0.so.1 msgraph-0.2.1_1 libgtk-session-lock.so.0 gtk-session-lock-0.2.0_1 libcamera.so.0.2 libcamera-0.2.0_1 libcamera-base.so.0.2 libcamera-0.2.0_1 +libplatform_folders.so platform_folders-4.2.0_1 +libreproc.so.14 reproc-14.2.5_1 +libreproc++.so.14 reproc++-14.2.5_1 +libkissfft-float.so.131 kissfft-131.1.0_1 diff --git a/srcpkgs/crossguid-git/patches/add_missing_include.patch b/srcpkgs/crossguid-git/patches/add_missing_include.patch new file mode 100644 index 00000000000000..4e0c24c2a11438 --- /dev/null +++ b/srcpkgs/crossguid-git/patches/add_missing_include.patch @@ -0,0 +1,12 @@ +Index: crossguid-git-201900529/include/crossguid/guid.hpp +=================================================================== +--- crossguid-git-201900529.orig/include/crossguid/guid.hpp ++++ crossguid-git-201900529/include/crossguid/guid.hpp +@@ -29,6 +29,7 @@ THE SOFTWARE. + #include + #endif + ++#include + #include + #include + #include diff --git a/srcpkgs/crossguid-git/template b/srcpkgs/crossguid-git/template new file mode 100644 index 00000000000000..bc731b6dae7eed --- /dev/null +++ b/srcpkgs/crossguid-git/template @@ -0,0 +1,27 @@ +# Template file for 'crossguid-git' +pkgname=crossguid-git +version=201900529 +revision=1 +build_style=cmake +hostmakedepends="git" +makedepends="libuuid-devel" +short_desc="Lightweight cross platform C++ GUID/UUID library (git)" +maintainer="Nicolas Porcel " +license="MIT" +homepage="https://github.com/graeme-hill/crossguid" +_commit_id=ca1bf4b810e2d188d04cb6286f957008ee1b7681 + +do_fetch() { + git clone $homepage $wrksrc + cd $wrksrc + git checkout ${_commit_id} +} + +do_install() { + vlicense LICENSE + vinstall build/libcrossguid.a 644 usr/lib + vinstall include/crossguid/guid.hpp 644 usr/include/crossguid + + vmkdir usr/lib/cmake/crossguid + vcopy build/CMakeFiles/Export/*/crossguid-config*.cmake usr/lib/cmake/crossguid +} diff --git a/srcpkgs/gl3w-git/template b/srcpkgs/gl3w-git/template new file mode 100644 index 00000000000000..6a536a3c92e8a3 --- /dev/null +++ b/srcpkgs/gl3w-git/template @@ -0,0 +1,20 @@ +# Template file for 'gl3w-git' +pkgname=gl3w-git +version=20231010 +revision=1 +archs="i686 x86_64" +build_style=cmake +hostmakedepends="git" +makedepends="MesaLib-devel python3" +depends="mesa" +short_desc="Simple OpenGL core profile loading" +maintainer="Nicolas Porcel " +license="Unlicense" +homepage="https://github.com/skaslev/gl3w" +_commit_id=3a33275633ce4be433332dc776e6a5b3bdea6506 + +do_fetch() { + git clone $homepage $wrksrc + cd $wrksrc + git checkout ${_commit_id} +} diff --git a/srcpkgs/kissfft-devel b/srcpkgs/kissfft-devel new file mode 120000 index 00000000000000..55f4052fc4c657 --- /dev/null +++ b/srcpkgs/kissfft-devel @@ -0,0 +1 @@ +kissfft \ No newline at end of file diff --git a/srcpkgs/kissfft/template b/srcpkgs/kissfft/template new file mode 100644 index 00000000000000..aa00325d753217 --- /dev/null +++ b/srcpkgs/kissfft/template @@ -0,0 +1,31 @@ +# Template file for 'kissfft' +pkgname=kissfft +version=131.1.0 +revision=1 +archs="i686 x86_64" +build_style=cmake +configure_args="-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DKISSFFT_OPENMP=OFF -DKISSFFT_PKGCONFIG=ON" +makedepends="python3 libpng-devel fftw-devel pkg-config" +depends="libpng" +checkdepends="python3-numpy" +short_desc="Fast Fourier Transform (FFT) library" +maintainer="Nicolas Porcel " +license="BSD-3-Clause,Unlicense" +homepage="https://github.com/mborgerding/kissfft" +distfiles="${homepage}/archive/refs/tags/${version}.tar.gz" +checksum=@a772a3a982bdbb515695d705bf7f4e2632a671af3144839479ce3813fe5223be + +post_install() { + vlicense LICENSES/BSD-3-Clause +} + +kissfft-devel_package() { + short_desc+=" (development files)" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/lib/*.so + vmove usr/include + vmove usr/lib/cmake + vmove usr/lib/pkgconfig + } +} diff --git a/srcpkgs/platform_folders-devel b/srcpkgs/platform_folders-devel new file mode 120000 index 00000000000000..68c09f7e4c01ef --- /dev/null +++ b/srcpkgs/platform_folders-devel @@ -0,0 +1 @@ +platform_folders \ No newline at end of file diff --git a/srcpkgs/platform_folders/template b/srcpkgs/platform_folders/template new file mode 100644 index 00000000000000..638b1d1572c8a1 --- /dev/null +++ b/srcpkgs/platform_folders/template @@ -0,0 +1,25 @@ +# Template file for 'platform_folders' +pkgname=platform_folders +version=4.2.0 +revision=1 +build_style=cmake +configure_args="-DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DPLATFORMFOLDERS_ENABLE_INSTALL=ON" +short_desc="C++ library to look for user directories" +maintainer="Nicolas Porcel " +license="MIT" +homepage="https://github.com/sago007/PlatformFolders" +distfiles="${homepage}/archive/refs/tags/${version}.tar.gz" +checksum=@368af4106c2aff0b46f0bb23b6460d6600eaafb2b5db786f05f2ca8e9be5a2fd + +post_install() { + vlicense LICENSE +} + +platform_folders-devel_package() { + short_desc+=" (development files)" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/include + vmove usr/lib/cmake + } +} diff --git a/srcpkgs/reproc++ b/srcpkgs/reproc++ new file mode 120000 index 00000000000000..ea2ee2920788c1 --- /dev/null +++ b/srcpkgs/reproc++ @@ -0,0 +1 @@ +reproc \ No newline at end of file diff --git a/srcpkgs/reproc++-devel b/srcpkgs/reproc++-devel new file mode 120000 index 00000000000000..ea2ee2920788c1 --- /dev/null +++ b/srcpkgs/reproc++-devel @@ -0,0 +1 @@ +reproc \ No newline at end of file diff --git a/srcpkgs/reproc-devel b/srcpkgs/reproc-devel new file mode 120000 index 00000000000000..ea2ee2920788c1 --- /dev/null +++ b/srcpkgs/reproc-devel @@ -0,0 +1 @@ +reproc \ No newline at end of file diff --git a/srcpkgs/reproc/template b/srcpkgs/reproc/template new file mode 100644 index 00000000000000..9a8fa95fb06920 --- /dev/null +++ b/srcpkgs/reproc/template @@ -0,0 +1,41 @@ +# Template file for 'reproc' +pkgname=reproc +version=14.2.5 +revision=1 +build_style=cmake +configure_args="-DBUILD_SHARED_LIBS=ON -DREPROC++=ON" +short_desc="Cross-platform C99/C++11 process library" +maintainer="Nicolas Porcel " +license="GPL-3.0-or-later" +homepage="https://github.com/DaanDeMeyer/reproc" +distfiles="https://github.com/DaanDeMeyer/reproc/archive/refs/tags/v${version}.tar.gz" +checksum=@24f06d6ff393ed89400ee1d5aaff7ba97cf2a996c031083bde613ce937d9f163 + +reproc-devel_package() { + short_desc+=" (development files)" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/include/reproc + vmove usr/lib/cmake/reproc + vmove usr/lib/pkgconfig/reproc.pc + vmove usr/lib/libreproc.so + } +} + +reproc++_package() { + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/lib/libreproc++.so.* + } +} + +reproc++-devel_package() { + short_desc="${short_desc} (development files)" + depends="${sourcepkg}-devel>=${version}_${revision} ${sourcepkg}++>=${version}_${revision}" + pkg_install() { + vmove usr/include/reproc++ + vmove usr/lib/cmake/reproc++ + vmove usr/lib/pkgconfig/reproc++.pc + vmove usr/lib/libreproc++.so + } +} diff --git a/srcpkgs/sonic-pi/files/sonic-pi b/srcpkgs/sonic-pi/files/sonic-pi new file mode 100644 index 00000000000000..eb75fd702c61df --- /dev/null +++ b/srcpkgs/sonic-pi/files/sonic-pi @@ -0,0 +1,3 @@ +#/usr/bin/env sh + +exec /opt/sonic-pi/bin/sonic-pi diff --git a/srcpkgs/sonic-pi/template b/srcpkgs/sonic-pi/template new file mode 100644 index 00000000000000..bbd888ca75d1c0 --- /dev/null +++ b/srcpkgs/sonic-pi/template @@ -0,0 +1,81 @@ +# Template file for 'sonic-pi' +pkgname=sonic-pi +version=4.5.0 +revision=1 +archs="x86_64" +build_style=cmake +build_wrksrc="app" +configure_args="-DCMAKE_BUILD_TYPE=Release -DBUILD_IMGUI_INTERFACE=ON -DUSE_SYSTEM_LIBS=ON -DQSCINTILLA_INCLUDE_DIR=/usr/include/qt5 -DQSCINTILLA_LIBRARY=/usr/lib/libqscintilla2_qt5.so" +makedepends="qscintilla-qt5-devel qt5-svg-devel SDL2-devel ruby-devel elixir pkg-config aubio-devel catch2 platform_folders-devel reproc++-devel kissfft-devel crossguid-git fmt-devel rtmidi-devel gl3w-git" +depends="qscintilla-qt5 qt5-svg SDL2 supercollider sc3-plugins aubio platform_folders reproc++ kissfft fmt rtmidi ruby erlang libjack-pipewire" +short_desc="Live Coding Music Synth for Everyone" +maintainer="Nicolas Porcel " +license="GPL-3.0-or-later" +homepage="https://sonic-pi.net/" +distfiles="https://github.com/samaaron/${pkgname}/archive/v${version}.tar.gz" +checksum=@3a958ca3c1bb429f5d3cafaee0ed82aae96d5152f06a6a40b1c04154b6291c17 + +pre_configure() { + ruby server/ruby/bin/compile-extensions.rb + ruby server/ruby/bin/i18n-tool.rb -t + + cp gui/qt/utils/ruby_help.tmpl gui/qt/utils/ruby_help.h + ruby server/ruby/bin/qt-doc.rb +} + +post_build() { + cd ${wrksrc}/app/server/beam/tau + MIX_ENV=prod mix tau.release + erl -noinput -eval \ + 'lists:foreach(fun(F) -> beam_lib:strip(F) end, filelib:wildcard("app/server/beam/tau/**/*.beam"))' \ + -s init stop + rm _build/prod/rel/tau/bin/tau.bat +} + +do_install() { + cd ${wrksrc} + + INSTALL_DIR=opt/${pkgname} + vmkdir ${INSTALL_DIR} + + vcopy bin ${INSTALL_DIR} + vcopy etc ${INSTALL_DIR} + + vmkdir ${INSTALL_DIR}/app + vcopy app/config ${INSTALL_DIR}/app + vcopy app/server/native ${INSTALL_DIR}/app/server + + # Ruby + RUBY_DIR=app/server/ruby + vmkdir ${INSTALL_DIR}/${RUBY_DIR} + vcopy ${RUBY_DIR}/*.rb ${INSTALL_DIR}/${RUBY_DIR} + vcopy ${RUBY_DIR}/bin ${INSTALL_DIR}/${RUBY_DIR} + vcopy ${RUBY_DIR}/lib ${INSTALL_DIR}/${RUBY_DIR} + vcopy ${RUBY_DIR}/rb-native ${INSTALL_DIR}/${RUBY_DIR} + for ruby_vendor in ${RUBY_DIR}/vendor/*; do + vendor_name=$(basename $ruby_vendor) + vmkdir ${INSTALL_DIR}/${RUBY_DIR}/vendor/${vendor_name} + vcopy ${RUBY_DIR}/vendor/${vendor_name}/lib ${INSTALL_DIR}/${RUBY_DIR}/vendor/${vendor_name} + done + + BEAM_DIR=app/server/beam/tau + BEAM_BUILD_DIR=${BEAM_DIR}/_build/prod + vmkdir ${INSTALL_DIR}/${BEAM_DIR}/_build + vcopy ${BEAM_BUILD_DIR} ${INSTALL_DIR}/${BEAM_BUILD_DIR} + vinstall ${BEAM_DIR}/boot-lin.sh 0755 ${INSTALL_DIR}/${BEAM_DIR} + + GUI_DIR=app/gui/qt + vmkdir ${INSTALL_DIR}/${GUI_DIR} + vcopy ${GUI_DIR}/lang ${INSTALL_DIR}/${GUI_DIR} + vcopy ${GUI_DIR}/theme ${INSTALL_DIR}/${GUI_DIR} + + GUI_BIN_DIR=app/build/gui/qt + vmkdir ${INSTALL_DIR}/${GUI_BIN_DIR} + vinstall ${GUI_BIN_DIR}/sonic-pi 0755 ${INSTALL_DIR}/${GUI_BIN_DIR} + + IMGUI_RES_DIR=app/gui/imgui/res + vmkdir ${INSTALL_DIR}/${IMGUI_RES_DIR} + vinstall ${IMGUI_RES_DIR}//Cousine-Regular.ttf 0644 ${INSTALL_DIR}/${IMGUI_RES_DIR} + + vbin ${FILESDIR}/sonic-pi +}