summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhololeap <hololeap@users.noreply.github.com>2022-08-11 21:47:58 -0600
committerSam James <sam@gentoo.org>2022-08-21 03:21:44 +0100
commitd8791e9c56f660b15ca89f04dba85add4d5c15d3 (patch)
tree0bdd90c068e1eef4970eb01982ad50b0d8a68a4d /dev-haskell/parser-combinators
parentdev-haskell/haskell-src-exts: add 1.23.1, drop 1.21.1 (diff)
downloadgentoo-d8791e9c56f660b15ca89f04dba85add4d5c15d3.tar.gz
gentoo-d8791e9c56f660b15ca89f04dba85add4d5c15d3.tar.bz2
gentoo-d8791e9c56f660b15ca89f04dba85add4d5c15d3.zip
dev-haskell/parser-combinators: Fix tests
Make creation of temporary GHC package DB conditional Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-haskell/parser-combinators')
-rw-r--r--dev-haskell/parser-combinators/parser-combinators-1.3.0.ebuild27
1 files 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