[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 8ceda6e24bafd984dabf37ff7f23dfe00fc6a272 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Apr 27 07:25:46 2024 + Commit: David Roman gmail com> CommitDate: Sat Apr 27 09:50:05 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8ceda6e2 daemons.eclass: eclassdoc example fix Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/daemons.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/daemons.eclass b/eclass/daemons.eclass index 24798158d3..90c3d76131 100644 --- a/eclass/daemons.eclass +++ b/eclass/daemons.eclass @@ -42,7 +42,7 @@ # # ... # -# DAEMONS_REQ_USE=( +# declare -Ag DAEMONS_REQ_USE=( # [postgresql]="xml" # ) # inherit daemons distutils-r1
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: cfdd31feb59d000371524571a6ff1e435e58afbc Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Feb 3 06:30:53 2024 + Commit: David Roman gmail com> CommitDate: Sun Feb 4 19:23:20 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=cfdd31fe databases.eclass: fix "--add-deps" helper It's called in ebuild scope so "+=" should be used. Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/databases.eclass | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/eclass/databases.eclass b/eclass/databases.eclass index 1c640d3ee9..721ec0e59d 100644 --- a/eclass/databases.eclass +++ b/eclass/databases.eclass @@ -192,12 +192,11 @@ _databases_add_deps() { local funcname=${1?} local useflag=${2?} - BDEPEND="${useflag}? ( ${DATABASES_DEPEND[${funcname:1}]} )" - IUSE="${useflag}" - [[ ${useflag} == "test" ]] && - RESTRICT="!test? ( test )" - - return 0 + IUSE+=" ${useflag}" + BDEPEND+=" ${useflag}? ( ${DATABASES_DEPEND[${funcname:1}]} )" + if [[ ${useflag} == "test" ]]; then + RESTRICT+= "!test? ( test )" + fi } # @FUNCTION: _databases_stop_service
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 3378f870a916cbcbe0db2706b9df3ab88f5babd8 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Feb 3 14:03:03 2024 + Commit: David Roman gmail com> CommitDate: Sun Feb 4 19:26:18 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3378f870 rhvoice-voice.eclass: new eclass Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/rhvoice-voice.eclass | 102 1 file changed, 102 insertions(+) diff --git a/eclass/rhvoice-voice.eclass b/eclass/rhvoice-voice.eclass new file mode 100644 index 00..796019f21d --- /dev/null +++ b/eclass/rhvoice-voice.eclass @@ -0,0 +1,102 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: rhvoice-voice.eclass +# @MAINTAINER: +# Anna +# @AUTHOR: +# Anna +# @SUPPORTED_EAPIS: 8 +# @BLURB: eclass for packaging RHVoice voices +# @DESCRIPTION: +# An eclass streamlining the construction of ebuilds for the officially +# supported RHVoice voices. +# +# Look at "copyright" files to identify voice's license. +# @EXAMPLE: +# +# Most ebuilds will look like this: +# +# @CODE +# +# EAPI=8 +# +# RHVOICE_VOICE="arina" +# RHVOICE_VOICE_REPO="arina-rus" +# RHVOICE_VOICE_L10N="ru" +# inherit rhvoice-voice +# +# LICENSE="CC-BY-NC-ND-4.0" +# +# @CODE + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_RHVOICE_VOICE_ECLASS} ]]; then +_RHVOICE_VOICE_ECLASS=1 + +# @ECLASS_VARIABLE: RHVOICE_VOICE +# @PRE_INHERIT +# @REQUIRED +# @DESCRIPTION: +# Voice name (see "data/voices" in RHVoice source code). + +# @ECLASS_VARIABLE: RHVOICE_VOICE_L10N +# @PRE_INHERIT +# @REQUIRED +# @DESCRIPTION: +# Language name in L10N USE_EXPAND syntax. + +if [[ ! ${RHVOICE_VOICE} ]]; then + die "RHVOICE_VOICE must be set before inherit" +fi + +if [[ ! ${RHVOICE_VOICE_L10N} ]]; then + die "RHVOICE_VOICE_L10N must be set before inherit" +fi + +# @ECLASS_VARIABLE: RHVOICE_VOICE_REPO +# @PRE_INHERIT +# @DESCRIPTION: +# Repository name under the RHVoice GitHub organization. +: "${RHVOICE_VOICE_REPO:=${RHVOICE_VOICE:?}}" + +# @ECLASS_VARIABLE: RHVOICE_VOICE_TAG +# @PRE_INHERIT +# @DESCRIPTION: +# Tag name for generating SRC_URI. +: "${RHVOICE_VOICE_TAG:=${PV}}" + +# @ECLASS_VARIABLE: RHVOICE_VOICE_DISTFILE +# @PRE_INHERIT +# @DESCRIPTION: +# Distfile name for generating SRC_URI, should be a ZIP archive. +: "${RHVOICE_VOICE_DISTFILE:=data.zip}" + +DESCRIPTION="RHVoice voice: ${RHVOICE_VOICE:?} (${RHVOICE_VOICE_L10N:?})" +HOMEPAGE="https://github.com/RHVoice/${RHVOICE_VOICE_REPO:?}; +SRC_URI="https://github.com/RHVoice/${RHVOICE_VOICE_REPO}/releases/download/${RHVOICE_VOICE_TAG}/${RHVOICE_VOICE_DISTFILE} -> ${P}.zip" +S="${WORKDIR}" + +KEYWORDS="~amd64 ~x86" +SLOT="0" + +RDEPEND="app-accessibility/rhvoice-core[l10n_${RHVOICE_VOICE_L10N}]" +BDEPEND="app-arch/unzip" + +# @FUNCTION: rhvoice-voice_src_install +# @DESCRIPTION: +# Install the voice. +rhvoice-voice_src_install() { + debug-print-function ${FUNCNAME} "${@}" + + insinto /usr/share/RHVoice/voices/${RHVOICE_VOICE:?} + doins -r . +} + +fi + +EXPORT_FUNCTIONS src_install
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: a27cd8860814a297f487e3b01c36e6e2d3292f04 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Feb 3 12:00:18 2024 + Commit: David Roman gmail com> CommitDate: Sun Feb 4 19:26:17 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a27cd886 rhvoice-lang.eclass: new eclass Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/rhvoice-lang.eclass | 109 + 1 file changed, 109 insertions(+) diff --git a/eclass/rhvoice-lang.eclass b/eclass/rhvoice-lang.eclass new file mode 100644 index 00..17e65096f6 --- /dev/null +++ b/eclass/rhvoice-lang.eclass @@ -0,0 +1,109 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: rhvoice-lang.eclass +# @MAINTAINER: +# Anna +# @AUTHOR: +# Anna +# @SUPPORTED_EAPIS: 8 +# @BLURB: eclass for packaging RHVoice languages +# @DESCRIPTION: +# An eclass streamlining the construction of ebuilds for the officially +# supported RHVoice languages. +# +# Look at "src/scripts" files to identify language's license. +# @EXAMPLE: +# +# Most ebuilds will look like this: +# +# @CODE +# +# EAPI=8 +# +# RHVOICE_LANG="Russian" +# inherit rhvoice-lang +# +# LICENSE="LGPL-2.1+" +# +# @CODE + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_RHVOICE_LANG_ECLASS} ]]; then +_RHVOICE_LANG_ECLASS=1 + +# @ECLASS_VARIABLE: RHVOICE_LANG +# @PRE_INHERIT +# @REQUIRED +# @DESCRIPTION: +# Full language name (see "data/languages" in RHVoice source code). + +if [[ ! ${RHVOICE_LANG} ]]; then + die "RHVOICE_LANG must be set before inherit" +fi + +# @ECLASS_VARIABLE: RHVOICE_LANG_REPO +# @PRE_INHERIT +# @DESCRIPTION: +# Repository name under the RHVoice GitHub organization. +: "${RHVOICE_LANG_REPO:=${RHVOICE_LANG:?}}" + +# @ECLASS_VARIABLE: RHVOICE_LANG_TAG +# @PRE_INHERIT +# @DESCRIPTION: +# Tag name for generating SRC_URI. +: "${RHVOICE_LANG_TAG:=${PV}}" + +# @ECLASS_VARIABLE: RHVOICE_LANG_DISTFILE +# @PRE_INHERIT +# @DESCRIPTION: +# Distfile name for generating SRC_URI, should be a ZIP archive. +: "${RHVOICE_LANG_DISTFILE:=RHVoice-language-${RHVOICE_LANG}-v${PV}.zip}" + +DESCRIPTION="${RHVOICE_LANG:?} language support for RHVoice" +HOMEPAGE="https://github.com/RHVoice/${RHVOICE_LANG_REPO:?}; +SRC_URI="https://github.com/RHVoice/${RHVOICE_LANG_REPO}/releases/download/${RHVOICE_LANG_TAG}/${RHVOICE_LANG_DISTFILE} -> ${P}.zip" +S="${WORKDIR}" + +KEYWORDS="~amd64 ~x86" +SLOT="0" + +BDEPEND="app-arch/unzip" + +# @FUNCTION: rhvoice-lang_src_prepare +# @DESCRIPTION: +# Remove stray files such as licenses. +rhvoice-lang_src_prepare() { + debug-print-function ${FUNCNAME} "${@}" + + default_src_prepare + find . -name "COPYING*" -o -name "LICENSE*" -delete || \ + die "removing licenses failed" +} + +# @FUNCTION: rhvoice-lang_src_install +# @DESCRIPTION: +# Install the language. +rhvoice-lang_src_install() { + debug-print-function ${FUNCNAME} "${@}" + + shopt -s nullglob + local docs=( README* ) + shopt -u nullglob + + for doc in "${docs[@]}"; do + dodoc "${doc}" + rm "${doc}" || die "removing ${doc}" failed + done + + insinto /usr/share/RHVoice/languages/${RHVOICE_LANG:?} + doins -r . +} + +fi + +EXPORT_FUNCTIONS src_prepare src_install
[gentoo-commits] repo/proj/guru:master commit in: eclass/tests/
commit: e677767400dab06bbb2c3d5ef0eb2b9c344089a7 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Feb 3 07:29:38 2024 + Commit: David Roman gmail com> CommitDate: Sun Feb 4 19:23:21 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e6777674 eclass/tests: add daemons.eclass tests Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/tests/daemons.sh | 91 + 1 file changed, 91 insertions(+) diff --git a/eclass/tests/daemons.sh b/eclass/tests/daemons.sh new file mode 100755 index 00..ccd0ded810 --- /dev/null +++ b/eclass/tests/daemons.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +GENTOO_REPO=$(portageq get_repo_path / gentoo) || exit +source "${GENTOO_REPO:?}"/eclass/tests/tests-common.sh || exit +TESTS_ECLASS_SEARCH_PATHS+=( "${GENTOO_REPO:?}"/eclass ) + +declare -A DAEMONS_REQ_USE=( + [ceph]="ssl" + [postgresql]="xml" +) + +inherit daemons + +test_depend() { + tbegin "if \${DAEMONS_DEPEND} is defined" + declare -p DAEMONS_DEPEND &>/dev/null + tend $? + + tbegin "if \${DAEMONS_DEPEND} contains Pifpaf" + [[ "${DAEMONS_DEPEND[*]}" == *"dev-util/pifpaf"* ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[ceph]}" + [[ "${DAEMONS_DEPEND[ceph]}" == *"sys-cluster/ceph[ssl]" ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[consul]}" + [[ "${DAEMONS_DEPEND[consul]}" == *"app-admin/consul" ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[httpbin]}" + [[ "${DAEMONS_DEPEND[httpbin]}" == *"dev-python/httpbin" ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[kafka]}" + [[ "${DAEMONS_DEPEND[kafka]}" == *"net-misc/kafka-bin" ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[memcached]}" + [[ "${DAEMONS_DEPEND[memcached]}" == *"net-misc/memcached" ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[mysql]}" + [[ "${DAEMONS_DEPEND[mysql]}" == *"virtual/mysql[server]" ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[postgresql]}" + [[ "${DAEMONS_DEPEND[postgresql]}" == *"dev-db/postgresql[server,xml]" ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[redis]}" + [[ "${DAEMONS_DEPEND[redis]}" == *"dev-db/redis" ]] + tend $? + + tbegin "\${DAEMONS_DEPEND[vault]}" + [[ "${DAEMONS_DEPEND[vault]}" == *"app-admin/vault" ]] + tend $? +} + +test_daemons_enable() { + local IUSE= RESTRICT= BDEPEND= + local svc=${1?} + + IUSE= RESTRICT= BDEPEND= + tbegin "'daemons_enable ${svc} test'" + daemons_enable ${svc} test && [[ ${BDEPEND} && ${IUSE} && ${RESTRICT} ]] + tend $? + + IUSE= RESTRICT= BDEPEND= + tbegin "'daemons_enable ${svc} test-db'" + daemons_enable ${svc} test-db && [[ ${BDEPEND} && ${IUSE} && ! ${RESTRICT} ]] + tend $? +} + +einfo "Testing dependency strings" +eindent +test_depend +eoutdent + +einfo "Testing daemons_enable" +eindent +for svc in "${!DAEMONS_DEPEND[@]}"; do + test_daemons_enable ${svc} +done +eoutdent + +texit
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 6b0464e027de7a13d7a0b39a2974f49fb32ff576 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Feb 3 06:31:43 2024 + Commit: David Roman gmail com> CommitDate: Sun Feb 4 19:23:21 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=6b0464e0 daemons.eclass: new eclass Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/daemons.eclass | 213 ++ 1 file changed, 213 insertions(+) diff --git a/eclass/daemons.eclass b/eclass/daemons.eclass new file mode 100644 index 00..24798158d3 --- /dev/null +++ b/eclass/daemons.eclass @@ -0,0 +1,213 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: daemons.eclass +# @MAINTAINER: +# Anna +# @AUTHOR: +# Anna +# @SUPPORTED_EAPIS: 8 +# @BLURB: eclass to test packages against running daemons +# @DESCRIPTION: +# A utility eclass providing functions for starting and stopping daemons with +# Pifpaf. +# +# This eclass does not set any metadata variables nor export any phase, so it +# can be inherited safely. +# +# @SUBSECTION Supported daemons +# +# - ceph +# +# - consul +# +# - httpbin +# +# - kafka +# +# - memcached +# +# - mysql +# +# - postgresql +# +# - redis +# +# - vault +# +# @EXAMPLE: +# +# @CODE +# EAPI=8 +# +# ... +# +# DAEMONS_REQ_USE=( +# [postgresql]="xml" +# ) +# inherit daemons distutils-r1 +# +# ... +# +# distutils_enable_tests pytest +# +# daemons_enable postgresql test +# +# src_test() { +# daemons_start postgresql +# distutils-r1_src_test +# daemons_stop postgresql +# } +# @CODE + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." +esac + +if [[ ! ${_DAEMONS_ECLASS} ]]; then +_DAEMONS_ECLASS=1 + +# @ECLASS_VARIABLE: DAEMONS_REQ_USE +# @PRE_INHERIT +# @DEFAULT_UNSET +# @DESCRIPTION: +# Bash associative array of USE flags required to be enabled on daemons, +# formed as a USE-dependency string. + +# @ECLASS_VARIABLE: DAEMONS_DEPEND +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated bash associative array of dependency strings for +# daemons. +declare -Ag DAEMONS_DEPEND=() + +# @FUNCTION: _daemons_set_globals +# @INTERNAL +# @DESCRIPTION: +# Set the DAEMONS_DEPEND variable. +_daemons_set_globals() { + local -A pkgs=( + [ceph]="sys-cluster/ceph" + [consul]="app-admin/consul" + [httpbin]="dev-python/httpbin" + [kafka]="net-misc/kafka-bin" + [memcached]="net-misc/memcached" + [mysql]="virtual/mysql" + [postgresql]="dev-db/postgresql" + [redis]="dev-db/redis" + [vault]="app-admin/vault" + ) + + local -A useflags=( + [mysql]="server" + [postgresql]="server" + ) + + if declare -p DAEMONS_REQ_USE &>/dev/null; then + [[ $(declare -p DAEMONS_REQ_USE) == "declare -A"* ]] || \ + die "DAEMONS_REQ_USE must be declared as an associative array" + fi + + local name dep usestr + for name in "${!pkgs[@]}"; do + dep=${pkgs[${name:?}]:?} + usestr=${useflags[${name:?}]} + usestr+=",${DAEMONS_REQ_USE[${name:?}]}" + # strip leading/trailing commas + usestr=${usestr#,} + usestr=${usestr%,} + + [[ ${usestr?} ]] && usestr="[${usestr?}]" + DAEMONS_DEPEND[${name:?}]="dev-util/pifpaf ${dep:?}${usestr?}" + done + + readonly DAEMONS_DEPEND +} +_daemons_set_globals +unset -f _daemons_set_globals + +# @FUNCTION: daemons_enable +# @USAGE: +# @DESCRIPTION: +# Add the daemon package to build-time dependencies under the given USE flag +# (IUSE will be set automatically). +daemons_enable() { + debug-print-function ${FUNCNAME} "${@}" + + local daemon=${1:?} + local useflag=${2:?} + + IUSE+=" ${useflag:?}" + BDEPEND+=" ${useflag:?}? ( ${DAEMONS_DEPEND[${daemon:?}]:?} )" + if [[ ${useflag:?} == "test" ]]; then + RESTRICT+=" !test? ( test )" + fi +} + +# @FUNCTION: daemons_start +# @USAGE: [args...] +# @DESCRIPTION: +# Start the daemon. All arguments are passes to Pifpaf. +# +# Pifpaf will set some environment variables for you, they will be prefixed by +# uppercase daemon name. See upstream documentation for details. +daemons_start() { + debug-print-function ${FUNCNAME} "${@}" + + local daemon=${1:?} + shift + + local logfile="${T?}/daemon-${daemon:?}.log" + local tempfile="${T?}/daemon-${daemon:?}.sh" + local myargs=( + --env-prefix "${daemon^^}" + --log-file "${logfile:?}" + --verbose + ) + + ebegin "Starting ${daemon:?}" + pifpaf "${myargs[@]}" run "${daemon:?}" "${@}" > "${tempfile:?}" && \ + source
[gentoo-commits] repo/proj/guru:master commit in: eclass/, eclass/tests/
commit: 586a56440594d8cde2ceb75e90cc0f4a19d8a8f5 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Tue Jan 23 15:24:35 2024 + Commit: David Roman gmail com> CommitDate: Wed Jan 24 18:43:00 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=586a5644 databases.eclass: new --add-deps helper Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/databases.eclass | 101 +- eclass/tests/databases.sh | 86 ++- 2 files changed, 131 insertions(+), 56 deletions(-) diff --git a/eclass/databases.eclass b/eclass/databases.eclass index 9c2457e93e..1c640d3ee9 100644 --- a/eclass/databases.eclass +++ b/eclass/databases.eclass @@ -28,6 +28,11 @@ # # @SUBSECTION Helper usage # +# --add-deps +# +# Adds the server package to build-time dependencies under the given USE flag +# (IUSE will be set automatically). +# # --die [msg] # # Prints the path to the server's log file to the console and aborts the @@ -79,10 +84,10 @@ # # ... # -# BDEPEND="test? ( ${DATABASES_DEPEND[postgres]} )" -# # distutils_enable_tests pytest # +# epostgres --add-deps test +# # src_test() { # epostgres --start 65432 # distutils-r1_src_test @@ -118,39 +123,41 @@ declare -Ag DATABASES_DEPEND=() # @FUNCTION: _databases_set_globals # @INTERNAL +# @DESCRIPTION: +# Set the DATABASES_DEPEND variable. _databases_set_globals() { - local -A db_pkgs=( - [memcached]="net-misc/memcached" - [mongod]="dev-db/mongodb" - [mysql]="virtual/mysql" - [postgres]="dev-db/postgresql" - [redis]="dev-db/redis" - ) - - local -A db_useflags=( - [mysql]="server" - [postgres]="server" - ) - - if declare -p DATABASES_REQ_USE &>/dev/null; then - [[ $(declare -p DATABASES_REQ_USE) == "declare -A"* ]] || \ - die "DATABASES_REQ_USE must be declared as an associative array" - fi - - local name dep usestr - for name in "${!db_pkgs[@]}"; do - dep=${db_pkgs[${name}]?} - usestr=${db_useflags[${name}]} - usestr+=",${DATABASES_REQ_USE[${name}]}" - # strip leading/trailing commas - usestr=${usestr#,} - usestr=${usestr%,} - - [[ ${usestr} ]] && usestr="[${usestr}]" - DATABASES_DEPEND[${name?}]="${dep?}${usestr}" - done - - readonly DATABASES_DEPEND + local -A db_pkgs=( + [memcached]="net-misc/memcached" + [mongod]="dev-db/mongodb" + [mysql]="virtual/mysql" + [postgres]="dev-db/postgresql" + [redis]="dev-db/redis" + ) + + local -A db_useflags=( + [mysql]="server" + [postgres]="server" + ) + + if declare -p DATABASES_REQ_USE &>/dev/null; then + [[ $(declare -p DATABASES_REQ_USE) == "declare -A"* ]] || \ + die "DATABASES_REQ_USE must be declared as an associative array" + fi + + local name dep usestr + for name in "${!db_pkgs[@]}"; do + dep=${db_pkgs[${name}]?} + usestr=${db_useflags[${name}]} + usestr+=",${DATABASES_REQ_USE[${name}]}" + # strip leading/trailing commas + usestr=${usestr#,} + usestr=${usestr%,} + + [[ ${usestr} ]] && usestr="[${usestr}]" + DATABASES_DEPEND[${name?}]="${dep?}${usestr}" + done + + readonly DATABASES_DEPEND } _databases_set_globals unset -f _databases_set_globals @@ -176,6 +183,23 @@ _databases_die() { die -n "${@}" } +# @FUNCTION: _databases_add_deps +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Set the BDEPEND, IUSE and RESTRICT variables. +_databases_add_deps() { + local funcname=${1?} + local useflag=${2?} + + BDEPEND="${useflag}? ( ${DATABASES_DEPEND[${funcname:1}]} )" + IUSE="${useflag}" + [[ ${useflag} == "test" ]] && + RESTRICT="!test? ( test )" + + return 0 +} + # @FUNCTION: _databases_stop_service # @USAGE: # @INTERNAL @@ -200,19 +224,22 @@ _databases_stop_service() { # @DESCRIPTION: # Process the given command with its options. # -# If "--start" command is used, `_${funcname}_start` function must be defined. +# If "--start" command is used, "_${funcname}_start" function must be defined. # Note that directories will be
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 84ddbd2c347574794ce2b4d2311eba982185e767 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Jan 20 07:11:51 2024 + Commit: David Roman gmail com> CommitDate: Sat Jan 20 07:11:51 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=84ddbd2c databases.eclass: typo Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/databases.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/databases.eclass b/eclass/databases.eclass index 079325a90d..d906f2a547 100644 --- a/eclass/databases.eclass +++ b/eclass/databases.eclass @@ -20,7 +20,7 @@ # # - MongoDB (via "emongod" helper) # -# - MySQL/MariaDB/ (via "emysql" helper) +# - MySQL / MariaDB (via "emysql" helper) # # - PostgreSQL (via "epostgres" helper) #
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 8281fc17d53355b09cf12e87a58bd31b29538f85 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon Jan 1 20:38:57 2024 + Commit: David Roman gmail com> CommitDate: Mon Jan 1 21:26:59 2024 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8281fc17 rebar3.eclass: new eclass for dev-util/rebar:3 Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/rebar3.eclass | 295 +++ 1 file changed, 295 insertions(+) diff --git a/eclass/rebar3.eclass b/eclass/rebar3.eclass new file mode 100644 index 00..4104bdcf64 --- /dev/null +++ b/eclass/rebar3.eclass @@ -0,0 +1,295 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: rebar3.eclass +# @MAINTAINER: +# Anna (cybertailor) Vyalkova +# @AUTHOR: +# Amadeusz Żołnowski +# @SUPPORTED_EAPIS: 8 +# @BLURB: Build Erlang/OTP projects using dev-util/rebar:3. +# @DESCRIPTION: +# An eclass providing functions to build Erlang/OTP projects using +# dev-util/rebar:3. +# +# rebar is a tool which tries to resolve dependencies itself which is by +# cloning remote git repositories. Dependent projects are usually expected to +# be in sub-directory 'deps' rather than looking at system Erlang lib +# directory. Projects relying on rebar usually don't have 'install' make +# targets. The eclass workarounds some of these problems. It handles +# installation in a generic way for Erlang/OTP structured projects. + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ -z ${_REBAR3_ECLASS} ]]; then + +inherit edo + +RDEPEND="dev-lang/erlang:=" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-util/rebar:3 + >=sys-apps/gawk-4.1 +" + +# @ECLASS_VARIABLE: REBAR_PROFILE +# @DESCRIPTION: +# Rebar profile to use. +: "${REBAR_PROFILE:=default}" + +# @ECLASS_VARIABLE: REBAR_APP_SRC +# @DESCRIPTION: +# Relative path to .app.src description file. +: "${REBAR_APP_SRC:=src/${PN}.app.src}" + +# @FUNCTION: get_erl_libs +# @RETURN: the path to Erlang lib directory +# @DESCRIPTION: +# Get the full path without EPREFIX to Erlang lib directory. +get_erl_libs() { + echo "/usr/$(get_libdir)/erlang/lib" +} + +# @FUNCTION: _rebar_find_dep +# @INTERNAL +# @USAGE: +# @RETURN: 0 success, 1 dependency not found, 2 multiple versions found +# @DESCRIPTION: +# Find a Erlang package/project by name in Erlang lib directory. Project +# directory is usually suffixed with version. It is matched to '' +# or '-*'. +_rebar_find_dep() { + local pn="${1}" + local p + local result + + pushd "${EPREFIX}/$(get_erl_libs)" >/dev/null || return 1 + for p in ${pn} ${pn}-*; do + if [[ -d ${p} ]]; then + # Ensure there's at most one matching. + [[ ${result} ]] && return 2 + result="${p}" + fi + done + popd >/dev/null || die + + [[ ${result} ]] || return 1 + echo "${result}" +} + +# @FUNCTION: rebar_disable_coverage +# @USAGE: [] +# @DESCRIPTION: +# Disable coverage in rebar.config. This is a workaround for failing coverage. +# Coverage is not relevant in this context, so there's no harm to disable it, +# although the issue should be fixed. +rebar_disable_coverage() { + debug-print-function ${FUNCNAME} "${@}" + + local rebar_config="${1:-rebar.config}" + + sed -e 's/{cover_enabled, true}/{cover_enabled, false}/' \ + -i "${rebar_config}" \ + || die "failed to disable coverage in ${rebar_config}" +} + +# @FUNCTION: erebar3 +# @USAGE: +# @DESCRIPTION: +# Run rebar with verbose flag. Die on failure. +erebar3() { + debug-print-function ${FUNCNAME} "${@}" + + (( $# > 0 )) || die "erebar: at least one target is required" + + case ${1} in + eunit|ct) + local -x ERL_LIBS="." ;; + *) + local -x ERL_LIBS="${EPREFIX}/$(get_erl_libs)" ;; + esac + + edo rebar3 "$@" +} + +# @FUNCTION: rebar_fix_include_path +# @USAGE: [] +# @DESCRIPTION: +# Fix path in rebar.config to 'include' directory of dependent project/package, +# so it points to installation in system Erlang lib rather than relative 'deps' +# directory. +# +# is optional. Default is 'rebar.config'. +# +# The function dies on failure. +rebar_fix_include_path() { + debug-print-function ${FUNCNAME} "${@}" + + local pn="${1}" + local rebar_config="${2:-rebar.config}" + local erl_libs="${EPREFIX}/$(get_erl_libs)" + local p + + p="$(_rebar_find_dep "${pn}")" \ + || die "failed to unambiguously resolve dependency of '${pn}'" + + gawk -i inplace \ + -v erl_libs="${erl_libs}" -v pn="${pn}" -v p="${p}" ' +/^{[[:space:]]*erl_opts[[:space:]]*,/, /}[[:space:]]*\.$/ { + pattern = "\"(./)?deps/" pn
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: b7fb055a13af12299ecab8ba34b451ee2a0bd8b7 Author: David Roman gmail com> AuthorDate: Thu Oct 5 13:09:58 2023 + Commit: Viorel Munteanu gentoo org> CommitDate: Thu Oct 5 13:09:58 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b7fb055a eclass: rename deprecated ECLASS-VARIABLE to ECLASS_VARIABLE Signed-off-by: David Roman gmail.com> eclass/mix.eclass | 10 +- eclass/octaveforge.eclass | 8 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eclass/mix.eclass b/eclass/mix.eclass index b5071e94d8..a1f079f77f 100644 --- a/eclass/mix.eclass +++ b/eclass/mix.eclass @@ -36,13 +36,13 @@ DEPEND="${RDEPEND}" # differences is present BDEPEND="!<${CATEGORY}/${P} !>${CATEGORY}/${PF}" -# @ECLASS-VARIABLE: HEX_OFFLINE +# @ECLASS_VARIABLE: HEX_OFFLINE HEX_OFFLINE=1 -# @ECLASS-VARIABLE: MIX_ENV +# @ECLASS_VARIABLE: MIX_ENV MIX_ENV="prod" -# @ECLASS-VARIABLE: MIX_NO_DEPS +# @ECLASS_VARIABLE: MIX_NO_DEPS MIX_NO_DEPS=1 # @FUNCTION: emix @@ -57,10 +57,10 @@ emix() { MIX_ENV="${MIX_ENV}" mix "$@" || die -n "mix $@ failed" } -# @ECLASS-VARIABLE: MIX_REWRITE +# @ECLASS_VARIABLE: MIX_REWRITE MIX_REWRITE="" -# @ECLASS-VARIABLE: MIX_BUILD_NAME +# @ECLASS_VARIABLE: MIX_BUILD_NAME MIX_BUILD_NAME="${MIX_ENV}" # @FUNCTION: mix_src_prepare diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index 0e2c166046..0528d2d907 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -19,24 +19,24 @@ esac EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install src_test pkg_postinst pkg_prerm pkg_postrm -# @ECLASS-VARIABLE: REPO_URI +# @ECLASS_VARIABLE: REPO_URI # @DESCRIPTION: # URI to the sourceforge octave-forge repository REPO_URI="http://svn.code.sf.net/p/octave/code/trunk/octave-forge; # defining some paths -# @ECLASS-VARIABLE: OCT_ROOT +# @ECLASS_VARIABLE: OCT_ROOT # @DESCRIPTION: # full path to octave share OCT_ROOT="/usr/share/octave" -# @ECLASS-VARIABLE: OCT_PKGDIR +# @ECLASS_VARIABLE: OCT_PKGDIR # @DESCRIPTION: # path to octave pkgdir OCT_PKGDIR="${OCT_ROOT}/packages" -# @ECLASS-VARIABLE: OCT_BIN +# @ECLASS_VARIABLE: OCT_BIN # @DESCRIPTION: # octave binary name OCT_BIN="octave"
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 4ae1d46d5b0770caa9ff7d7c6891476b6e293218 Author: Haelwenn (lanodan) Monnier hacktivis me> AuthorDate: Sun Aug 6 12:14:47 2023 + Commit: David Roman gmail com> CommitDate: Sun Aug 6 12:21:17 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4ae1d46d mix.eclass: Add subslot on erlang Closes: https://bugs.gentoo.org/909293 Signed-off-by: Haelwenn (lanodan) Monnier hacktivis.me> eclass/mix.eclass | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eclass/mix.eclass b/eclass/mix.eclass index b7d4647313..39c6bed500 100644 --- a/eclass/mix.eclass +++ b/eclass/mix.eclass @@ -26,7 +26,10 @@ esac EXPORT_FUNCTIONS src_prepare src_compile src_install -RDEPEND="dev-lang/elixir" +RDEPEND=" + dev-lang/elixir + dev-lang/erlang:= +" DEPEND="${RDEPEND}" # Erlang/Elixir software fails to build when another version with API
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 9721644167277d26aa761cf9c11f8191c04b4968 Author: Haelwenn (lanodan) Monnier hacktivis me> AuthorDate: Mon Aug 7 05:59:04 2023 + Commit: David Roman gmail com> CommitDate: Mon Aug 7 05:59:16 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=97216441 mix.eclass: fix self-blocking of revisions Signed-off-by: Haelwenn (lanodan) Monnier hacktivis.me> eclass/mix.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/mix.eclass b/eclass/mix.eclass index 39c6bed500..b5071e94d8 100644 --- a/eclass/mix.eclass +++ b/eclass/mix.eclass @@ -34,7 +34,7 @@ DEPEND="${RDEPEND}" # Erlang/Elixir software fails to build when another version with API # differences is present -BDEPEND="!<${CATEGORY}/${P} !>${CATEGORY}/${P}" +BDEPEND="!<${CATEGORY}/${P} !>${CATEGORY}/${PF}" # @ECLASS-VARIABLE: HEX_OFFLINE HEX_OFFLINE=1
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: c64dbb92037c38a5afb44467023b7ece43d662c5 Author: Haelwenn (lanodan) Monnier hacktivis me> AuthorDate: Sat Jun 24 19:13:05 2023 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Sat Jun 24 19:13:05 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c64dbb92 mix.eclass: New eclass, used by www-apps/pleroma Signed-off-by: Haelwenn (lanodan) Monnier hacktivis.me> eclass/mix.eclass | 95 +++ 1 file changed, 95 insertions(+) diff --git a/eclass/mix.eclass b/eclass/mix.eclass new file mode 100644 index 0..b7d464731 --- /dev/null +++ b/eclass/mix.eclass @@ -0,0 +1,95 @@ +# Copyright 2019-2023 Haelwenn (lanodan) Monnier +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: mix.eclass +# @MAINTAINER: +# Haelwenn (lanodan) Monnier +# @AUTHOR: +# Haelwenn (lanodan) Monnier +# @SUPPORTED_EAPIS: 6 7 8 +# @BLURB: Build Elixir projects using Elixir's mix +# @DESCRIPTION: +# An eclass providing functions to build Elixir projects using Elixir's mix +# +# mix is a tool which tries to resolve dependencies itself + +case "${EAPI:-0}" in + 0|1|2|3|4|5) + die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" + ;; + 6|7) + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; +esac + +EXPORT_FUNCTIONS src_prepare src_compile src_install + +RDEPEND="dev-lang/elixir" +DEPEND="${RDEPEND}" + +# Erlang/Elixir software fails to build when another version with API +# differences is present +BDEPEND="!<${CATEGORY}/${P} !>${CATEGORY}/${P}" + +# @ECLASS-VARIABLE: HEX_OFFLINE +HEX_OFFLINE=1 + +# @ECLASS-VARIABLE: MIX_ENV +MIX_ENV="prod" + +# @ECLASS-VARIABLE: MIX_NO_DEPS +MIX_NO_DEPS=1 + +# @FUNCTION: emix +# @USAGE: +# @DESCRIPTION: +# Run mix with provided arguments. Die on failure +emix() { + debug-print-function ${FUNCNAME} "${@}" + + (( $# > 0 )) || die "emix: at least one target is required" + + MIX_ENV="${MIX_ENV}" mix "$@" || die -n "mix $@ failed" +} + +# @ECLASS-VARIABLE: MIX_REWRITE +MIX_REWRITE="" + +# @ECLASS-VARIABLE: MIX_BUILD_NAME +MIX_BUILD_NAME="${MIX_ENV}" + +# @FUNCTION: mix_src_prepare +mix_src_prepare() { + if [[ "${MIX_REWRITE}" != "" ]] + then + sed -i -E -e 's@\{.*(only|optional): .*},?@@' mix.exs || die "failed removing only & optionnal deps" + rm -f mix.lock + fi + + default +} + +# @FUNCTION: mix_src_compile +# @DESCRIPTION: +# Compile project with mix. +mix_src_compile() { + debug-print-function ${FUNCNAME} "${@}" + + emix compile --no-deps-check +} + +# @FUNCTION: mix_src_install +# @DESCRIPTION: +# Install project with mix. +mix_src_install() { + debug-print-function ${FUNCNAME} "${@}" + + insinto "/usr/$(get_libdir)/elixir/lib/${P}" + pushd "_build/${MIX_BUILD_NAME}/lib/${PN}" >/dev/null + for reldir in src ebin priv include; do + [ -d "$reldir" ] && doins -r "$(realpath ${reldir})" + done + popd >/dev/null +}
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: a5f49bbc8a320932ab708e68eb86d9666ec48ded Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sun May 21 16:18:29 2023 + Commit: Viorel Munteanu gentoo org> CommitDate: Sun May 21 16:19:55 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a5f49bbc shards.eclass: pass CRYSTAL_DEFINES to docs cmd Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shards.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/shards.eclass b/eclass/shards.eclass index 0de0deb47..3258cea48 100644 --- a/eclass/shards.eclass +++ b/eclass/shards.eclass @@ -77,7 +77,7 @@ shards_src_compile() { done if use doc; then - ecrystal docs + ecrystal docs "${CRYSTAL_DEFINES[@]}" HTML_DOCS=( docs/. ) fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: e75c73870af006070292d631e1fe4e7490b0a5ec Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sun May 21 16:17:52 2023 + Commit: Viorel Munteanu gentoo org> CommitDate: Sun May 21 16:19:55 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e75c7387 crystal-utils.eclass: add CRYSTAL_DEFINES var Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/crystal-utils.eclass | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/eclass/crystal-utils.eclass b/eclass/crystal-utils.eclass index 8456c5af6..57325a993 100644 --- a/eclass/crystal-utils.eclass +++ b/eclass/crystal-utils.eclass @@ -48,6 +48,11 @@ SHARDS_DEPS=" ) " +# @ECLASS_VARIABLE: CRYSTAL_DEFINES +# @DEFAULT_UNSET +# @DESCRIPTION: +# List of compile-time defines. Used by 'crystal build' and 'crystal docs'. + # @FUNCTION: _crystal_get_colors_opt # @INTERNAL # @RETURN: "--no-color" if colors should be disabled, empty string otherwise @@ -76,15 +81,6 @@ _crystal_get_debug_opt() { # mycrystalargs bash array. # # Must be run or ecrystal/eshards will fail. -# -# @CODE -# src_configure() { -# local mycrystalargs=( -# -Dfoo -# ) -# crystal_configure -# } -# @CODE crystal_configure() { debug-print-function ${FUNCNAME} "${@}" @@ -107,6 +103,7 @@ crystal_configure() { $(is-flagq -mcpu && echo "--mcpu=$(get-flag mcpu)") $(is-flagq -mcmodel && echo "--mcmodel=$(get-flag mcmodel)") # TODO: --mattr + "${CRYSTAL_DEFINES[@]}" "${mycrystalargs[@]}" )
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 68db6d9b906fc6c0efecfdbc797aa286bc155546 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Tue May 9 19:28:54 2023 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue May 9 19:30:07 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=68db6d9b shards.eclass: detect build targets using gshards Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shards.eclass | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/eclass/shards.eclass b/eclass/shards.eclass index 5fd9f6c10..0de0deb47 100644 --- a/eclass/shards.eclass +++ b/eclass/shards.eclass @@ -28,7 +28,7 @@ inherit crystal-utils multiprocessing toolchain-funcs BDEPEND=" ${CRYSTAL_DEPS} ${SHARDS_DEPS} - dev-util/gshards + >=dev-util/gshards-0.2 " IUSE="debug doc" @@ -67,10 +67,15 @@ shards_src_configure() { # @FUNCTION: shards_src_compile # @DESCRIPTION: -# Function for building the package's documentation. +# Function for building the package's executables and documentation. shards_src_compile() { debug-print-function ${FUNCNAME} "${@}" + local args + gshards-print-targets | while read -r args; do + crystal_build "${@}" ${args} + done + if use doc; then ecrystal docs HTML_DOCS=( docs/. ) @@ -95,14 +100,10 @@ shards_src_test() { # @FUNCTION: shards_src_install # @DESCRIPTION: -# Function for installing the package. +# Function for installing the package's source. shards_src_install() { debug-print-function ${FUNCNAME} "${@}" - if [[ -d "bin" ]]; then - dobin bin/* - fi - if [[ -d "src" ]]; then insinto $(shards_get_libdir)/$(shards_get_pkgname) doins -r src
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 471145080920d7798f2e00a1001f7d454b29f02f Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon May 8 18:53:50 2023 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue May 9 15:42:47 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=47114508 crystal-utils.eclass: add crystal_spec function Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/crystal-utils.eclass | 8 eclass/shards.eclass| 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/eclass/crystal-utils.eclass b/eclass/crystal-utils.eclass index 3c0b7d48a..8456c5af6 100644 --- a/eclass/crystal-utils.eclass +++ b/eclass/crystal-utils.eclass @@ -164,4 +164,12 @@ crystal_build() { ecrystal build "${build_args[@]}" "${@}" } +# @FUNCTION: crystal_spec +# @USAGE: [...] +# @DESCRIPTION: +# Function for running tests. All arguments are passed to crystal. +crystal_spec() { + ecrystal spec --verbose "${@}" || die -n "Tests failed" +} + fi diff --git a/eclass/shards.eclass b/eclass/shards.eclass index 122464cc5..5fd9f6c10 100644 --- a/eclass/shards.eclass +++ b/eclass/shards.eclass @@ -87,7 +87,7 @@ shards_src_test() { debug-print-function ${FUNCNAME} "${@}" if [[ -d "spec" ]]; then - ecrystal spec --verbose "${@}" || die "Tests failed" + crystal_spec "${@}" fi return 0
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: a908862549f4504fd88bfbe5305dd3c34101ea77 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon May 8 18:51:48 2023 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue May 9 15:42:47 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a9088625 crystal-utils.eclass: add crystal_build function Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/crystal-utils.eclass | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/eclass/crystal-utils.eclass b/eclass/crystal-utils.eclass index 09a4049a4..3c0b7d48a 100644 --- a/eclass/crystal-utils.eclass +++ b/eclass/crystal-utils.eclass @@ -24,7 +24,7 @@ esac if [[ ! ${_CRYSTAL_UTILS_ECLASS} ]]; then _CRYSTAL_UTILS_ECLASS=1 -inherit edo flag-o-matic +inherit edo flag-o-matic multiprocessing # @ECLASS_VARIABLE: CRYSTAL_DEPS # @OUTPUT_VARIABLE @@ -151,4 +151,17 @@ eshards() { edo shards "${args[@]}" "${@}" } +# @FUNCTION: crystal_build +# @USAGE: ... +# @DESCRIPTION: +# Function for building a target. All arguments are passed to crystal. +crystal_build() { + local build_args=( + --threads=$(makeopts_jobs) + --verbose + ) + + ecrystal build "${build_args[@]}" "${@}" +} + fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: ec1443faebbc71275ac1d107074d4ab4255574dc Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon May 8 17:25:56 2023 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue May 9 15:42:46 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ec1443fa shards.eclass: set SHARDS_INSTALL_PATH Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shards.eclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eclass/shards.eclass b/eclass/shards.eclass index 0958709e3..f17f93cb9 100644 --- a/eclass/shards.eclass +++ b/eclass/shards.eclass @@ -58,7 +58,8 @@ shards_src_configure() { crystal_configure debug-print "CRYSTAL_OPTS='${CRYSTAL_OPTS}'" - export CRYSTAL_PATH="${BROOT}$(shards_get_libdir):$(crystal env CRYSTAL_PATH || die "'crystal env' failed")" + export SHARDS_INSTALL_PATH="${BROOT}$(shards_get_libdir)" + export CRYSTAL_PATH="${SHARDS_INSTALL_PATH}:$(crystal env CRYSTAL_PATH || die "'crystal env' failed")" debug-print "CRYSTAL_PATH='${CRYSTAL_PATH}'" tc-export CC
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 8a943f0dd2fb8c23968f2c43b5d7fe0bca29 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon May 8 18:50:50 2023 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue May 9 15:42:46 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8a943f0d shards.eclass: do not use 'shards build' Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shards.eclass | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/eclass/shards.eclass b/eclass/shards.eclass index f17f93cb9..122464cc5 100644 --- a/eclass/shards.eclass +++ b/eclass/shards.eclass @@ -67,19 +67,10 @@ shards_src_configure() { # @FUNCTION: shards_src_compile # @DESCRIPTION: -# General function for building packages using Shards. +# Function for building the package's documentation. shards_src_compile() { debug-print-function ${FUNCNAME} "${@}" - local build_args=( - --threads=$(makeopts_jobs) - --verbose - ) - - if gshards-has-targets; then - eshards build "${build_args[@]}" - fi - if use doc; then ecrystal docs HTML_DOCS=( docs/. )
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 01245d2fcbce7ecdf0a900774b711eabc7541c36 Author: Jonas Frei pm me> AuthorDate: Wed Apr 12 18:42:30 2023 + Commit: Florian Schmaus gentoo org> CommitDate: Wed Apr 12 18:42:30 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=01245d2f shell-completion.eclass: Credit to original author cc: @parona-source Signed-off-by: Jonas Frei pm.me> eclass/shell-completion.eclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eclass/shell-completion.eclass b/eclass/shell-completion.eclass index aa7c7bab7..b7b59802a 100644 --- a/eclass/shell-completion.eclass +++ b/eclass/shell-completion.eclass @@ -4,6 +4,8 @@ # @ECLASS: shell-completion.eclass # @SUPPORTED_EAPIS: 8 # @PROVIDES: bash-completion-r1 +# @AUTHOR: +# Alfred Wingate # @MAINTAINER: # Jonas Frei # @BLURB: a few quick functions to install various shell completion files
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: e8b38584b1308aa123c3b60278d0f683f2331628 Author: Jonas Frei pm me> AuthorDate: Fri Mar 31 18:13:03 2023 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Fri Mar 31 18:13:03 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e8b38584 shell-completion.eclass: New eclass Signed-off-by: Jonas Frei pm.me> eclass/shell-completion.eclass | 119 + 1 file changed, 119 insertions(+) diff --git a/eclass/shell-completion.eclass b/eclass/shell-completion.eclass new file mode 100644 index 0..271378c51 --- /dev/null +++ b/eclass/shell-completion.eclass @@ -0,0 +1,119 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: shell-completion.eclass +# @SUPPORTED_EAPIS: 6 7 8 +# @MAINTAINER: +# Jonas Frei +# @BLURB: A few quick functions to install various shell completion files +# @DESCRIPTION: +# This eclass provides a standardised way to install shell completions +# for popular shells. It inherits the already widely adopted +# `bash-completion-r1`, thus extending on its functionality. + +if [[ ! ${_SHELL_COMPLETION_ECLASS} ]]; then +_SHELL_COMPLETION_ECLASS=1 + +# Extend bash-completion-r1 +inherit bash-completion-r1 + +case ${EAPI} in + 6|7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." +esac + +# @FUNCTION: _shell-completion_get_fishcompdir +# @INTERNAL +# @DESCRIPTION: +# Get unprefixed fish completions directory +_shell-completion_get_fishcompdir() { + debug-print-function ${FUNCNAME} "${@}" + + echo "/usr/share/fish/vendor_completions.d" +} + +# @FUNCTION: _shell-completion_get_zshcompdir +# @INTERNAL +# @DESCRIPTION: +# Get unprefixed zsh completions directory +_shell-completion_get_zshcompdir() { + debug-print-function ${FUNCNAME} "${@}" + + echo "/usr/share/zsh/site-functions" +} + +# @FUNCTION: get_fishcompdir +# @DESCRIPTION: +# Get the fish completions directory. +get_fishcompdir() { + debug-print-function ${FUNCNAME} "${@}" + + echo "${EPREFIX}$(_get_fishcompdir)" +} + +# @FUNCTION: get_zshcompdir +# @DESCRIPTION: +# Get the zsh completions directory. +get_zshcompdir() { + debug-print-function ${FUNCNAME} "${@}" + + echo "${EPREFIX}$(_get_zshcompdir)" +} + +# @FUNCTION: dofishcomp +# @USAGE: [...] +# @DESCRIPTION: +# Install fish completion files passed as args. +dofishcomp() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insopts -m 0644 + insinto "$(_shell-completion_get_fishcompdir)" + doins "${@}" + ) +} + +# @FUNCTION: dozshcomp +# @USAGE: [...] +# @DESCRIPTION: +# Install zsh completion files passed as args. +dozshcomp() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insopts -m 0644 + insinto "$(_shell-completion_get_zshcompdir)" + doins "${@}" + ) +} + +# @FUNCTION: newfishcomp +# @USAGE: +# @DESCRIPTION: +# Install fish file under a new name. +newfishcomp() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insopts -m 0644 + insinto "$(_shell-completion_get_fishcompdir)" + newins "${@}" + ) +} + +# @FUNCTION: newzshcomp +# @USAGE: +# @DESCRIPTION: +# Install zsh file under a new name. +newzshcomp() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insopts -m 0644 + insinto "$(_shell-completion_get_zshcompdir)" + newins "${@}" + ) +} + +fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 5c938acd334d8d33bbdb5a116fd11a7d885aaa40 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Mar 31 18:39:54 2023 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Fri Mar 31 18:39:54 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5c938acd shell-completion.eclass: move EAPI guard Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shell-completion.eclass | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eclass/shell-completion.eclass b/eclass/shell-completion.eclass index 271378c51..008c1c0a0 100644 --- a/eclass/shell-completion.eclass +++ b/eclass/shell-completion.eclass @@ -11,17 +11,17 @@ # for popular shells. It inherits the already widely adopted # `bash-completion-r1`, thus extending on its functionality. +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" +esac + if [[ ! ${_SHELL_COMPLETION_ECLASS} ]]; then _SHELL_COMPLETION_ECLASS=1 # Extend bash-completion-r1 inherit bash-completion-r1 -case ${EAPI} in - 6|7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI} unsupported." -esac - # @FUNCTION: _shell-completion_get_fishcompdir # @INTERNAL # @DESCRIPTION:
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 02350e141d89bb1415f0452188dbab8aebdb3083 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Mar 31 18:45:20 2023 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Fri Mar 31 18:47:58 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=02350e14 shell-completion.eclass: small fixes Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shell-completion.eclass | 35 ++- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/eclass/shell-completion.eclass b/eclass/shell-completion.eclass index 008c1c0a0..aa7c7bab7 100644 --- a/eclass/shell-completion.eclass +++ b/eclass/shell-completion.eclass @@ -2,14 +2,15 @@ # Distributed under the terms of the GNU General Public License v2 # @ECLASS: shell-completion.eclass -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 8 +# @PROVIDES: bash-completion-r1 # @MAINTAINER: # Jonas Frei -# @BLURB: A few quick functions to install various shell completion files +# @BLURB: a few quick functions to install various shell completion files # @DESCRIPTION: -# This eclass provides a standardised way to install shell completions -# for popular shells. It inherits the already widely adopted -# `bash-completion-r1`, thus extending on its functionality. +# This eclass provides a standardised way to install shell completions +# for popular shells. It inherits the already widely adopted +# 'bash-completion-r1', thus extending on its functionality. case ${EAPI} in 8) ;; @@ -24,44 +25,36 @@ inherit bash-completion-r1 # @FUNCTION: _shell-completion_get_fishcompdir # @INTERNAL -# @DESCRIPTION: -# Get unprefixed fish completions directory +# @RETURN: unprefixed fish completions directory _shell-completion_get_fishcompdir() { - debug-print-function ${FUNCNAME} "${@}" - echo "/usr/share/fish/vendor_completions.d" } # @FUNCTION: _shell-completion_get_zshcompdir # @INTERNAL -# @DESCRIPTION: -# Get unprefixed zsh completions directory +# @RETURN: unprefixed zsh completions directory _shell-completion_get_zshcompdir() { - debug-print-function ${FUNCNAME} "${@}" - echo "/usr/share/zsh/site-functions" } # @FUNCTION: get_fishcompdir -# @DESCRIPTION: -# Get the fish completions directory. +# @RETURN: the fish completions directory (with EPREFIX) get_fishcompdir() { debug-print-function ${FUNCNAME} "${@}" - echo "${EPREFIX}$(_get_fishcompdir)" + echo "${EPREFIX}$(_shell-completion_get_fishcompdir)" } # @FUNCTION: get_zshcompdir -# @DESCRIPTION: -# Get the zsh completions directory. +# @RETURN: the zsh completions directory (with EPREFIX) get_zshcompdir() { debug-print-function ${FUNCNAME} "${@}" - echo "${EPREFIX}$(_get_zshcompdir)" + echo "${EPREFIX}$(_shell-completion_get_zshcompdir)" } # @FUNCTION: dofishcomp -# @USAGE: [...] +# @USAGE: # @DESCRIPTION: # Install fish completion files passed as args. dofishcomp() { @@ -75,7 +68,7 @@ dofishcomp() { } # @FUNCTION: dozshcomp -# @USAGE: [...] +# @USAGE: # @DESCRIPTION: # Install zsh completion files passed as args. dozshcomp() {
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: f8621872924609016acb5639ef26369fe51ad673 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon Feb 27 03:32:34 2023 + Commit: Florian Schmaus gentoo org> CommitDate: Mon Feb 27 03:32:34 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=f8621872 shards.eclass: don't print env in src_configure Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shards.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/shards.eclass b/eclass/shards.eclass index 5c4ae2c82..0958709e3 100644 --- a/eclass/shards.eclass +++ b/eclass/shards.eclass @@ -56,10 +56,10 @@ shards_src_configure() { debug-print-function ${FUNCNAME} "${@}" crystal_configure - einfo "CRYSTAL_OPTS='${CRYSTAL_OPTS}'" + debug-print "CRYSTAL_OPTS='${CRYSTAL_OPTS}'" export CRYSTAL_PATH="${BROOT}$(shards_get_libdir):$(crystal env CRYSTAL_PATH || die "'crystal env' failed")" - einfo "CRYSTAL_PATH='${CRYSTAL_PATH}'" + debug-print "CRYSTAL_PATH='${CRYSTAL_PATH}'" tc-export CC }
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 611cc98f39adc9826d679dbea08cb569bb201cdd Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon Feb 27 03:20:04 2023 + Commit: Florian Schmaus gentoo org> CommitDate: Mon Feb 27 03:22:29 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=611cc98f shards.eclass: enable verbose test runner Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shards.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/shards.eclass b/eclass/shards.eclass index a78d792ba..5c4ae2c82 100644 --- a/eclass/shards.eclass +++ b/eclass/shards.eclass @@ -95,7 +95,7 @@ shards_src_test() { debug-print-function ${FUNCNAME} "${@}" if [[ -d "spec" ]]; then - ecrystal spec "${@}" || die "Tests failed" + ecrystal spec --verbose "${@}" || die "Tests failed" fi return 0
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 993876f59fe1d91fdbef62ae37292730a7da1c7d Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Jan 7 13:55:38 2023 + Commit: Florian Schmaus gentoo org> CommitDate: Sun Jan 8 02:17:24 2023 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=993876f5 nim-utils.eclass: rename testament-skipfile.txt Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nim-utils.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index 61cb4b45e..03df41014 100644 --- a/eclass/nim-utils.eclass +++ b/eclass/nim-utils.eclass @@ -1,4 +1,4 @@ -# Copyright 2022 Gentoo Authors +# Copyright 2022-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: nim-utils.eclass @@ -97,7 +97,7 @@ etestament() { testament_args+=( --megatest:off ) if [[ ${ETESTAMENT_DESELECT} ]]; then - local skipfile="${T}"/testament.skipfile + local skipfile="${T}"/testament-skipfile.txt if [[ ! -f ${skipfile} ]]; then printf "%s\n" "${ETESTAMENT_DESELECT[@]}" > "${skipfile}" || die else
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: c2df2fac2e785537f9f826ca9cec158c2a492c5c Author: Anna (navi) Figueiredo Gomes navirc com> AuthorDate: Thu Dec 8 16:53:29 2022 + Commit: Ronny Gutbrod tastytea de> CommitDate: Thu Dec 8 16:53:29 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c2df2fac dotnet-utils.eclass: Typo in default src_compile Signed-off-by: Anna (navi) Figueiredo Gomes navirc.com> eclass/dotnet-utils.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index be3953b89..deeb4c3c0 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -178,7 +178,7 @@ dotnet-utils_src_prepare() { dotnet-utils_src_compile() { debug-print-function ${FUNCNAME} "${@}" - local publist_args=( + local publish_args=( --no-restore --configuration Release -p:Version=${PV} @@ -186,7 +186,7 @@ dotnet-utils_src_compile() { --self-contained ) - edotnet publish "${publish_args}" || die "'dotnet publish' failed" + edotnet publish "${publish_args[@]}" || die "'dotnet publish' failed" } fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: d39cc4f19da2e3fc1a58665aa26156e4608455a5 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:25:07 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:00 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d39cc4f1 dotnet-utils.eclass: small improvements Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 55 +++--- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index e5c5d3c8f..745676186 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -20,31 +20,37 @@ _DOTNET_UTILS_ECLASS=1 inherit multiprocessing # @ECLASS_VARIABLE: DOTNET_SLOT +# @REQUIRED +# @PRE_INHERIT # @DESCRIPTION: -# Allows for choosing a slot for dotnet -# @DEFAULT_UNSET +# Allows to choose a slot for dotnet -if [[ -z "${DOTNET_SLOT}" ]]; then - die "DOTNET_SLOT not set." +if [[ ! ${DOTNET_SLOT} ]]; then + die "${ECLASS}: DOTNET_SLOT not set" fi # Temporary, use the virtual once you can have multiple virtuals installed at once BDEPEND+=" || ( dev-dotnet/dotnet-sdk:${DOTNET_SLOT} dev-dotnet/dotnet-sdk-bin:${DOTNET_SLOT} )" # @ECLASS_VARIABLE: DOTNET_EXECUTABLE -# @DESCRIPTION: -# Holds the right executable name # @DEFAULT_UNSET +# @DESCRIPTION: +# Sets the right executable name. # @ECLASS_VARIABLE: DOTNET_CLI_TELEMETRY_OPTOUT +# @OUTPUT_VARIABLE # @DESCRIPTION: # Disables telemetry on dotnet. export DOTNET_CLI_TELEMETRY_OPTOUT=1 + # @ECLASS_VARIABLE: MSBUILDDISABLENODEREUSE +# @OUTPUT_VARIABLE # @DESCRIPTION: -# Stops the dotnet node from not stopping after the build is done. +# Stops the dotnet node after the build is done. export MSBUILDDISABLENODEREUSE=1 + # @ECLASS_VARIABLE: DOTNET_NOLOGO +# @OUTPUT_VARIABLE # @DESCRIPTION: # Disables the header logo when running dotnet commands. export DOTNET_NOLOGO=1 @@ -54,37 +60,40 @@ RESTRICT+=" strip" # @ECLASS_VARIABLE: NUGETS # @DEFAULT_UNSET -# @PRE_INHERIT # @DESCRIPTION: -# bash string containing all nuget package wants to download -# used by nuget_uris() +# String containing all nuget packages that need to be downloaded. Used by +# the 'nuget_uris' function. +# # Example: # @CODE # NUGETS=" -# ImGui.NET-1.87.2 -# Config.Net-4.19.0 +# ImGui.NET-1.87.2 +# Config.Net-4.19.0 # " -# inherit nuget +# +# inherit dotnet-utils +# # ... +# # SRC_URI="$(nuget_uris)" # @CODE # @FUNCTION: nuget_uris +# @USAGE: # @DESCRIPTION: # Generates the URIs to put in SRC_URI to help fetch dependencies. -# Uses first argument as nuget list. -# If no argument provided, uses NUGETS variable. +# If no arguments provided, uses NUGETS variable. nuget_uris() { local -r regex='^([a-zA-Z0-9_.-]+)-([0-9]+\.[0-9]+\.[0-9]+.*)$' local nuget nugets - if [[ -n ${@} ]]; then - nugets="$@" - elif [[ -n ${NUGETS} ]]; then + if (( $# != 0 )); then + nugets="${@}" + elif [[ ${NUGETS} ]]; then nugets="${NUGETS}" else eerror "NUGETS variable is not defined and nothing passed as argument" - die "Can't generate SRC_URI from empty input" + die "${FUNCNAME}: Can't generate SRC_URI from empty input" fi for nuget in ${nugets}; do @@ -150,7 +159,7 @@ edotnet() { # @DESCRIPTION: # Unpacks the package dotnet-utils_src_unpack() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local archive for archive in ${A}; do @@ -167,9 +176,9 @@ dotnet-utils_src_unpack() { # @FUNCTION: dotnet-utils_src_prepare # @DESCRIPTION: # Restores the packages - dotnet-utils_src_prepare() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" + edotnet restore \ --source "${DISTDIR}" || die default @@ -179,7 +188,7 @@ dotnet-utils_src_prepare() { # @DESCRIPTION: # Build the package using dotnet publish dotnet-utils_src_compile() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" edotnet publish \ --no-restore \
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 2e00acb8c29cc4d92a42fb374ff25de3b01bffd1 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:13:57 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:00 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2e00acb8 dotnet-utils.eclass: add inherit guard Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index f7f84dde3..e5c5d3c8f 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -14,6 +14,9 @@ case ${EAPI} in *) die "${ECLASS}: EAPI ${EAPI} unsupported." ;; esac +if [[ ! ${_DOTNET_UTILS_ECLASS} ]]; then +_DOTNET_UTILS_ECLASS=1 + inherit multiprocessing # @ECLASS_VARIABLE: DOTNET_SLOT @@ -27,7 +30,6 @@ fi # Temporary, use the virtual once you can have multiple virtuals installed at once BDEPEND+=" || ( dev-dotnet/dotnet-sdk:${DOTNET_SLOT} dev-dotnet/dotnet-sdk-bin:${DOTNET_SLOT} )" -EXPORT_FUNCTIONS src_unpack src_prepare src_compile pkg_setup # @ECLASS_VARIABLE: DOTNET_EXECUTABLE # @DESCRIPTION: @@ -186,3 +188,7 @@ dotnet-utils_src_compile() { -p:DebugType=embedded \ --self-contained || die } + +fi + +EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 357b53a29786d1edac47aa85417c6f281f48430c Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:12:41 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:00 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=357b53a2 dotnet-utils.eclass: use standard eapi guard Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index 93f163c25..f7f84dde3 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -9,12 +9,9 @@ # @SUPPORTED_EAPIS: 7 8 # @BLURB: common functions and variables for dotnet builds -case "${EAPI:-0}" in - 7|8) - ;; - *) - die "Unsupported EAPI=${EAPI} for ${ECLASS}" - ;; +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." ;; esac inherit multiprocessing
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 3191567b7af405031ab9a2e4e5a01daad14293b2 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:33:26 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:01 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3191567b dotnet-utils.eclass: use "edo" Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index ea7c6591e..17c2c685a 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -17,7 +17,7 @@ esac if [[ ! ${_DOTNET_UTILS_ECLASS} ]]; then _DOTNET_UTILS_ECLASS=1 -inherit multiprocessing +inherit edo multiprocessing # @ECLASS_VARIABLE: DOTNET_SLOT # @REQUIRED @@ -129,25 +129,18 @@ dotnet-utils_pkg_setup() { } # @FUNCTION: edotnet -# @USAGE: [[command] ...] +# @USAGE: [args...] # @DESCRIPTION: # Call dotnet, passing the supplied arguments. -# @RETURN: dotnet exit code edotnet() { - debug-print-function ${FUNCNAME} "$@" - - local ret - - set -- "$DOTNET_EXECUTABLE" "${@}" --runtime "${DOTNET_RUNTIME}" -maxcpucount:$(makeopts_jobs) - echo "${@}" >&2 - "${@}" - ret=${?} + debug-print-function ${FUNCNAME} "${@}" - if [[ ${ret} -ne 0 ]]; then - die -n "edotnet failed" - fi + local dotnet_args=( + --runtime "${DOTNET_RUNTIME}" + -maxcpucount:$(makeopts_jobs) + ) - return ${ret} + edo "${DOTNET_EXECUTABLE}" "${@}" "${dotnet_args[@]}" } # @FUNCTION: dotnet-utils_src_unpack
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: a1cca7e4aa93042fe25047fe4367a2e6ae53d707 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:36:39 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:02 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a1cca7e4 dotnet-utils.eclass: use array for src_compile args Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index 7be67d216..d035a95da 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -167,7 +167,7 @@ dotnet-utils_src_unpack() { dotnet-utils_src_prepare() { debug-print-function ${FUNCNAME} "${@}" - edotnet restore --source "${DISTDIR}" || die "Restore failed" + edotnet restore --source "${DISTDIR}" || die "'dotnet restore' failed" default_src_prepare } @@ -177,12 +177,15 @@ dotnet-utils_src_prepare() { dotnet-utils_src_compile() { debug-print-function ${FUNCNAME} "${@}" - edotnet publish \ - --no-restore \ - --configuration Release \ - "-p:Version=${PV}" \ - -p:DebugType=embedded \ - --self-contained || die + local publist_args=( + --no-restore + --configuration Release + -p:Version=${PV} + -p:DebugType=embedded + --self-contained + ) + + edotnet publish "${publish_args}" || die "'dotnet publish' failed" } fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 637fee59f92658dcacab882c31237635a79ff53f Author: Anna (navi) Figueiredo Gomes navirc com> AuthorDate: Fri Nov 25 02:34:07 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 02:34:07 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=637fee59 dotnet-utils.eclass: SLOT and runtime ARCH support Signed-off-by: Anna (navi) Figueiredo Gomes navirc.com> eclass/dotnet-utils.eclass | 56 +- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index 26a968035..61ccf8f11 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -3,9 +3,9 @@ # @ECLASS: dotnet-utils.eclass # @MAINTAINER: -# anna-...@tutanota.com +# a...@navirc.com # @AUTHOR: -# Anna Figueiredo Gomes +# Anna Figueiredo Gomes # @SUPPORTED_EAPIS: 7 8 # @BLURB: common functions and variables for dotnet builds @@ -19,8 +19,23 @@ esac inherit multiprocessing -BDEPEND=">=virtual/dotnet-sdk-6.0" -EXPORT_FUNCTIONS src_unpack src_prepare src_compile +# @ECLASS_VARIABLE: DOTNET_SLOT +# @DESCRIPTION: +# Allows for choosing a slot for dotnet +# @DEFAULT_UNSET + +if [[ -z "${DOTNET_SLOT}" ]]; then + die "DOTNET_SLOT not set." +fi + +# Temporary, use the virtual once you can have multiple virtuals installed at once +BDEPEND+=" || ( dev-dotnet/dotnet-sdk:${DOTNET_SLOT} dev-dotnet/dotnet-sdk-bin:${DOTNET_SLOT} )" +EXPORT_FUNCTIONS src_unpack src_prepare src_compile pkg_setup + +# @ECLASS_VARIABLE: DOTNET_EXECUTABLE +# @DESCRIPTION: +# Holds the right executable name +# @DEFAULT_UNSET # @ECLASS_VARIABLE: DOTNET_CLI_TELEMETRY_OPTOUT # @DESCRIPTION: @@ -36,7 +51,7 @@ export MSBUILDDISABLENODEREUSE=1 export DOTNET_NOLOGO=1 # Needed otherwise the binaries break -RESTRICT="strip" +RESTRICT+=" strip" # @ECLASS_VARIABLE: NUGETS # @DEFAULT_UNSET @@ -83,6 +98,30 @@ nuget_uris() { done } +dotnet-utils_pkg_setup() { + case "${ARCH}" in + *amd64) + DOTNET_RUNTIME="linux-x64" + ;; + *arm) + DOTNET_RUNTIME="linux-arm" + ;; + *arm64) + DOTNET_RUNTIME="linux-arm64" + ;; + *) + die "Unsupported arch: ${ARCH}" + ;; + esac + + for _dotnet in dotnet-{${DOTNET_SLOT},bin-${DOTNET_SLOT}}; do + if type $_dotnet 1> /dev/null 2>&1; then + DOTNET_EXECUTABLE=$_dotnet + break + fi + done +} + # @FUNCTION: edotnet # @USAGE: [[command] ...] # @DESCRIPTION: @@ -93,7 +132,7 @@ edotnet() { local ret - set -- dotnet "${@}" -maxcpucount:$(makeopts_jobs) + set -- "$DOTNET_EXECUTABLE" "${@}" --runtime "${DOTNET_RUNTIME}" -maxcpucount:$(makeopts_jobs) echo "${@}" >&2 "${@}" ret=${?} @@ -130,7 +169,6 @@ dotnet-utils_src_unpack() { dotnet-utils_src_prepare() { debug-print-function ${FUNCNAME} "$@" edotnet restore \ - --runtime linux-x64 \ --source "${DISTDIR}" || die default } @@ -141,13 +179,9 @@ dotnet-utils_src_prepare() { dotnet-utils_src_compile() { debug-print-function ${FUNCNAME} "$@" - addpredict /opt/dotnet-sdk-bin-6.0/metadata - edotnet publish \ - --nologo \ --no-restore \ --configuration Release \ - --runtime linux-x64 \ "-p:Version=${PV}" \ -p:DebugType=embedded \ --self-contained || die
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 20ac305c615fa9f437476ce1c42db6171b6fc48b Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:30:29 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:01 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=20ac305c dotnet-utils.eclass: match use-flags instead of ${ARCH} Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 34 +++--- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index 9e15fb08c..ea7c6591e 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -97,7 +97,7 @@ nuget_uris() { for nuget in ${nugets}; do local name version url - [[ $nuget =~ $regex ]] || die "Could not parse name and version from nuget: $nuget" + [[ ${nuget} =~ ${regex} ]] || die "Could not parse name and version from nuget: $nuget" name="${BASH_REMATCH[1]}" version="${BASH_REMATCH[2]}" url="https://api.nuget.org/v3-flatcontainer/${name}/${version}/${name}.${version}.nupkg; @@ -109,24 +109,20 @@ nuget_uris() { # @DESCRIPTION: # Sets up DOTNET_RUNTIME and DOTNET_EXECUTABLE variables for later use in edotnet. dotnet-utils_pkg_setup() { - case "${ARCH}" in - *amd64) - DOTNET_RUNTIME="linux-x64" - ;; - *arm) - DOTNET_RUNTIME="linux-arm" - ;; - *arm64) - DOTNET_RUNTIME="linux-arm64" - ;; - *) - die "Unsupported arch: ${ARCH}" - ;; - esac - - for _dotnet in dotnet-{${DOTNET_SLOT},bin-${DOTNET_SLOT}}; do - if type $_dotnet 1> /dev/null 2>&1; then - DOTNET_EXECUTABLE=$_dotnet + if use amd64; then + DOTNET_RUNTIME="linux-x64" + elif use arm; then + DOTNET_RUNTIME="linux-arm" + elif use arm64; then + DOTNET_RUNTIME="linux-arm64" + else + die "Unsupported arch: ${ARCH}" + fi + + local _dotnet + for _dotnet in dotnet{,-bin}-${DOTNET_SLOT}; do + if type ${_dotnet} 1> /dev/null 2>&1; then + DOTNET_EXECUTABLE=${_dotnet} break fi done
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 032cdad38dc59e27721f499261daef09832e0aa4 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:34:34 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:01 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=032cdad3 dotnet-utils.eclass: fix src_prepare Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index 17c2c685a..7be67d216 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -163,13 +163,12 @@ dotnet-utils_src_unpack() { # @FUNCTION: dotnet-utils_src_prepare # @DESCRIPTION: -# Restores the packages +# Restore the packages using 'dotnet restore' dotnet-utils_src_prepare() { debug-print-function ${FUNCNAME} "${@}" - edotnet restore \ - --source "${DISTDIR}" || die - default + edotnet restore --source "${DISTDIR}" || die "Restore failed" + default_src_prepare } # @FUNCTION: dotnet-utils_src_compile
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: b54ed838ce8548a24d20c7192ae36747ff78de66 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 17:54:44 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 17:54:44 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b54ed838 Revert "dotnet-utils.eclass: depend on virtual" This reverts commit 13541aa6d02056b862fa4960b9e98c0f8a2e1408. Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index d035a95da..be3953b89 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -29,7 +29,8 @@ if [[ ! ${DOTNET_SLOT} ]]; then die "${ECLASS}: DOTNET_SLOT not set" fi -BDEPEND="virtual/dotnet-sdk:${DOTNET_SLOT}" +# Temporary, use the virtual once you can have multiple virtuals installed at once +BDEPEND+=" || ( dev-dotnet/dotnet-sdk:${DOTNET_SLOT} dev-dotnet/dotnet-sdk-bin:${DOTNET_SLOT} )" # @ECLASS_VARIABLE: DOTNET_EXECUTABLE # @DEFAULT_UNSET
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 13541aa6d02056b862fa4960b9e98c0f8a2e1408 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:26:03 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:01 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=13541aa6 dotnet-utils.eclass: depend on virtual Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index 745676186..9e15fb08c 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -29,8 +29,7 @@ if [[ ! ${DOTNET_SLOT} ]]; then die "${ECLASS}: DOTNET_SLOT not set" fi -# Temporary, use the virtual once you can have multiple virtuals installed at once -BDEPEND+=" || ( dev-dotnet/dotnet-sdk:${DOTNET_SLOT} dev-dotnet/dotnet-sdk-bin:${DOTNET_SLOT} )" +BDEPEND="virtual/dotnet-sdk:${DOTNET_SLOT}" # @ECLASS_VARIABLE: DOTNET_EXECUTABLE # @DEFAULT_UNSET
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: aca09be8b1882d68e999469827e85f4ca825e9c3 Author: Anna (navi) Figueiredo Gomes navirc com> AuthorDate: Fri Nov 25 02:41:21 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 02:43:53 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=aca09be8 dotnet-utils.eclass: Forgot a function description Signed-off-by: Anna (navi) Figueiredo Gomes navirc.com> eclass/dotnet-utils.eclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index 61ccf8f11..93f163c25 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -98,6 +98,9 @@ nuget_uris() { done } +# @FUNCTION: dotnet-utils_pkg_setup +# @DESCRIPTION: +# Sets up DOTNET_RUNTIME and DOTNET_EXECUTABLE variables for later use in edotnet. dotnet-utils_pkg_setup() { case "${ARCH}" in *amd64)
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: d622daae90169366a97059c3dc4cf0f9661bb662 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Wed Nov 16 14:28:47 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Wed Nov 16 14:30:25 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d622daae crystal-utils.eclass: add SHARDS_DEPS Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/crystal-utils.eclass | 11 +++ 1 file changed, 11 insertions(+) diff --git a/eclass/crystal-utils.eclass b/eclass/crystal-utils.eclass index 8f8df3cc3..09a4049a4 100644 --- a/eclass/crystal-utils.eclass +++ b/eclass/crystal-utils.eclass @@ -37,6 +37,17 @@ CRYSTAL_DEPS=" ) " +# @ECLASS_VARIABLE: SHARDS_DEPS +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated Shards dependency string. +SHARDS_DEPS=" + || ( + dev-util/shards + dev-lang/crystal-bin + ) +" + # @FUNCTION: _crystal_get_colors_opt # @INTERNAL # @RETURN: "--no-color" if colors should be disabled, empty string otherwise
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: e03f20522f819495ef8decd2a80261da3abacd68 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Wed Nov 16 14:43:10 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Wed Nov 16 14:43:10 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e03f2052 databases.eclass: add "required use" stuff Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/databases.eclass | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/eclass/databases.eclass b/eclass/databases.eclass index fbf653435..079325a90 100644 --- a/eclass/databases.eclass +++ b/eclass/databases.eclass @@ -28,7 +28,7 @@ # # @SUBSECTION Helper usage # -# --die [msg...] +# --die [msg] # # Prints the path to the server's log file to the console and aborts the # current merge process with the given message. @@ -37,7 +37,7 @@ # # Returns the directory where the server stores database files. # -# --get-depend +# --get-depend [use1,use2,...] # # Returns a dependency string (to be included in BDEPEND). # @@ -104,31 +104,41 @@ _DATABASES_ECLASS=1 # == # @FUNCTION: _databases_gen_depend -# @USAGE: +# @USAGE: # @INTERNAL # @DESCRIPTION: # Get a dependency string for the given helper function. _databases_gen_depend() { local srvname=${1:1} + local req_use=${2} + + local pkg_dep case ${srvname} in memcached) - echo "net-misc/memcached" + pkg_dep="net-misc/memcached" ;; mongod) - echo "dev-db/mongodb" + pkg_dep="dev-db/mongodb" ;; mysql) - echo "virtual/mysql[server]" + pkg_dep="virtual/mysql" + req_use="server,${req_use}" ;; postgres) - echo "dev-db/postgresql[server]" + pkg_dep="dev-db/postgresql" + req_use="server,${req_use}" ;; redis) - echo "dev-db/redis" + pkg_dep="dev-db/redis" ;; *) die "${ECLASS}: unknown database: ${srvname}" esac + + req_use=${req_use%,} # strip trailing comma + printf "%s" "${pkg_dep}" + [[ ${req_use} ]] && \ + printf "[%s]" "${req_use}" } # @FUNCTION: _databases_die @@ -189,7 +199,7 @@ _databases_dispatch() { _databases_die ${funcname} "${@}" ;; --get-depend) - _databases_gen_depend ${funcname} + _databases_gen_depend ${funcname} "${@}" ;; --get-dbpath) echo "${T}"/${funcname}/db/
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 3a363993304d35e57ce64df95fc8b4f271fc13fa Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Wed Nov 16 14:29:57 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Wed Nov 16 14:30:25 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3a363993 shards.eclass: add SHARDS_DEPS Closes: https://bugs.gentoo.org/881485 Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/shards.eclass | 1 + 1 file changed, 1 insertion(+) diff --git a/eclass/shards.eclass b/eclass/shards.eclass index 756fdf335..a78d792ba 100644 --- a/eclass/shards.eclass +++ b/eclass/shards.eclass @@ -27,6 +27,7 @@ inherit crystal-utils multiprocessing toolchain-funcs BDEPEND=" ${CRYSTAL_DEPS} + ${SHARDS_DEPS} dev-util/gshards " IUSE="debug doc"
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: f0252164166f2b5005476664dd8c40f75afd9cba Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 4 06:25:56 2022 + Commit: Arthur Zamarin gentoo org> CommitDate: Sat Nov 5 14:41:31 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=f0252164 databases.eclass: new eclass for running databases Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/databases.eclass | 480 1 file changed, 480 insertions(+) diff --git a/eclass/databases.eclass b/eclass/databases.eclass new file mode 100644 index 0..fbf653435 --- /dev/null +++ b/eclass/databases.eclass @@ -0,0 +1,480 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: databases.eclass +# @MAINTAINER: +# Anna +# @AUTHOR: +# Anna +# @SUPPORTED_EAPIS: 8 +# @BLURB: eclass to test packages against databases +# @DESCRIPTION: +# A utility eclass providing functions for running databases. +# +# This eclass does not set any metadata variables nor export any phase, so it +# can be inherited safely. +# +# @SUBSECTION Supported databases +# +# - memcached (via "ememcached" helper) +# +# - MongoDB (via "emongod" helper) +# +# - MySQL/MariaDB/ (via "emysql" helper) +# +# - PostgreSQL (via "epostgres" helper) +# +# - Redis (via "eredis" helper) +# +# @SUBSECTION Helper usage +# +# --die [msg...] +# +# Prints the path to the server's log file to the console and aborts the +# current merge process with the given message. +# +# --get-dbpath +# +# Returns the directory where the server stores database files. +# +# --get-depend +# +# Returns a dependency string (to be included in BDEPEND). +# +# --get-logfile +# +# Returns the path to the server's log file. +# +# --get-pidfile +# +# Returns the path to the server's PID file. +# +# --get-sockdir +# +# Returns the directory where the server's sockets are located. +# +# --get-sockfile +# +# Returns the path to the server's socket file. +# +# --start +# +# Starts the server on the default port. +# +# --start +# +# Starts the server on the given port. +# +# --stop +# +# Stops the server. +# +# @EXAMPLE: +# +# @CODE +# EAPI=8 +# +# ... +# +# inherit databases distutils-r1 +# +# ... +# +# BDEPEND="$(eredis --get-depend)" +# +# distutils_enable_tests pytest +# +# src_test() { +# eredis --start 16739 +# distutils-r1_src_test +# eredis --stop +# } +# @CODE + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." +esac + +if [[ ! ${_DATABASES_ECLASS} ]]; then +_DATABASES_ECLASS=1 + +# == +# GENERIC FUNCTIONS +# == + +# @FUNCTION: _databases_gen_depend +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Get a dependency string for the given helper function. +_databases_gen_depend() { + local srvname=${1:1} + case ${srvname} in + memcached) + echo "net-misc/memcached" + ;; + mongod) + echo "dev-db/mongodb" + ;; + mysql) + echo "virtual/mysql[server]" + ;; + postgres) + echo "dev-db/postgresql[server]" + ;; + redis) + echo "dev-db/redis" + ;; + *) + die "${ECLASS}: unknown database: ${srvname}" + esac +} + +# @FUNCTION: _databases_die +# @USAGE: [msg] +# @INTERNAL +# @DESCRIPTION: +# Print the given message and the path to the server's log file to the console +# and die. +# +# This function supports being called via "nonfatal". +_databases_die() { + local funcname=${1?} + shift + + eerror "See the server log for details:" + eerror "$(${funcname} --get-logfile)" + die -n "${@}" +} + +# @FUNCTION: _databases_stop_service +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Default function to stop servers. Reads PID from a file and sends the TERM +# signal. +_databases_stop_service() { + debug-print-function "${FUNCNAME}" "${@}" + + local funcname=${1?} + local srvname=${funcname:1} + local pidfile="$(${funcname} --get-pidfile)" + + ebegin "Stopping ${srvname}" + kill "$(<"${pidfile}")" + eend $? || ${funcname} --die "Stopping ${srvname} failed" +} + +# @FUNCTION: _databases_dispatch +# @USAGE: [args...] +# @INTERNAL +# @DESCRIPTION: +# Process the given command with its options. +# +# If "--start" command is used, `_${funcname}_start` function must be defined. +# Note that directories will be created automatically. +# +# If `_${funcname}_stop` function is not declared, the internal +#
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 16dab572c817e91990e26752a9734160062d974c Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Wed Jul 20 09:33:36 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Wed Jul 20 09:33:36 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=16dab572 nim-utils.eclass: "|| die" Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nim-utils.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index bab1a55f4..61f25905b 100644 --- a/eclass/nim-utils.eclass +++ b/eclass/nim-utils.eclass @@ -103,7 +103,7 @@ etestament() { if [[ ${ETESTAMENT_DESELECT} ]]; then local skipfile="${T}"/testament.skipfile if [[ ! -f ${skipfile} ]]; then - printf "%s\n" "${ETESTAMENT_DESELECT[@]}" > "${skipfile}" + printf "%s\n" "${ETESTAMENT_DESELECT[@]}" > "${skipfile}" || die else debug-print "${skipfile} already exists, not overwriting" fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: dd644b2fb8960c0481c41efe0215eb109bd29ffd Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Tue Jul 19 06:29:36 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue Jul 19 06:33:01 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=dd644b2f nim-utils.eclass: don't write NIMFLAGS to the config file There are issues with strings containing spaces. Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nim-utils.eclass | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index 743aa9877..bab1a55f4 100644 --- a/eclass/nim-utils.eclass +++ b/eclass/nim-utils.eclass @@ -25,11 +25,11 @@ if [[ ! ${_NIM_UTILS_ECLASS} ]]; then # @USER_VARIABLE # @DEFAULT_UNSET # @DESCRIPTION: -# Flags for the Nim compiler. All values (if any) must be double-quoted. +# Flags for the Nim compiler. Spaces need to be quoted or shell-escaped. # Example: # # @CODE@ -# # NIMFLAGS='-d:myFlag -d:myOpt:"value"' emerge category/package +# # NIMFLAGS="-d:myFlag -d:myOpt:'my value'" emerge category/package # @CODE@ # @ECLASS_VARIABLE: TESTAMENT_DISABLE_MEGATEST @@ -49,14 +49,14 @@ inherit multiprocessing toolchain-funcs xdg-utils # @FUNCTION: enim # @USAGE: [...] # @DESCRIPTION: -# Call nim, passing the supplied arguments. +# Call nim, passing the supplied arguments and NIMFLAGS. # This function dies if nim fails. It also supports being called via 'nonfatal'. # If you need to call nim directly in your ebuilds, this is the way it should # be done. enim() { debug-print-function ${FUNCNAME} "${@}" - set -- nim "${@}" + set -- nim "${@}" ${NIMFLAGS} echo "$@" >&2 "$@" || die -n "${*} failed" } @@ -173,7 +173,6 @@ nim_gen_config() { -d:"$(nim_get_buildtype)" --colors:"$(nim_get_colors)" --parallelBuild:"$(makeopts_jobs)" - $(printf "%s\n" ${NIMFLAGS}) EOF }
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 183aa05bdca90107022edf7ee1cbcccd07fc893b Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Tue Jul 19 06:07:06 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue Jul 19 06:07:06 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=183aa05b nim-utils.eclass: link bug Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nim-utils.eclass | 1 + 1 file changed, 1 insertion(+) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index fae8bb292..743aa9877 100644 --- a/eclass/nim-utils.eclass +++ b/eclass/nim-utils.eclass @@ -148,6 +148,7 @@ nim_get_colors() { nim_gen_config() { debug-print-function ${FUNCNAME} "${@}" + # bug 667182 xdg_environment_reset local dir=${1:-${WORKDIR}}
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: d7803c78b4f9b2a711a66a56378e1ce6df150afe Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sun Jul 17 13:19:59 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue Jul 19 05:57:46 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d7803c78 nimble.eclass: use depfiles Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nimble.eclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eclass/nimble.eclass b/eclass/nimble.eclass index 20e9f5a5a..e08c2840e 100644 --- a/eclass/nimble.eclass +++ b/eclass/nimble.eclass @@ -60,8 +60,8 @@ NINJA="ninja" inherit nim-utils ninja-utils BDEPEND="${NINJA_DEPEND} - dev-lang/nim - dev-nim/nimbus + dev-lang/nim[experimental(-)] + >=dev-nim/nimbus-1.0.0 " # @FUNCTION: set_package_url @@ -134,6 +134,7 @@ nimble_src_configure() { local nimbusargs=( --nimbleDir:"${EPREFIX}"/opt/nimble --binDir:"${EPREFIX}"/usr/bin + --useDepfile "${mynimargs[@]}" )
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 5c6cf732a610b270318ee0d9546f145d1bd48881 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Jul 16 21:08:14 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Sat Jul 16 21:08:14 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5c6cf732 nim-utils.eclass: add ekoch helper Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nim-utils.eclass | 24 1 file changed, 24 insertions(+) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index b5ce4d6b0..fae8bb292 100644 --- a/eclass/nim-utils.eclass +++ b/eclass/nim-utils.eclass @@ -61,6 +61,30 @@ enim() { "$@" || die -n "${*} failed" } +# @FUNCTION: ekoch +# @USAGE: [...] +# @DESCRIPTION: +# Call koch, passing the supplied arguments. Used only for building compilers +# that originate from Nim. +# This function dies if koch fails. +ekoch() { + debug-print-function ${FUNCNAME} "${@}" + + local koch + case "${CATEGORY}/${PN}" in + dev-lang/nim) + koch="./koch" + [[ -e ${koch} ]] || enim c koch + ;; + *) + eerror "${FUNCNAME} is not implemented for ${CATEGORY}/${PN}" ;; + esac + + set -- ${koch} "${@}" + echo "$@" >&2 + "$@" || die -n "${*} failed" +} + # @FUNCTION: etestament # @USAGE: [...] # @DESCRIPTION:
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 88cc11da55f9224341be015595d62397bc535b4d Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sun Jul 10 03:36:07 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Sun Jul 10 03:36:07 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=88cc11da boinc-app.eclass: add acct-user deps Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/boinc-app.eclass | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass index 2b6fc5e40..540fc8ea0 100644 --- a/eclass/boinc-app.eclass +++ b/eclass/boinc-app.eclass @@ -5,7 +5,7 @@ # @MAINTAINER: # Anna Vyalkova # @SUPPORTED_EAPIS: 8 -# @BLURB: Eclass that provides base functions for installing BOINC applications. +# @BLURB: base functions for installing BOINC applications # @DESCRIPTION: # This eclass provides base functions for installation of software developed # for the BOINC platform. @@ -77,7 +77,7 @@ in order to use this application with BOINC.} # Generate appropriate (R)DEPEND for wrapper-enabled or # native application. boinc-app_add_deps() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" if [[ $1 == "--wrapper" ]]; then RDEPEND="sci-misc/boinc-wrapper" @@ -85,6 +85,9 @@ boinc-app_add_deps() { DEPEND="sci-misc/boinc" RDEPEND="sci-misc/boinc" fi + + DEPEND="${DEPEND} acct-user/boinc" + RDEPEND="${RDEPEND} acct-user/boinc" } # @FUNCTION: boinc_master_url_check @@ -92,9 +95,9 @@ boinc-app_add_deps() { # @DESCRIPTION: # Make sure BOINC_MASTER_URL has a value. boinc_master_url_check() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" - [[ ! ${BOINC_MASTER_URL} ]] && \ + [[ -n ${BOINC_MASTER_URL} ]] || \ die "BOINC_MASTER_URL is not set" return 0 } @@ -103,7 +106,7 @@ boinc_master_url_check() { # @USAGE: # @RETURN: non-prefixed default BOINC runtime directory get_boincdir() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" echo /var/lib/boinc } @@ -121,7 +124,7 @@ get_boincdir() { # -> boinc.berkeley.edu_example # @CODE get_project_dirname() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" boinc_master_url_check @@ -137,7 +140,7 @@ get_project_dirname() { # @USAGE: # @RETURN: non-prefixed directory where applications and files should be installed get_project_root() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" echo "$(get_boincdir)/projects/$(get_project_dirname)" } @@ -163,7 +166,7 @@ _boinc-app_fix_permissions() { # The default appinfo_prepare(). It replaces all occurences # of @PV@ with its corresponding value. boinc-app_appinfo_prepare() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" sed -i "$1" \ -e "s:@PV@:${PV}:g" \ @@ -196,7 +199,7 @@ boinc-app_appinfo_prepare() { # } # @CODE doappinfo() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" (( $# == 1 )) || \ die "${FUNCNAME} takes exactly one argument" @@ -224,7 +227,7 @@ doappinfo() { # The default foreach_wrapper_job(). It replaces all occurences # of @PV@, @EPREFIX@ and @LIBDIR@ strings with their corresponding values. boinc-wrapper_foreach_wrapper_job() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" sed -i "$1" \ -e "s:@PV@:${PV}:g" \ @@ -260,7 +263,7 @@ boinc-wrapper_foreach_wrapper_job() { # # Keep your job.xml files in sync with app_info.xml! dowrapper() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" for app in "$@"; do local wrapperjob="${app}_job_${PV}.xml" @@ -293,7 +296,7 @@ dowrapper() { # Display helpful instructions on how to make the BOINC client use installed # applications. boinc-app_pkg_postinst() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" if [[ -f "${EROOT}/$(get_boincdir)/master_$(get_project_dirname).xml" ]]; then if [[ -z ${REPLACING_VERSIONS} ]]; then @@ -328,7 +331,7 @@ boinc-app_pkg_postinst() { # Display helpful instructions on how to cleanly uninstall unmerged # applications. boinc-app_pkg_postrm() { - debug-print-function ${FUNCNAME} "${@}"] + debug-print-function ${FUNCNAME} "${@}" if [[ -z ${REPLACED_BY_VERSION} ]]; then local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg"
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 9228cc58d0ff44a3c82fee30c56fbf9d4aae540e Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Wed Jun 29 20:26:52 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Thu Jun 30 06:00:04 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=9228cc58 nimble.eclass: drop edo Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nimble.eclass | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eclass/nimble.eclass b/eclass/nimble.eclass index 60bd28689..4c80bd2a9 100644 --- a/eclass/nimble.eclass +++ b/eclass/nimble.eclass @@ -57,7 +57,7 @@ if [[ ! ${_NIMBLE_ECLASS} ]]; then # Force ninja because samu doesn't work correctly. NINJA="ninja" -inherit edo nim-utils ninja-utils +inherit nim-utils ninja-utils BDEPEND="${NINJA_DEPEND} dev-lang/nim @@ -138,7 +138,9 @@ nimble_src_configure() { "${mynimargs[@]}" ) - edo nimbus "${nimbusargs[@]}" "${S}" "${BUILD_DIR}" + set -- nimbus "${nimbusargs[@]}" "${S}" "${BUILD_DIR}" + echo "${@}" >&2 + "${@}" || die "${*} failed" } # @FUNCTION: nimble_build
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: d34b616bfc616418be86dab44d53f9397665a7bc Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Wed Jun 29 07:13:20 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Wed Jun 29 11:52:26 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d34b616b eclass/nim-utils.eclass: new eclass Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nim-utils.eclass | 115 1 file changed, 115 insertions(+) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass new file mode 100644 index 0..12b077452 --- /dev/null +++ b/eclass/nim-utils.eclass @@ -0,0 +1,115 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: nim-utils.eclass +# @MAINTAINER: +# Anna Vyalkova +# @AUTHOR: +# Anna Vyalkova +# @SUPPORTED_EAPIS: 8 +# @BLURB: utility functions for Nim packages +# @DESCRIPTION: +# A utility eclass providing functions to call and configure Nim. +# +# This eclass does not set any metadata variables nor export any phase +# functions. It can be inherited safely. + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." +esac + +if [[ ! ${_NIM_UTILS_ECLASS} ]]; then + +# @ECLASS_VARIABLE: NIMFLAGS +# @USER_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# Flags for the Nim compiler. + +# @ECLASS_VARIABLE: TESTAMENT_DISABLE_MEGATEST +# @USER_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set, pass '--megatest:off' to testament. + +# @VARIABLE: ETESTAMENT_DESELECT +# @DEFAULT_UNSET +# @DESCRIPTION: +# Specifies an array of test files to be deselected via testament's --skipFrom +# parameter, when calling etestament. + +inherit multiprocessing toolchain-funcs xdg-utils + +# @FUNCTION: enim +# @USAGE: [...] +# @DESCRIPTION: +# Call nim, passing the supplied arguments. +# This function dies if nim fails. It also supports being called via 'nonfatal'. +# If you need to call nim directly in your ebuilds, this is the way it should +# be done. +enim() { + debug-print-function ${FUNCNAME} "${@}" + + set -- nim "${@}" + echo "$@" >&2 + "$@" || die -n "${*} failed" +} + +# @FUNCTION: etestament +# @USAGE: [...] +# @DESCRIPTION: +# Call testament, passing the supplied arguments. +# This function dies if testament fails. +etestament() { + debug-print-function ${FUNCNAME} "${@}" + + local -a testament_args=() + [[ ${TESTAMENT_DISABLE_MEGATEST} ]] && \ + testament_args+=( --megatest:off ) + + [[ "${NOCOLOR}" == true || "${NOCOLOR}" == yes ]] && \ + testament_args+=( --colors:off ) + + if [[ ${ETESTAMENT_DESELECT} ]]; then + local skipfile="${T}"/testament.skipfile + for t in "${ETESTAMENT_DESELECT[@]}"; do + echo "${t}" >> "${skipfile}" + done + testament_args+=( --skipFrom:"${skipfile}" ) + fi + + set -- testament "${testament_args[@]}" "${@}" + echo "$@" >&2 + "$@" || die -n "${*} failed" +} + +# @FUNCTION: nim_gen_config +# @USAGE: +# @DESCRIPTION: +# Generate the ${WORKDIR}/nim.cfg to respect user's toolchain and preferences. +nim_gen_config() { + debug-print-function ${FUNCNAME} "${@}" + + xdg_environment_reset + + cat > "${WORKDIR}/nim.cfg" <<- EOF || die "Failed to create Nim config" + cc:"gcc" + gcc.exe:"$(tc-getCC)" + gcc.linkerexe:"$(tc-getCC)" + gcc.cpp.exe:"$(tc-getCXX)" + gcc.cpp.linkerexe:"$(tc-getCXX)" + gcc.options.always:"${CFLAGS} ${CPPFLAGS}" + gcc.options.linker:"${LDFLAGS}" + gcc.cpp.options.always:"${CFLAGS} ${CPPFLAGS}" + gcc.cpp.options.linker:"${LDFLAGS}" + + $([[ "${NOCOLOR}" == true || "${NOCOLOR}" == yes ]] && echo '--colors:"off"') + -d:"release" + --parallelBuild:"$(makeopts_jobs)" + $(printf "%s\n" ${NIMFLAGS}) + EOF +} + +_NIM_UTILS_ECLASS=1 +fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 56b12ae84dcc932450abcab8e2099582cf4e22c0 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Wed Jun 29 08:18:03 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Wed Jun 29 11:52:32 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=56b12ae8 eclass/nimble.eclass: new eclass Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/nimble.eclass | 169 +++ 1 file changed, 169 insertions(+) diff --git a/eclass/nimble.eclass b/eclass/nimble.eclass new file mode 100644 index 0..177a2fbd4 --- /dev/null +++ b/eclass/nimble.eclass @@ -0,0 +1,169 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: nimble.eclass +# @MAINTAINER: +# Anna Vyalkova +# @AUTHOR: +# Anna Vyalkova +# @SUPPORTED_EAPIS: 8 +# @PROVIDES: nim-utils +# @BLURB: eclass to build Nim packages that use nimble as a build system +# @EXAMPLE: +# Typical ebuild for a Nim application: +# +# EAPI=8 +# +# inherit nimble +# +# ... +# +# src_compile() { +# nimble_src_compile +# nimble_build scss +# } +# +# ... +# +# +# Typical ebuild for a Nim library: +# +# EAPI=8 +# +# inherit nimble +# +# ... +# SLOT=${PV} +# +# set_package_url "https://github.com/example/example; + + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." +esac + +if [[ ! ${_NIMBLE_ECLASS} ]]; then + +# @ECLASS_VARIABLE: BUILD_DIR +# @DEFAULT_UNSET +# @DESCRIPTION: +# Build directory, location where all generated files should be placed. +# If this isn't set, it defaults to ${WORKDIR}/${P}-build. + +inherit edo nim-utils ninja-utils + +BDEPEND="${NINJA_DEPEND} + dev-lang/nim + dev-nim/nimbus +" + +# @FUNCTION: set_package_url +# @USAGE: +# @DESCRIPTION: +# If this function is called, nimbus will generate and install a nimblemeta.json +# file. Some packages specify their dependencies using URLs and nimbus is +# unable to find them unless a metadata file exists. +set_package_url() { + debug-print-function ${FUNCNAME} "${@}" + + (( $# == 1 )) || \ + die "${FUNCNAME} takes exactly one argument" + + _PACKAGE_URL="${1}" +} + +# @FUNCTION: get_package_url +# @USAGE: +# @INTERNAL +# @RETURN: package URL +get_package_url() { + echo "${_PACKAGE_URL}" +} + +# @FUNCTION: nimble_src_configure +# @USAGE: +# @DESCRIPTION: +# Configure the package with nimbus. This will start an out-of-source build. +# Passes arguments to Nim by reading from an optionally pre-defined local +# mynimargs bash array. +# @CODE +# src_configure() { +# local mynimargs=( +# --threads:on +# ) +# nimble_src_configure +# } +# @CODE +nimble_src_configure() { + debug-print-function ${FUNCNAME} "${@}" + + [[ -n "${NINJA_DEPEND}" ]] || \ + ewarn "Unknown value '${NINJA}' for \${NINJA}" + + BUILD_DIR="${BUILD_DIR:-${WORKDIR}/${P}-build}" + + [[ -z ${mynimargs} ]] && local -a mynimargs=() + local mynimargstype=$(declare -p mynimargs 2>&-) + if [[ "${mynimargstype}" != "declare -a mynimargs="* ]]; then + die "mynimargs must be declared as array" + fi + + nim_gen_config + + local nimbusargs=( + --nimbleDir:"${EPREFIX}"/opt/nimble + --binDir:"${EPREFIX}"/usr/bin + --url:"$(get_package_url)" + "${mynimargs[@]}" + ) + + edo nimbus "${nimbusargs[@]}" "${S}" "${BUILD_DIR}" +} + +# @FUNCTION: nimble_build +# @USAGE: [ninja args...] +# @DESCRIPTION: +# Function for building the package. All arguments are passed to eninja. +nimble_build() { + debug-print-function ${FUNCNAME} "${@}" + + eninja -C "${BUILD_DIR}" "${@}" +} + +# @FUNCTION: nimble_src_compile +# @USAGE: [ninja args...] +# @DESCRIPTION: +# Build the package with Ninja. All arguments are passed to nimble_build. +nimble_src_compile() { + debug-print-function ${FUNCNAME} "${@}" + + nimble_build "${@}" +} + +# @FUNCTION: nimble_src_test +# @USAGE: [ninja args...] +# @DESCRIPTION: +# Test the package. All arguments are passed to nimble_build. +nimble_src_test() { + debug-print-function ${FUNCNAME} "${@}" + + if nonfatal nimble_build test -n &> /dev/null; then + nimble_build test "${@}" + fi +} + +# @FUNCTION: nimble_src_install +# @DESCRIPTION: +# Install the package with Ninja. All arguments are passed to nimble_build. +nimble_src_install() { + debug-print-function ${FUNCNAME} "${@}" + + DESTDIR="${D}" nimble_build install "${@}" + einstalldocs +} + +_NIMBLE_ECLASS=1 +fi + +EXPORT_FUNCTIONS src_configure src_compile src_test src_install
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 390cdd54fada331960fa08571194e5e9fba960e9 Author: Alessandro Barbieri gmail com> AuthorDate: Tue Jun 14 09:10:58 2022 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Tue Jun 14 09:10:58 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=390cdd54 octaveforge.eclass: remove octave detection Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index 6f74951a6..0e2c16604 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -38,8 +38,8 @@ OCT_PKGDIR="${OCT_ROOT}/packages" # @ECLASS-VARIABLE: OCT_BIN # @DESCRIPTION: -# full path to octave binary -OCT_BIN="$(type -p octave || die)" +# octave binary name +OCT_BIN="octave" SRC_URI="mirror://sourceforge/octave/${P}.tar.gz" SLOT="0"
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 8dc69248dca0f9f9420b8650c3bdef6cd8307bb0 Author: Alessandro Barbieri gmail com> AuthorDate: Tue Jun 14 01:22:00 2022 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Tue Jun 14 08:00:25 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8dc69248 octaveforge.eclass: remove unneeded edo Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 66 +++ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index 31e1f270d..6f74951a6 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -39,7 +39,7 @@ OCT_PKGDIR="${OCT_ROOT}/packages" # @ECLASS-VARIABLE: OCT_BIN # @DESCRIPTION: # full path to octave binary -OCT_BIN="$(type -p octave)" +OCT_BIN="$(type -p octave || die)" SRC_URI="mirror://sourceforge/octave/${P}.tar.gz" SLOT="0" @@ -60,19 +60,19 @@ octaveforge_src_unpack() { octaveforge_src_prepare() { default - _generate_configure + _generate_configure || die if [[ -e "${S}/src/configure.ac" ]]; then - edo pushd "${S}/src" + pushd "${S}/src" || die eautoreconf - edo popd + popd || die elif [[ -e "${S}/src/autogen.sh" ]]; then - edo pushd "${S}/src" + pushd "${S}/src" || die edo ./autogen.sh - edo popd + popd || die fi if [[ -e "${S}/src/Makefile" ]]; then - edo sed -i 's/ -s / /g' "${S}/src/Makefile" + sed -i 's/ -s / /g' "${S}/src/Makefile" || die fi } @@ -82,7 +82,7 @@ octaveforge_src_compile() { export MKOCTFILE="mkoctfile -v" cmd="disp(__octave_config_info__('octlibdir'));" - OCTLIBDIR=$(edo octavecommand "${cmd}") + OCTLIBDIR=$(octavecommand "${cmd}" || die) export LFLAGS="${LFLAGS} -L${OCTLIBDIR}" export LDFLAGS="${LDFLAGS} -L${OCTLIBDIR}" @@ -91,25 +91,25 @@ octaveforge_src_compile() { fi if [[ -e src/Makefile ]]; then - edo mv src/Makefile src/Makefile.disable + mv src/Makefile src/Makefile.disable || die fi if [[ -e src/configure ]]; then - edo mv src/configure src/configure.disable + mv src/configure src/configure.disable || die fi - edo pushd .. - edo tar -czf "${OCT_PACKAGE}" "${PKGDIR}" + pushd .. || die + tar -czf "${OCT_PACKAGE}" "${PKGDIR}" || die } # @FUNCTION: octaveforge_src_install # @DESCRIPTION: # function to install the octave package octaveforge_src_install() { - DESTDIR="${D}" edo _octaveforge_pkg_install + DESTDIR="${D}" _octaveforge_pkg_install || die } octaveforge_src_test() { - DESTDIR="${T}" edo _octaveforge_pkg_install + DESTDIR="${T}" _octaveforge_pkg_install || die # cargo culted from Fedora cmd=" @@ -118,7 +118,7 @@ octaveforge_src_test() { unlink(pkg('local_list')); unlink(pkg('global_list')); " - edo octavecommand "${cmd}" + octavecommand "${cmd}" || die } # @FUNCTION: octaveforge_pkg_postinst @@ -127,10 +127,10 @@ octaveforge_src_test() { octaveforge_pkg_postinst() { einfo "Registering ${CATEGORY}/${PF} on the Octave package database." if [[ ! -d "${OCT_PKGDIR}" ]] ; then - edo mkdir -p "${OCT_PKGDIR}" + mkdir -p "${OCT_PKGDIR}" || die fi cmd="pkg('rebuild');" - edo octavecommand "${cmd}" + octavecommand "${cmd}" || die } # @FUNCTION: octaveforge_pkg_prerm @@ -143,16 +143,16 @@ octaveforge_pkg_prerm() { l = pkg('list'); disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); " - oct_pkgdir=$(edo octavecommand "${cmd}") - edo rm -f "${oct_pkgdir}/packinfo/on_uninstall.m" + oct_pkgdir=$(octavecommand "${cmd}" || die) + rm -f "${oct_pkgdir}/packinfo/on_uninstall.m" || die if [[ -e "${oct_pkgdir}/packinfo/on_uninstall.m.orig" ]]; then - edo mv "$oct_pkgdir"/packinfo/on_uninstall.m{.orig,} - edo pushd "$oct_pkgdir/packinfo" + mv "$oct_pkgdir"/packinfo/on_uninstall.m{.orig,} || die + pushd "$oct_pkgdir/packinfo" || die cmd=" l = pkg('list'); on_uninstall(l{cellfun(@(x)strcmp(x.name,'${PN}'), l)}); " - edo octavecommand "${cmd}" + octavecommand "${cmd}" || die fi } @@ -162,7 +162,7 @@ octaveforge_pkg_prerm() { octaveforge_pkg_postrm() { einfo 'Rebuilding the Octave package database.' if [[ ! -d "${OCT_PKGDIR}" ]] ; then - edo mkdir -p "${OCT_PKGDIR}" + mkdir -p "${OCT_PKGDIR}" || die fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 0a8c734ce06415d1ace17665675de9c2fa0e33a9 Author: Alessandro Barbieri gmail com> AuthorDate: Tue Jun 14 01:14:48 2022 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Tue Jun 14 08:00:25 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0a8c734c R-packages.eclass: remove unneeded edo Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages.eclass | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index 4c4b16fd9..1aa612403 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -37,9 +37,9 @@ BDEPEND="sys-apps/pkgcore" # will contain symlinks to everything in _movelink() { if [[ -e "${1}" ]]; then - local rp1="$(edo realpath ${1})" - edo mv "${rp1}" "${2}" - edo cp -rsf "${2}" "${rp1}" + local rp1="$(realpath ${1} || die)" + mv "${rp1}" "${2}" || die + cp -rsf "${2}" "${rp1}" || die fi } @@ -49,7 +49,7 @@ _movelink() { R-packages_src_unpack() { unpack ${A} if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then - edo mv "${PN//_/.}" "${P}" + mv "${PN//_/.}" "${P}" || die fi } @@ -57,9 +57,9 @@ R-packages_src_unpack() { # @DESCRIPTION: # function to remove unwanted files from the sources R-packages_src_prepare() { - edo rm -f LICENSE + rm -f LICENSE || die default - edo mkdir -p "${T}/R" + mkdir -p "${T}/R" || die } # @FUNCTION: R-packages_src_configure @@ -99,35 +99,35 @@ R-packages_src_compile() { # documentation and examples to docsdir, symlinked back to R site-library (to allow access from within R) # everything else to R site-library R-packages_src_install() { - edo pushd "${T}/R/${PN//_/.}" + pushd "${T}/R/${PN//_/.}" || die local DOCS_DIR="/usr/share/doc/${PF}" - edo mkdir -p "${ED}/${DOCS_DIR}" + mkdir -p "${ED}/${DOCS_DIR}" || die for i in NEWS.md README.md DESCRIPTION examples CITATION INDEX NEWS WORDLIST News.Rd ; do - edo _movelink "${i}" "${ED}${DOCS_DIR}/${i}" + _movelink "${i}" "${ED}${DOCS_DIR}/${i}" || die docompress -x "${DOCS_DIR}/${i}" done if [[ -e html ]]; then - edo _movelink html "${ED}${DOCS_DIR}/html" + _movelink html "${ED}${DOCS_DIR}/html" || die docompress -x "${DOCS_DIR}/html" fi if [[ -e doc ]]; then - edo pushd doc + pushd doc || die for i in * ; do - edo _movelink "${i}" "${ED}${DOCS_DIR}/${i}" + _movelink "${i}" "${ED}${DOCS_DIR}/${i}" || die docompress -x "${DOCS_DIR}/${i}" done - edo popd + popd || die fi if [[ -e doc/html ]]; then docompress -x "${DOCS_DIR}/html" fi docompress -x "${DOCS_DIR}" - edo rm -rf tests test + rm -rf tests test || die insinto "/usr/$(get_libdir)/R/site-library" doins -r "${T}/R/${PN//_/.}" @@ -139,7 +139,7 @@ R-packages_src_install() { R-packages_pkg_postinst() { if [[ -v SUGGESTED_PACKAGES ]]; then for p in ${SUGGESTED_PACKAGES} ; do - pexist=$(edo pquery -n1 "${p}" 2>/dev/null) + pexist="$(pquery -n1 ${p} 2>/dev/null || die)" if [[ -n "${pexist}" ]]; then optfeature "having the upstream suggested package" "${p}" fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 5778e18ce802eadc134be8da814893287fd06d8c Author: Alessandro Barbieri gmail com> AuthorDate: Wed May 11 10:18:19 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Wed May 11 11:29:17 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5778e18c octaveforge.eclass: add octaveforge_src_test() Closes: https://bugs.gentoo.org/843536 Closes: https://bugs.gentoo.org/843521 Closes: https://bugs.gentoo.org/843518 Closes: https://bugs.gentoo.org/843515 Closes: https://bugs.gentoo.org/843512 Closes: https://bugs.gentoo.org/843509 Closes: https://bugs.gentoo.org/843503 Closes: https://bugs.gentoo.org/843500 Closes: https://bugs.gentoo.org/843497 Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 125 +- 1 file changed, 68 insertions(+), 57 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index fb708e3a7..bb6176be9 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -17,7 +17,7 @@ case ${EAPI} in *) die "${ECLASS}: EAPI ${EAPI} unsupported." esac -EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_prerm pkg_postrm +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install src_test pkg_postinst pkg_prerm pkg_postrm # @ECLASS-VARIABLE: REPO_URI # @DESCRIPTION: @@ -103,65 +103,21 @@ octaveforge_src_compile() { # @FUNCTION: octaveforge_src_install # @DESCRIPTION: # function to install the octave package -# documentation to docsdir octaveforge_src_install() { - TMPDIR="${T}" - DESTDIR="${D}" - DISTPKG='Gentoo' + DESTDIR="${D}" _octaveforge_pkg_install || die +} - pushd ../ || die - if [[ "X${DISTPKG}X" != "XX" ]]; then - stripcmd=" - unlink(pkg('local_list')); - unlink(pkg('global_list')); - " - fi - if [[ "X${DESTDIR}X" = "XX" ]]; then - cmd=" - warning('off','all'); - pkg('install','${OCT_PACKAGE}'); - l=pkg('list'); - disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); - ${stripcmd} - " - oct_pkgdir=$(octavecommand "${cmd}" || die) - else - cmd="disp(fullfile(__octave_config_info__('datadir'),'octave'));" - shareprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) - cmd="disp(fullfile(__octave_config_info__('libdir'),'octave'));" - libprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) - octprefix="${shareprefix}/packages" || die - archprefix="${libprefix}/packages" || die - if [[ ! -e "${octprefix}" ]]; then - mkdir -p "${octprefix}" || die - fi - if [[ ! -e "${archprefix}" ]]; then - mkdir -p "${archprefix}" || die - fi - cmd=" - warning('off','all'); - pkg('prefix','${octprefix}','${archprefix}'); - pkg('global_list',fullfile('${shareprefix}','octave_packages')); - pkg('local_list',fullfile('${shareprefix}','octave_packages')); - pkg('install','-nodeps','-verbose','${OCT_PACKAGE}'); - " - octavecommand "${cmd}" || die - cmd=" - warning('off','all'); - pkg('prefix','${octprefix}','${archprefix}'); - pkg('global_list',fullfile('${shareprefix}','octave_packages')); - pkg('local_list',fullfile('${shareprefix}','octave_packages')); - l=pkg('list'); - disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); - ${stripcmd} - " - oct_pkgdir=$(octavecommand "${cmd}" || die) - fi - export oct_pkgdir +octaveforge_src_test() { + DESTDIR="${T}" _octaveforge_pkg_install || die - if [[ -d doc/ ]]; then - dodoc -r doc/* - fi + # cargo culted from Fedora + cmd=" + pkg('load','${PN}'); + oruntests('${oct_pkgdir}'); + unlink(pkg('local_list')); + unlink(pkg('global_list')); + " + octavecommand "${cmd}" || die 'failed testing' } # @FUNCTION: octaveforge_pkg_postinst @@ -226,3 +182,58 @@ fi EOF chmod 0755 "configure" || die } + +_octaveforge_pkg_install() { + TMPDIR="${T}" + DISTPKG='Gentoo' + + pushd ../ || die + if [[ "X${DISTPKG}X" != "XX" ]]; then + stripcmd=" + unlink(pkg('local_list')); + unlink(pkg('global_list')); + " + fi + if [[ "X${DESTDIR}X" = "XX"
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 14617d41adcaac22702439046b5dad6a5979ac94 Author: Alessandro Barbieri gmail com> AuthorDate: Thu May 5 07:24:49 2022 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Thu May 5 07:32:17 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=14617d41 octaveforge.eclass: move octaveforge makefile logic into the eclass Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 128 +++--- 1 file changed, 99 insertions(+), 29 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index 590f21a1c..7f5f38dee 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -17,12 +17,7 @@ case ${EAPI} in *) die "${ECLASS}: EAPI ${EAPI} unsupported." esac -EXPORT_FUNCTIONS src_unpack src_prepare src_install pkg_postinst pkg_prerm pkg_postrm - -# @ECLASS-VARIABLE: OCTAVEFORGE_CAT -# @DESCRIPTION: -# the octave-forge category of the package. -OCTAVEFORGE_CAT="${OCTAVEFORGE_CAT:-main}" +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_prerm pkg_postrm # @ECLASS-VARIABLE: REPO_URI # @DESCRIPTION: @@ -48,7 +43,6 @@ OCT_BIN="$(type -p octave)" SRC_URI=" mirror://sourceforge/octave/${P}.tar.gz - ${REPO_URI}/packages/package_Makefile.in -> octaveforge_Makefile ${REPO_URI}/packages/package_configure.in -> octaveforge_configure " SLOT="0" @@ -68,12 +62,7 @@ octaveforge_src_unpack() { # @DESCRIPTION: # function to add octaveforge specific makefile and configure and run autogen.sh if available octaveforge_src_prepare() { - for filename in Makefile configure; do - cp "${DISTDIR}/octaveforge_${filename}" "${S}/${filename}" || die - done - - #octave_config_info is deprecated in octave5 - sed -i 's|octave_config_info|__octave_config_info__|g' Makefile || die + cp "${DISTDIR}/octaveforge_configure" "${S}/configure" || die chmod 0755 "${S}/configure" || die if [[ -e "${S}/src/autogen.sh" ]]; then @@ -87,12 +76,87 @@ octaveforge_src_prepare() { eapply_user } +octaveforge_src_compile() { + PKGDIR="$(pwd | sed -e 's|^.*/||' || die)" + export OCT_PACKAGE="${TMPDIR}/${PKGDIR}.tar.gz" + export OCT_PKG=$(echo "${PKGDIR}" | sed -e 's|^\(.*\)-.*|\1|' || die) + export MKOCTFILE="mkoctfile -v" + + cmd="disp(__octave_config_info__('octlibdir'));" + OCTLIBDIR=$(octavecommand "${cmd}" || die) + export LFLAGS="-L${OCTLIBDIR}" + + if [[ -e src/Makefile ]]; then + emake -C src all + fi + + if [[ -e src/Makefile ]]; then + mv src/Makefile src/Makefile.disable || die + fi + if [[ -e src/configure ]]; then + mv src/configure src/configure.disable || die + fi + + pushd .. || die + tar -czf "${OCT_PACKAGE}" "${PKGDIR}" || die +} + # @FUNCTION: octaveforge_src_install # @DESCRIPTION: # function to install the octave package # documentation to docsdir octaveforge_src_install() { - emake DESTDIR="${D}" DISTPKG='Gentoo' install + TMPDIR="${T}" + DESTDIR="${D}" + DISTPKG='Gentoo' + + pushd ../ || die + if [[ "X${DISTPKG}X" != "XX" ]]; then + stripcmd=" + unlink(pkg('local_list')); + unlink(pkg('global_list')); + " + fi + if [[ "X${DESTDIR}X" = "XX" ]]; then + cmd=" + warning('off','all'); + pkg('install','${OCT_PACKAGE}');l=pkg('list'); + disp(l{cellfun(@(x)strcmp(x.name,'${OCT_PKG}'),l)}.dir); + " + oct_pkgdir=$(octavecommand "${cmd}${stripcmd}" || die) + else + cmd="disp(fullfile(OCTAVE_HOME(),'share','octave'));" + shareprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) + cmd="disp(fullfile(__octave_config_info__('libexecdir'),'octave'));" + libexecprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) + octprefix="${shareprefix}/packages" || die + archprefix="${libexecprefix}/packages" || die + if [[ ! -e "${octprefix}" ]]; then + mkdir -p "${octprefix}" || die + fi + if [[ ! -e "${archprefix}" ]]; then + mkdir -p "${archprefix}" || die + fi + cmd=" + warning('off','all'); + pkg('prefix','${octprefix}','${archprefix}'); + pkg('global_list',fullfile('${shareprefix}','octave_packages')); + pkg('local_list',fullfile('${shareprefix}','octave_packages')); + pkg('install','-nodeps','-verbose','${OCT_PACKAGE}'); + " + octavecommand "${cmd}" || die + cmd="
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: f16593b366ff0061d602f4dc792a2e2a26006733 Author: Alessandro Barbieri gmail com> AuthorDate: Wed May 4 20:12:03 2022 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Thu May 5 07:32:17 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=f16593b3 octaveforge.eclass: use bash style tests Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index b9303884c..590f21a1c 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -58,7 +58,7 @@ SLOT="0" # function to unpack and set the correct S octaveforge_src_unpack() { default - if [ ! -d "${WORKDIR}/${P}" ]; then + if [[ ! -d "${WORKDIR}/${P}" ]]; then S="${WORKDIR}/${PN}" pushd "${S}" || die fi @@ -76,12 +76,12 @@ octaveforge_src_prepare() { sed -i 's|octave_config_info|__octave_config_info__|g' Makefile || die chmod 0755 "${S}/configure" || die - if [ -e "${S}/src/autogen.sh" ]; then + if [[ -e "${S}/src/autogen.sh" ]]; then pushd "${S}/src" || die ./autogen.sh || die 'failed to run autogen.sh' popd || die fi - if [ -e "${S}/src/Makefile" ]; then + if [[ -e "${S}/src/Makefile" ]]; then sed -i 's/ -s / /g' "${S}/src/Makefile" || die 'sed failed.' fi eapply_user @@ -93,7 +93,7 @@ octaveforge_src_prepare() { # documentation to docsdir octaveforge_src_install() { emake DESTDIR="${D}" DISTPKG='Gentoo' install - if [ -d doc/ ]; then + if [[ -d doc/ ]]; then dodoc -r doc/* fi } @@ -103,7 +103,7 @@ octaveforge_src_install() { # function that will rebuild the octave package database octaveforge_pkg_postinst() { einfo "Registering ${CATEGORY}/${PF} on the Octave package database." - if [ ! -d "${OCT_PKGDIR}" ] ; then + if [[ ! -d "${OCT_PKGDIR}" ]] ; then mkdir -p "${OCT_PKGDIR}" || die fi "${OCT_BIN}" -H -q --no-site-file --eval "pkg('rebuild');" &> /dev/null || die 'failed to register the package.' @@ -122,7 +122,7 @@ octaveforge_pkg_prerm() { " ) rm -f "${pkgdir}/packinfo/on_uninstall.m" || die - if [ -e "${pkgdir}/packinfo/on_uninstall.m.orig" ]; then + if [[ -e "${pkgdir}/packinfo/on_uninstall.m.orig" ]]; then mv "$pkgdir"/packinfo/on_uninstall.m{.orig,} || die cd "$pkgdir/packinfo" || die "${OCT_BIN}" -H -q --no-site-file --eval " @@ -137,7 +137,7 @@ octaveforge_pkg_prerm() { # function that will rebuild the octave package database octaveforge_pkg_postrm() { einfo 'Rebuilding the Octave package database.' - if [ ! -d "${OCT_PKGDIR}" ] ; then + if [[ ! -d "${OCT_PKGDIR}" ]] ; then mkdir -p "${OCT_PKGDIR}" || die fi "${OCT_BIN}" -H --silent --eval 'pkg rebuild' &> /dev/null || die 'failed to rebuild the package database'
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 450bc33de335b67a9ea402faa2395d2e5b10a4a1 Author: Alessandro Barbieri gmail com> AuthorDate: Wed May 4 20:11:42 2022 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Thu May 5 07:32:17 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=450bc33d R-packages.eclass: use bash style tests Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages.eclass | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index 1412ba802..0be59a20c 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -36,7 +36,7 @@ BDEPEND="sys-apps/pkgcore" # @DESCRIPTION: # will contain symlinks to everything in _movelink() { - if [ -e "${1}" ]; then + if [[ -e "${1}" ]]; then local rp1="$(realpath ${1})" || die mv "${rp1}" "${2}" || die cp -rsf "${2}" "${rp1}" || die @@ -110,11 +110,11 @@ R-packages_src_install() { docompress -x "${DOCS_DIR}/${i}" done - if [ -e html ]; then + if [[ -e html ]]; then _movelink html "${ED}${DOCS_DIR}/html" || die docompress -x "${DOCS_DIR}/html" fi - if [ -e doc ]; then + if [[ -e doc ]]; then pushd doc || die for i in * ; do _movelink "${i}" "${ED}${DOCS_DIR}/${i}" || die @@ -122,7 +122,7 @@ R-packages_src_install() { done popd || die fi - if [ -e doc/html ]; then + if [[ -e doc/html ]]; then docompress -x "${DOCS_DIR}/html" fi docompress -x "${DOCS_DIR}" @@ -137,10 +137,10 @@ R-packages_src_install() { # @DESCRIPTION: # function that will prompt to install the suggested packages if they exist R-packages_pkg_postinst() { - if [ -v SUGGESTED_PACKAGES ]; then + if [[ -v SUGGESTED_PACKAGES ]]; then for p in ${SUGGESTED_PACKAGES} ; do pexist=$(pquery -n1 "${p}" 2>/dev/null) || die - if [ -n "${pexist}" ]; then + if [[ -n "${pexist}" ]]; then optfeature "having the upstream suggested package" "${p}" fi done
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: b2710c1d1c0ff01dbe02764a127291b55331b455 Author: Alessandro Barbieri gmail com> AuthorDate: Fri Apr 15 17:47:32 2022 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Fri Apr 15 20:34:21 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b2710c1d octaveforge.eclass: add documentation comments Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 86 --- 1 file changed, 67 insertions(+), 19 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index 8a7fe0396..b9303884c 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -1,43 +1,72 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# -# Original Author: Rafael G. Martins -# Purpose: octaveforge helper eclass. -# +# @ECLASS: octaveforge.eclass +# @AUTHOR: +# Rafael G. Martins +# Alessandro Barbieri +# @BLURB: octaveforge helper eclass. +# @MAINTAINER: +# Alessandro Barbieri +# @SUPPORTED_EAPIS: 8 + +inherit autotools + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." +esac + +EXPORT_FUNCTIONS src_unpack src_prepare src_install pkg_postinst pkg_prerm pkg_postrm # @ECLASS-VARIABLE: OCTAVEFORGE_CAT # @DESCRIPTION: # the octave-forge category of the package. OCTAVEFORGE_CAT="${OCTAVEFORGE_CAT:-main}" +# @ECLASS-VARIABLE: REPO_URI +# @DESCRIPTION: +# URI to the sourceforge octave-forge repository REPO_URI="http://svn.code.sf.net/p/octave/code/trunk/octave-forge; -inherit autotools -SRC_URI="mirror://sourceforge/octave/${P}.tar.gz" +# defining some paths + +# @ECLASS-VARIABLE: OCT_ROOT +# @DESCRIPTION: +# full path to octave share +OCT_ROOT="/usr/share/octave" + +# @ECLASS-VARIABLE: OCT_PKGDIR +# @DESCRIPTION: +# path to octave pkgdir +OCT_PKGDIR="${OCT_ROOT}/packages" + +# @ECLASS-VARIABLE: OCT_BIN +# @DESCRIPTION: +# full path to octave binary +OCT_BIN="$(type -p octave)" SRC_URI=" - ${SRC_URI} + mirror://sourceforge/octave/${P}.tar.gz ${REPO_URI}/packages/package_Makefile.in -> octaveforge_Makefile ${REPO_URI}/packages/package_configure.in -> octaveforge_configure " SLOT="0" -# defining some paths -OCT_ROOT="/usr/share/octave" -OCT_PKGDIR="${OCT_ROOT}/packages" -OCT_BIN="$(type -p octave)" - -EXPORT_FUNCTIONS src_unpack src_prepare src_install pkg_postinst pkg_prerm pkg_postrm - +# @FUNCTION: octaveforge_src_unpack +# @DESCRIPTION: +# function to unpack and set the correct S octaveforge_src_unpack() { default if [ ! -d "${WORKDIR}/${P}" ]; then S="${WORKDIR}/${PN}" - cd "${S}" || die + pushd "${S}" || die fi } +# @FUNCTION: octaveforge_src_prepare +# @DESCRIPTION: +# function to add octaveforge specific makefile and configure and run autogen.sh if available octaveforge_src_prepare() { for filename in Makefile configure; do cp "${DISTDIR}/octaveforge_${filename}" "${S}/${filename}" || die @@ -48,7 +77,9 @@ octaveforge_src_prepare() { chmod 0755 "${S}/configure" || die if [ -e "${S}/src/autogen.sh" ]; then - cd "${S}/src" && ./autogen.sh || die 'failed to run autogen.sh' + pushd "${S}/src" || die +./autogen.sh || die 'failed to run autogen.sh' + popd || die fi if [ -e "${S}/src/Makefile" ]; then sed -i 's/ -s / /g' "${S}/src/Makefile" || die 'sed failed.' @@ -56,6 +87,10 @@ octaveforge_src_prepare() { eapply_user } +# @FUNCTION: octaveforge_src_install +# @DESCRIPTION: +# function to install the octave package +# documentation to docsdir octaveforge_src_install() { emake DESTDIR="${D}" DISTPKG='Gentoo' install if [ -d doc/ ]; then @@ -63,12 +98,20 @@ octaveforge_src_install() { fi } +# @FUNCTION: octaveforge_pkg_postinst +# @DESCRIPTION: +# function that will rebuild the octave package database octaveforge_pkg_postinst() { einfo "Registering ${CATEGORY}/${PF} on the Octave package database." - [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" || die + if [ ! -d "${OCT_PKGDIR}" ] ; then + mkdir -p "${OCT_PKGDIR}" || die + fi "${OCT_BIN}" -H -q --no-site-file --eval "pkg('rebuild');" &> /dev/null || die 'failed to register the package.' } +# @FUNCTION: octaveforge_pkg_prerm +# @DESCRIPTION: +# function that will run on_uninstall routines to prepare the package to remove octaveforge_pkg_prerm() { einfo 'Running on_uninstall routines to prepare the package to remove.' local pkgdir=$( @@ -89,8 +132,13 @@ octaveforge_pkg_prerm() { fi } +# @FUNCTION: octaveforge_pkg_postrm +# @DESCRIPTION: +# function that will rebuild the octave package database octaveforge_pkg_postrm() { einfo
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 4ec6a5d7055d7197a3eb9f8b9ab95a0c9a9e1b83 Author: Alessandro Barbieri gmail com> AuthorDate: Fri Apr 15 17:46:55 2022 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Fri Apr 15 20:34:21 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4ec6a5d7 R-packages.eclass: add documentation comments Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages.eclass | 120 ++- 1 file changed, 97 insertions(+), 23 deletions(-) diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index 6cbf9d7d3..51765af2b 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -1,9 +1,25 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# @ECLASS: R-packages.eclass +# @AUTHOR: +# André Erdmann +# Denis Dupeyron +# Benda Xu +# Alessandro Barbieri +# @BLURB: eclass to build R packages +# @MAINTAINER: +# Alessandro Barbieri +# @SUPPORTED_EAPIS: 7 + inherit eutils optfeature toolchain-funcs -EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst +case ${EAPI} in + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI} unsupported." +esac + +EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz" HOMEPAGE="https://cran.r-project.org/package=${PN}; @@ -12,14 +28,24 @@ SLOT="0" DEPEND="dev-lang/R" RDEPEND="${DEPEND}" +BDEPEND="sys-apps/pkgcore" -dodocrm() { +# @FUNCTION: _movelink +# @INTERNAL +# @USAGE: [ ] +# @DESCRIPTION: +# will contain symlinks to everything in +_movelink() { if [ -e "${1}" ]; then - dodoc -r "${1}" - rm -rf "${1}" || die + local rp1="$(realpath ${1})" || die + mv "${rp1}" "${2}" || die + cp -rsf "${2}" "${rp1}" || die fi } +# @FUNCTION: R-packages_src_unpack +# @DESCRIPTION: +# function to unpack R packages into the right folder R-packages_src_unpack() { unpack ${A} if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then @@ -27,43 +53,91 @@ R-packages_src_unpack() { fi } +# @FUNCTION: R-packages_src_prepare +# @DESCRIPTION: +# function to remove unwanted files from the sources R-packages_src_prepare() { rm -f LICENSE || die default } +# @FUNCTION: R-packages_src_configure +# @DESCRIPTION: +# dummy function to disable configure +R-packages_src_configure() { :; } + +# @FUNCTION: R-packages_src_compile +# @DESCRIPTION: +# function that will pass some environment variables to R and then build/install the package R-packages_src_compile() { - MAKEFLAGS="AR=$(tc-getAR) CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" R CMD INSTALL . -l "${WORKDIR}" "--byte-compile" || die + MAKEFLAGS=" \ + ${MAKEFLAGS// /\\ } \ + AR=$(tc-getAR) \ + CC=$(tc-getCC) \ + CPP=$(tc-getCPP) \ + CXX=$(tc-getCXX) \ + FC=$(tc-getFC) \ + LD=$(tc-getLD) \ + NM=$(tc-getNM) \ + RANLIB=$(tc-getRANLIB) \ + CFLAGS=${CFLAGS// /\\ } \ + CPPFLAGS=${CPPFLAGS// /\\ } \ + CXXFLAGS=${CXXFLAGS// /\\ } \ + FFLAGS=${FFLAGS// /\\ } \ + FCFLAGS=${FCFLAGS// /\\ } \ + LDFLAGS=${LDFLAGS// /\\ } \ + MAKEOPTS=${MAKEOPTS// /\\ } \ + " \ + R CMD INSTALL . -l "${WORKDIR}" "--byte-compile" || die } + +# @FUNCTION: R-packages_src_install +# @DESCRIPTION: +# function to move the files in the right folders +# documentation and examples to docsdir, symlinked back to R site-library (to allow access from within R) +# everything else to R site-library R-packages_src_install() { - cd "${WORKDIR}/${PN//_/.}" || die + pushd "${WORKDIR}/${PN//_/.}" || die - dodocrm examples || die - #dodocrm DESCRIPTION || die #keep this - dodocrm NEWS.md || die - dodocrm README.md || die - dodocrm html || die + local DOCS_DIR="${ED}/usr/share/doc/${PF}" + mkdir -p "${DOCS_DIR}" || die + + for i in NEWS.md README.md DESCRIPTION examples ; do + _movelink "${i}" "${DOCS_DIR}/${i}" || die + done + + if [ -e html ]; then + _movelink html "${DOCS_DIR}/html" || die + docompress -x "${DOCS_DIR}/html" + fi if [ -e doc ]; then - if [ -e doc/html ]; then - docinto "${DOCSDIR}/html" - dodoc -r doc/*.html - rm -r doc/*.html || die - docompress -x "${DOCSDIR}/html" - fi - - docinto "${DOCSDIR}" - dodoc -r doc/. -
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: ce3b957642e8aff38a6c923b8a5bc79ef9f20729 Author: Nicola Smaniotto gmail com> AuthorDate: Thu Apr 14 09:13:00 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Thu Apr 14 09:26:30 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ce3b9576 mpv-plugin.eclass: new eclass Signed-off-by: Nicola Smaniotto gmail.com> eclass/mpv-plugin.eclass | 128 +++ 1 file changed, 128 insertions(+) diff --git a/eclass/mpv-plugin.eclass b/eclass/mpv-plugin.eclass new file mode 100644 index 0..01212adec --- /dev/null +++ b/eclass/mpv-plugin.eclass @@ -0,0 +1,128 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: mpv-plugin.eclass +# @MAINTAINER: +# Nicola Smaniotto +# @AUTHOR: +# Nicola Smaniotto +# @SUPPORTED_EAPIS: 8 +# @BLURB: install mpv plugins +# @DESCRIPTION: +# This eclass simplifies the installation of mpv plugins into system-wide +# directories. Also handles the mpv dependency and provides an USE flag +# for automatic loading of the plugin. + +case ${EAPI:-0} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} unsupported." +esac + +EXPORT_FUNCTIONS src_install pkg_postinst + +# @ECLASS_VARIABLE: USE_MPV +# @DEFAULT_UNSET +# @PRE_INHERIT +# @DESCRIPTION: +# Controls adding media-video/mpv dependency. The allowed values are: +# +# - rdepend -- add it to RDEPEND +# +# - depend -- add it to DEPEND+RDEPEND with the binding slot operator (the +# default) + +# @ECLASS_VARIABLE: MPV_REQ_USE +# @DEFAULT_UNSET +# @PRE_INHERIT +# @DESCRIPTION: +# The list of USE flags required to be enabled on mpv, formed as a +# USE-dependency string. +# +# Example: +# @CODE@ +# MPV_REQ_USE="lua" +# @CODE@ + +if [[ ! ${_MPV_PLUGIN_ECLASS} ]]; then + +# @FUNCTION: _mpv-plugin_set_globals +# @INTERNAL +# @USAGE: +# @DESCRIPTION: +# Sets all the global output variables provided by this eclass. +# This function must be called once, in global scope. +_mpv-plugin_set_globals() { + local MPV_PKG_DEP + + SLOT="0" + IUSE="+autoload" + + MPV_PKG_DEP="media-video/mpv" + case ${USE_MPV:-depend} in +rdepend) + ;; +depend) + MPV_PKG_DEP+=":=" + ;; +*) + die "Invalid USE_MPV=${USE_MPV}" + ;; + esac + if [ ${MPV_REQ_USE} ]; then +MPV_PKG_DEP+="[${MPV_REQ_USE}]" + fi + + RDEPEND="${MPV_PKG_DEP}" + if [[ ${USE_MPV} == depend ]]; then +DEPEND="${MPV_PKG_DEP}" + fi +} +_mpv-plugin_set_globals + +# @ECLASS_VARIABLE: MPV_PLUGIN_FILES +# @DEFAULT_UNSET +# @REQUIRED +# @DESCRIPTION: +# Array containing the list of files to be installed. + +# @FUNCTION: mpv-plugin_src_install +# @USAGE: +# @DESCRIPTION: +# Install the specified files in ${D} and symlink them if the autoload flag is +# set. +# The ebuild must specify the file list in the MPV_PLUGIN_FILES array. +mpv-plugin_src_install() { + if [[ ! ${MPV_PLUGIN_FILES} ]]; then +die "${ECLASS}: no files specified in MPV_PLUGIN_FILES, cannot install" + fi + + insinto /usr/$(get_libdir)/mpv + for f in "${MPV_PLUGIN_FILES[@]}"; do +doins "${f}" +use autoload && dosym -r "/usr/$(get_libdir)/mpv/${f}" "/etc/mpv/scripts/${f}" + done + + einstalldocs +} + +# @FUNCTION: mpv-plugin_pkg_postinst +# @USAGE: +# @DESCRIPTION: +# Warns the user of the existence of the autoload use flag. +mpv-plugin_pkg_postinst() { + if ! use autoload; then +elog +elog "The plugin has not been installed to /etc/mpv/scripts for autoloading." +elog "You have to activate it manually by passing" +for f in "${MPV_PLUGIN_FILES[@]}"; do + elog " \"${EPREFIX}/usr/$(get_libdir)/mpv/${f}\"" +done +elog "as script option to mpv or symlinking the library to \"scripts/\" in your mpv" +elog "config directory." +elog "Alternatively, activate the autoload use flag." +elog + fi +} + +_MPV_PLUGIN_ECLASS=1 +fi
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 3931b905b44d3728eebfba8097ef6030fc1beac3 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Apr 8 13:21:55 2022 + Commit: Ronny Gutbrod tastytea de> CommitDate: Mon Apr 11 09:40:03 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3931b905 boinc.eclass: fix inherit guard usage Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/boinc.eclass | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/eclass/boinc.eclass b/eclass/boinc.eclass index f2c28b628..cf5cd8515 100644 --- a/eclass/boinc.eclass +++ b/eclass/boinc.eclass @@ -9,14 +9,12 @@ # @DESCRIPTION: # This eclass provides helper functions to build BOINC applications and libraries. -inherit autotools toolchain-funcs - case ${EAPI} in 8) ;; *) die "${ECLASS}: EAPI ${EAPI} unsupported." esac -# @ECLASS-VARIABLE: BOINC_SUBMODULE +# @ECLASS_VARIABLE: BOINC_SUBMODULE # @PRE_INHERIT # @DEFAULT_UNSET # @DESCRIPTION: @@ -26,7 +24,7 @@ esac # # If unset, no functions will be exported. -# @ECLASS-VARIABLE: BOINC_S +# @ECLASS_VARIABLE: BOINC_S # @DEFAULT_UNSET # @DESCRIPTION: # If defined this variable determines the source directory name after @@ -34,6 +32,12 @@ esac # variable supports a wildcard mechanism to help with github tarballs # that contain the commit hash as part of the directory name. +if [[ ! ${_BOINC_ECLASS} ]]; then + +inherit autotools toolchain-funcs + +fi + if [[ ${BOINC_SUBMODULE} ]]; then EXPORT_FUNCTIONS src_unpack src_prepare src_configure fi @@ -72,7 +76,7 @@ get_boinc_src() { } -# @ECLASS-VARIABLE: BOINC_BUILD_DIR +# @ECLASS_VARIABLE: BOINC_BUILD_DIR # @OUTPUT_VARIABLE # @DESCRIPTION: # Temporary build directory, where BOINC sources are located.
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 4db76ea2163a20dff8df6ac054d054eb01e93293 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Apr 8 13:19:47 2022 + Commit: Ronny Gutbrod tastytea de> CommitDate: Mon Apr 11 09:40:03 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4db76ea2 boinc-app.eclass: rename @ECLASS_VARIABLE Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/boinc-app.eclass | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass index 8a92447a2..496dbb337 100644 --- a/eclass/boinc-app.eclass +++ b/eclass/boinc-app.eclass @@ -25,7 +25,7 @@ case ${EAPI} in *) die "${ECLASS}: EAPI ${EAPI} unsupported." esac -# @ECLASS-VARIABLE: BOINC_APP_OPTIONAL +# @ECLASS_VARIABLE: BOINC_APP_OPTIONAL # @DEFAULT_UNSET # @DESCRIPTION: # If set to a non-null value, BOINC part in the ebuild will be @@ -40,7 +40,7 @@ fi if [[ ! ${_BOINC_APP_ECLASS} ]]; then -# @ECLASS-VARIABLE: BOINC_MASTER_URL +# @ECLASS_VARIABLE: BOINC_MASTER_URL # @REQUIRED # @DESCRIPTION: # Each project is publicly identified by a master URL. It also serves @@ -51,20 +51,20 @@ if [[ ! ${_BOINC_APP_ECLASS} ]]; then # grep "" /var/lib/boinc/client_state.xml # @CODE -# @ECLASS-VARIABLE: BOINC_INVITATION_CODE +# @ECLASS_VARIABLE: BOINC_INVITATION_CODE # @DEFAULT_UNSET # @DESCRIPTION: # Some projects restrict account creation to those who present an # "invitation code". Write it to BOINC_INVITATION_CODE variable if # it's published on project's website. -# @ECLASS-VARIABLE: HOMEPAGE +# @ECLASS_VARIABLE: HOMEPAGE # @DESCRIPTION: # This variable defines the HOMEPAGE for BOINC projects if BOINC_MASTER_URL # was set before inherit. : ${HOMEPAGE:=${BOINC_MASTER_URL}} -# @ECLASS-VARIABLE: BOINC_APP_HELPTEXT +# @ECLASS_VARIABLE: BOINC_APP_HELPTEXT # @DESCRIPTION: # Help message to display during the pkg_postinst phase : ${BOINC_APP_HELPTEXT:=\
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 6d8aacbe58de94ea8ed04e6078b5c159907f99b4 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Apr 8 13:15:56 2022 + Commit: Ronny Gutbrod tastytea de> CommitDate: Mon Apr 11 09:40:03 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=6d8aacbe qbs.eclass: fix inherit guard usage Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/qbs.eclass | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/eclass/qbs.eclass b/eclass/qbs.eclass index 6c3f06310..af5709e26 100644 --- a/eclass/qbs.eclass +++ b/eclass/qbs.eclass @@ -12,16 +12,22 @@ # @DESCRIPTION: # Utility eclass providing wrapper functions for Qbs build system. -if [[ ! ${_QBS_ECLASS} ]]; then - -case ${EAPI} in +case ${EAPI:-0} in 8) ;; - *) die "${ECLASS}: EAPI ${EAPI} unsupported." + *) die "${ECLASS}: EAPI ${EAPI:-0} unsupported." esac +if [[ ! ${_QBS_ECLASS} ]]; then + inherit multiprocessing toolchain-funcs qmake-utils -# @ECLASS-VARIABLE: QBS_COMMAND_ECHO_MODE +fi + +EXPORT_FUNCTIONS src_configure src_compile src_install + +if [[ ! ${_QBS_ECLASS} ]]; then + +# @ECLASS_VARIABLE: QBS_COMMAND_ECHO_MODE # @USER_VARIABLE # @DESCRIPTION: # Determines what kind of output to show when executing commands. Possible @@ -38,8 +44,6 @@ inherit multiprocessing toolchain-funcs qmake-utils BDEPEND="dev-util/qbs" -EXPORT_FUNCTIONS src_configure src_compile src_install - # @FUNCTION: eqbs # @USAGE: [...] # @DESCRIPTION:
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: d7ab16c621c6dfa45e7a09bcf39c09b34750f180 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon Feb 14 15:22:22 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Thu Feb 17 21:11:15 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d7ab16c6 boinc-app.eclass: add debug-print-function calls Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/boinc-app.eclass | 22 ++ 1 file changed, 22 insertions(+) diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass index d62c8a91f..8a92447a2 100644 --- a/eclass/boinc-app.eclass +++ b/eclass/boinc-app.eclass @@ -77,6 +77,8 @@ in order to use this application with BOINC.} # Generate appropriate (R)DEPEND for wrapper-enabled or # native application. boinc-app_add_deps() { + debug-print-function ${FUNCNAME} "${@}"] + if [[ $1 == "--wrapper" ]]; then RDEPEND="sci-misc/boinc-wrapper" else @@ -90,6 +92,8 @@ boinc-app_add_deps() { # @DESCRIPTION: # Make sure BOINC_MASTER_URL has a value. boinc_master_url_check() { + debug-print-function ${FUNCNAME} "${@}"] + [[ ! ${BOINC_MASTER_URL} ]] && \ die "BOINC_MASTER_URL is not set" return 0 @@ -99,6 +103,8 @@ boinc_master_url_check() { # @USAGE: # @RETURN: non-prefixed default BOINC runtime directory get_boincdir() { + debug-print-function ${FUNCNAME} "${@}"] + echo /var/lib/boinc } @@ -115,6 +121,8 @@ get_boincdir() { # -> boinc.berkeley.edu_example # @CODE get_project_dirname() { + debug-print-function ${FUNCNAME} "${@}"] + boinc_master_url_check local dirname @@ -129,6 +137,8 @@ get_project_dirname() { # @USAGE: # @RETURN: non-prefixed directory where applications and files should be installed get_project_root() { + debug-print-function ${FUNCNAME} "${@}"] + echo "$(get_boincdir)/projects/$(get_project_dirname)" } @@ -138,6 +148,8 @@ get_project_root() { # The default appinfo_prepare(). It replaces all occurences # of @PV@ with its corresponding value. boinc-app_appinfo_prepare() { + debug-print-function ${FUNCNAME} "${@}"] + sed -i "$1" \ -e "s:%PV%:${PV}:g" \ || die "app_info.xml sed failed" @@ -169,6 +181,8 @@ boinc-app_appinfo_prepare() { # } # @CODE doappinfo() { + debug-print-function ${FUNCNAME} "${@}"] + (( $# == 1 )) || \ die "${FUNCNAME} takes exactly one argument" @@ -193,6 +207,8 @@ doappinfo() { # The default foreach_wrapper_job(). It replaces all occurences # of @PV@, @EPREFIX@ and @LIBDIR@ strings with their corresponding values. boinc-wrapper_foreach_wrapper_job() { + debug-print-function ${FUNCNAME} "${@}"] + sed -i "$1" \ -e "s:@PV@:${PV}:g" \ -e "s:@EPREFIX@:${EPREFIX}:g" \ @@ -227,6 +243,8 @@ boinc-wrapper_foreach_wrapper_job() { # # Keep your job.xml files in sync with app_info.xml! dowrapper() { + debug-print-function ${FUNCNAME} "${@}"] + for app in "$@"; do local wrapperjob="${app}_job_${PV}.xml" local wrapperexe="${app}_wrapper_${PV}" @@ -256,6 +274,8 @@ dowrapper() { # Display helpful instructions on how to make the BOINC client use installed # applications. boinc-app_pkg_postinst() { + debug-print-function ${FUNCNAME} "${@}"] + if [[ -f "${EROOT}$(get_boincdir)/master_$(get_project_dirname).xml" ]]; then if [[ ! ${REPLACING_VERSIONS} ]]; then # most likely replacing applications downloaded @@ -289,6 +309,8 @@ boinc-app_pkg_postinst() { # Display helpful instructions on how to cleanly uninstall unmerged # applications. boinc-app_pkg_postrm() { + debug-print-function ${FUNCNAME} "${@}"] + if [[ ! ${REPLACED_BY_VERSION} ]]; then local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg" local passwd=$(cat "${EROOT}${gui_rpc_auth}")
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 7efa176f5dcd69d978f2d110251117a9e1437069 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Mon Feb 14 15:21:13 2022 + Commit: Florian Schmaus gentoo org> CommitDate: Thu Feb 17 21:11:15 2022 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7efa176f boinc.eclass: add debug-print-function calls Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/boinc.eclass | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/eclass/boinc.eclass b/eclass/boinc.eclass index 80281c69d..f2c28b628 100644 --- a/eclass/boinc.eclass +++ b/eclass/boinc.eclass @@ -9,7 +9,7 @@ # @DESCRIPTION: # This eclass provides helper functions to build BOINC applications and libraries. -inherit toolchain-funcs +inherit autotools toolchain-funcs case ${EAPI} in 8) ;; @@ -44,6 +44,8 @@ if [[ ! ${_BOINC_ECLASS} ]]; then # @USAGE: [client|server] # @RETURN: SRC_URI snippet or temporary build directory for given BOINC release get_boinc_src() { + debug-print-function ${FUNCNAME} "${@}"] + local query_var=${1} local RELEASE_PATCH=${2} local RELEASE_MINOR=$(ver_cut 1-2 ${RELEASE_PATCH}) @@ -87,6 +89,8 @@ get_boinc_src() { # If no BOINC version is given, this function assumes it equal to client # release $PV. boinc_require_source() { + debug-print-function ${FUNCNAME} "${@}"] + local boinc_version=${1:-${PV}} SRC_URI+=" $(get_boinc_src SRC_URI ${boinc_version} ${2})" @@ -104,7 +108,8 @@ boinc_require_source() { # # This function must be called in global scope. boinc_enable_autotools() { - inherit autotools + debug-print-function ${FUNCNAME} "${@}"] + _BOINC_RUN_AUTOTOOLS=1 _BOINC_ECONF_ARGS=${@:---enable-pkg-devel} } @@ -120,6 +125,8 @@ boinc_enable_autotools() { # # This function must be called in global scope. boinc_override_config() { + debug-print-function ${FUNCNAME} "${@}"] + _BOINC_CONFIG_OVERRIDE="${1}" } @@ -128,6 +135,8 @@ boinc_override_config() { # @DESCRIPTION: # Make sure BOINC_BUILD_DIR has a value. boinc_builddir_check() { + debug-print-function ${FUNCNAME} "${@}"] + if [[ ! ${BOINC_BUILD_DIR} ]]; then eerror "BOINC_BUILD_DIR is not set." die "Did you forget to call boinc_require_source?" @@ -137,6 +146,8 @@ boinc_builddir_check() { } boinc_src_unpack() { + debug-print-function ${FUNCNAME} "${@}"] + default_src_unpack boinc_builddir_check @@ -166,6 +177,8 @@ boinc_src_unpack() { } boinc_src_prepare() { + debug-print-function ${FUNCNAME} "${@}"] + boinc_builddir_check default_src_prepare @@ -177,6 +190,8 @@ boinc_src_prepare() { } boinc_src_configure() { + debug-print-function ${FUNCNAME} "${@}"] + boinc_builddir_check pushd "${BOINC_BUILD_DIR}" >/dev/null || die
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: fcc3d7d78eda6e965820a39b9bbcb062cbd1549d Author: Alessandro Barbieri gmail com> AuthorDate: Tue Oct 5 21:23:30 2021 + Commit: Theo Anderson posteo de> CommitDate: Tue Oct 5 21:24:13 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fcc3d7d7 R-packages.eclass: add SUGGESTED_PACKAGES optfeature Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages.eclass | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index a072e5cc2..6cbf9d7d3 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -1,9 +1,9 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -inherit eutils toolchain-funcs +inherit eutils optfeature toolchain-funcs -EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz" HOMEPAGE="https://cran.r-project.org/package=${PN}; @@ -32,7 +32,6 @@ R-packages_src_prepare() { default } - R-packages_src_compile() { MAKEFLAGS="AR=$(tc-getAR) CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" R CMD INSTALL . -l "${WORKDIR}" "--byte-compile" || die } @@ -62,3 +61,9 @@ R-packages_src_install() { insinto "/usr/$(get_libdir)/R/site-library" doins -r "${WORKDIR}/${PN//_/.}" } + +R-packages_pkg_postinst() { + if [ -v SUGGESTED_PACKAGES ]; then + optfeature "having the upstream suggested packages" "${SUGGESTED_PACKAGES}" + fi +}
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 601610833831462786c12893b87ec8a9ccc50fda Author: Alessandro Barbieri gmail com> AuthorDate: Wed Sep 29 13:13:36 2021 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed Sep 29 13:13:36 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=60161083 node.eclass: remove /opt from paths Signed-off-by: Alessandro Barbieri gmail.com> eclass/node.eclass | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eclass/node.eclass b/eclass/node.eclass index aeff2f3c7..47b7a57b1 100644 --- a/eclass/node.eclass +++ b/eclass/node.eclass @@ -82,9 +82,8 @@ node_src_prepare() { } node_src_configure() { - export PATH="${PATH}:/opt/node-debian/usr/bin" #path to the modules - export NODE_PATH="/usr/$(get_libdir)/node_modules:/opt/node-debian/usr/share/nodejs" + export NODE_PATH="/usr/$(get_libdir)/node_modules" export npm_config_prefix="${NODE_MODULE_PREFIX}" #path to the headers needed by node-gyp export npm_config_nodedir="/usr/include/node"
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 9ac9f8dfc1decbcd2b10565935252c72da807d51 Author: Alessandro Barbieri gmail com> AuthorDate: Wed Sep 8 10:43:25 2021 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed Sep 8 10:46:18 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=9ac9f8df R-packages.eclass: pass AR via MAKEFLAGS Closes: https://bugs.gentoo.org/812113 Closes: https://bugs.gentoo.org/812110 Closes: https://bugs.gentoo.org/812107 Closes: https://bugs.gentoo.org/812104 Closes: https://bugs.gentoo.org/812101 Closes: https://bugs.gentoo.org/812098 Closes: https://bugs.gentoo.org/812095 Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index 5e1d6bccc..a072e5cc2 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -1,7 +1,7 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -inherit eutils +inherit eutils toolchain-funcs EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install @@ -34,7 +34,7 @@ R-packages_src_prepare() { R-packages_src_compile() { - MAKEFLAGS="CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" R CMD INSTALL . -l "${WORKDIR}" "--byte-compile" || die + MAKEFLAGS="AR=$(tc-getAR) CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" R CMD INSTALL . -l "${WORKDIR}" "--byte-compile" || die } R-packages_src_install() {
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 7550cd50ab0c998a6b0630c1a153bb891640a475 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sun Jul 25 17:54:13 2021 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Sun Jul 25 17:54:13 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7550cd50 boinc.eclass: add missing slash in download URL Closes: https://bugs.gentoo.org/803902 Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/boinc.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/boinc.eclass b/eclass/boinc.eclass index d16d6e250..80281c69d 100644 --- a/eclass/boinc.eclass +++ b/eclass/boinc.eclass @@ -56,7 +56,7 @@ get_boinc_src() { *) die "${FUNCNAME}: unknown release type '${RELEASE_TYPE}'" esac - local _SRC_URI="https://github.com/BOINC/boinc/archive; + local _SRC_URI="https://github.com/BOINC/boinc/archive/; _SRC_URI+="${RELEASE_TYPE}_release/${RELEASE_MINOR}/${RELEASE_PATCH}.tar.gz" _SRC_URI+=" -> boinc${SUFFIX}-${RELEASE_PATCH}.tar.gz"
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 9fd80923195264194a8c1394ed79c8564f9fb5c4 Author: Alessandro Barbieri gmail com> AuthorDate: Mon May 31 23:15:27 2021 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Mon May 31 23:15:27 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=9fd80923 R-packages.eclass: split string Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index 9fba5d5c2..4afcde26f 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -34,7 +34,7 @@ R-packages_src_prepare() { R-packages_src_compile() { - MAKEFLAGS="CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" R CMD INSTALL . -l "${WORKDIR} --byte-compile" + MAKEFLAGS="CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" R CMD INSTALL . -l "${WORKDIR}" "--byte-compile" } R-packages_src_install() {
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 55604b91a81e9e391253623c7b3ce40f57eec0b0 Author: Alessandro Barbieri gmail com> AuthorDate: Mon May 24 14:48:21 2021 + Commit: Haelwenn Monnier hacktivis me> CommitDate: Mon May 24 14:49:55 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=55604b91 eclass: remove unused eclasses Signed-off-by: Alessandro Barbieri gmail.com> eclass/golang-common.eclass | 1027 --- eclass/golang-single.eclass | 180 2 files changed, 1207 deletions(-) diff --git a/eclass/golang-common.eclass b/eclass/golang-common.eclass deleted file mode 100644 index 85dac9d25..0 --- a/eclass/golang-common.eclass +++ /dev/null @@ -1,1027 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: golang-utils.eclass -# @MAINTAINER: -# -# @AUTHOR: -# Mauro Toffanin -# @BLURB: Base eclass for GoLang packages -# @SUPPORTED_EAPIS: 7 -# @DESCRIPTION: -# This eclass provides functionalities which are used by golang-single.eclass, -# golang-live.eclass, and as well as from ebuilds. -# -# This eclass should not be inherited directly from an ebuild. -# Instead, you should inherit golang-single or golang-live for GoLang packages. - -inherit eutils multiprocessing - -if [[ -z ${_GOLANG_BASE_ECLASS} ]]; then -_GOLANG_BASE_ECLASS=1 - -# Silences repoman warnings. -case "${EAPI:-0}" in - 7) - case "${GOLANG_PKG_DEPEND_ON_GO_SUBSLOT:-yes}" in - yes) - GO_DEPEND="dev-lang/go:0=" - ;; - *) - GO_DEPEND="dev-lang/go:*" - ;; - esac - ;; - *) - die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;; -esac - -DEPEND+=" ${GO_DEPEND}" - -RESTRICT+=" strip" - -QA_FLAGS_IGNORED=" - usr/bin/.* - usr/sbin/.* -" -QA_PRESTRIPPED=" - usr/bin/.* - usr/sbin/.* -" - -# @ECLASS-VARIABLE: GOLANG_PKG_NAME -# @DESCRIPTION: -# Sets the GoLang name for the generated package. -# GOLANG_PKG_NAME="${PN}" -GOLANG_PKG_NAME="${GOLANG_PKG_NAME:-${PN}}" - -# @ECLASS-VARIABLE: GOLANG_PKG_VERSION -# @DESCRIPTION: -# Sets the GoLang version for the generated package. -# GOLANG_PKG_VERSION="${PV}" -GOLANG_PKG_VERSION="${GOLANG_PKG_VERSION:-${PV/_pre/.pre}}" - -# @ECLASS-VARIABLE: GOLANG_PKG_IMPORTPATH -# @DESCRIPTION: -# Sets the remote import path for the generated package. -# GOLANG_PKG_IMPORTPATH="github.com/captObvious/" -GOLANG_PKG_IMPORTPATH="${GOLANG_PKG_IMPORTPATH:-}" - -# @ECLASS-VARIABLE: GOLANG_PKG_IMPORTPATH_ALIAS -# @DESCRIPTION: -# Sets an alias of the remote import path for the generated package. -# GOLANG_PKG_IMPORTPATH_ALIAS="privaterepo.com/captObvious/" -GOLANG_PKG_IMPORTPATH_ALIAS="${GOLANG_PKG_IMPORTPATH_ALIAS:=${GOLANG_PKG_IMPORTPATH}}" - -# @ECLASS-VARIABLE: GOLANG_PKG_ARCHIVEPREFIX -# @DESCRIPTION: -# Sets the archive prefix for the file URI of the package. -# Most projects hosted on GitHub's mirrors provide archives with prefix as -# 'v' or 'source-', other hosted services offer different archive formats. -# This eclass defaults to an empty prefix. -GOLANG_PKG_ARCHIVEPREFIX="${GOLANG_PKG_ARCHIVEPREFIX:-}" - -# @ECLASS-VARIABLE: GOLANG_PKG_ARCHIVESUFFIX -# @DESCRIPTION: -# Sets the archive suffix for the file URI of the package. -# Most projects hosted on GitHub's mirrors provide archives with suffix as -# '.tar.gz' or '.zip', other hosted services offer different archive formats. -# This eclass defaults to '.tar.gz'. -GOLANG_PKG_ARCHIVESUFFIX="${GOLANG_PKG_ARCHIVESUFFIX:=".tar.gz"}" - -# @ECLASS-VARIABLE: GOLANG_PKG_OUTPUT_NAME -# @DESCRIPTION: -# Specifies the output file name of the package. -# If not set, it derives from the name of the package, such as $GOLANG_PKG_NAME. -# This eclass defaults to $PN. -GOLANG_PKG_OUTPUT_NAME="${GOLANG_PKG_OUTPUT_NAME:=${PN}}" - -# @ECLASS-VARIABLE: GOLANG_PKG_BUILDPATH -# @DESCRIPTION: -# Specifies a go source file to be compiled as a single main package. -# This eclass defaults to an empty value. -# This eclass defaults to "/..." when the user declares GOLANG_PKG_IS_MULTIPLE=1 -GOLANG_PKG_BUILDPATH="${GOLANG_PKG_BUILDPATH:-}" - -# @ECLASS-VARIABLE: GOLANG_PKG_INSTALLPATH -# @DESCRIPTION: -# Sets the root path into which a binary, or a list of binaries, will be -# installed (e.x.: ${GOLANG_PKG_INSTALLPATH}/bin). -# This eclass defaults to "/usr" -GOLANG_PKG_INSTALLPATH="${GOLANG_PKG_INSTALLPATH:="/usr"}" - -# @ECLASS-VARIABLE: GOLANG_PKG_INSTALLSUFFIX -# @DESCRIPTION: -# Sets a suffix to use in the name of the package installation directory. -# This eclass defaults to an empty install suffix. -GOLANG_PKG_INSTALLSUFFIX="${GOLANG_PKG_INSTALLSUFFIX:-}" - -# @ECLASS-VARIABLE: GOLANG_PKG_IS_MULTIPLE -# @DESCRIPTION: -# Set to enable the building of multiple packages from a single import path. - -#
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: ca2efddff82c08b87f8936dec44e740846e51c06 Author: Alessandro Barbieri gmail com> AuthorDate: Mon May 17 10:07:08 2021 + Commit: Andrew Ammerlaan riseup net> CommitDate: Mon May 17 10:16:27 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ca2efddf Import go eclasses from go-overlay Signed-off-by: Alessandro Barbieri gmail.com> eclass/golang-common.eclass | 1027 +++ eclass/golang-single.eclass | 180 2 files changed, 1207 insertions(+) diff --git a/eclass/golang-common.eclass b/eclass/golang-common.eclass new file mode 100644 index 0..85dac9d25 --- /dev/null +++ b/eclass/golang-common.eclass @@ -0,0 +1,1027 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: golang-utils.eclass +# @MAINTAINER: +# +# @AUTHOR: +# Mauro Toffanin +# @BLURB: Base eclass for GoLang packages +# @SUPPORTED_EAPIS: 7 +# @DESCRIPTION: +# This eclass provides functionalities which are used by golang-single.eclass, +# golang-live.eclass, and as well as from ebuilds. +# +# This eclass should not be inherited directly from an ebuild. +# Instead, you should inherit golang-single or golang-live for GoLang packages. + +inherit eutils multiprocessing + +if [[ -z ${_GOLANG_BASE_ECLASS} ]]; then +_GOLANG_BASE_ECLASS=1 + +# Silences repoman warnings. +case "${EAPI:-0}" in + 7) + case "${GOLANG_PKG_DEPEND_ON_GO_SUBSLOT:-yes}" in + yes) + GO_DEPEND="dev-lang/go:0=" + ;; + *) + GO_DEPEND="dev-lang/go:*" + ;; + esac + ;; + *) + die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;; +esac + +DEPEND+=" ${GO_DEPEND}" + +RESTRICT+=" strip" + +QA_FLAGS_IGNORED=" + usr/bin/.* + usr/sbin/.* +" +QA_PRESTRIPPED=" + usr/bin/.* + usr/sbin/.* +" + +# @ECLASS-VARIABLE: GOLANG_PKG_NAME +# @DESCRIPTION: +# Sets the GoLang name for the generated package. +# GOLANG_PKG_NAME="${PN}" +GOLANG_PKG_NAME="${GOLANG_PKG_NAME:-${PN}}" + +# @ECLASS-VARIABLE: GOLANG_PKG_VERSION +# @DESCRIPTION: +# Sets the GoLang version for the generated package. +# GOLANG_PKG_VERSION="${PV}" +GOLANG_PKG_VERSION="${GOLANG_PKG_VERSION:-${PV/_pre/.pre}}" + +# @ECLASS-VARIABLE: GOLANG_PKG_IMPORTPATH +# @DESCRIPTION: +# Sets the remote import path for the generated package. +# GOLANG_PKG_IMPORTPATH="github.com/captObvious/" +GOLANG_PKG_IMPORTPATH="${GOLANG_PKG_IMPORTPATH:-}" + +# @ECLASS-VARIABLE: GOLANG_PKG_IMPORTPATH_ALIAS +# @DESCRIPTION: +# Sets an alias of the remote import path for the generated package. +# GOLANG_PKG_IMPORTPATH_ALIAS="privaterepo.com/captObvious/" +GOLANG_PKG_IMPORTPATH_ALIAS="${GOLANG_PKG_IMPORTPATH_ALIAS:=${GOLANG_PKG_IMPORTPATH}}" + +# @ECLASS-VARIABLE: GOLANG_PKG_ARCHIVEPREFIX +# @DESCRIPTION: +# Sets the archive prefix for the file URI of the package. +# Most projects hosted on GitHub's mirrors provide archives with prefix as +# 'v' or 'source-', other hosted services offer different archive formats. +# This eclass defaults to an empty prefix. +GOLANG_PKG_ARCHIVEPREFIX="${GOLANG_PKG_ARCHIVEPREFIX:-}" + +# @ECLASS-VARIABLE: GOLANG_PKG_ARCHIVESUFFIX +# @DESCRIPTION: +# Sets the archive suffix for the file URI of the package. +# Most projects hosted on GitHub's mirrors provide archives with suffix as +# '.tar.gz' or '.zip', other hosted services offer different archive formats. +# This eclass defaults to '.tar.gz'. +GOLANG_PKG_ARCHIVESUFFIX="${GOLANG_PKG_ARCHIVESUFFIX:=".tar.gz"}" + +# @ECLASS-VARIABLE: GOLANG_PKG_OUTPUT_NAME +# @DESCRIPTION: +# Specifies the output file name of the package. +# If not set, it derives from the name of the package, such as $GOLANG_PKG_NAME. +# This eclass defaults to $PN. +GOLANG_PKG_OUTPUT_NAME="${GOLANG_PKG_OUTPUT_NAME:=${PN}}" + +# @ECLASS-VARIABLE: GOLANG_PKG_BUILDPATH +# @DESCRIPTION: +# Specifies a go source file to be compiled as a single main package. +# This eclass defaults to an empty value. +# This eclass defaults to "/..." when the user declares GOLANG_PKG_IS_MULTIPLE=1 +GOLANG_PKG_BUILDPATH="${GOLANG_PKG_BUILDPATH:-}" + +# @ECLASS-VARIABLE: GOLANG_PKG_INSTALLPATH +# @DESCRIPTION: +# Sets the root path into which a binary, or a list of binaries, will be +# installed (e.x.: ${GOLANG_PKG_INSTALLPATH}/bin). +# This eclass defaults to "/usr" +GOLANG_PKG_INSTALLPATH="${GOLANG_PKG_INSTALLPATH:="/usr"}" + +# @ECLASS-VARIABLE: GOLANG_PKG_INSTALLSUFFIX +# @DESCRIPTION: +# Sets a suffix to use in the name of the package installation directory. +# This eclass defaults to an empty install suffix. +GOLANG_PKG_INSTALLSUFFIX="${GOLANG_PKG_INSTALLSUFFIX:-}" + +# @ECLASS-VARIABLE: GOLANG_PKG_IS_MULTIPLE +# @DESCRIPTION: +# Set to enable the building of multiple packages from a single import path. + +#
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 34cd25319d156c12ba87f238e3c3fe4ab495788e Author: Alessandro Barbieri gmail com> AuthorDate: Tue Mar 16 00:54:37 2021 + Commit: Andrew Ammerlaan riseup net> CommitDate: Tue Mar 16 00:55:18 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=34cd2531 eclass: install documentation in DOCDIR Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages-guru.eclass | 37 - 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/eclass/R-packages-guru.eclass b/eclass/R-packages-guru.eclass index 6419cfec..8475f975 100644 --- a/eclass/R-packages-guru.eclass +++ b/eclass/R-packages-guru.eclass @@ -11,6 +11,13 @@ IUSE="byte-compile" DEPEND="dev-lang/R" RDEPEND="${DEPEND}" +dodocrm() { + if [ -e "${1}" ]; then + dodoc -r "${1}" + rm -rf "${1}" || die + fi +} + R-packages-guru_src_unpack() { unpack ${A} if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then @@ -18,15 +25,11 @@ R-packages-guru_src_unpack() { fi } -if has "${EAPI:-0}" 0 1 2 3 4 5; then - R-packages-guru_src_prepare() { - epatch_user - } -else - R-packages-guru_src_prepare() { - default - } -fi +R-packages-guru_src_prepare() { + rm -f LICENSE || die + default +} + R-packages-guru_src_compile() { MAKEFLAGS="CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" \ @@ -34,6 +37,22 @@ R-packages-guru_src_compile() { } R-packages-guru_src_install() { + cd "${WORKDIR}"/${PN//_/.} || die + + dodocrm examples || die +# dodocrm DESCRIPTION || die #keep this + dodocrm NEWS.md || die + dodocrm README.md || die + dodocrm html || die + docinto "${DOCSDIR}/html" + if [ -e doc ]; then + ls doc/*.html &>/dev/null && dodoc -r doc/*.html + rm -rf doc/*.html || die + docinto "${DOCSDIR}" + dodoc -r doc/. + rm -rf doc + fi + insinto /usr/$(get_libdir)/R/site-library doins -r "${WORKDIR}"/${PN//_/.} }
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 2f3797d95a55a13ae749f9050d17438a460f0049 Author: Alessandro Barbieri gmail com> AuthorDate: Sun Mar 14 22:48:48 2021 + Commit: Andrew Ammerlaan riseup net> CommitDate: Sun Mar 14 22:48:48 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2f3797d9 eclass: old g-octave eclass Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 105 ++ 1 file changed, 105 insertions(+) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass new file mode 100644 index ..d5492e89 --- /dev/null +++ b/eclass/octaveforge.eclass @@ -0,0 +1,105 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# +# Original Author: Rafael G. Martins +# Purpose: octaveforge helper eclass. +# + +# @ECLASS-VARIABLE: OCTAVEFORGE_CAT +# @DESCRIPTION: +# the octave-forge category of the package. +OCTAVEFORGE_CAT="${OCTAVEFORGE_CAT:-main}" + + +REPO_URI="http://svn.code.sf.net/p/octave/code/trunk/octave-forge; +if [[ "${PV}" = * ]]; then + inherit subversion autotools + ESVN_REPO_URI="${REPO_URI}/${OCTAVEFORGE_CAT}/${PN}" +else + inherit autotools + SRC_URI="mirror://sourceforge/octave/${P}.tar.gz" +fi + +SRC_URI=" + ${SRC_URI} + ${REPO_URI}/packages/package_Makefile.in -> octaveforge_Makefile + ${REPO_URI}/packages/package_configure.in -> octaveforge_configure +" +SLOT="0" + +# defining some paths +OCT_ROOT="/usr/share/octave" +OCT_PKGDIR="${OCT_ROOT}/packages" +OCT_BIN="$(type -p octave)" + +EXPORT_FUNCTIONS src_unpack src_prepare src_install pkg_postinst pkg_prerm pkg_postrm + +octaveforge_src_unpack() { + default + if [ ! -d "${WORKDIR}/${P}" ]; then + S="${WORKDIR}/${PN}" + cd "${S}" + fi +} + +octaveforge_src_prepare() { + [[ "${PV}" = * ]] && subversion_src_prepare + for filename in Makefile configure; do + cp "${DISTDIR}/octaveforge_${filename}" "${S}/${filename}" + done + + #octave_config_info is deprecated in octave5 + sed -i 's|octave_config_info|__octave_config_info__|g' Makefile || die + + chmod 0755 "${S}/configure" + if [ -e "${S}"/src/autogen.sh ]; then + cd "${S}"/src && ./autogen.sh || die 'failed to run autogen.sh' + fi + if [ -e "${S}/src/Makefile" ]; then + sed -i 's/ -s / /g' "${S}/src/Makefile" || die 'sed failed.' + fi + eapply_user +} + +octaveforge_src_install() { + emake DESTDIR="${D}" DISTPKG='Gentoo' install + if [ -d doc/ ]; then + insinto "/usr/share/doc/${PF}" + doins -r doc/* || die 'failed to install the docs' + fi +} + +octaveforge_pkg_postinst() { + einfo "Registering ${CATEGORY}/${PF} on the Octave package database." + [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" + "${OCT_BIN}" -H -q --no-site-file --eval "pkg('rebuild');" \ + &> /dev/null || die 'failed to register the package.' +} + +octaveforge_pkg_prerm() { + einfo 'Running on_uninstall routines to prepare the package to remove.' + local pkgdir=$( + "${OCT_BIN}" -H -q --no-site-file --eval " + pkg('rebuild'); + l = pkg('list'); + disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); + " + ) + rm -f "${pkgdir}"/packinfo/on_uninstall.m + if [ -e "${pkgdir}"/packinfo/on_uninstall.m.orig ]; then + mv "$pkgdir"/packinfo/on_uninstall.m{.orig,} + cd "$pkgdir"/packinfo + "${OCT_BIN}" -H -q --no-site-file --eval " + l = pkg('list'); + on_uninstall(l{cellfun(@(x)strcmp(x.name,'${PN}'), l)}); + " &> /dev/null || die 'failed to remove the package' + fi +} + +octaveforge_pkg_postrm() { + einfo 'Rebuilding the Octave package database.' + [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" + "${OCT_BIN}" -H --silent --eval 'pkg rebuild' \ + &> /dev/null || die 'failed to rebuild the package database' +}
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: c061b7e28839e7747df90df1cb77aee61cd53849 Author: Alessandro Barbieri gmail com> AuthorDate: Sun Mar 14 22:57:48 2021 + Commit: Andrew Ammerlaan riseup net> CommitDate: Sun Mar 14 22:57:48 2021 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c061b7e2 eclass: no live ebuilds, dodoc, minor style things, || die Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 43 +-- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index d5492e89..8a7fe039 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -11,15 +11,10 @@ # the octave-forge category of the package. OCTAVEFORGE_CAT="${OCTAVEFORGE_CAT:-main}" - REPO_URI="http://svn.code.sf.net/p/octave/code/trunk/octave-forge; -if [[ "${PV}" = * ]]; then - inherit subversion autotools - ESVN_REPO_URI="${REPO_URI}/${OCTAVEFORGE_CAT}/${PN}" -else - inherit autotools - SRC_URI="mirror://sourceforge/octave/${P}.tar.gz" -fi + +inherit autotools +SRC_URI="mirror://sourceforge/octave/${P}.tar.gz" SRC_URI=" ${SRC_URI} @@ -39,22 +34,21 @@ octaveforge_src_unpack() { default if [ ! -d "${WORKDIR}/${P}" ]; then S="${WORKDIR}/${PN}" - cd "${S}" + cd "${S}" || die fi } octaveforge_src_prepare() { - [[ "${PV}" = * ]] && subversion_src_prepare for filename in Makefile configure; do - cp "${DISTDIR}/octaveforge_${filename}" "${S}/${filename}" + cp "${DISTDIR}/octaveforge_${filename}" "${S}/${filename}" || die done #octave_config_info is deprecated in octave5 sed -i 's|octave_config_info|__octave_config_info__|g' Makefile || die - chmod 0755 "${S}/configure" - if [ -e "${S}"/src/autogen.sh ]; then - cd "${S}"/src && ./autogen.sh || die 'failed to run autogen.sh' + chmod 0755 "${S}/configure" || die + if [ -e "${S}/src/autogen.sh" ]; then + cd "${S}/src" && ./autogen.sh || die 'failed to run autogen.sh' fi if [ -e "${S}/src/Makefile" ]; then sed -i 's/ -s / /g' "${S}/src/Makefile" || die 'sed failed.' @@ -65,16 +59,14 @@ octaveforge_src_prepare() { octaveforge_src_install() { emake DESTDIR="${D}" DISTPKG='Gentoo' install if [ -d doc/ ]; then - insinto "/usr/share/doc/${PF}" - doins -r doc/* || die 'failed to install the docs' + dodoc -r doc/* fi } octaveforge_pkg_postinst() { einfo "Registering ${CATEGORY}/${PF} on the Octave package database." - [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" - "${OCT_BIN}" -H -q --no-site-file --eval "pkg('rebuild');" \ - &> /dev/null || die 'failed to register the package.' + [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" || die + "${OCT_BIN}" -H -q --no-site-file --eval "pkg('rebuild');" &> /dev/null || die 'failed to register the package.' } octaveforge_pkg_prerm() { @@ -86,10 +78,10 @@ octaveforge_pkg_prerm() { disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); " ) - rm -f "${pkgdir}"/packinfo/on_uninstall.m - if [ -e "${pkgdir}"/packinfo/on_uninstall.m.orig ]; then - mv "$pkgdir"/packinfo/on_uninstall.m{.orig,} - cd "$pkgdir"/packinfo + rm -f "${pkgdir}/packinfo/on_uninstall.m" || die + if [ -e "${pkgdir}/packinfo/on_uninstall.m.orig" ]; then + mv "$pkgdir"/packinfo/on_uninstall.m{.orig,} || die + cd "$pkgdir/packinfo" || die "${OCT_BIN}" -H -q --no-site-file --eval " l = pkg('list'); on_uninstall(l{cellfun(@(x)strcmp(x.name,'${PN}'), l)}); @@ -99,7 +91,6 @@ octaveforge_pkg_prerm() { octaveforge_pkg_postrm() { einfo 'Rebuilding the Octave package database.' - [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" - "${OCT_BIN}" -H --silent --eval 'pkg rebuild' \ - &> /dev/null || die 'failed to rebuild the package database' + [ -d "${OCT_PKGDIR}" ] || mkdir -p "${OCT_PKGDIR}" || die + "${OCT_BIN}" -H --silent --eval 'pkg rebuild' &> /dev/null || die 'failed to rebuild the package database' }
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: bdffb505eca41fccdac6625b586f7a7ed05159b4 Author: Alessandro Barbieri gmail com> AuthorDate: Wed May 6 23:28:47 2020 + Commit: Andrew Ammerlaan riseup net> CommitDate: Wed May 6 23:35:55 2020 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=bdffb505 new eclass for R packages, taken from the R_Overlay Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages-guru.eclass | 54 +++ 1 file changed, 54 insertions(+) diff --git a/eclass/R-packages-guru.eclass b/eclass/R-packages-guru.eclass new file mode 100644 index 000..e365b03 --- /dev/null +++ b/eclass/R-packages-guru.eclass @@ -0,0 +1,54 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit eutils + +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst + +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="byte-compile" + +DEPEND="dev-lang/R" +RDEPEND="${DEPEND}" + +R-packages-guru_src_unpack() { + unpack ${A} + if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then + mv ${PN//_/.} "${P}" + fi +} + +if has "${EAPI:-0}" 0 1 2 3 4 5; then + R-packages-guru_src_prepare() { + epatch_user + } +else + R-packages-guru_src_prepare() { + default + } +fi + +R-packages-guru_src_compile() { + MAKEFLAGS="CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" \ + R CMD INSTALL . -l "${WORKDIR}" $(use byte-compile && echo "--byte-compile") +} + +R-packages-guru_src_install() { + insinto /usr/$(get_libdir)/R/site-library + doins -r "${WORKDIR}"/${PN//_/.} +} + +R-packages-guru_pkg_postinst() { + if [[ "${_UNRESOLVABLE_PACKAGES:-}" ]]; then + # _UNRESOLVABLE_PACKAGES is only set if it has more than zero items + local _max=${#_UNRESOLVABLE_PACKAGES[*]} i= + + einfo "Dependency(-ies):" + for (( i=0; i<"${_max}"; i++ )); do + einfo "- ${_UNRESOLVABLE_PACKAGES[$i]}" + done + einfo 'are (is) suggested by upstream but could not be found.' + einfo 'Please install it manually from the R interpreter if you need it.' + fi +}
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: fec5f391149ee6a33d09753127246374fafa7486 Author: Alessandro Barbieri gmail com> AuthorDate: Wed May 6 23:35:03 2020 + Commit: Andrew Ammerlaan riseup net> CommitDate: Wed May 6 23:35:56 2020 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fec5f391 R-eclass-guru, update copyright Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages-guru.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/R-packages-guru.eclass b/eclass/R-packages-guru.eclass index e365b03..0f28749 100644 --- a/eclass/R-packages-guru.eclass +++ b/eclass/R-packages-guru.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 inherit eutils
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: fc06fbb6979e1cb303048b0770024af202897a4f Author: Kurt Kanzenbach kmk-computers de> AuthorDate: Fri May 1 11:34:27 2020 + Commit: Andrew Ammerlaan riseup net> CommitDate: Fri May 1 11:34:27 2020 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fc06fbb6 eclass: docs: Remove trailing whitespaces Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Kurt Kanzenbach kmk-computers.de> eclass/docs.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/docs.eclass b/eclass/docs.eclass index b05145b..773c006 100644 --- a/eclass/docs.eclass +++ b/eclass/docs.eclass @@ -21,7 +21,7 @@ # The aim of this eclass is to make it easy to add additional # doc builders. To do this, add a -setup and # -build function for your doc builder. -# For python based doc builders you can use the +# For python based doc builders you can use the # python_append_deps function to append [${PYTHON_USEDEP}] # automatically to additional dependencies. @@ -201,7 +201,7 @@ sphinx_compile() { die "${FUNCNAME}: sphinx.ext.autodoc not found in ${confpy}, set AUTODOC=0" fi fi - + sed -i -e 's:^intersphinx_mapping:disabled_&:' \ "${DOCDIR}"/conf.py || die # not all packages include the Makefile in pypi tarball
[gentoo-commits] repo/proj/guru:master commit in: eclass/
commit: 624b0488addb5c3e1e2b4e700a40a9c7fb98637d Author: Andrew Ammerlaan riseup net> AuthorDate: Tue Apr 28 07:43:18 2020 + Commit: Andrew Ammerlaan riseup net> CommitDate: Tue Apr 28 07:43:18 2020 + URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=624b0488 eclass/docs: documentation fixes Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Andrew Ammerlaan riseup.net> eclass/docs.eclass | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/eclass/docs.eclass b/eclass/docs.eclass index e537447..f3d4eb2 100644 --- a/eclass/docs.eclass +++ b/eclass/docs.eclass @@ -23,10 +23,7 @@ # -build function for your doc builder. # For python based doc builders you can use the # python_append_deps function to append [${PYTHON_USEDEP}] -# automatically to additional dependencies -# -# For more information, please see the Python Guide: -# https://dev.gentoo.org/~mgorny/python-guide/ +# automatically to additional dependencies. case "${EAPI:-0}" in 0|1|2|3|4) @@ -48,7 +45,7 @@ esac # @ECLASS-VARIABLE: DOCDIR # @DESCRIPTION: -# Sets the location of the doc builder config file. +# Path containing the doc builder config file(s). # # For sphinx this is the location of "conf.py" # For mkdocs this is the location of "mkdocs.yml"