public inbox for gentoo-guru@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates
@ 2024-07-12 14:55 Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 1/9] boinc-app.eclass: better wrapper install function Anna (cybertailor) Vyalkova
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

Publishing eclass updates for review :3



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 1/9] boinc-app.eclass: better wrapper install function
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 2/9] boinc-app.eclass: rename boinc-wrapper_foreach_wrapper_job Anna (cybertailor) Vyalkova
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

"dowrapper" had too much magic: it relied on specifically files being
present in ${FILESDIR}, which is just… wrong.

It will burn in flames without any backwards compatibility. New
"boinc_install_wrapper" function replaces it.

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
---
 eclass/boinc-app.eclass | 62 ++++++++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 28 deletions(-)

diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass
index 540fc8ea0..6a386bf2f 100644
--- a/eclass/boinc-app.eclass
+++ b/eclass/boinc-app.eclass
@@ -1,352 +1,358 @@
 # Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: boinc-app.eclass
 # @MAINTAINER:
 # Anna Vyalkova <cyber+gentoo@sysrq.in>
 # @SUPPORTED_EAPIS: 8
 # @BLURB: base functions for installing BOINC applications
 # @DESCRIPTION:
 # This eclass provides base functions for installation of software developed
 # for the BOINC platform.
 #
 # Do not package *-bin applications as BOINC can handle them itself better.
 #
 # Note that BOINC won't detect a custom application unless you provide it with
 # app_info.xml file (see https://boinc.berkeley.edu/wiki/Anonymous_platform).
 # Attach to a project of your interest and use values from
 # /var/lib/boinc/client_state.xml to write the file.
 #
 # BOINC.Italy did a great job discovering sources of many BOINC applications:
 # https://www.boincitaly.org/progetti/sorgenti-progetti.html
 
 case ${EAPI} in
 	8) ;;
 	*) die "${ECLASS}: EAPI ${EAPI} unsupported."
 esac
 
 # @ECLASS_VARIABLE: BOINC_APP_OPTIONAL
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # If set to a non-null value, BOINC part in the ebuild will be
 # considered optional and no phase functions will be exported.
 #
 # If you enable BOINC_APP_OPTIONAL, you have to call boinc-app
 # default phase functions and add dependencies manually.
 
 if [[ ! ${BOINC_APP_OPTIONAL} ]]; then
 	EXPORT_FUNCTIONS pkg_postinst pkg_postrm
 fi
 
 if [[ ! ${_BOINC_APP_ECLASS} ]]; then
 
 # @ECLASS_VARIABLE: BOINC_MASTER_URL
 # @REQUIRED
 # @DESCRIPTION:
 # Each project is publicly identified by a master URL. It also serves
 # as the home page of the project.
 #
 # You need to look it up using the following command:
 # @CODE
 #	grep "<master_url>" /var/lib/boinc/client_state.xml
 # @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
 # @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
 # @DESCRIPTION:
 # Help message to display during the pkg_postinst phase
 : ${BOINC_APP_HELPTEXT:=\
 You have to attach to the corresponding project
 in order to use this application with BOINC.}
 
 # @FUNCTION: boinc-app_add_deps
 # @USAGE: [--wrapper]
 # @DESCRIPTION:
 # 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
 		DEPEND="sci-misc/boinc"
 		RDEPEND="sci-misc/boinc"
 	fi
 
 	DEPEND="${DEPEND} acct-user/boinc"
 	RDEPEND="${RDEPEND} acct-user/boinc"
 }
 
 # @FUNCTION: boinc_master_url_check
 # @USAGE:
 # @DESCRIPTION:
 # Make sure BOINC_MASTER_URL has a value.
 boinc_master_url_check() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ -n ${BOINC_MASTER_URL} ]] || \
 		die "BOINC_MASTER_URL is not set"
 	return 0
 }
 
 # @FUNCTION: get_boincdir
 # @USAGE:
 # @RETURN: non-prefixed default BOINC runtime directory
 get_boincdir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	echo /var/lib/boinc
 }
 
 # @FUNCTION: get_project_dirname
 # @INTERNAL
 # @USAGE:
 # @RETURN: project's dirname, derived from BOINC_MASTER_URL
 # @DESCRIPTION:
 # Example:
 #
 # @CODE
 # BOINC_MASTER_URL="https://boinc.berkeley.edu/example/"
 # get_project_dirname
 # -> boinc.berkeley.edu_example
 # @CODE
 get_project_dirname() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	boinc_master_url_check
 
 	local dirname
 	dirname=${BOINC_MASTER_URL#*://}	# strip http[s]://
 	dirname=${dirname%/}			# strip trailing slash
 	dirname=${dirname////_}			# replace '/' with '_'
 
 	echo "${dirname}"
 }
 
 # @FUNCTION: get_project_root
 # @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)"
 }
 
 # @FUNCTION: _boinc-app_fix_permissions
 # @USAGE:
 # @INTERNAL
 # @DESCRIPTION:
 # Fix owner and permissions for the project root.
 _boinc-app_fix_permissions() {
 	local paths=(
 		$(get_boincdir)
 		$(get_boincdir)/projects
 		$(get_project_root)
 	)
 	fowners boinc:boinc "${paths[@]}"
 	fperms 0771 "${paths[@]}"
 }
 
 # @FUNCTION: boinc-app_appinfo_prepare
 # @USAGE: <writable app_info.xml>
 # @DESCRIPTION:
 # 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"
 }
 
 # @FUNCTION: doappinfo
 # @USAGE: <app_info.xml>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 #
 # Tip: implement appinfo_prepare() function for all your sed hacks.
 # It should recognize first argument as a file and edit it in place.
 #
 # Example:
 # @CODE
 # appinfo_prepare() {
 # 	if ! use cuda; then
 # 		sed "/<plan_class>cuda/d" -i "$1" || die
 # 	fi
 # 	boinc-app_appinfo_prepare "$1"
 # }
 #
 # src_install() {
 # 	doappinfo "${FILESDIR}"/app_info_${PV}.xml
 #
 #	exeinto $(get_project_root)
 # 	exeopts -m 0755 --owner root --group boinc
 # 	newexe bin/${PN} example_app_v${PV}
 # }
 # @CODE
 doappinfo() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# == 1 )) || \
 		die "${FUNCNAME} takes exactly one argument"
 
 	cp "$1" "${T}"/app_info.xml || die
 
 	if declare -f appinfo_prepare >/dev/null; then
 		appinfo_prepare "${T}"/app_info.xml
 	else
 		boinc-app_appinfo_prepare "${T}"/app_info.xml
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto $(get_project_root)
 		insopts -m 0644 --owner root --group boinc
 		doins "${T}"/app_info.xml
 	) || die "failed to install app_info.xml"
 
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: boinc-wrapper_foreach_wrapper_job
 # @USAGE: <job.xml>
 # @DESCRIPTION:
 # 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" \
 		-e "s:@LIBDIR@:$(get_libdir):g" \
 		|| die "$(basename "$1") sed failed"
 }
 
-# @FUNCTION: dowrapper
-# @USAGE: <app> [more apps...]
+# @FUNCTION: boinc_install_wrapper
+# @USAGE: <bin> <job> [new name]
 # @DESCRIPTION:
 # This function provides a uniform way to install wrapper applications
 # for BOINC projects. It makes symlinks to the BOINC wrapper and also
 # installs respective job.xml files.
 #
-# When sci-misc/boinc-example-1.0 calls `dowrapper boinc-example` it:
+# When `dowrapper boinc-example_wrapper A.xml B.xml` is called, it:
 #
-# 1. Installs boinc-example_job_1.0.xml from ebuild's files/ directory
-#    to project's root directory
+# 1. Installs A.xml in the project's root directory, renaming it to B.xml
 #
-# 2. Installs boinc-example_wrapper_1.0 symlink, which points
-#    to /usr/bin/boinc-wrapper, to project's root directory
+# 2. Installs boinc-example_wrapper symlink, which points
+#    to /usr/bin/boinc-wrapper, in the project's root directory
 #
 # Example:
 # @CODE
 # src_install() {
 # 	meson_src_install
 #
-# 	dowrapper boinc-example boinc-sample
+# 	boinc_install_wrapper boinc-example_wrapper "${FILESDIR}"/job.xml
 #	doappinfo "${FILESDIR}"/app_info_${PV}.xml
 # }
 # @CODE
 #
 # Keep your job.xml files in sync with app_info.xml!
-dowrapper() {
+boinc_install_wrapper() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-	for app in "$@"; do
-		local wrapperjob="${app}_job_${PV}.xml"
-		local wrapperexe="${app}_wrapper_${PV}"
+	(( $# >= 2 && $# <= 3 )) || \
+		die "${FUNCNAME} got wrong number of arguments"
 
-		[[ -f "${FILESDIR}/${wrapperjob}" ]] || \
-			die "${wrapperjob} not found in ebuild's files/ directory"
+	local exe="${1:?}"
+	local job="${2:?}"
+	local job_dest="${3:-$(basename "${job:?}")}"
 
-		cp "${FILESDIR}/${wrapperjob}" "${T}" || die
-
-		if declare -f foreach_wrapper_job >/dev/null; then
-			foreach_wrapper_job "${T}/${wrapperjob}"
-		else
-			boinc-wrapper_foreach_wrapper_job "${T}/${wrapperjob}"
-		fi
+	cp "${job:?}" "${T:?}/${job_dest:?}" || die
+	if declare -f foreach_wrapper_job >/dev/null; then
+		foreach_wrapper_job "${T:?}/${job_dest:?}"
+	else
+		boinc-wrapper_foreach_wrapper_job "${T:?}/${job_dest:?}"
+	fi
 
-		( # subshell to avoid pollution of calling environment
-			insinto $(get_project_root)
-			insopts -m 0644 --owner root --group boinc
-			doins "${T}/${wrapperjob}"
-			dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${wrapperexe}"
-		) || die "failed to install '${app}' wrapper app"
-	done
+	( # subshell to avoid pollution of calling environment
+		insinto "$(get_project_root)"
+		insopts -m 0644 --owner root --group boinc
+		doins "${T:?}/${job_dest:?}"
+	) || die "failed to install ${exe:?} wrapper job"
+	rm -f "${T:?}/${job_dest:?}"
 
+	dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${exe:?}"
 	_boinc-app_fix_permissions
 }
 
+# @FUNCTION: dowrapper
+# @DEPRECATED: boinc_install_wrapper
+# @DESCRIPTION:
+# Install BOINC wrappers and job definitions.
+dowrapper() {
+	die "${FUNCNAME} has been removed, please use boinc_install_wrapper instead"
+}
+
 # @FUNCTION: boinc-app_pkg_postinst
 # @DESCRIPTION:
 # 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 [[ -z ${REPLACING_VERSIONS} ]]; then
 			# most likely replacing applications downloaded
 			# by the BOINC client from project's website
 			elog "Restart the BOINC daemon for changes to take place:"
 			elog "# rc-service boinc restart"
 			return
 		else
 			# applications are already in use
 			return
 		fi
 	fi
 
 	elog
 	while read h; do
 		elog "${h}"
 	done <<<"${BOINC_APP_HELPTEXT}"
 	elog
 
 	if [[ ! ${BOINC_INVITATION_CODE} ]]; then
 		elog "# rc-service boinc attach"
 		elog "    Enter the Project URL: ${BOINC_MASTER_URL}"
 	else
 		elog "- Master URL: ${BOINC_MASTER_URL}"
 		elog "- Invitation code: ${BOINC_INVITATION_CODE}"
 	fi
 }
 
 # @FUNCTION: boinc-app_pkg_postrm
 # @DESCRIPTION:
 # Display helpful instructions on how to cleanly uninstall unmerged
 # applications.
 boinc-app_pkg_postrm() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ -z ${REPLACED_BY_VERSION} ]]; then
 		local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg"
 		local passwd=$(cat "${EROOT}/${gui_rpc_auth}" 2>/dev/null)
 		if [[ -z ${passwd} ]]; then
 			passwd="\$(cat ${gui_rpc_auth})"
 		fi
 
 		elog "You should detach this project from the BOINC client"
 		elog "to stop current tasks and delete remaining project files:"
 		elog
 		elog "$ boinccmd --passwd ${passwd} --project ${BOINC_MASTER_URL} detach"
 		elog
 	fi
 }
 
 _BOINC_APP_ECLASS=1
 fi
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 2/9] boinc-app.eclass: rename boinc-wrapper_foreach_wrapper_job
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 1/9] boinc-app.eclass: better wrapper install function Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 3/9] boinc-app.eclass: rename doappinfo → boinc_install_appinfo Anna (cybertailor) Vyalkova
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

This shouldn't have been like this in the first place. I must've been
really sleepy when I was writing this eclass.

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
---
 eclass/boinc-app.eclass | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass
index 6a386bf2f..689be4992 100644
--- a/eclass/boinc-app.eclass
+++ b/eclass/boinc-app.eclass
@@ -1,358 +1,358 @@
 # Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: boinc-app.eclass
 # @MAINTAINER:
 # Anna Vyalkova <cyber+gentoo@sysrq.in>
 # @SUPPORTED_EAPIS: 8
 # @BLURB: base functions for installing BOINC applications
 # @DESCRIPTION:
 # This eclass provides base functions for installation of software developed
 # for the BOINC platform.
 #
 # Do not package *-bin applications as BOINC can handle them itself better.
 #
 # Note that BOINC won't detect a custom application unless you provide it with
 # app_info.xml file (see https://boinc.berkeley.edu/wiki/Anonymous_platform).
 # Attach to a project of your interest and use values from
 # /var/lib/boinc/client_state.xml to write the file.
 #
 # BOINC.Italy did a great job discovering sources of many BOINC applications:
 # https://www.boincitaly.org/progetti/sorgenti-progetti.html
 
 case ${EAPI} in
 	8) ;;
 	*) die "${ECLASS}: EAPI ${EAPI} unsupported."
 esac
 
 # @ECLASS_VARIABLE: BOINC_APP_OPTIONAL
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # If set to a non-null value, BOINC part in the ebuild will be
 # considered optional and no phase functions will be exported.
 #
 # If you enable BOINC_APP_OPTIONAL, you have to call boinc-app
 # default phase functions and add dependencies manually.
 
 if [[ ! ${BOINC_APP_OPTIONAL} ]]; then
 	EXPORT_FUNCTIONS pkg_postinst pkg_postrm
 fi
 
 if [[ ! ${_BOINC_APP_ECLASS} ]]; then
 
 # @ECLASS_VARIABLE: BOINC_MASTER_URL
 # @REQUIRED
 # @DESCRIPTION:
 # Each project is publicly identified by a master URL. It also serves
 # as the home page of the project.
 #
 # You need to look it up using the following command:
 # @CODE
 #	grep "<master_url>" /var/lib/boinc/client_state.xml
 # @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
 # @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
 # @DESCRIPTION:
 # Help message to display during the pkg_postinst phase
 : ${BOINC_APP_HELPTEXT:=\
 You have to attach to the corresponding project
 in order to use this application with BOINC.}
 
 # @FUNCTION: boinc-app_add_deps
 # @USAGE: [--wrapper]
 # @DESCRIPTION:
 # 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
 		DEPEND="sci-misc/boinc"
 		RDEPEND="sci-misc/boinc"
 	fi
 
 	DEPEND="${DEPEND} acct-user/boinc"
 	RDEPEND="${RDEPEND} acct-user/boinc"
 }
 
 # @FUNCTION: boinc_master_url_check
 # @USAGE:
 # @DESCRIPTION:
 # Make sure BOINC_MASTER_URL has a value.
 boinc_master_url_check() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ -n ${BOINC_MASTER_URL} ]] || \
 		die "BOINC_MASTER_URL is not set"
 	return 0
 }
 
 # @FUNCTION: get_boincdir
 # @USAGE:
 # @RETURN: non-prefixed default BOINC runtime directory
 get_boincdir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	echo /var/lib/boinc
 }
 
 # @FUNCTION: get_project_dirname
 # @INTERNAL
 # @USAGE:
 # @RETURN: project's dirname, derived from BOINC_MASTER_URL
 # @DESCRIPTION:
 # Example:
 #
 # @CODE
 # BOINC_MASTER_URL="https://boinc.berkeley.edu/example/"
 # get_project_dirname
 # -> boinc.berkeley.edu_example
 # @CODE
 get_project_dirname() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	boinc_master_url_check
 
 	local dirname
 	dirname=${BOINC_MASTER_URL#*://}	# strip http[s]://
 	dirname=${dirname%/}			# strip trailing slash
 	dirname=${dirname////_}			# replace '/' with '_'
 
 	echo "${dirname}"
 }
 
 # @FUNCTION: get_project_root
 # @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)"
 }
 
 # @FUNCTION: _boinc-app_fix_permissions
 # @USAGE:
 # @INTERNAL
 # @DESCRIPTION:
 # Fix owner and permissions for the project root.
 _boinc-app_fix_permissions() {
 	local paths=(
 		$(get_boincdir)
 		$(get_boincdir)/projects
 		$(get_project_root)
 	)
 	fowners boinc:boinc "${paths[@]}"
 	fperms 0771 "${paths[@]}"
 }
 
 # @FUNCTION: boinc-app_appinfo_prepare
 # @USAGE: <writable app_info.xml>
 # @DESCRIPTION:
 # 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"
 }
 
 # @FUNCTION: doappinfo
 # @USAGE: <app_info.xml>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 #
 # Tip: implement appinfo_prepare() function for all your sed hacks.
 # It should recognize first argument as a file and edit it in place.
 #
 # Example:
 # @CODE
 # appinfo_prepare() {
 # 	if ! use cuda; then
 # 		sed "/<plan_class>cuda/d" -i "$1" || die
 # 	fi
 # 	boinc-app_appinfo_prepare "$1"
 # }
 #
 # src_install() {
 # 	doappinfo "${FILESDIR}"/app_info_${PV}.xml
 #
 #	exeinto $(get_project_root)
 # 	exeopts -m 0755 --owner root --group boinc
 # 	newexe bin/${PN} example_app_v${PV}
 # }
 # @CODE
 doappinfo() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# == 1 )) || \
 		die "${FUNCNAME} takes exactly one argument"
 
 	cp "$1" "${T}"/app_info.xml || die
 
 	if declare -f appinfo_prepare >/dev/null; then
 		appinfo_prepare "${T}"/app_info.xml
 	else
 		boinc-app_appinfo_prepare "${T}"/app_info.xml
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto $(get_project_root)
 		insopts -m 0644 --owner root --group boinc
 		doins "${T}"/app_info.xml
 	) || die "failed to install app_info.xml"
 
 	_boinc-app_fix_permissions
 }
 
-# @FUNCTION: boinc-wrapper_foreach_wrapper_job
-# @USAGE: <job.xml>
+# @FUNCTION: boinc-app_foreach_wrapper_job
+# @USAGE: <job>
 # @DESCRIPTION:
 # The default foreach_wrapper_job(). It replaces all occurences
 # of @PV@, @EPREFIX@ and @LIBDIR@ strings with their corresponding values.
-boinc-wrapper_foreach_wrapper_job() {
+boinc-app_foreach_wrapper_job() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-	sed -i "$1" \
+	sed -i "${1:?}" \
 		-e "s:@PV@:${PV}:g" \
 		-e "s:@EPREFIX@:${EPREFIX}:g" \
 		-e "s:@LIBDIR@:$(get_libdir):g" \
-		|| die "$(basename "$1") sed failed"
+		|| die "$(basename "${1}") sed failed"
 }
 
 # @FUNCTION: boinc_install_wrapper
 # @USAGE: <bin> <job> [new name]
 # @DESCRIPTION:
 # This function provides a uniform way to install wrapper applications
 # for BOINC projects. It makes symlinks to the BOINC wrapper and also
 # installs respective job.xml files.
 #
 # When `dowrapper boinc-example_wrapper A.xml B.xml` is called, it:
 #
 # 1. Installs A.xml in the project's root directory, renaming it to B.xml
 #
 # 2. Installs boinc-example_wrapper symlink, which points
 #    to /usr/bin/boinc-wrapper, in the project's root directory
 #
 # Example:
 # @CODE
 # src_install() {
 # 	meson_src_install
 #
 # 	boinc_install_wrapper boinc-example_wrapper "${FILESDIR}"/job.xml
 #	doappinfo "${FILESDIR}"/app_info_${PV}.xml
 # }
 # @CODE
 #
 # Keep your job.xml files in sync with app_info.xml!
 boinc_install_wrapper() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# >= 2 && $# <= 3 )) || \
 		die "${FUNCNAME} got wrong number of arguments"
 
 	local exe="${1:?}"
 	local job="${2:?}"
 	local job_dest="${3:-$(basename "${job:?}")}"
 
 	cp "${job:?}" "${T:?}/${job_dest:?}" || die
 	if declare -f foreach_wrapper_job >/dev/null; then
 		foreach_wrapper_job "${T:?}/${job_dest:?}"
 	else
-		boinc-wrapper_foreach_wrapper_job "${T:?}/${job_dest:?}"
+		boinc-app_foreach_wrapper_job "${T:?}/${job_dest:?}"
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}/${job_dest:?}"
 	) || die "failed to install ${exe:?} wrapper job"
 	rm -f "${T:?}/${job_dest:?}"
 
 	dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${exe:?}"
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: dowrapper
 # @DEPRECATED: boinc_install_wrapper
 # @DESCRIPTION:
 # Install BOINC wrappers and job definitions.
 dowrapper() {
 	die "${FUNCNAME} has been removed, please use boinc_install_wrapper instead"
 }
 
 # @FUNCTION: boinc-app_pkg_postinst
 # @DESCRIPTION:
 # 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 [[ -z ${REPLACING_VERSIONS} ]]; then
 			# most likely replacing applications downloaded
 			# by the BOINC client from project's website
 			elog "Restart the BOINC daemon for changes to take place:"
 			elog "# rc-service boinc restart"
 			return
 		else
 			# applications are already in use
 			return
 		fi
 	fi
 
 	elog
 	while read h; do
 		elog "${h}"
 	done <<<"${BOINC_APP_HELPTEXT}"
 	elog
 
 	if [[ ! ${BOINC_INVITATION_CODE} ]]; then
 		elog "# rc-service boinc attach"
 		elog "    Enter the Project URL: ${BOINC_MASTER_URL}"
 	else
 		elog "- Master URL: ${BOINC_MASTER_URL}"
 		elog "- Invitation code: ${BOINC_INVITATION_CODE}"
 	fi
 }
 
 # @FUNCTION: boinc-app_pkg_postrm
 # @DESCRIPTION:
 # Display helpful instructions on how to cleanly uninstall unmerged
 # applications.
 boinc-app_pkg_postrm() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ -z ${REPLACED_BY_VERSION} ]]; then
 		local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg"
 		local passwd=$(cat "${EROOT}/${gui_rpc_auth}" 2>/dev/null)
 		if [[ -z ${passwd} ]]; then
 			passwd="\$(cat ${gui_rpc_auth})"
 		fi
 
 		elog "You should detach this project from the BOINC client"
 		elog "to stop current tasks and delete remaining project files:"
 		elog
 		elog "$ boinccmd --passwd ${passwd} --project ${BOINC_MASTER_URL} detach"
 		elog
 	fi
 }
 
 _BOINC_APP_ECLASS=1
 fi
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 3/9] boinc-app.eclass: rename doappinfo → boinc_install_appinfo
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 1/9] boinc-app.eclass: better wrapper install function Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 2/9] boinc-app.eclass: rename boinc-wrapper_foreach_wrapper_job Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 4/9] boinc-app.eclass: allow non-standard runtime dir Anna (cybertailor) Vyalkova
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

Use the same naming style as in "boinc_install_wrapper".

"doappinfo" is kept for compatibility but deprecated and will be
removed sooner or later.

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
---
 eclass/boinc-app.eclass | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass
index 689be4992..a20c800cb 100644
--- a/eclass/boinc-app.eclass
+++ b/eclass/boinc-app.eclass
@@ -1,358 +1,367 @@
 # Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: boinc-app.eclass
 # @MAINTAINER:
 # Anna Vyalkova <cyber+gentoo@sysrq.in>
 # @SUPPORTED_EAPIS: 8
 # @BLURB: base functions for installing BOINC applications
 # @DESCRIPTION:
 # This eclass provides base functions for installation of software developed
 # for the BOINC platform.
 #
 # Do not package *-bin applications as BOINC can handle them itself better.
 #
 # Note that BOINC won't detect a custom application unless you provide it with
 # app_info.xml file (see https://boinc.berkeley.edu/wiki/Anonymous_platform).
 # Attach to a project of your interest and use values from
 # /var/lib/boinc/client_state.xml to write the file.
 #
 # BOINC.Italy did a great job discovering sources of many BOINC applications:
 # https://www.boincitaly.org/progetti/sorgenti-progetti.html
 
 case ${EAPI} in
 	8) ;;
 	*) die "${ECLASS}: EAPI ${EAPI} unsupported."
 esac
 
 # @ECLASS_VARIABLE: BOINC_APP_OPTIONAL
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # If set to a non-null value, BOINC part in the ebuild will be
 # considered optional and no phase functions will be exported.
 #
 # If you enable BOINC_APP_OPTIONAL, you have to call boinc-app
 # default phase functions and add dependencies manually.
 
 if [[ ! ${BOINC_APP_OPTIONAL} ]]; then
 	EXPORT_FUNCTIONS pkg_postinst pkg_postrm
 fi
 
 if [[ ! ${_BOINC_APP_ECLASS} ]]; then
 
 # @ECLASS_VARIABLE: BOINC_MASTER_URL
 # @REQUIRED
 # @DESCRIPTION:
 # Each project is publicly identified by a master URL. It also serves
 # as the home page of the project.
 #
 # You need to look it up using the following command:
 # @CODE
 #	grep "<master_url>" /var/lib/boinc/client_state.xml
 # @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
 # @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
 # @DESCRIPTION:
 # Help message to display during the pkg_postinst phase
 : ${BOINC_APP_HELPTEXT:=\
 You have to attach to the corresponding project
 in order to use this application with BOINC.}
 
 # @FUNCTION: boinc-app_add_deps
 # @USAGE: [--wrapper]
 # @DESCRIPTION:
 # 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
 		DEPEND="sci-misc/boinc"
 		RDEPEND="sci-misc/boinc"
 	fi
 
 	DEPEND="${DEPEND} acct-user/boinc"
 	RDEPEND="${RDEPEND} acct-user/boinc"
 }
 
 # @FUNCTION: boinc_master_url_check
 # @USAGE:
 # @DESCRIPTION:
 # Make sure BOINC_MASTER_URL has a value.
 boinc_master_url_check() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ -n ${BOINC_MASTER_URL} ]] || \
 		die "BOINC_MASTER_URL is not set"
 	return 0
 }
 
 # @FUNCTION: get_boincdir
 # @USAGE:
 # @RETURN: non-prefixed default BOINC runtime directory
 get_boincdir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	echo /var/lib/boinc
 }
 
 # @FUNCTION: get_project_dirname
 # @INTERNAL
 # @USAGE:
 # @RETURN: project's dirname, derived from BOINC_MASTER_URL
 # @DESCRIPTION:
 # Example:
 #
 # @CODE
 # BOINC_MASTER_URL="https://boinc.berkeley.edu/example/"
 # get_project_dirname
 # -> boinc.berkeley.edu_example
 # @CODE
 get_project_dirname() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	boinc_master_url_check
 
 	local dirname
 	dirname=${BOINC_MASTER_URL#*://}	# strip http[s]://
 	dirname=${dirname%/}			# strip trailing slash
 	dirname=${dirname////_}			# replace '/' with '_'
 
 	echo "${dirname}"
 }
 
 # @FUNCTION: get_project_root
 # @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)"
 }
 
 # @FUNCTION: _boinc-app_fix_permissions
 # @USAGE:
 # @INTERNAL
 # @DESCRIPTION:
 # Fix owner and permissions for the project root.
 _boinc-app_fix_permissions() {
 	local paths=(
 		$(get_boincdir)
 		$(get_boincdir)/projects
 		$(get_project_root)
 	)
 	fowners boinc:boinc "${paths[@]}"
 	fperms 0771 "${paths[@]}"
 }
 
 # @FUNCTION: boinc-app_appinfo_prepare
 # @USAGE: <writable app_info.xml>
 # @DESCRIPTION:
 # 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"
 }
 
-# @FUNCTION: doappinfo
-# @USAGE: <app_info.xml>
+# @FUNCTION: boinc_install_appinfo
+# @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 #
 # Tip: implement appinfo_prepare() function for all your sed hacks.
 # It should recognize first argument as a file and edit it in place.
 #
 # Example:
 # @CODE
 # appinfo_prepare() {
 # 	if ! use cuda; then
 # 		sed "/<plan_class>cuda/d" -i "$1" || die
 # 	fi
 # 	boinc-app_appinfo_prepare "$1"
 # }
 #
 # src_install() {
-# 	doappinfo "${FILESDIR}"/app_info_${PV}.xml
+# 	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 #
 #	exeinto $(get_project_root)
 # 	exeopts -m 0755 --owner root --group boinc
-# 	newexe bin/${PN} example_app_v${PV}
+# 	newexe bin/${PN} example_app_v1.0
 # }
 # @CODE
-doappinfo() {
+boinc_install_appinfo() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# == 1 )) || \
 		die "${FUNCNAME} takes exactly one argument"
 
-	cp "$1" "${T}"/app_info.xml || die
+	cp "${1:?}" "${T:?}"/app_info.xml || die
 
 	if declare -f appinfo_prepare >/dev/null; then
-		appinfo_prepare "${T}"/app_info.xml
+		appinfo_prepare "${T:?}"/app_info.xml
 	else
-		boinc-app_appinfo_prepare "${T}"/app_info.xml
+		boinc-app_appinfo_prepare "${T:?}"/app_info.xml
 	fi
 
 	( # subshell to avoid pollution of calling environment
-		insinto $(get_project_root)
+		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
-		doins "${T}"/app_info.xml
+		doins "${T:?}"/app_info.xml
 	) || die "failed to install app_info.xml"
 
 	_boinc-app_fix_permissions
 }
 
+# @FUNCTION: doappinfo
+# @DEPRECATED: boinc_install_appinfo
+# @USAGE: <app_info>
+# @DESCRIPTION:
+# Installs given app_info.xml file to the project root.
+doappinfo() {
+	boinc_install_appinfo "${@}"
+}
+
 # @FUNCTION: boinc-app_foreach_wrapper_job
 # @USAGE: <job>
 # @DESCRIPTION:
 # The default foreach_wrapper_job(). It replaces all occurences
 # of @PV@, @EPREFIX@ and @LIBDIR@ strings with their corresponding values.
 boinc-app_foreach_wrapper_job() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	sed -i "${1:?}" \
 		-e "s:@PV@:${PV}:g" \
 		-e "s:@EPREFIX@:${EPREFIX}:g" \
 		-e "s:@LIBDIR@:$(get_libdir):g" \
 		|| die "$(basename "${1}") sed failed"
 }
 
 # @FUNCTION: boinc_install_wrapper
 # @USAGE: <bin> <job> [new name]
 # @DESCRIPTION:
 # This function provides a uniform way to install wrapper applications
 # for BOINC projects. It makes symlinks to the BOINC wrapper and also
 # installs respective job.xml files.
 #
 # When `dowrapper boinc-example_wrapper A.xml B.xml` is called, it:
 #
 # 1. Installs A.xml in the project's root directory, renaming it to B.xml
 #
 # 2. Installs boinc-example_wrapper symlink, which points
 #    to /usr/bin/boinc-wrapper, in the project's root directory
 #
 # Example:
 # @CODE
 # src_install() {
 # 	meson_src_install
 #
 # 	boinc_install_wrapper boinc-example_wrapper "${FILESDIR}"/job.xml
-#	doappinfo "${FILESDIR}"/app_info_${PV}.xml
+#	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 # }
 # @CODE
 #
 # Keep your job.xml files in sync with app_info.xml!
 boinc_install_wrapper() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# >= 2 && $# <= 3 )) || \
 		die "${FUNCNAME} got wrong number of arguments"
 
 	local exe="${1:?}"
 	local job="${2:?}"
 	local job_dest="${3:-$(basename "${job:?}")}"
 
 	cp "${job:?}" "${T:?}/${job_dest:?}" || die
 	if declare -f foreach_wrapper_job >/dev/null; then
 		foreach_wrapper_job "${T:?}/${job_dest:?}"
 	else
 		boinc-app_foreach_wrapper_job "${T:?}/${job_dest:?}"
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}/${job_dest:?}"
 	) || die "failed to install ${exe:?} wrapper job"
 	rm -f "${T:?}/${job_dest:?}"
 
 	dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${exe:?}"
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: dowrapper
 # @DEPRECATED: boinc_install_wrapper
 # @DESCRIPTION:
 # Install BOINC wrappers and job definitions.
 dowrapper() {
 	die "${FUNCNAME} has been removed, please use boinc_install_wrapper instead"
 }
 
 # @FUNCTION: boinc-app_pkg_postinst
 # @DESCRIPTION:
 # 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 [[ -z ${REPLACING_VERSIONS} ]]; then
 			# most likely replacing applications downloaded
 			# by the BOINC client from project's website
 			elog "Restart the BOINC daemon for changes to take place:"
 			elog "# rc-service boinc restart"
 			return
 		else
 			# applications are already in use
 			return
 		fi
 	fi
 
 	elog
 	while read h; do
 		elog "${h}"
 	done <<<"${BOINC_APP_HELPTEXT}"
 	elog
 
 	if [[ ! ${BOINC_INVITATION_CODE} ]]; then
 		elog "# rc-service boinc attach"
 		elog "    Enter the Project URL: ${BOINC_MASTER_URL}"
 	else
 		elog "- Master URL: ${BOINC_MASTER_URL}"
 		elog "- Invitation code: ${BOINC_INVITATION_CODE}"
 	fi
 }
 
 # @FUNCTION: boinc-app_pkg_postrm
 # @DESCRIPTION:
 # Display helpful instructions on how to cleanly uninstall unmerged
 # applications.
 boinc-app_pkg_postrm() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ -z ${REPLACED_BY_VERSION} ]]; then
 		local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg"
 		local passwd=$(cat "${EROOT}/${gui_rpc_auth}" 2>/dev/null)
 		if [[ -z ${passwd} ]]; then
 			passwd="\$(cat ${gui_rpc_auth})"
 		fi
 
 		elog "You should detach this project from the BOINC client"
 		elog "to stop current tasks and delete remaining project files:"
 		elog
 		elog "$ boinccmd --passwd ${passwd} --project ${BOINC_MASTER_URL} detach"
 		elog
 	fi
 }
 
 _BOINC_APP_ECLASS=1
 fi
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 4/9] boinc-app.eclass: allow non-standard runtime dir
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
                   ` (2 preceding siblings ...)
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 3/9] boinc-app.eclass: rename doappinfo → boinc_install_appinfo Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 5/9] boinc-app.eclass: allow to set deps for boinc-optional apps Anna (cybertailor) Vyalkova
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
---
 eclass/boinc-app.eclass | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass
index a20c800cb..00ffd39ed 100644
--- a/eclass/boinc-app.eclass
+++ b/eclass/boinc-app.eclass
@@ -1,367 +1,371 @@
 # Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: boinc-app.eclass
 # @MAINTAINER:
 # Anna Vyalkova <cyber+gentoo@sysrq.in>
 # @SUPPORTED_EAPIS: 8
 # @BLURB: base functions for installing BOINC applications
 # @DESCRIPTION:
 # This eclass provides base functions for installation of software developed
 # for the BOINC platform.
 #
 # Do not package *-bin applications as BOINC can handle them itself better.
 #
 # Note that BOINC won't detect a custom application unless you provide it with
 # app_info.xml file (see https://boinc.berkeley.edu/wiki/Anonymous_platform).
 # Attach to a project of your interest and use values from
 # /var/lib/boinc/client_state.xml to write the file.
 #
 # BOINC.Italy did a great job discovering sources of many BOINC applications:
 # https://www.boincitaly.org/progetti/sorgenti-progetti.html
 
 case ${EAPI} in
 	8) ;;
 	*) die "${ECLASS}: EAPI ${EAPI} unsupported."
 esac
 
 # @ECLASS_VARIABLE: BOINC_APP_OPTIONAL
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # If set to a non-null value, BOINC part in the ebuild will be
 # considered optional and no phase functions will be exported.
 #
 # If you enable BOINC_APP_OPTIONAL, you have to call boinc-app
 # default phase functions and add dependencies manually.
 
 if [[ ! ${BOINC_APP_OPTIONAL} ]]; then
 	EXPORT_FUNCTIONS pkg_postinst pkg_postrm
 fi
 
 if [[ ! ${_BOINC_APP_ECLASS} ]]; then
 
 # @ECLASS_VARIABLE: BOINC_MASTER_URL
 # @REQUIRED
 # @DESCRIPTION:
 # Each project is publicly identified by a master URL. It also serves
 # as the home page of the project.
 #
 # You need to look it up using the following command:
 # @CODE
 #	grep "<master_url>" /var/lib/boinc/client_state.xml
 # @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
 # @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
 # @DESCRIPTION:
 # Help message to display during the pkg_postinst phase
 : ${BOINC_APP_HELPTEXT:=\
 You have to attach to the corresponding project
 in order to use this application with BOINC.}
 
+# @ECLASS_VARIABLE: BOINC_RUNTIMEDIR
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Directory with BOINC runtime data.
+
 # @FUNCTION: boinc-app_add_deps
 # @USAGE: [--wrapper]
 # @DESCRIPTION:
 # 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
 		DEPEND="sci-misc/boinc"
 		RDEPEND="sci-misc/boinc"
 	fi
 
 	DEPEND="${DEPEND} acct-user/boinc"
 	RDEPEND="${RDEPEND} acct-user/boinc"
 }
 
 # @FUNCTION: boinc_master_url_check
 # @USAGE:
 # @DESCRIPTION:
 # Make sure BOINC_MASTER_URL has a value.
 boinc_master_url_check() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ -n ${BOINC_MASTER_URL} ]] || \
 		die "BOINC_MASTER_URL is not set"
 	return 0
 }
 
 # @FUNCTION: get_boincdir
 # @USAGE:
-# @RETURN: non-prefixed default BOINC runtime directory
+# @RETURN: non-prefixed BOINC runtime directory
 get_boincdir() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	echo /var/lib/boinc
+	echo "${BOINC_RUNTIMEDIR:-/var/lib/boinc}"
 }
 
 # @FUNCTION: get_project_dirname
 # @INTERNAL
 # @USAGE:
 # @RETURN: project's dirname, derived from BOINC_MASTER_URL
 # @DESCRIPTION:
 # Example:
 #
 # @CODE
 # BOINC_MASTER_URL="https://boinc.berkeley.edu/example/"
 # get_project_dirname
 # -> boinc.berkeley.edu_example
 # @CODE
 get_project_dirname() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	boinc_master_url_check
 
 	local dirname
 	dirname=${BOINC_MASTER_URL#*://}	# strip http[s]://
 	dirname=${dirname%/}			# strip trailing slash
 	dirname=${dirname////_}			# replace '/' with '_'
 
 	echo "${dirname}"
 }
 
 # @FUNCTION: get_project_root
 # @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)"
 }
 
 # @FUNCTION: _boinc-app_fix_permissions
 # @USAGE:
 # @INTERNAL
 # @DESCRIPTION:
 # Fix owner and permissions for the project root.
 _boinc-app_fix_permissions() {
 	local paths=(
 		$(get_boincdir)
 		$(get_boincdir)/projects
 		$(get_project_root)
 	)
 	fowners boinc:boinc "${paths[@]}"
 	fperms 0771 "${paths[@]}"
 }
 
 # @FUNCTION: boinc-app_appinfo_prepare
 # @USAGE: <writable app_info.xml>
 # @DESCRIPTION:
 # 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"
 }
 
 # @FUNCTION: boinc_install_appinfo
 # @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 #
 # Tip: implement appinfo_prepare() function for all your sed hacks.
 # It should recognize first argument as a file and edit it in place.
 #
 # Example:
 # @CODE
 # appinfo_prepare() {
 # 	if ! use cuda; then
 # 		sed "/<plan_class>cuda/d" -i "$1" || die
 # 	fi
 # 	boinc-app_appinfo_prepare "$1"
 # }
 #
 # src_install() {
 # 	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 #
 #	exeinto $(get_project_root)
 # 	exeopts -m 0755 --owner root --group boinc
 # 	newexe bin/${PN} example_app_v1.0
 # }
 # @CODE
 boinc_install_appinfo() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# == 1 )) || \
 		die "${FUNCNAME} takes exactly one argument"
 
 	cp "${1:?}" "${T:?}"/app_info.xml || die
 
 	if declare -f appinfo_prepare >/dev/null; then
 		appinfo_prepare "${T:?}"/app_info.xml
 	else
 		boinc-app_appinfo_prepare "${T:?}"/app_info.xml
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}"/app_info.xml
 	) || die "failed to install app_info.xml"
 
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: doappinfo
 # @DEPRECATED: boinc_install_appinfo
 # @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 doappinfo() {
 	boinc_install_appinfo "${@}"
 }
 
 # @FUNCTION: boinc-app_foreach_wrapper_job
 # @USAGE: <job>
 # @DESCRIPTION:
 # The default foreach_wrapper_job(). It replaces all occurences
 # of @PV@, @EPREFIX@ and @LIBDIR@ strings with their corresponding values.
 boinc-app_foreach_wrapper_job() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	sed -i "${1:?}" \
 		-e "s:@PV@:${PV}:g" \
 		-e "s:@EPREFIX@:${EPREFIX}:g" \
 		-e "s:@LIBDIR@:$(get_libdir):g" \
 		|| die "$(basename "${1}") sed failed"
 }
 
 # @FUNCTION: boinc_install_wrapper
 # @USAGE: <bin> <job> [new name]
 # @DESCRIPTION:
 # This function provides a uniform way to install wrapper applications
 # for BOINC projects. It makes symlinks to the BOINC wrapper and also
 # installs respective job.xml files.
 #
 # When `dowrapper boinc-example_wrapper A.xml B.xml` is called, it:
 #
 # 1. Installs A.xml in the project's root directory, renaming it to B.xml
 #
 # 2. Installs boinc-example_wrapper symlink, which points
 #    to /usr/bin/boinc-wrapper, in the project's root directory
 #
 # Example:
 # @CODE
 # src_install() {
 # 	meson_src_install
 #
 # 	boinc_install_wrapper boinc-example_wrapper "${FILESDIR}"/job.xml
 #	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 # }
 # @CODE
 #
 # Keep your job.xml files in sync with app_info.xml!
 boinc_install_wrapper() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# >= 2 && $# <= 3 )) || \
 		die "${FUNCNAME} got wrong number of arguments"
 
 	local exe="${1:?}"
 	local job="${2:?}"
 	local job_dest="${3:-$(basename "${job:?}")}"
 
 	cp "${job:?}" "${T:?}/${job_dest:?}" || die
 	if declare -f foreach_wrapper_job >/dev/null; then
 		foreach_wrapper_job "${T:?}/${job_dest:?}"
 	else
 		boinc-app_foreach_wrapper_job "${T:?}/${job_dest:?}"
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}/${job_dest:?}"
 	) || die "failed to install ${exe:?} wrapper job"
 	rm -f "${T:?}/${job_dest:?}"
 
 	dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${exe:?}"
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: dowrapper
 # @DEPRECATED: boinc_install_wrapper
 # @DESCRIPTION:
 # Install BOINC wrappers and job definitions.
 dowrapper() {
 	die "${FUNCNAME} has been removed, please use boinc_install_wrapper instead"
 }
 
 # @FUNCTION: boinc-app_pkg_postinst
 # @DESCRIPTION:
 # 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 [[ -z ${REPLACING_VERSIONS} ]]; then
 			# most likely replacing applications downloaded
 			# by the BOINC client from project's website
 			elog "Restart the BOINC daemon for changes to take place:"
 			elog "# rc-service boinc restart"
 			return
 		else
 			# applications are already in use
 			return
 		fi
 	fi
 
 	elog
 	while read h; do
 		elog "${h}"
 	done <<<"${BOINC_APP_HELPTEXT}"
 	elog
 
 	if [[ ! ${BOINC_INVITATION_CODE} ]]; then
 		elog "# rc-service boinc attach"
 		elog "    Enter the Project URL: ${BOINC_MASTER_URL}"
 	else
 		elog "- Master URL: ${BOINC_MASTER_URL}"
 		elog "- Invitation code: ${BOINC_INVITATION_CODE}"
 	fi
 }
 
 # @FUNCTION: boinc-app_pkg_postrm
 # @DESCRIPTION:
 # Display helpful instructions on how to cleanly uninstall unmerged
 # applications.
 boinc-app_pkg_postrm() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ -z ${REPLACED_BY_VERSION} ]]; then
 		local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg"
 		local passwd=$(cat "${EROOT}/${gui_rpc_auth}" 2>/dev/null)
 		if [[ -z ${passwd} ]]; then
 			passwd="\$(cat ${gui_rpc_auth})"
 		fi
 
 		elog "You should detach this project from the BOINC client"
 		elog "to stop current tasks and delete remaining project files:"
 		elog
 		elog "$ boinccmd --passwd ${passwd} --project ${BOINC_MASTER_URL} detach"
 		elog
 	fi
 }
 
 _BOINC_APP_ECLASS=1
 fi
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 5/9] boinc-app.eclass: allow to set deps for boinc-optional apps
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
                   ` (3 preceding siblings ...)
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 4/9] boinc-app.eclass: allow non-standard runtime dir Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 6/9] boinc-app.eclass: use standard inherit guard style Anna (cybertailor) Vyalkova
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
---
 eclass/boinc-app.eclass | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass
index 00ffd39ed..3a26e6738 100644
--- a/eclass/boinc-app.eclass
+++ b/eclass/boinc-app.eclass
@@ -1,371 +1,384 @@
 # Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: boinc-app.eclass
 # @MAINTAINER:
 # Anna Vyalkova <cyber+gentoo@sysrq.in>
 # @SUPPORTED_EAPIS: 8
 # @BLURB: base functions for installing BOINC applications
 # @DESCRIPTION:
 # This eclass provides base functions for installation of software developed
 # for the BOINC platform.
 #
 # Do not package *-bin applications as BOINC can handle them itself better.
 #
 # Note that BOINC won't detect a custom application unless you provide it with
 # app_info.xml file (see https://boinc.berkeley.edu/wiki/Anonymous_platform).
 # Attach to a project of your interest and use values from
 # /var/lib/boinc/client_state.xml to write the file.
 #
 # BOINC.Italy did a great job discovering sources of many BOINC applications:
 # https://www.boincitaly.org/progetti/sorgenti-progetti.html
 
 case ${EAPI} in
 	8) ;;
 	*) die "${ECLASS}: EAPI ${EAPI} unsupported."
 esac
 
 # @ECLASS_VARIABLE: BOINC_APP_OPTIONAL
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # If set to a non-null value, BOINC part in the ebuild will be
 # considered optional and no phase functions will be exported.
 #
 # If you enable BOINC_APP_OPTIONAL, you have to call boinc-app
 # default phase functions and add dependencies manually.
 
 if [[ ! ${BOINC_APP_OPTIONAL} ]]; then
 	EXPORT_FUNCTIONS pkg_postinst pkg_postrm
 fi
 
 if [[ ! ${_BOINC_APP_ECLASS} ]]; then
 
 # @ECLASS_VARIABLE: BOINC_MASTER_URL
 # @REQUIRED
 # @DESCRIPTION:
 # Each project is publicly identified by a master URL. It also serves
 # as the home page of the project.
 #
 # You need to look it up using the following command:
 # @CODE
 #	grep "<master_url>" /var/lib/boinc/client_state.xml
 # @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
 # @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
 # @DESCRIPTION:
 # Help message to display during the pkg_postinst phase
 : ${BOINC_APP_HELPTEXT:=\
 You have to attach to the corresponding project
 in order to use this application with BOINC.}
 
 # @ECLASS_VARIABLE: BOINC_RUNTIMEDIR
 # @USER_VARIABLE
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Directory with BOINC runtime data.
 
 # @FUNCTION: boinc-app_add_deps
 # @USAGE: [--wrapper]
 # @DESCRIPTION:
-# Generate appropriate (R)DEPEND for wrapper-enabled or
+# Generate appropriate IUSE and (R)DEPEND for wrapper-enabled or
 # native application.
+#
+# If BOINC_APP_OPTIONAL is set to a non-null value, dependencies
+# will be added for "boinc" USE-flag.
 boinc-app_add_deps() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-	if [[ $1 == "--wrapper" ]]; then
-		RDEPEND="sci-misc/boinc-wrapper"
+	local depend rdepend
+	if [[ ${1} == "--wrapper" ]]; then
+		rdepend="sci-misc/boinc-wrapper"
 	else
-		DEPEND="sci-misc/boinc"
-		RDEPEND="sci-misc/boinc"
+		depend="sci-misc/boinc"
+		rdepend="sci-misc/boinc"
 	fi
 
-	DEPEND="${DEPEND} acct-user/boinc"
-	RDEPEND="${RDEPEND} acct-user/boinc"
+	depend+=" acct-user/boinc"
+	rdepend+=" acct-user/boinc"
+
+	if [[ ${BOINC_APP_OPTIONAL} ]]; then
+		IUSE+=" boinc"
+		DEPEND+=" boinc? ( ${depend} )"
+		RDEPEND+=" boinc? ( ${rdepend} )"
+	else
+		DEPEND+=" ${depend}"
+		RDEPEND+=" ${rdepend}"
+	fi
 }
 
 # @FUNCTION: boinc_master_url_check
 # @USAGE:
 # @DESCRIPTION:
 # Make sure BOINC_MASTER_URL has a value.
 boinc_master_url_check() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ -n ${BOINC_MASTER_URL} ]] || \
 		die "BOINC_MASTER_URL is not set"
 	return 0
 }
 
 # @FUNCTION: get_boincdir
 # @USAGE:
 # @RETURN: non-prefixed BOINC runtime directory
 get_boincdir() {
 	echo "${BOINC_RUNTIMEDIR:-/var/lib/boinc}"
 }
 
 # @FUNCTION: get_project_dirname
 # @INTERNAL
 # @USAGE:
 # @RETURN: project's dirname, derived from BOINC_MASTER_URL
 # @DESCRIPTION:
 # Example:
 #
 # @CODE
 # BOINC_MASTER_URL="https://boinc.berkeley.edu/example/"
 # get_project_dirname
 # -> boinc.berkeley.edu_example
 # @CODE
 get_project_dirname() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	boinc_master_url_check
 
 	local dirname
 	dirname=${BOINC_MASTER_URL#*://}	# strip http[s]://
 	dirname=${dirname%/}			# strip trailing slash
 	dirname=${dirname////_}			# replace '/' with '_'
 
 	echo "${dirname}"
 }
 
 # @FUNCTION: get_project_root
 # @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)"
 }
 
 # @FUNCTION: _boinc-app_fix_permissions
 # @USAGE:
 # @INTERNAL
 # @DESCRIPTION:
 # Fix owner and permissions for the project root.
 _boinc-app_fix_permissions() {
 	local paths=(
 		$(get_boincdir)
 		$(get_boincdir)/projects
 		$(get_project_root)
 	)
 	fowners boinc:boinc "${paths[@]}"
 	fperms 0771 "${paths[@]}"
 }
 
 # @FUNCTION: boinc-app_appinfo_prepare
 # @USAGE: <writable app_info.xml>
 # @DESCRIPTION:
 # 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"
 }
 
 # @FUNCTION: boinc_install_appinfo
 # @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 #
 # Tip: implement appinfo_prepare() function for all your sed hacks.
 # It should recognize first argument as a file and edit it in place.
 #
 # Example:
 # @CODE
 # appinfo_prepare() {
 # 	if ! use cuda; then
 # 		sed "/<plan_class>cuda/d" -i "$1" || die
 # 	fi
 # 	boinc-app_appinfo_prepare "$1"
 # }
 #
 # src_install() {
 # 	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 #
 #	exeinto $(get_project_root)
 # 	exeopts -m 0755 --owner root --group boinc
 # 	newexe bin/${PN} example_app_v1.0
 # }
 # @CODE
 boinc_install_appinfo() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# == 1 )) || \
 		die "${FUNCNAME} takes exactly one argument"
 
 	cp "${1:?}" "${T:?}"/app_info.xml || die
 
 	if declare -f appinfo_prepare >/dev/null; then
 		appinfo_prepare "${T:?}"/app_info.xml
 	else
 		boinc-app_appinfo_prepare "${T:?}"/app_info.xml
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}"/app_info.xml
 	) || die "failed to install app_info.xml"
 
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: doappinfo
 # @DEPRECATED: boinc_install_appinfo
 # @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 doappinfo() {
 	boinc_install_appinfo "${@}"
 }
 
 # @FUNCTION: boinc-app_foreach_wrapper_job
 # @USAGE: <job>
 # @DESCRIPTION:
 # The default foreach_wrapper_job(). It replaces all occurences
 # of @PV@, @EPREFIX@ and @LIBDIR@ strings with their corresponding values.
 boinc-app_foreach_wrapper_job() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	sed -i "${1:?}" \
 		-e "s:@PV@:${PV}:g" \
 		-e "s:@EPREFIX@:${EPREFIX}:g" \
 		-e "s:@LIBDIR@:$(get_libdir):g" \
 		|| die "$(basename "${1}") sed failed"
 }
 
 # @FUNCTION: boinc_install_wrapper
 # @USAGE: <bin> <job> [new name]
 # @DESCRIPTION:
 # This function provides a uniform way to install wrapper applications
 # for BOINC projects. It makes symlinks to the BOINC wrapper and also
 # installs respective job.xml files.
 #
 # When `dowrapper boinc-example_wrapper A.xml B.xml` is called, it:
 #
 # 1. Installs A.xml in the project's root directory, renaming it to B.xml
 #
 # 2. Installs boinc-example_wrapper symlink, which points
 #    to /usr/bin/boinc-wrapper, in the project's root directory
 #
 # Example:
 # @CODE
 # src_install() {
 # 	meson_src_install
 #
 # 	boinc_install_wrapper boinc-example_wrapper "${FILESDIR}"/job.xml
 #	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 # }
 # @CODE
 #
 # Keep your job.xml files in sync with app_info.xml!
 boinc_install_wrapper() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# >= 2 && $# <= 3 )) || \
 		die "${FUNCNAME} got wrong number of arguments"
 
 	local exe="${1:?}"
 	local job="${2:?}"
 	local job_dest="${3:-$(basename "${job:?}")}"
 
 	cp "${job:?}" "${T:?}/${job_dest:?}" || die
 	if declare -f foreach_wrapper_job >/dev/null; then
 		foreach_wrapper_job "${T:?}/${job_dest:?}"
 	else
 		boinc-app_foreach_wrapper_job "${T:?}/${job_dest:?}"
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}/${job_dest:?}"
 	) || die "failed to install ${exe:?} wrapper job"
 	rm -f "${T:?}/${job_dest:?}"
 
 	dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${exe:?}"
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: dowrapper
 # @DEPRECATED: boinc_install_wrapper
 # @DESCRIPTION:
 # Install BOINC wrappers and job definitions.
 dowrapper() {
 	die "${FUNCNAME} has been removed, please use boinc_install_wrapper instead"
 }
 
 # @FUNCTION: boinc-app_pkg_postinst
 # @DESCRIPTION:
 # 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 [[ -z ${REPLACING_VERSIONS} ]]; then
 			# most likely replacing applications downloaded
 			# by the BOINC client from project's website
 			elog "Restart the BOINC daemon for changes to take place:"
 			elog "# rc-service boinc restart"
 			return
 		else
 			# applications are already in use
 			return
 		fi
 	fi
 
 	elog
 	while read h; do
 		elog "${h}"
 	done <<<"${BOINC_APP_HELPTEXT}"
 	elog
 
 	if [[ ! ${BOINC_INVITATION_CODE} ]]; then
 		elog "# rc-service boinc attach"
 		elog "    Enter the Project URL: ${BOINC_MASTER_URL}"
 	else
 		elog "- Master URL: ${BOINC_MASTER_URL}"
 		elog "- Invitation code: ${BOINC_INVITATION_CODE}"
 	fi
 }
 
 # @FUNCTION: boinc-app_pkg_postrm
 # @DESCRIPTION:
 # Display helpful instructions on how to cleanly uninstall unmerged
 # applications.
 boinc-app_pkg_postrm() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ -z ${REPLACED_BY_VERSION} ]]; then
 		local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg"
 		local passwd=$(cat "${EROOT}/${gui_rpc_auth}" 2>/dev/null)
 		if [[ -z ${passwd} ]]; then
 			passwd="\$(cat ${gui_rpc_auth})"
 		fi
 
 		elog "You should detach this project from the BOINC client"
 		elog "to stop current tasks and delete remaining project files:"
 		elog
 		elog "$ boinccmd --passwd ${passwd} --project ${BOINC_MASTER_URL} detach"
 		elog
 	fi
 }
 
 _BOINC_APP_ECLASS=1
 fi
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 6/9] boinc-app.eclass: use standard inherit guard style
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
                   ` (4 preceding siblings ...)
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 5/9] boinc-app.eclass: allow to set deps for boinc-optional apps Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 7/9] boinc-app.eclass: remove excess and fix style Anna (cybertailor) Vyalkova
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@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 3a26e6738..f6fb82034 100644
--- a/eclass/boinc-app.eclass
+++ b/eclass/boinc-app.eclass
@@ -1,384 +1,384 @@
 # Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: boinc-app.eclass
 # @MAINTAINER:
 # Anna Vyalkova <cyber+gentoo@sysrq.in>
 # @SUPPORTED_EAPIS: 8
 # @BLURB: base functions for installing BOINC applications
 # @DESCRIPTION:
 # This eclass provides base functions for installation of software developed
 # for the BOINC platform.
 #
 # Do not package *-bin applications as BOINC can handle them itself better.
 #
 # Note that BOINC won't detect a custom application unless you provide it with
 # app_info.xml file (see https://boinc.berkeley.edu/wiki/Anonymous_platform).
 # Attach to a project of your interest and use values from
 # /var/lib/boinc/client_state.xml to write the file.
 #
 # BOINC.Italy did a great job discovering sources of many BOINC applications:
 # https://www.boincitaly.org/progetti/sorgenti-progetti.html
 
 case ${EAPI} in
 	8) ;;
-	*) die "${ECLASS}: EAPI ${EAPI} unsupported."
+	*) die "${ECLASS}: EAPI ${EAPI:-0} unsupported"
 esac
 
 # @ECLASS_VARIABLE: BOINC_APP_OPTIONAL
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # If set to a non-null value, BOINC part in the ebuild will be
 # considered optional and no phase functions will be exported.
 #
 # If you enable BOINC_APP_OPTIONAL, you have to call boinc-app
 # default phase functions and add dependencies manually.
 
-if [[ ! ${BOINC_APP_OPTIONAL} ]]; then
-	EXPORT_FUNCTIONS pkg_postinst pkg_postrm
-fi
-
 if [[ ! ${_BOINC_APP_ECLASS} ]]; then
 
 # @ECLASS_VARIABLE: BOINC_MASTER_URL
 # @REQUIRED
 # @DESCRIPTION:
 # Each project is publicly identified by a master URL. It also serves
 # as the home page of the project.
 #
 # You need to look it up using the following command:
 # @CODE
 #	grep "<master_url>" /var/lib/boinc/client_state.xml
 # @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
 # @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
 # @DESCRIPTION:
 # Help message to display during the pkg_postinst phase
 : ${BOINC_APP_HELPTEXT:=\
 You have to attach to the corresponding project
 in order to use this application with BOINC.}
 
 # @ECLASS_VARIABLE: BOINC_RUNTIMEDIR
 # @USER_VARIABLE
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Directory with BOINC runtime data.
 
 # @FUNCTION: boinc-app_add_deps
 # @USAGE: [--wrapper]
 # @DESCRIPTION:
 # Generate appropriate IUSE and (R)DEPEND for wrapper-enabled or
 # native application.
 #
 # If BOINC_APP_OPTIONAL is set to a non-null value, dependencies
 # will be added for "boinc" USE-flag.
 boinc-app_add_deps() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	local depend rdepend
 	if [[ ${1} == "--wrapper" ]]; then
 		rdepend="sci-misc/boinc-wrapper"
 	else
 		depend="sci-misc/boinc"
 		rdepend="sci-misc/boinc"
 	fi
 
 	depend+=" acct-user/boinc"
 	rdepend+=" acct-user/boinc"
 
 	if [[ ${BOINC_APP_OPTIONAL} ]]; then
 		IUSE+=" boinc"
 		DEPEND+=" boinc? ( ${depend} )"
 		RDEPEND+=" boinc? ( ${rdepend} )"
 	else
 		DEPEND+=" ${depend}"
 		RDEPEND+=" ${rdepend}"
 	fi
 }
 
 # @FUNCTION: boinc_master_url_check
 # @USAGE:
 # @DESCRIPTION:
 # Make sure BOINC_MASTER_URL has a value.
 boinc_master_url_check() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ -n ${BOINC_MASTER_URL} ]] || \
 		die "BOINC_MASTER_URL is not set"
 	return 0
 }
 
 # @FUNCTION: get_boincdir
 # @USAGE:
 # @RETURN: non-prefixed BOINC runtime directory
 get_boincdir() {
 	echo "${BOINC_RUNTIMEDIR:-/var/lib/boinc}"
 }
 
 # @FUNCTION: get_project_dirname
 # @INTERNAL
 # @USAGE:
 # @RETURN: project's dirname, derived from BOINC_MASTER_URL
 # @DESCRIPTION:
 # Example:
 #
 # @CODE
 # BOINC_MASTER_URL="https://boinc.berkeley.edu/example/"
 # get_project_dirname
 # -> boinc.berkeley.edu_example
 # @CODE
 get_project_dirname() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	boinc_master_url_check
 
 	local dirname
 	dirname=${BOINC_MASTER_URL#*://}	# strip http[s]://
 	dirname=${dirname%/}			# strip trailing slash
 	dirname=${dirname////_}			# replace '/' with '_'
 
 	echo "${dirname}"
 }
 
 # @FUNCTION: get_project_root
 # @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)"
 }
 
 # @FUNCTION: _boinc-app_fix_permissions
 # @USAGE:
 # @INTERNAL
 # @DESCRIPTION:
 # Fix owner and permissions for the project root.
 _boinc-app_fix_permissions() {
 	local paths=(
 		$(get_boincdir)
 		$(get_boincdir)/projects
 		$(get_project_root)
 	)
 	fowners boinc:boinc "${paths[@]}"
 	fperms 0771 "${paths[@]}"
 }
 
 # @FUNCTION: boinc-app_appinfo_prepare
 # @USAGE: <writable app_info.xml>
 # @DESCRIPTION:
 # 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"
 }
 
 # @FUNCTION: boinc_install_appinfo
 # @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 #
 # Tip: implement appinfo_prepare() function for all your sed hacks.
 # It should recognize first argument as a file and edit it in place.
 #
 # Example:
 # @CODE
 # appinfo_prepare() {
 # 	if ! use cuda; then
 # 		sed "/<plan_class>cuda/d" -i "$1" || die
 # 	fi
 # 	boinc-app_appinfo_prepare "$1"
 # }
 #
 # src_install() {
 # 	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 #
 #	exeinto $(get_project_root)
 # 	exeopts -m 0755 --owner root --group boinc
 # 	newexe bin/${PN} example_app_v1.0
 # }
 # @CODE
 boinc_install_appinfo() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# == 1 )) || \
 		die "${FUNCNAME} takes exactly one argument"
 
 	cp "${1:?}" "${T:?}"/app_info.xml || die
 
 	if declare -f appinfo_prepare >/dev/null; then
 		appinfo_prepare "${T:?}"/app_info.xml
 	else
 		boinc-app_appinfo_prepare "${T:?}"/app_info.xml
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}"/app_info.xml
 	) || die "failed to install app_info.xml"
 
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: doappinfo
 # @DEPRECATED: boinc_install_appinfo
 # @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 doappinfo() {
 	boinc_install_appinfo "${@}"
 }
 
 # @FUNCTION: boinc-app_foreach_wrapper_job
 # @USAGE: <job>
 # @DESCRIPTION:
 # The default foreach_wrapper_job(). It replaces all occurences
 # of @PV@, @EPREFIX@ and @LIBDIR@ strings with their corresponding values.
 boinc-app_foreach_wrapper_job() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	sed -i "${1:?}" \
 		-e "s:@PV@:${PV}:g" \
 		-e "s:@EPREFIX@:${EPREFIX}:g" \
 		-e "s:@LIBDIR@:$(get_libdir):g" \
 		|| die "$(basename "${1}") sed failed"
 }
 
 # @FUNCTION: boinc_install_wrapper
 # @USAGE: <bin> <job> [new name]
 # @DESCRIPTION:
 # This function provides a uniform way to install wrapper applications
 # for BOINC projects. It makes symlinks to the BOINC wrapper and also
 # installs respective job.xml files.
 #
 # When `dowrapper boinc-example_wrapper A.xml B.xml` is called, it:
 #
 # 1. Installs A.xml in the project's root directory, renaming it to B.xml
 #
 # 2. Installs boinc-example_wrapper symlink, which points
 #    to /usr/bin/boinc-wrapper, in the project's root directory
 #
 # Example:
 # @CODE
 # src_install() {
 # 	meson_src_install
 #
 # 	boinc_install_wrapper boinc-example_wrapper "${FILESDIR}"/job.xml
 #	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 # }
 # @CODE
 #
 # Keep your job.xml files in sync with app_info.xml!
 boinc_install_wrapper() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# >= 2 && $# <= 3 )) || \
 		die "${FUNCNAME} got wrong number of arguments"
 
 	local exe="${1:?}"
 	local job="${2:?}"
 	local job_dest="${3:-$(basename "${job:?}")}"
 
 	cp "${job:?}" "${T:?}/${job_dest:?}" || die
 	if declare -f foreach_wrapper_job >/dev/null; then
 		foreach_wrapper_job "${T:?}/${job_dest:?}"
 	else
 		boinc-app_foreach_wrapper_job "${T:?}/${job_dest:?}"
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}/${job_dest:?}"
 	) || die "failed to install ${exe:?} wrapper job"
 	rm -f "${T:?}/${job_dest:?}"
 
 	dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${exe:?}"
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: dowrapper
 # @DEPRECATED: boinc_install_wrapper
 # @DESCRIPTION:
 # Install BOINC wrappers and job definitions.
 dowrapper() {
 	die "${FUNCNAME} has been removed, please use boinc_install_wrapper instead"
 }
 
 # @FUNCTION: boinc-app_pkg_postinst
 # @DESCRIPTION:
 # 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 [[ -z ${REPLACING_VERSIONS} ]]; then
 			# most likely replacing applications downloaded
 			# by the BOINC client from project's website
 			elog "Restart the BOINC daemon for changes to take place:"
 			elog "# rc-service boinc restart"
 			return
 		else
 			# applications are already in use
 			return
 		fi
 	fi
 
 	elog
 	while read h; do
 		elog "${h}"
 	done <<<"${BOINC_APP_HELPTEXT}"
 	elog
 
 	if [[ ! ${BOINC_INVITATION_CODE} ]]; then
 		elog "# rc-service boinc attach"
 		elog "    Enter the Project URL: ${BOINC_MASTER_URL}"
 	else
 		elog "- Master URL: ${BOINC_MASTER_URL}"
 		elog "- Invitation code: ${BOINC_INVITATION_CODE}"
 	fi
 }
 
 # @FUNCTION: boinc-app_pkg_postrm
 # @DESCRIPTION:
 # Display helpful instructions on how to cleanly uninstall unmerged
 # applications.
 boinc-app_pkg_postrm() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ -z ${REPLACED_BY_VERSION} ]]; then
 		local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg"
 		local passwd=$(cat "${EROOT}/${gui_rpc_auth}" 2>/dev/null)
 		if [[ -z ${passwd} ]]; then
 			passwd="\$(cat ${gui_rpc_auth})"
 		fi
 
 		elog "You should detach this project from the BOINC client"
 		elog "to stop current tasks and delete remaining project files:"
 		elog
 		elog "$ boinccmd --passwd ${passwd} --project ${BOINC_MASTER_URL} detach"
 		elog
 	fi
 }
 
 _BOINC_APP_ECLASS=1
 fi
+
+if [[ ! ${BOINC_APP_OPTIONAL} ]]; then
+	EXPORT_FUNCTIONS pkg_postinst pkg_postrm
+fi
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 7/9] boinc-app.eclass: remove excess and fix style
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
                   ` (5 preceding siblings ...)
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 6/9] boinc-app.eclass: use standard inherit guard style Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 8/9] sci-biology/cmdock: drop 0.2.0-r0 Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 9/9] sci-biology/cmdock: boinc fixes Anna (cybertailor) Vyalkova
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
---
 eclass/boinc-app.eclass | 56 ++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 35 deletions(-)

diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass
index f6fb82034..822c84397 100644
--- a/eclass/boinc-app.eclass
+++ b/eclass/boinc-app.eclass
@@ -1,384 +1,370 @@
 # Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: boinc-app.eclass
 # @MAINTAINER:
 # Anna Vyalkova <cyber+gentoo@sysrq.in>
 # @SUPPORTED_EAPIS: 8
 # @BLURB: base functions for installing BOINC applications
 # @DESCRIPTION:
 # This eclass provides base functions for installation of software developed
 # for the BOINC platform.
 #
 # Do not package *-bin applications as BOINC can handle them itself better.
 #
 # Note that BOINC won't detect a custom application unless you provide it with
 # app_info.xml file (see https://boinc.berkeley.edu/wiki/Anonymous_platform).
 # Attach to a project of your interest and use values from
 # /var/lib/boinc/client_state.xml to write the file.
 #
 # BOINC.Italy did a great job discovering sources of many BOINC applications:
 # https://www.boincitaly.org/progetti/sorgenti-progetti.html
 
 case ${EAPI} in
 	8) ;;
 	*) die "${ECLASS}: EAPI ${EAPI:-0} unsupported"
 esac
 
 # @ECLASS_VARIABLE: BOINC_APP_OPTIONAL
+# @PRE_INHERIT
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # If set to a non-null value, BOINC part in the ebuild will be
 # considered optional and no phase functions will be exported.
 #
 # If you enable BOINC_APP_OPTIONAL, you have to call boinc-app
 # default phase functions and add dependencies manually.
 
 if [[ ! ${_BOINC_APP_ECLASS} ]]; then
 
 # @ECLASS_VARIABLE: BOINC_MASTER_URL
 # @REQUIRED
 # @DESCRIPTION:
 # Each project is publicly identified by a master URL. It also serves
 # as the home page of the project.
 #
 # You need to look it up using the following command:
 # @CODE
 #	grep "<master_url>" /var/lib/boinc/client_state.xml
 # @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
+# @OUTPUT_VARIABLE
 # @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
 # @DESCRIPTION:
 # Help message to display during the pkg_postinst phase
 : ${BOINC_APP_HELPTEXT:=\
 You have to attach to the corresponding project
 in order to use this application with BOINC.}
 
 # @ECLASS_VARIABLE: BOINC_RUNTIMEDIR
 # @USER_VARIABLE
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Directory with BOINC runtime data.
 
 # @FUNCTION: boinc-app_add_deps
 # @USAGE: [--wrapper]
 # @DESCRIPTION:
 # Generate appropriate IUSE and (R)DEPEND for wrapper-enabled or
 # native application.
 #
 # If BOINC_APP_OPTIONAL is set to a non-null value, dependencies
 # will be added for "boinc" USE-flag.
 boinc-app_add_deps() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	local depend rdepend
 	if [[ ${1} == "--wrapper" ]]; then
 		rdepend="sci-misc/boinc-wrapper"
 	else
 		depend="sci-misc/boinc"
 		rdepend="sci-misc/boinc"
 	fi
 
 	depend+=" acct-user/boinc"
 	rdepend+=" acct-user/boinc"
 
 	if [[ ${BOINC_APP_OPTIONAL} ]]; then
 		IUSE+=" boinc"
 		DEPEND+=" boinc? ( ${depend} )"
 		RDEPEND+=" boinc? ( ${rdepend} )"
 	else
 		DEPEND+=" ${depend}"
 		RDEPEND+=" ${rdepend}"
 	fi
 }
 
-# @FUNCTION: boinc_master_url_check
-# @USAGE:
-# @DESCRIPTION:
-# Make sure BOINC_MASTER_URL has a value.
-boinc_master_url_check() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	[[ -n ${BOINC_MASTER_URL} ]] || \
-		die "BOINC_MASTER_URL is not set"
-	return 0
-}
-
 # @FUNCTION: get_boincdir
-# @USAGE:
 # @RETURN: non-prefixed BOINC runtime directory
 get_boincdir() {
 	echo "${BOINC_RUNTIMEDIR:-/var/lib/boinc}"
 }
 
 # @FUNCTION: get_project_dirname
 # @INTERNAL
-# @USAGE:
 # @RETURN: project's dirname, derived from BOINC_MASTER_URL
 # @DESCRIPTION:
 # Example:
 #
 # @CODE
 # BOINC_MASTER_URL="https://boinc.berkeley.edu/example/"
 # get_project_dirname
 # -> boinc.berkeley.edu_example
 # @CODE
 get_project_dirname() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	boinc_master_url_check
+	[[ ${BOINC_MASTER_URL} ]] || \
+		die "BOINC_MASTER_URL is not set"
 
 	local dirname
 	dirname=${BOINC_MASTER_URL#*://}	# strip http[s]://
 	dirname=${dirname%/}			# strip trailing slash
 	dirname=${dirname////_}			# replace '/' with '_'
 
 	echo "${dirname}"
 }
 
 # @FUNCTION: get_project_root
-# @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)"
 }
 
 # @FUNCTION: _boinc-app_fix_permissions
-# @USAGE:
 # @INTERNAL
 # @DESCRIPTION:
 # Fix owner and permissions for the project root.
 _boinc-app_fix_permissions() {
 	local paths=(
 		$(get_boincdir)
 		$(get_boincdir)/projects
 		$(get_project_root)
 	)
 	fowners boinc:boinc "${paths[@]}"
 	fperms 0771 "${paths[@]}"
 }
 
 # @FUNCTION: boinc-app_appinfo_prepare
-# @USAGE: <writable app_info.xml>
+# @USAGE: <app_info>
 # @DESCRIPTION:
 # 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" \
+	(( $# == 1 )) || \
+		die "${FUNCNAME} takes exactly one argument"
+
+	sed -i "${1:?}" \
 		-e "s:@PV@:${PV}:g" \
 		|| die "app_info.xml sed failed"
 }
 
 # @FUNCTION: boinc_install_appinfo
 # @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 #
 # Tip: implement appinfo_prepare() function for all your sed hacks.
 # It should recognize first argument as a file and edit it in place.
 #
 # Example:
 # @CODE
 # appinfo_prepare() {
 # 	if ! use cuda; then
 # 		sed "/<plan_class>cuda/d" -i "$1" || die
 # 	fi
 # 	boinc-app_appinfo_prepare "$1"
 # }
 #
 # src_install() {
 # 	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 #
 #	exeinto $(get_project_root)
 # 	exeopts -m 0755 --owner root --group boinc
 # 	newexe bin/${PN} example_app_v1.0
 # }
 # @CODE
 boinc_install_appinfo() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# == 1 )) || \
 		die "${FUNCNAME} takes exactly one argument"
 
 	cp "${1:?}" "${T:?}"/app_info.xml || die
 
 	if declare -f appinfo_prepare >/dev/null; then
 		appinfo_prepare "${T:?}"/app_info.xml
 	else
 		boinc-app_appinfo_prepare "${T:?}"/app_info.xml
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}"/app_info.xml
 	) || die "failed to install app_info.xml"
 
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: doappinfo
 # @DEPRECATED: boinc_install_appinfo
 # @USAGE: <app_info>
 # @DESCRIPTION:
 # Installs given app_info.xml file to the project root.
 doappinfo() {
 	boinc_install_appinfo "${@}"
 }
 
 # @FUNCTION: boinc-app_foreach_wrapper_job
 # @USAGE: <job>
 # @DESCRIPTION:
 # The default foreach_wrapper_job(). It replaces all occurences
 # of @PV@, @EPREFIX@ and @LIBDIR@ strings with their corresponding values.
 boinc-app_foreach_wrapper_job() {
 	debug-print-function ${FUNCNAME} "${@}"
 
+	(( $# == 1 )) || \
+		die "${FUNCNAME} takes exactly one argument"
+
 	sed -i "${1:?}" \
 		-e "s:@PV@:${PV}:g" \
 		-e "s:@EPREFIX@:${EPREFIX}:g" \
 		-e "s:@LIBDIR@:$(get_libdir):g" \
 		|| die "$(basename "${1}") sed failed"
 }
 
 # @FUNCTION: boinc_install_wrapper
 # @USAGE: <bin> <job> [new name]
 # @DESCRIPTION:
 # This function provides a uniform way to install wrapper applications
 # for BOINC projects. It makes symlinks to the BOINC wrapper and also
 # installs respective job.xml files.
 #
 # When `dowrapper boinc-example_wrapper A.xml B.xml` is called, it:
 #
 # 1. Installs A.xml in the project's root directory, renaming it to B.xml
 #
 # 2. Installs boinc-example_wrapper symlink, which points
 #    to /usr/bin/boinc-wrapper, in the project's root directory
 #
 # Example:
 # @CODE
 # src_install() {
 # 	meson_src_install
 #
 # 	boinc_install_wrapper boinc-example_wrapper "${FILESDIR}"/job.xml
 #	boinc_install_appinfo "${FILESDIR}"/app_info_1.0.xml
 # }
 # @CODE
 #
 # Keep your job.xml files in sync with app_info.xml!
 boinc_install_wrapper() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	(( $# >= 2 && $# <= 3 )) || \
 		die "${FUNCNAME} got wrong number of arguments"
 
 	local exe="${1:?}"
 	local job="${2:?}"
 	local job_dest="${3:-$(basename "${job:?}")}"
 
 	cp "${job:?}" "${T:?}/${job_dest:?}" || die
 	if declare -f foreach_wrapper_job >/dev/null; then
 		foreach_wrapper_job "${T:?}/${job_dest:?}"
 	else
 		boinc-app_foreach_wrapper_job "${T:?}/${job_dest:?}"
 	fi
 
 	( # subshell to avoid pollution of calling environment
 		insinto "$(get_project_root)"
 		insopts -m 0644 --owner root --group boinc
 		doins "${T:?}/${job_dest:?}"
 	) || die "failed to install ${exe:?} wrapper job"
 	rm -f "${T:?}/${job_dest:?}"
 
 	dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${exe:?}"
 	_boinc-app_fix_permissions
 }
 
 # @FUNCTION: dowrapper
 # @DEPRECATED: boinc_install_wrapper
 # @DESCRIPTION:
 # Install BOINC wrappers and job definitions.
 dowrapper() {
 	die "${FUNCNAME} has been removed, please use boinc_install_wrapper instead"
 }
 
 # @FUNCTION: boinc-app_pkg_postinst
 # @DESCRIPTION:
 # 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 [[ -z ${REPLACING_VERSIONS} ]]; then
+		if [[ ! ${REPLACING_VERSIONS} ]]; then
 			# most likely replacing applications downloaded
 			# by the BOINC client from project's website
 			elog "Restart the BOINC daemon for changes to take place:"
 			elog "# rc-service boinc restart"
-			return
-		else
-			# applications are already in use
-			return
 		fi
+		return
 	fi
 
 	elog
 	while read h; do
 		elog "${h}"
 	done <<<"${BOINC_APP_HELPTEXT}"
 	elog
 
 	if [[ ! ${BOINC_INVITATION_CODE} ]]; then
 		elog "# rc-service boinc attach"
-		elog "    Enter the Project URL: ${BOINC_MASTER_URL}"
+		elog "    Enter the Project URL: ${BOINC_MASTER_URL:?}"
 	else
-		elog "- Master URL: ${BOINC_MASTER_URL}"
-		elog "- Invitation code: ${BOINC_INVITATION_CODE}"
+		elog "- Master URL: ${BOINC_MASTER_URL:?}"
+		elog "- Invitation code: ${BOINC_INVITATION_CODE:?}"
 	fi
 }
 
 # @FUNCTION: boinc-app_pkg_postrm
 # @DESCRIPTION:
 # Display helpful instructions on how to cleanly uninstall unmerged
 # applications.
 boinc-app_pkg_postrm() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-	if [[ -z ${REPLACED_BY_VERSION} ]]; then
+	if [[ ! ${REPLACED_BY_VERSION} ]]; then
 		local gui_rpc_auth="$(get_boincdir)/gui_rpc_auth.cfg"
 		local passwd=$(cat "${EROOT}/${gui_rpc_auth}" 2>/dev/null)
-		if [[ -z ${passwd} ]]; then
-			passwd="\$(cat ${gui_rpc_auth})"
+		if [[ ! ${passwd?} ]]; then
+			passwd="\$(cat ${gui_rpc_auth:?})"
 		fi
 
 		elog "You should detach this project from the BOINC client"
 		elog "to stop current tasks and delete remaining project files:"
 		elog
-		elog "$ boinccmd --passwd ${passwd} --project ${BOINC_MASTER_URL} detach"
+		elog "$ boinccmd --passwd ${passwd:?} --project ${BOINC_MASTER_URL:?} detach"
 		elog
 	fi
 }
 
 _BOINC_APP_ECLASS=1
 fi
 
 if [[ ! ${BOINC_APP_OPTIONAL} ]]; then
 	EXPORT_FUNCTIONS pkg_postinst pkg_postrm
 fi
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 8/9] sci-biology/cmdock: drop 0.2.0-r0
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
                   ` (6 preceding siblings ...)
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 7/9] boinc-app.eclass: remove excess and fix style Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 9/9] sci-biology/cmdock: boinc fixes Anna (cybertailor) Vyalkova
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
---
 sci-biology/cmdock/cmdock-0.2.0.ebuild | 112 -------------------------
 1 file changed, 112 deletions(-)
 delete mode 100644 sci-biology/cmdock/cmdock-0.2.0.ebuild

diff --git a/sci-biology/cmdock/cmdock-0.2.0.ebuild b/sci-biology/cmdock/cmdock-0.2.0.ebuild
deleted file mode 100644
index 3d1c2f035..000000000
--- a/sci-biology/cmdock/cmdock-0.2.0.ebuild
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright 2021-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{10..12} )
-BOINC_APP_OPTIONAL="true"
-inherit boinc-app flag-o-matic meson optfeature python-any-r1
-
-DESCRIPTION="Program for docking ligands to proteins and nucleic acids"
-HOMEPAGE="https://gitlab.com/Jukic/cmdock"
-SRC_URI="https://gitlab.com/Jukic/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.bz2"
-S="${WORKDIR}/${PN}-v${PV}"
-
-LICENSE="LGPL-3 ZLIB"
-SLOT="0/${PV}"
-KEYWORDS="~amd64"
-IUSE="apidoc boinc cpu_flags_x86_sse2 doc test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
-	boinc? ( sci-misc/boinc-wrapper )
-"
-DEPEND="
-	dev-cpp/eigen:3
-	dev-cpp/indicators
-	>=dev-cpp/pcg-cpp-0.98.1_p20210406-r1
-	dev-libs/cxxopts
-"
-BDEPEND="
-	apidoc? (
-		app-text/doxygen
-		dev-texlive/texlive-fontutils
-	)
-	doc? (
-		$(python_gen_any_dep '
-			dev-python/insipid-sphinx-theme[${PYTHON_USEDEP}]
-			dev-python/sphinx[${PYTHON_USEDEP}]
-		')
-	)
-	test? ( ${PYTHON_DEPS} )
-"
-
-DOCS=( README.md changelog.md )
-
-BOINC_MASTER_URL="https://www.sidock.si/sidock/"
-BOINC_INVITATION_CODE="Crunch_4Science"
-BOINC_APP_HELPTEXT=\
-"The easiest way to do something useful with this application
-is to attach it to SiDock@home BOINC project."
-
-INSTALL_PREFIX="${EPREFIX}/opt/${P}"
-
-python_check_deps() {
-	use doc || return 0
-
-	python_has_version "dev-python/sphinx[${PYTHON_USEDEP}]" &&
-	python_has_version "dev-python/insipid-sphinx-theme[${PYTHON_USEDEP}]"
-}
-
-foreach_wrapper_job() {
-	sed -e "s:@PREFIX@:${INSTALL_PREFIX}:g" -i "${1}" || die
-}
-
-src_prepare() {
-	default
-	python_fix_shebang "${S}"/bin
-}
-
-src_configure() {
-	# very weird directory layout
-	local emesonargs=(
-		--prefix="${INSTALL_PREFIX}"
-		$(meson_use apidoc)
-		$(meson_use doc)
-		$(meson_use test tests)
-		-Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
-	)
-	meson_src_configure
-
-	use cpu_flags_x86_sse2 || append-cppflags "-DBUNDLE_NO_SSE"
-}
-
-src_install() {
-	meson_src_install
-	python_optimize "${D}${INSTALL_PREFIX}"/bin
-
-	if use boinc; then
-		doappinfo "${FILESDIR}"/app_info_${PV}.xml
-		dowrapper cmdock-l
-
-		# install cmdock executable
-		exeinto "$(get_project_root)"
-		exeopts --owner root --group boinc
-		newexe "${D}${INSTALL_PREFIX}"/bin/cmdock cmdock-${PV}
-
-		# install a blank file
-		touch "${T}"/docking_out || die
-		insinto "$(get_project_root)"
-		insopts --owner root --group boinc
-		doins "${T}"/docking_out
-	fi
-}
-
-pkg_postinst() {
-	optfeature "sdtether.py and sdrmsd.py scripts" "dev-python/numpy sci-chemistry/openbabel[python]"
-	use boinc && boinc-app_pkg_postinst
-}
-
-pkg_postrm() {
-	use boinc && boinc-app_pkg_postrm
-}
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-guru] [PATCH 9/9] sci-biology/cmdock: boinc fixes
  2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
                   ` (7 preceding siblings ...)
  2024-07-12 14:55 ` [gentoo-guru] [PATCH 8/9] sci-biology/cmdock: drop 0.2.0-r0 Anna (cybertailor) Vyalkova
@ 2024-07-12 14:55 ` Anna (cybertailor) Vyalkova
  8 siblings, 0 replies; 10+ messages in thread
From: Anna (cybertailor) Vyalkova @ 2024-07-12 14:55 UTC (permalink / raw
  To: gentoo-guru

* Update cmdline to the upstream current.

* Sync with boinc-app.eclass updates.

Closes: https://bugs.gentoo.org/935231
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
---
 ...0.2.0-r1.ebuild => cmdock-0.2.0-r2.ebuild} | 25 +++++++++----------
 ...p_info_0.2.0.xml => app_info_0.2.0-r1.xml} | 14 +++++------
 ...ob_0.2.0.xml => cmdock-l_job_0.2.0-r1.xml} |  2 +-
 3 files changed, 20 insertions(+), 21 deletions(-)
 rename sci-biology/cmdock/{cmdock-0.2.0-r1.ebuild => cmdock-0.2.0-r2.ebuild} (83%)
 rename sci-biology/cmdock/files/{app_info_0.2.0.xml => app_info_0.2.0-r1.xml} (68%)
 rename sci-biology/cmdock/files/{cmdock-l_job_0.2.0.xml => cmdock-l_job_0.2.0-r1.xml} (77%)

diff --git a/sci-biology/cmdock/cmdock-0.2.0-r1.ebuild b/sci-biology/cmdock/cmdock-0.2.0-r2.ebuild
similarity index 83%
rename from sci-biology/cmdock/cmdock-0.2.0-r1.ebuild
rename to sci-biology/cmdock/cmdock-0.2.0-r2.ebuild
index f46747447..55e83bffb 100644
--- a/sci-biology/cmdock/cmdock-0.2.0-r1.ebuild
+++ b/sci-biology/cmdock/cmdock-0.2.0-r2.ebuild
@@ -1,119 +1,118 @@
 # Copyright 2021-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
-BOINC_APP_OPTIONAL="true"
+BOINC_APP_OPTIONAL=1
 inherit boinc-app flag-o-matic meson optfeature python-any-r1
 
 DESCRIPTION="Program for docking ligands to proteins and nucleic acids"
 HOMEPAGE="https://gitlab.com/Jukic/cmdock"
 SRC_URI="https://gitlab.com/Jukic/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.bz2"
 S="${WORKDIR}/${PN}-v${PV}"
 
 LICENSE="LGPL-3 ZLIB"
 SLOT="0/${PV}"
 KEYWORDS="~amd64"
-IUSE="apidoc boinc cpu_flags_x86_sse2 doc test"
+IUSE="apidoc cpu_flags_x86_sse2 doc test"
 
 # Flaky tests
 RESTRICT="test"
 
-RDEPEND="
-	boinc? ( sci-misc/boinc-wrapper )
-"
 DEPEND="
 	dev-cpp/eigen:3
 	>=dev-cpp/indicators-2.3-r1
 	>=dev-cpp/pcg-cpp-0.98.1_p20210406-r1
 	>=dev-libs/cxxopts-3
 "
 BDEPEND="
 	apidoc? (
 		app-text/doxygen
 		dev-texlive/texlive-fontutils
 	)
 	doc? (
 		$(python_gen_any_dep '
 			dev-python/insipid-sphinx-theme[${PYTHON_USEDEP}]
 			dev-python/sphinx[${PYTHON_USEDEP}]
 		')
 	)
 	test? ( ${PYTHON_DEPS} )
 "
 
 PATCHES=(
 	"${FILESDIR}"/${P}-include.patch
 	"${FILESDIR}"/${P}-cxxopts.patch
 )
 
 DOCS=( README.md changelog.md )
 
 BOINC_MASTER_URL="https://www.sidock.si/sidock/"
 BOINC_INVITATION_CODE="Crunch_4Science"
 BOINC_APP_HELPTEXT=\
 "The easiest way to do something useful with this application
 is to attach it to SiDock@home BOINC project."
 
 INSTALL_PREFIX="${EPREFIX}/opt/${P}"
 
+boinc-app_add_deps
+
 python_check_deps() {
 	use doc || return 0
 
 	python_has_version "dev-python/sphinx[${PYTHON_USEDEP}]" &&
 	python_has_version "dev-python/insipid-sphinx-theme[${PYTHON_USEDEP}]"
 }
 
 foreach_wrapper_job() {
 	sed -e "s:@PREFIX@:${INSTALL_PREFIX}:g" -i "${1}" || die
 }
 
 src_prepare() {
 	default
 	python_fix_shebang "${S}"/bin
 }
 
 src_configure() {
 	# very weird directory layout
 	local emesonargs=(
-		--prefix="${INSTALL_PREFIX}"
+		--prefix="${INSTALL_PREFIX:?}"
 		$(meson_use apidoc)
 		$(meson_use doc)
 		$(meson_use test tests)
 		-Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
 	)
 	meson_src_configure
 
 	use cpu_flags_x86_sse2 || append-cppflags "-DBUNDLE_NO_SSE"
 }
 
 src_install() {
 	meson_src_install
-	python_optimize "${D}${INSTALL_PREFIX}"/bin
+	python_optimize "${D}${INSTALL_PREFIX:?}"/bin
 
 	if use boinc; then
-		doappinfo "${FILESDIR}"/app_info_${PV}.xml
-		dowrapper cmdock-l
+		boinc_install_appinfo "${FILESDIR}"/app_info_0.2.0-r1.xml
+		boinc_install_wrapper cmdock-l_wrapper \
+			"${FILESDIR}"/cmdock-l_job_0.2.0-r1.xml cmdock-l_job.xml
 
 		# install cmdock executable
 		exeinto "$(get_project_root)"
 		exeopts --owner root --group boinc
-		newexe "${D}${INSTALL_PREFIX}"/bin/cmdock cmdock-${PV}
+		doexe "${D}${INSTALL_PREFIX:?}"/bin/cmdock
 
 		# install a blank file
-		touch "${T}"/docking_out || die
 		insinto "$(get_project_root)"
-		insopts --owner root --group boinc
-		doins "${T}"/docking_out
+		insopts -m 0644 --owner root --group boinc
+		newins - docking_out
 	fi
 }
 
 pkg_postinst() {
 	optfeature "sdtether.py and sdrmsd.py scripts" "dev-python/numpy sci-chemistry/openbabel[python]"
 	use boinc && boinc-app_pkg_postinst
 }
 
 pkg_postrm() {
 	use boinc && boinc-app_pkg_postrm
 }
diff --git a/sci-biology/cmdock/files/app_info_0.2.0.xml b/sci-biology/cmdock/files/app_info_0.2.0-r1.xml
similarity index 68%
rename from sci-biology/cmdock/files/app_info_0.2.0.xml
rename to sci-biology/cmdock/files/app_info_0.2.0-r1.xml
index ad23f7890..b9eb040fb 100644
--- a/sci-biology/cmdock/files/app_info_0.2.0.xml
+++ b/sci-biology/cmdock/files/app_info_0.2.0-r1.xml
@@ -1,50 +1,50 @@
 <app_info>
 <app>
 	<name>cmdock-l</name>
-	<user_friendly_name>CurieMarieDock 0.2.0 long tasks</user_friendly_name>
+	<user_friendly_name>CurieMarieDock @PV@ long tasks</user_friendly_name>
 </app>
 
 <file_info>
-	<name>cmdock-l_wrapper_@PV@</name>
+	<name>cmdock-l_wrapper</name>
 	<sticky/>
 	<executable/>
 </file_info>
 <file_info>
-	<name>cmdock-@PV@</name>
+	<name>cmdock</name>
 	<sticky/>
 	<executable/>
 </file_info>
 
 <file_info>
-	<name>cmdock-l_job_@PV@.xml</name>
+	<name>cmdock-l_job.xml</name>
 	<sticky/>
 </file_info>
 <file_info>
 	<name>docking_out</name>
 	<sticky/>
 </file_info>
 
 <app_version>
 	<app_name>cmdock-l</app_name>
 	<version_num>100</version_num>
 	<file_ref>
-		<file_name>cmdock-l_wrapper_@PV@</file_name>
+		<file_name>cmdock-l_wrapper</file_name>
 		<main_program/>
 	</file_ref>
 	<file_ref>
-		<file_name>cmdock-@PV@</file_name>
+		<file_name>cmdock</file_name>
 		<open_name>cmdock</open_name>
 		<copy_file/>
 	</file_ref>
 	<file_ref>
-		<file_name>cmdock-l_job_@PV@.xml</file_name>
+		<file_name>cmdock-l_job.xml</file_name>
 		<open_name>job.xml</open_name>
 		<copy_file/>
 	</file_ref>
 	<file_ref>
 		<file_name>docking_out</file_name>
 		<open_name>docking_out</open_name>
 		<copy_file/>
 	</file_ref>
 </app_version>
 </app_info>
diff --git a/sci-biology/cmdock/files/cmdock-l_job_0.2.0.xml b/sci-biology/cmdock/files/cmdock-l_job_0.2.0-r1.xml
similarity index 77%
rename from sci-biology/cmdock/files/cmdock-l_job_0.2.0.xml
rename to sci-biology/cmdock/files/cmdock-l_job_0.2.0-r1.xml
index a163eb29c..6d626fb82 100644
--- a/sci-biology/cmdock/files/cmdock-l_job_0.2.0.xml
+++ b/sci-biology/cmdock/files/cmdock-l_job_0.2.0-r1.xml
@@ -1,15 +1,15 @@
 <job_desc>
 	<task>
 		<application>cmdock</application>
 		<stdout_filename>docking_log</stdout_filename>
-		<command_line>-c -j 1 -b 1 -x -r target.prm -p "@PREFIX@/data/scripts/dock.prm" -f htvs.ptc -i ligands.sdf -o docking_out</command_line>
+		<command_line>-c -j 1 -b 1 -r target.prm -p "@PREFIX@/data/scripts/dock.prm" -f htvs.ptc -i ligands.sdf -o docking_out</command_line>
 		<checkpoint_filename>docking_out.chk</checkpoint_filename>
 		<fraction_done_filename>docking_out.progress</fraction_done_filename>
 		<setenv>CMDOCK_ROOT=@PREFIX@</setenv>
 		<setenv>LD_LIBRARY_PATH=@PREFIX@/lib:$LD_LIBRARY_PATH</setenv>
 		<setenv>PERL5LIB=@PREFIX@/lib:$PERL5LIB</setenv>
 	</task>
 	<unzip_input>
 		<zipfilename>ligands.zip</zipfilename>
 	</unzip_input>
 </job_desc>
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-11-24 22:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 14:55 [gentoo-guru] [PATCH 0/10] boinc-app.eclass updates Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 1/9] boinc-app.eclass: better wrapper install function Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 2/9] boinc-app.eclass: rename boinc-wrapper_foreach_wrapper_job Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 3/9] boinc-app.eclass: rename doappinfo → boinc_install_appinfo Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 4/9] boinc-app.eclass: allow non-standard runtime dir Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 5/9] boinc-app.eclass: allow to set deps for boinc-optional apps Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 6/9] boinc-app.eclass: use standard inherit guard style Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 7/9] boinc-app.eclass: remove excess and fix style Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 8/9] sci-biology/cmdock: drop 0.2.0-r0 Anna (cybertailor) Vyalkova
2024-07-12 14:55 ` [gentoo-guru] [PATCH 9/9] sci-biology/cmdock: boinc fixes Anna (cybertailor) Vyalkova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox