From d2a8b3c50ef46ed916e34ae758e0a01ba800d865 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Thu, 11 Jun 2026 10:21:32 +0300 Subject: [PATCH 1/4] dev-cpp/exprtk: strip Werror for test compile Closes: https://bugs.gentoo.org/977184 Signed-off-by: Alfred Wingate Part-of: https://codeberg.org/gentoo/gentoo/pulls/1138 Merges: https://codeberg.org/gentoo/gentoo/pulls/1138 Signed-off-by: Sam James --- dev-cpp/exprtk/exprtk-0.0.3.ebuild | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev-cpp/exprtk/exprtk-0.0.3.ebuild b/dev-cpp/exprtk/exprtk-0.0.3.ebuild index 39d0edbfa52d1..44466056b0d6b 100644 --- a/dev-cpp/exprtk/exprtk-0.0.3.ebuild +++ b/dev-cpp/exprtk/exprtk-0.0.3.ebuild @@ -21,6 +21,13 @@ KEYWORDS="amd64 ~arm arm64 ~ppc ppc64 ~riscv x86" DOCS=( readme.txt ) +src_prepare () { + default + + # bug #977184 + sed -e '/^BASE_OPTIONS/ s/-Werror //' -i Makefile || die +} + src_compile() { :; } src_test() { From 9eec6761abcbfbdbf06bc3984626712d1eedcfbf Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Sun, 31 May 2026 20:08:44 +0300 Subject: [PATCH 2/4] dev-db/mycli: drop 1.71.0 Signed-off-by: Alfred Wingate Part-of: https://codeberg.org/gentoo/gentoo/pulls/1112 Signed-off-by: Sam James --- dev-db/mycli/Manifest | 2 - dev-db/mycli/mycli-1.71.0.ebuild | 190 ------------------------------- 2 files changed, 192 deletions(-) delete mode 100644 dev-db/mycli/mycli-1.71.0.ebuild diff --git a/dev-db/mycli/Manifest b/dev-db/mycli/Manifest index c10fe2e09e9bc..2b06326f37596 100644 --- a/dev-db/mycli/Manifest +++ b/dev-db/mycli/Manifest @@ -1,6 +1,4 @@ DIST mycli-1.65.0.tar.gz 358883 BLAKE2B f155547301dc01fd3e2546dc662998f7f9c2bb301a0b8081b7eac1078782a879d0f96854ca50be298a144ca292b9a119032890091115c76726811621faa8bab6 SHA512 fcd58c72cc0d98c58467e90e566f79d1ce4693ce79b0be49203a547f3a92f0818ba04ebfc8c0822a5807e37701ec1345d785bd01e1d5fad1258f28d188b375f8 DIST mycli-1.65.0.tar.gz.provenance 9484 BLAKE2B f9af01db05dac0a069e3a5da5ccb9c3741079f21c6f3d0dcc07eb475d672aa6ecd83eb992f3f8c8fa42ca5b4d1d6707d961012a4677f9f9244a5fcf2fda71fbb SHA512 0d1418fd257a7efab78f1266eb166b37669c9fa308b93c1f84ffe967e74d83da33cf7265930329296fed5ae5161107edb207780922961251b81df0220035422d -DIST mycli-1.71.0.tar.gz 464366 BLAKE2B b5af6a2323b41ad47475868d63c04c3c150fe6a07b523679a9458dc628a9a287c16a60d878e2fed9b85c39f81f7f2d60900705deb42c271a58bbf05ae7235894 SHA512 b9b657b53e2e3c72ab6c272420aa866db8dd9d1052769fe16d7d070079bb3b46b743f288b8037b12f530de3f3567cd819c8538345f2c2474325785187909203a -DIST mycli-1.71.0.tar.gz.provenance 9318 BLAKE2B ed936ceff7191091c04b0fc32b1212b069328f25269efc36315b61990a796d104d290c176aa0a914bf7a0eea3105bed2b8964334fc1d92ba3182ec6e92b5725b SHA512 7ed5b00309a87c7e63602f3934780a16da2873496be783e3290e501f4900aad0c43be4dc093c5603cd676be36cc25b7c035de722816fb69c329a99a71c76dec4 DIST mycli-1.72.1.tar.gz 465979 BLAKE2B b6b98f23fee288cd5d57b32ea3862e7602d2b8999155d990d5a0dd5472aca744045f9609f0530806a6d3c27195729dee50845e483b4965e524f0e185be8e028e SHA512 0e7c22604e2f3baa49fd9969ecf71213eeb44bb704d372798e25955a230165454b5067ed2f0877831dc387e5ac541ad2d1485e34710b83bbf749fd4be26f5b2a DIST mycli-1.72.1.tar.gz.provenance 9365 BLAKE2B ebff7eb277b8fa7b9ff1e690d70ec3f3aad4d2d81bf90908a7e0722b2ed3c25e1ff5d4779e96be7d6c16b1966f6305b131e5a4c49a7245c62231083edc064220 SHA512 69644eed8cfcee8d545d4e9178a922b9f752206ee6069a5e892ac91c0d62f7e58e3d28a2e65f42e8ffae0a6d7b6ab810114c4da6c18a96c6507ab793fc1b90a3 diff --git a/dev-db/mycli/mycli-1.71.0.ebuild b/dev-db/mycli/mycli-1.71.0.ebuild deleted file mode 100644 index 9f9822441cf16..0000000000000 --- a/dev-db/mycli/mycli-1.71.0.ebuild +++ /dev/null @@ -1,190 +0,0 @@ -# Copyright 1999-2026 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_SINGLE_IMPL=yes -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{12..14} ) -PYPI_VERIFY_REPO=https://github.com/dbcli/mycli -inherit distutils-r1 edo eapi9-ver multiprocessing pypi - -DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting" -HOMEPAGE=" - https://www.mycli.net/ - https://github.com/dbcli/mycli/ - https://pypi.org/project/mycli/ -" - -LICENSE="BSD MIT" -SLOT="0" -KEYWORDS="~amd64" - -# optional llm unpackaged -IUSE="ssh" - -# ~paramiko-3.5.1: Pinned due to breakage. Feature soft deprecated for future removal -# https://github.com/dbcli/mycli/commit/82c7d92a16ad15906c46df14cc6e6ee0249609e6 -# https://github.com/dbcli/mycli/issues/1464 -RDEPEND=" - $(python_gen_cond_dep ' - >=dev-python/cli-helpers-2.14.0[${PYTHON_USEDEP}] - >=dev-python/click-8.3.1[${PYTHON_USEDEP}] - >=dev-python/clickdc-0.1.1[${PYTHON_USEDEP}] - >=dev-python/configobj-5.0.9[${PYTHON_USEDEP}] - >=dev-python/cryptography-46.0.5[${PYTHON_USEDEP}] - >=dev-python/keyring-25.7.0[${PYTHON_USEDEP}] - >=dev-python/prompt-toolkit-3.0.41[${PYTHON_USEDEP}] - =dev-python/pycryptodome-3.23.0[${PYTHON_USEDEP}] - >=dev-python/pyfzf-0.3.1[${PYTHON_USEDEP}] - >=dev-python/pygments-2.19.2[${PYTHON_USEDEP}] - >=dev-python/pymysql-1.1.2[${PYTHON_USEDEP}] - >=dev-python/pyperclip-1.11.0[${PYTHON_USEDEP}] - >=dev-python/rapidfuzz-3.14.3[${PYTHON_USEDEP}] - >=dev-python/sqlglot-30.4.3[${PYTHON_USEDEP}] - =dev-python/sqlparse-0.3.0[${PYTHON_USEDEP}] - >=dev-python/wcwidth-0.6.0[${PYTHON_USEDEP}] - ssh? ( - ~dev-python/paramiko-3.5.1[${PYTHON_USEDEP}] - dev-python/sshtunnel[${PYTHON_USEDEP}] - ) - ') -" -BDEPEND=" - $(python_gen_cond_dep ' - dev-python/setuptools-scm[${PYTHON_USEDEP}] - test? ( - dev-db/mysql[server] - >=dev-python/behave-1.3.3[${PYTHON_USEDEP}] - ~dev-python/paramiko-3.5.1[${PYTHON_USEDEP}] - >=dev-python/pexpect-4.9.0[${PYTHON_USEDEP}] - dev-python/sshtunnel[${PYTHON_USEDEP}] - ) - ') -" - -EPYTEST_PLUGINS=() -distutils_enable_tests pytest - -export SETUPTOOLS_SCM_PRETEND_VERSION=${PV} - -python_prepare_all() { - # no coverage please - sed -e 's/import coverage ; coverage.process_startup(); //' \ - -i test/features/environment.py test/features/steps/wrappers.py || die - - # dont pin dependencies - sed -e '/^dependencies = \[/,/^\]$/ s/"\(.*\) ~=/"\1 >=/' \ - -i pyproject.toml || die - - # convert from pycryptodomex to pycryptodome - sed -e 's/pycryptodomex/pycryptodome/' -i pyproject.toml || die - sed -e 's/from Cryptodome/from Crypto/' -i mycli/config.py || die - - # network-sandbox messes with these - sed -e '/run mycli on localhost without port/i @gentoo_skip' \ - -e '/run mycli on TCP host without port/i @gentoo_skip' \ - -e '/run mycli without host and port/i @gentoo_skip' \ - -i test/features/connection.feature || die - - # Requires an old school vi and the symlink for vi itself messes with this - sed -e '/edit sql in file with external editor/i @gentoo_skip' \ - -i test/features/iocommands.feature || die - - # avoid unpackaged pytest-random-order - sed -e "/^addopts =/ s/, '--random-order'//" -i pyproject.toml || die - - distutils-r1_python_prepare_all -} - -src_test() { - # test/utils.py - local -x PYTEST_PASSWORD="notsecure" - local -x PYTEST_HOST="127.0.0.1" - local -x PYTEST_PORT="43307" - local -x PYTEST_CHARSET="utf8" - - einfo "Creating mysql test instance ..." - mysqld \ - --no-defaults \ - --initialize-insecure \ - --basedir="${EPREFIX}/usr" \ - --datadir="${T}/mysql" 1>"${T}"/mysql_install.log || die - - einfo "Starting mysql test instance ..." - mysqld \ - --no-defaults \ - --character-set-server="${PYTEST_CHARSET}" \ - --bind-address="${PYTEST_HOST}" \ - --port="${PYTEST_PORT}" \ - --pid-file="${T}/mysqld.pid" \ - --socket="${T}/mysqld.sock" \ - --datadir="${T}/mysql" 1>"${T}/mysqld.log" 2>&1 & - - # wait for it to start - local i - for (( i = 0; i < 10; i++ )); do - [[ -S ${T}/mysqld.sock ]] && break - sleep 1 - done - [[ ! -S ${T}/mysqld.sock ]] && die "mysqld failed to start" - - einfo "Configuring test mysql instance ..." - mysql \ - -u root \ - --socket="${T}/mysqld.sock" \ - -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${PYTEST_PASSWORD}'" \ - || die "Failed to change mysql user password" - - EPYTEST_IGNORE=( - # Requires unpackaged llm - test/pytests/test_special_llm.py - ) - - local failures=() - if ! nonfatal distutils-r1_src_test ; then - failures+=( pytest ) - fi - - if ! nonfatal edo behave \ - --jobs=$(get_makeopts_jobs) \ - --summary --verbose \ - --tags="not @gentoo_skip" \ - test/features ; then - failures+=( behave ) - fi - - einfo "Stopping mysql test instance ..." - pkill -F "${T}"/mysqld.pid || die - # wait for it to stop - local i - for (( i = 0; i < 10; i++ )); do - [[ -S ${T}/mysqld.sock ]] || break - sleep 1 - done - - rm -rf "${T}"/mysql || die - - if [[ ${#failures[@]} -gt 0 ]]; then - die "Tests failed: ${failures}" - fi -} - -pkg_postinst() { - if use ssh && ver_replacing -lt 1.49; then - elog "The built-in SSH functionality has been soft deprecated in mycli." - elog "It may be removed upstream in a future release and even sooner" - elog "downstream in the ebuild due to the pinned paramiko dependency." - elog "See also https://github.com/dbcli/mycli/issues/1464" - elog "" - fi - if ver_replacing -lt 1.50; then - elog "Reading configuration from '.my.cnf' has been deprecated." - elog "Configuration should be done in '.myclirc' from now on," - elog "and in the future '.my.cnf' will be ignored." - elog "See also https://github.com/dbcli/mycli/issues/1490" - elog "" - fi -} From d75172e39b82fd524aab6eae5b26554115e4ee1c Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Sun, 31 May 2026 22:43:36 +0300 Subject: [PATCH 3/4] dev-db/mycli: add 1.74.0 Signed-off-by: Alfred Wingate Part-of: https://codeberg.org/gentoo/gentoo/pulls/1112 Merges: https://codeberg.org/gentoo/gentoo/pulls/1112 Signed-off-by: Sam James --- dev-db/mycli/Manifest | 2 + dev-db/mycli/mycli-1.74.0.ebuild | 194 +++++++++++++++++++++++++++++++ 2 files changed, 196 insertions(+) create mode 100644 dev-db/mycli/mycli-1.74.0.ebuild diff --git a/dev-db/mycli/Manifest b/dev-db/mycli/Manifest index 2b06326f37596..1e51f56bb8c0b 100644 --- a/dev-db/mycli/Manifest +++ b/dev-db/mycli/Manifest @@ -2,3 +2,5 @@ DIST mycli-1.65.0.tar.gz 358883 BLAKE2B f155547301dc01fd3e2546dc662998f7f9c2bb30 DIST mycli-1.65.0.tar.gz.provenance 9484 BLAKE2B f9af01db05dac0a069e3a5da5ccb9c3741079f21c6f3d0dcc07eb475d672aa6ecd83eb992f3f8c8fa42ca5b4d1d6707d961012a4677f9f9244a5fcf2fda71fbb SHA512 0d1418fd257a7efab78f1266eb166b37669c9fa308b93c1f84ffe967e74d83da33cf7265930329296fed5ae5161107edb207780922961251b81df0220035422d DIST mycli-1.72.1.tar.gz 465979 BLAKE2B b6b98f23fee288cd5d57b32ea3862e7602d2b8999155d990d5a0dd5472aca744045f9609f0530806a6d3c27195729dee50845e483b4965e524f0e185be8e028e SHA512 0e7c22604e2f3baa49fd9969ecf71213eeb44bb704d372798e25955a230165454b5067ed2f0877831dc387e5ac541ad2d1485e34710b83bbf749fd4be26f5b2a DIST mycli-1.72.1.tar.gz.provenance 9365 BLAKE2B ebff7eb277b8fa7b9ff1e690d70ec3f3aad4d2d81bf90908a7e0722b2ed3c25e1ff5d4779e96be7d6c16b1966f6305b131e5a4c49a7245c62231083edc064220 SHA512 69644eed8cfcee8d545d4e9178a922b9f752206ee6069a5e892ac91c0d62f7e58e3d28a2e65f42e8ffae0a6d7b6ab810114c4da6c18a96c6507ab793fc1b90a3 +DIST mycli-1.74.0.tar.gz 463638 BLAKE2B e1852eab2f494484115097e6d9d5304f8cedaefc53b2f12704bf03ec603a61ec7cb13c47362f5078b92f3c6666bdb0ee811b2d4248ff34d949639e955491fed9 SHA512 6205b2b5ad099a6ab99b30cad0d7a2ac8dc993a69f9493edf5663ebaacf003eea5bf3e64e1d793603793cc76a1bbc523b6cd890b730a684c77d275678a064e1f +DIST mycli-1.74.0.tar.gz.provenance 9495 BLAKE2B 826fa1aa571e9de4a595ef31e7431d675cf678f09eda5ca1aea1d6991e1152c128ac764487e2a4586a0abc7873779e8e4840359f9386f261bf913fa691f7b4e7 SHA512 e5e2d088423d7c9fd6b45ae9af3e8d43204d1b265350d6296273c134b1c0e7d41a589d93e5a5324da192abd5ad8e417b9aa41162593ff607e8ba8ce05aa5bcc4 diff --git a/dev-db/mycli/mycli-1.74.0.ebuild b/dev-db/mycli/mycli-1.74.0.ebuild new file mode 100644 index 0000000000000..4d3618bf610be --- /dev/null +++ b/dev-db/mycli/mycli-1.74.0.ebuild @@ -0,0 +1,194 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_SINGLE_IMPL=yes +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{12..14} ) +PYPI_VERIFY_REPO=https://github.com/dbcli/mycli +inherit distutils-r1 edo eapi9-ver multiprocessing pypi + +DESCRIPTION="CLI for MySQL Database with auto-completion and syntax highlighting" +HOMEPAGE=" + https://www.mycli.net/ + https://github.com/dbcli/mycli/ + https://pypi.org/project/mycli/ +" + +LICENSE="BSD MIT" +SLOT="0" +KEYWORDS="~amd64" + +# optional llm unpackaged +IUSE="ssh" + +# =/' \ + -i pyproject.toml || die + + # convert from pycryptodomex to pycryptodome + sed -e 's/pycryptodomex/pycryptodome/' -i pyproject.toml || die + sed -e 's/from Cryptodome/from Crypto/' -i mycli/config.py || die + + # network-sandbox messes with these + sed -e '/run mycli on localhost without port/i @gentoo_skip' \ + -e '/run mycli on TCP host without port/i @gentoo_skip' \ + -e '/run mycli without host and port/i @gentoo_skip' \ + -i test/features/connection.feature || die + + # Requires an old school vi and the symlink for vi itself messes with this + sed -e '/edit sql in file with external editor/i @gentoo_skip' \ + -i test/features/iocommands.feature || die + + # avoid unpackaged pytest-random-order + sed -e "/^addopts =/ s/, '--random-order'//" -i pyproject.toml || die + + distutils-r1_python_prepare_all +} + +src_test() { + # test/utils.py + local -x PYTEST_PASSWORD="notsecure" + local -x PYTEST_HOST="127.0.0.1" + local -x PYTEST_PORT="43307" + local -x PYTEST_CHARSET="utf8" + + einfo "Creating mysql test instance ..." + mysqld \ + --no-defaults \ + --initialize-insecure \ + --basedir="${EPREFIX}/usr" \ + --datadir="${T}/mysql" 1>"${T}"/mysql_install.log || die + + einfo "Starting mysql test instance ..." + mysqld \ + --no-defaults \ + --character-set-server="${PYTEST_CHARSET}" \ + --bind-address="${PYTEST_HOST}" \ + --port="${PYTEST_PORT}" \ + --pid-file="${T}/mysqld.pid" \ + --socket="${T}/mysqld.sock" \ + --datadir="${T}/mysql" 1>"${T}/mysqld.log" 2>&1 & + + # wait for it to start + local i + for (( i = 0; i < 10; i++ )); do + [[ -S ${T}/mysqld.sock ]] && break + sleep 1 + done + [[ ! -S ${T}/mysqld.sock ]] && die "mysqld failed to start" + + einfo "Configuring test mysql instance ..." + mysql \ + -u root \ + --socket="${T}/mysqld.sock" \ + -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${PYTEST_PASSWORD}'" \ + || die "Failed to change mysql user password" + + EPYTEST_IGNORE=( + # Requires unpackaged llm + test/pytests/test_special_llm.py + ) + + local failures=() + if ! nonfatal distutils-r1_src_test ; then + failures+=( pytest ) + fi + + if ! nonfatal edo behave \ + --jobs=$(get_makeopts_jobs) \ + --summary --verbose \ + --tags="not @gentoo_skip" \ + test/features ; then + failures+=( behave ) + fi + + einfo "Stopping mysql test instance ..." + pkill -F "${T}"/mysqld.pid || die + # wait for it to stop + local i + for (( i = 0; i < 10; i++ )); do + [[ -S ${T}/mysqld.sock ]] || break + sleep 1 + done + + rm -rf "${T}"/mysql || die + + if [[ ${#failures[@]} -gt 0 ]]; then + die "Tests failed with ${EPYTHON}: ${failures}" + fi +} + +pkg_postinst() { + if use ssh && ver_replacing -lt 1.49; then + elog "The built-in SSH functionality has been soft deprecated in mycli." + elog "It may be removed upstream in a future release and even sooner" + elog "downstream in the ebuild due to the pinned paramiko dependency." + elog "See also https://github.com/dbcli/mycli/issues/1464" + elog "" + fi + if ver_replacing -lt 1.50; then + elog "Reading configuration from '.my.cnf' has been deprecated." + elog "Configuration should be done in '.myclirc' from now on," + elog "and in the future '.my.cnf' will be ignored." + elog "See also https://github.com/dbcli/mycli/issues/1490" + elog "" + fi +} From 554974bfc25e454d28ecbfb36623abf13fe94206 Mon Sep 17 00:00:00 2001 From: Nicolas PARLANT Date: Mon, 8 Jun 2026 14:18:26 +0200 Subject: [PATCH 4/4] media-sound/snd: add 26.4 This release fixes building w/ motif-2.5.2. No support for multiple audio backends, except jack+alsa, and the patch previously applied results in unused_functions. To no break profiles w/ `?? ( alsa pulseaudio)`, use alsa as a fallback w/ the disadvantage of having alsa-lib required in any case. install s7.h and export symbols to fix s7 w/o gui/notcurses notcurses requires s7 remove readline, this is no longer an option update x11-libs for gui opengl was automagic, update deps (glu and libglvnd) and add an option filter lto with opengl (type-mismatch) jack requires libsamplerate define the path for all tools avoiding automagic; if one is missing during runtime, snd shows an explicit error in console (no crash) noexecstack is no longer required configure only checks <=ruby-3.0, add a sed-op to try w/ the latest version installed add a desktop file w/ an icon install manpages always install html Closes: https://bugs.gentoo.org/878307 Closes: https://bugs.gentoo.org/879607 Closes: https://bugs.gentoo.org/887149 Closes: https://bugs.gentoo.org/914433 Closes: https://bugs.gentoo.org/965500 Closes: https://bugs.gentoo.org/976384 Signed-off-by: Nicolas PARLANT Part-of: https://codeberg.org/gentoo/gentoo/pulls/1120 Merges: https://codeberg.org/gentoo/gentoo/pulls/1120 Signed-off-by: Sam James --- media-sound/snd/Manifest | 1 + media-sound/snd/snd-26.4.ebuild | 180 ++++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 media-sound/snd/snd-26.4.ebuild diff --git a/media-sound/snd/Manifest b/media-sound/snd/Manifest index 4a63d82f802a6..1e4ce856ca1d8 100644 --- a/media-sound/snd/Manifest +++ b/media-sound/snd/Manifest @@ -1 +1,2 @@ DIST snd-25.6.tar.gz 14892626 BLAKE2B 2c38451d3e61876ee465e2461344d285a667fcb401a11a698e2816178702445dd025e857f07a3ba7430e048e1647eb5627e3a559ac4da927e306aa4f07c6b9d5 SHA512 6bbc74b95366f76faf7b4d3ca0c9f472c2e6ecd54020da6d95f27a998796ae33d4e8df5018cebdb9b642c4745f44773159d668c7d854f18acce7b82cd5065cdc +DIST snd-26.4.tar.gz 14944456 BLAKE2B 32c8054c2f85a158c7c357a1d8250a01c43a54383cdb9c4673f3a3c094af466c18f1a79042c724dcd6564e2e82c21c54a32b55913568ee93fc6deca50a0451ae SHA512 f20f0896e3d3e3dad9da9a313c20baee0dbb71ed71bc67af7b6dcdd9d445ba43e4073e5120a3b67be9fec901dbbbfcd52fedb9fcf5ed71904a0aa5568704f1df diff --git a/media-sound/snd/snd-26.4.ebuild b/media-sound/snd/snd-26.4.ebuild new file mode 100644 index 0000000000000..677a2c2856f20 --- /dev/null +++ b/media-sound/snd/snd-26.4.ebuild @@ -0,0 +1,180 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools desktop flag-o-matic optfeature toolchain-funcs + +DESCRIPTION="Sound editor" +HOMEPAGE="https://ccrma.stanford.edu/software/snd/" +SRC_URI="https://ccrma.stanford.edu/software/${PN}/${P}.tar.gz" + +LICENSE="Snd 0BSD BSD-2 HPND GPL-2+ LGPL-2.1+ LGPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +# alsa may be optional too but at-most-one with pulseaudio breaks profiles +IUSE="fftw gmp gsl gui jack ladspa notcurses opengl oss portaudio pulseaudio ruby +s7" +REQUIRED_USE=" + ?? ( jack oss pulseaudio portaudio ) + ?? ( gui notcurses ) + ?? ( ruby s7 ) + notcurses? ( s7 ) +" + +RDEPEND=" + media-libs/alsa-lib + fftw? ( sci-libs/fftw:3.0= ) + gmp? ( + dev-libs/gmp:= + dev-libs/mpc:= + dev-libs/mpfr:= + ) + gsl? ( sci-libs/gsl:= ) + gui? ( + x11-libs/motif:0= + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXft + x11-libs/libXpm + x11-libs/libXt + opengl? ( + media-libs/glu + media-libs/libglvnd[X] + ) + ) + jack? ( + media-libs/libsamplerate + virtual/jack + ) + ladspa? ( media-libs/ladspa-sdk ) + notcurses? ( dev-cpp/notcurses ) + portaudio? ( media-libs/portaudio ) + pulseaudio? ( media-libs/libpulse ) + ruby? ( dev-lang/ruby:* ) +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +src_prepare() { + default + + # upstream searches <=ruby-3.0, try forcing with latest ruby version + if use ruby; then + local ruby_ver="$(best_version dev-lang/ruby | sed 's/.*\(ruby-[0-9]\+\.[0-9]\+\).*/\1/')" + sed -e "s/m4_foreach(\[ruby_version\].*/m4_foreach([ruby_version], [[${ruby_ver}]],/" \ + -i configure.ac || die + fi + + sed -i -e "s:-O2 ::" configure.ac || die + eautoreconf +} + +src_configure() { + # -Wincompatible-pointer-types + use ruby && append-cflags -std=gnu17 + + # fix s7 bindings exporting s7_f symbols + use s7 && append-ldflags -Wl,--export-dynamic + + export ac_cv_path_PKG_CONFIG="$(tc-getPKG_CONFIG)" + + # define the path for all tools instead of automagic + local tools=( + oggdec + oggenc + mpg123 + flac + speexdec + speexenc + timidity + wavpack + wvunpack + ) + local tool + for tool in "${tools[@]}"; do + export ac_cv_path_PATH_${tool^^}="${EPREFIX}/usr/bin/${tool}" + done + + local myeconfargs=( + $(use_with fftw) + $(use_with gmp) + $(use_with gsl) + $(use_with gui) + $(use_with jack) + $(use_with ladspa) + $(use_with notcurses) + $(use_with oss) + $(use_with portaudio) + $(use_with pulseaudio) + $(use_with ruby) + $(use_with s7) + ) + + if use gui && use opengl; then + # -Werror=lto-type-mismatch + filter-lto + myeconfargs+=( --with-gl ) + else + myeconfargs+=( --without-gl ) + fi + + # determine audio backend and use alsa as a fallback + if use oss || use portaudio || use pulseaudio; then + myeconfargs+=( --without-alsa ) + else + # jack and alsa can be used together + myeconfargs+=( --with-alsa ) + fi + + if ! use ruby && ! use s7 ; then + myeconfargs+=( --without-extension-language ) + fi + + econf "${myeconfargs[@]}" +} + +src_compile() { + emake snd + + # Do not compile ruby extensions for command line programs since they fail + if use ruby; then + sed -i -e "s:HAVE_RUBY 1:HAVE_RUBY 0:" mus-config.h || die + fi + + emake sndplay sndinfo +} + +src_install() { + dobin snd sndplay sndinfo + + if use gui; then + newicon pix/s.png ${PN}.png + make_desktop_entry --eapi9 ${PN} -C "sound editor" -c "AudioVideo;AudioVideoEditing" + fi + + if use ruby ; then + insinto /usr/share/snd + doins *.rb + fi + + if use s7 ; then + insinto /usr/share/snd + doins *.scm s7.h + fi + + doman snd.1 + + local DOCS=( *.Snd NEWS ) + local HTML_DOCS=( *.html pix/*.png ) + einstalldocs +} + +pkg_postinst() { + optfeature_header "converting in audio formats:" + optfeature flac media-libs/flac + optfeature MIDI media-sound/timidity++ + optfeature MPEG media-sound/mpg123-base + optfeature Ogg media-sound/vorbis-tools + optfeature Speex media-libs/speex[utils] + optfeature WavPack media-sound/wavpack +}