From 947777a6276726dc3541d588e31f491a6d14bc7d 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 | 19 +++++ srcpkgs/kissfft-devel | 1 + srcpkgs/kissfft/template | 26 ++++++ srcpkgs/platform_folders-devel | 1 + srcpkgs/platform_folders/template | 24 ++++++ srcpkgs/reproc++ | 1 + srcpkgs/reproc++-devel | 1 + srcpkgs/reproc-devel | 1 + srcpkgs/reproc/template | 56 +++++++++++++ srcpkgs/sonic-pi/files/sonic-pi | 3 + srcpkgs/sonic-pi/template | 84 +++++++++++++++++++ 14 files changed, 260 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..dfd3f0a577185b --- /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..621bade1283f9e --- /dev/null +++ b/srcpkgs/gl3w-git/template @@ -0,0 +1,19 @@ +# Template file for 'gl3w-git' +pkgname=gl3w-git +version=20231010 +revision=1 +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..3d350dfcd9087e --- /dev/null +++ b/srcpkgs/kissfft/template @@ -0,0 +1,26 @@ +# Template file for 'kissfft' +pkgname=kissfft +version=131.1.0 +revision=1 +build_style=cmake +configure_args="-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DKISSFFT_OPENMP=OFF -DKISSFFT_PKGCONFIG=ON" +hostmakedepends="" +makedepends="python3 libpng-devel fftw-devel pkg-config" +depends="libpng" +short_desc="a Fast Fourier Transform (FFT) library that tries to Keep it Simple, Stupid " +maintainer="Nicolas Porcel " +license="BSD-3-Clause" +homepage="https://github.com/mborgerding/kissfft" +distfiles="${homepage}/archive/refs/tags/${version}.tar.gz" +checksum=@a772a3a982bdbb515695d705bf7f4e2632a671af3144839479ce3813fe5223be + +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..cea41fa32a7225 --- /dev/null +++ b/srcpkgs/platform_folders/template @@ -0,0 +1,24 @@ +# 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" +hostmakedepends="" +makedepends="" +depends="" +short_desc='A C++ library to look for special directories like "My Documents" and "%APPDATA%" so that you do not need to write Linux, Windows or Mac OS X specific code' +maintainer="Nicolas Porcel " +license="MIT" +homepage="https://github.com/sago007/PlatformFolders" +distfiles="${homepage}/archive/refs/tags/${version}.tar.gz" +checksum=@368af4106c2aff0b46f0bb23b6460d6600eaafb2b5db786f05f2ca8e9be5a2fd + +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..ec9f240f008b52 --- /dev/null +++ b/srcpkgs/reproc/template @@ -0,0 +1,56 @@ +# Template file for 'reproc' +pkgname=reproc +version=14.2.5 +revision=1 +build_style=cmake +configure_args="-DBUILD_SHARED_LIBS=ON -DREPROC++=ON" +hostmakedepends="" +makedepends="" +depends="" +short_desc="A cross-platform C99 process library" +short_desc_cpp="A cross-platform 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() { + short_desc=short_desc_cpp + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/lib/libreproc++.so.* + } +} + +reproc++-devel_package() { + short_desc="${short_desc_cpp} (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 + } +} + +reproc-devel_package() { + short_desc+=" (development files)" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/include + vmove usr/lib/cmake + vmove usr/lib/pkgconfig + } +} 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..dbe93f08504e4d --- /dev/null +++ b/srcpkgs/sonic-pi/template @@ -0,0 +1,84 @@ +# Template file for 'sonic-pi' +pkgname=sonic-pi +version=4.5.0 +revision=1 +archs="i686 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="The 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} + + mkdir -p /usr/bin/ + vinstall ${FILESDIR}/sonic-pi 0755 usr/bin + + vlicense LICENSE.md +}