public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-haskell/parser-combinators/
Date: Sun, 21 Aug 2022 02:22:05 +0000 (UTC)	[thread overview]
Message-ID: <1661048504.d8791e9c56f660b15ca89f04dba85add4d5c15d3.sam@gentoo> (raw)

commit:     d8791e9c56f660b15ca89f04dba85add4d5c15d3
Author:     hololeap <hololeap <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Fri Aug 12 03:47:58 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 21 02:21:44 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8791e9c

dev-haskell/parser-combinators: Fix tests

Make creation of temporary GHC package DB conditional

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../parser-combinators-1.3.0.ebuild                | 27 +++++++++++-----------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/dev-haskell/parser-combinators/parser-combinators-1.3.0.ebuild b/dev-haskell/parser-combinators/parser-combinators-1.3.0.ebuild
index fc3e4a9d5cb2..7c57fcc85c7d 100644
--- a/dev-haskell/parser-combinators/parser-combinators-1.3.0.ebuild
+++ b/dev-haskell/parser-combinators/parser-combinators-1.3.0.ebuild
@@ -9,18 +9,16 @@ EAPI=8
 CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
 inherit haskell-cabal
 
-TESTS_PN="${PN}-tests"
-TESTS_P="${TESTS_PN}-${PV}"
+TESTS_PN="${CABAL_PN}-tests"
+TESTS_P="${TESTS_PN}-${CABAL_PV}"
 
 DESCRIPTION="Lightweight package providing commonly useful parser combinators"
 HOMEPAGE="https://github.com/mrkkrp/parser-combinators"
-SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz
-	https://hackage.haskell.org/package/${TESTS_P}/${TESTS_P}.tar.gz"
+SRC_URI+=" https://hackage.haskell.org/package/${TESTS_P}/${TESTS_P}.tar.gz"
 
 LICENSE="BSD"
 SLOT="0/${PV}"
 KEYWORDS="~amd64 ~ppc64 ~x86"
-RESTRICT="test" # tests only work if not already installed
 
 RDEPEND=">=dev-lang/ghc-8.6.3:=
 "
@@ -41,18 +39,21 @@ src_configure() {
 
 src_test() {
 	if use test; then
-		./setup register --inplace --gen-pkg-config || die
-		ghc-pkg init pkgdb || die
-		ghc-pkg -f pkgdb register "${P}.conf"
+		local -a configure_flags=( "--flag=-dev" )
 
-		old_S="${S}"
+		# Runs the block if the main package is not installed currently
+		if ! ghc-pkg describe "${CABAL_PN}" &>/dev/null; then
+			./setup register --inplace --gen-pkg-config || die
+			ghc-pkg init pkgdb || die
+			ghc-pkg -f pkgdb register "${CABAL_P}.conf" || die
+			configure_flags+=( "--package-db=${S}/pkgdb" )
+		fi
+
+		local old_S="${S}"
 		export S="${WORKDIR}/${TESTS_P}"
 		pushd "${S}" > /dev/null || die
 
-		haskell-cabal_src_configure \
-			--package-db="${old_S}/pkgdb" \
-			--flag=-dev
-
+		haskell-cabal_src_configure "${configure_flags[@]}"
 		haskell-cabal_src_compile
 		haskell-cabal_src_test
 


             reply	other threads:[~2022-08-21  2:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-21  2:22 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-26 22:39 [gentoo-commits] repo/gentoo:master commit in: dev-haskell/parser-combinators/ Sergei Trofimovich
2019-01-27 11:05 Pacho Ramos
2018-07-05 11:39 Manuel Rüger
2018-06-08 14:57 Manuel Rüger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1661048504.d8791e9c56f660b15ca89f04dba85add4d5c15d3.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox