From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A1CF0158091 for ; Wed, 11 May 2022 11:29:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 58EFCE08EF; Wed, 11 May 2022 11:29:23 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BA5ACE0934 for ; Wed, 11 May 2022 11:29:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 596433419EF for ; Wed, 11 May 2022 11:29:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7D025389 for ; Wed, 11 May 2022 11:29:19 +0000 (UTC) From: "Alessandro Barbieri" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alessandro Barbieri" Message-ID: <1652268557.5778e18ce802eadc134be8da814893287fd06d8c.Alessandro-Barbieri@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/octaveforge.eclass X-VCS-Directories: eclass/ X-VCS-Committer: Alessandro-Barbieri X-VCS-Committer-Name: Alessandro Barbieri X-VCS-Revision: 5778e18ce802eadc134be8da814893287fd06d8c X-VCS-Branch: dev Date: Wed, 11 May 2022 11:29:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 36778e01-7419-44db-b417-5252f689c9a2 X-Archives-Hash: b0b9a4678a69652426ef4828d642da60 commit: 5778e18ce802eadc134be8da814893287fd06d8c Author: Alessandro Barbieri gmail com> AuthorDate: Wed May 11 10:18:19 2022 +0000 Commit: Alessandro Barbieri gmail com> CommitDate: Wed May 11 11:29:17 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5778e18c octaveforge.eclass: add octaveforge_src_test() Closes: https://bugs.gentoo.org/843536 Closes: https://bugs.gentoo.org/843521 Closes: https://bugs.gentoo.org/843518 Closes: https://bugs.gentoo.org/843515 Closes: https://bugs.gentoo.org/843512 Closes: https://bugs.gentoo.org/843509 Closes: https://bugs.gentoo.org/843503 Closes: https://bugs.gentoo.org/843500 Closes: https://bugs.gentoo.org/843497 Signed-off-by: Alessandro Barbieri gmail.com> eclass/octaveforge.eclass | 125 +++++++++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 57 deletions(-) diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass index fb708e3a7..bb6176be9 100644 --- a/eclass/octaveforge.eclass +++ b/eclass/octaveforge.eclass @@ -17,7 +17,7 @@ case ${EAPI} in *) die "${ECLASS}: EAPI ${EAPI} unsupported." esac -EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_prerm pkg_postrm +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install src_test pkg_postinst pkg_prerm pkg_postrm # @ECLASS-VARIABLE: REPO_URI # @DESCRIPTION: @@ -103,65 +103,21 @@ octaveforge_src_compile() { # @FUNCTION: octaveforge_src_install # @DESCRIPTION: # function to install the octave package -# documentation to docsdir octaveforge_src_install() { - TMPDIR="${T}" - DESTDIR="${D}" - DISTPKG='Gentoo' + DESTDIR="${D}" _octaveforge_pkg_install || die +} - pushd ../ || die - if [[ "X${DISTPKG}X" != "XX" ]]; then - stripcmd=" - unlink(pkg('local_list')); - unlink(pkg('global_list')); - " - fi - if [[ "X${DESTDIR}X" = "XX" ]]; then - cmd=" - warning('off','all'); - pkg('install','${OCT_PACKAGE}'); - l=pkg('list'); - disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); - ${stripcmd} - " - oct_pkgdir=$(octavecommand "${cmd}" || die) - else - cmd="disp(fullfile(__octave_config_info__('datadir'),'octave'));" - shareprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) - cmd="disp(fullfile(__octave_config_info__('libdir'),'octave'));" - libprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) - octprefix="${shareprefix}/packages" || die - archprefix="${libprefix}/packages" || die - if [[ ! -e "${octprefix}" ]]; then - mkdir -p "${octprefix}" || die - fi - if [[ ! -e "${archprefix}" ]]; then - mkdir -p "${archprefix}" || die - fi - cmd=" - warning('off','all'); - pkg('prefix','${octprefix}','${archprefix}'); - pkg('global_list',fullfile('${shareprefix}','octave_packages')); - pkg('local_list',fullfile('${shareprefix}','octave_packages')); - pkg('install','-nodeps','-verbose','${OCT_PACKAGE}'); - " - octavecommand "${cmd}" || die - cmd=" - warning('off','all'); - pkg('prefix','${octprefix}','${archprefix}'); - pkg('global_list',fullfile('${shareprefix}','octave_packages')); - pkg('local_list',fullfile('${shareprefix}','octave_packages')); - l=pkg('list'); - disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); - ${stripcmd} - " - oct_pkgdir=$(octavecommand "${cmd}" || die) - fi - export oct_pkgdir +octaveforge_src_test() { + DESTDIR="${T}" _octaveforge_pkg_install || die - if [[ -d doc/ ]]; then - dodoc -r doc/* - fi + # cargo culted from Fedora + cmd=" + pkg('load','${PN}'); + oruntests('${oct_pkgdir}'); + unlink(pkg('local_list')); + unlink(pkg('global_list')); + " + octavecommand "${cmd}" || die 'failed testing' } # @FUNCTION: octaveforge_pkg_postinst @@ -226,3 +182,58 @@ fi EOF chmod 0755 "configure" || die } + +_octaveforge_pkg_install() { + TMPDIR="${T}" + DISTPKG='Gentoo' + + pushd ../ || die + if [[ "X${DISTPKG}X" != "XX" ]]; then + stripcmd=" + unlink(pkg('local_list')); + unlink(pkg('global_list')); + " + fi + if [[ "X${DESTDIR}X" = "XX" ]]; then + cmd=" + warning('off','all'); + pkg('install','${OCT_PACKAGE}'); + l=pkg('list'); + disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); + ${stripcmd} + " + oct_pkgdir=$(octavecommand "${cmd}" || die) + else + cmd="disp(fullfile(__octave_config_info__('datadir'),'octave'));" + shareprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) + cmd="disp(fullfile(__octave_config_info__('libdir'),'octave'));" + libprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) + octprefix="${shareprefix}/packages" || die + archprefix="${libprefix}/packages" || die + if [[ ! -e "${octprefix}" ]]; then + mkdir -p "${octprefix}" || die + fi + if [[ ! -e "${archprefix}" ]]; then + mkdir -p "${archprefix}" || die + fi + cmd=" + warning('off','all'); + pkg('prefix','${octprefix}','${archprefix}'); + pkg('global_list',fullfile('${shareprefix}','octave_packages')); + pkg('local_list',fullfile('${shareprefix}','octave_packages')); + pkg('install','-nodeps','-verbose','${OCT_PACKAGE}'); + " + octavecommand "${cmd}" || die + cmd=" + warning('off','all'); + pkg('prefix','${octprefix}','${archprefix}'); + pkg('global_list',fullfile('${shareprefix}','octave_packages')); + pkg('local_list',fullfile('${shareprefix}','octave_packages')); + l=pkg('list'); + disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); + ${stripcmd} + " + oct_pkgdir=$(octavecommand "${cmd}" || die) + fi + export oct_pkgdir +}