diff options
author | 2023-10-29 08:23:29 -0600 | |
---|---|---|
committer | 2023-11-19 18:32:25 +0000 | |
commit | 5bc8689c272fef57dc52cd3eda99deee98045b41 (patch) | |
tree | cca55196a3f5a83819df70a461e4545a582c2f4d /dev-haskell/doctest-driver-gen | |
parent | dev-haskell/cabal-install: Fix CABAL_CHDEPS line (diff) | |
download | gentoo-5bc8689c272fef57dc52cd3eda99deee98045b41.tar.gz gentoo-5bc8689c272fef57dc52cd3eda99deee98045b41.tar.bz2 gentoo-5bc8689c272fef57dc52cd3eda99deee98045b41.zip |
dev-haskell/doctest-driver-gen: Fix tests
Tests use a preprocessor which runs doctest-driver-gen. PATH and
LD_LIBRARY_PATH need to be adjusted to find the newly-built library
and binary or it will fail in the compile phase.
Signed-off-by: hololeap <hololeap@protonmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-haskell/doctest-driver-gen')
-rw-r--r-- | dev-haskell/doctest-driver-gen/doctest-driver-gen-0.3.0.7.ebuild | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/dev-haskell/doctest-driver-gen/doctest-driver-gen-0.3.0.7.ebuild b/dev-haskell/doctest-driver-gen/doctest-driver-gen-0.3.0.7.ebuild index 4607b051369a..eca005fa90d4 100644 --- a/dev-haskell/doctest-driver-gen/doctest-driver-gen-0.3.0.7.ebuild +++ b/dev-haskell/doctest-driver-gen/doctest-driver-gen-0.3.0.7.ebuild @@ -14,12 +14,16 @@ HOMEPAGE="https://github.com/Hexirp/doctest-driver-gen#readme" LICENSE="BSD" SLOT="0/${PV}" KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" -IUSE="+executable" +IUSE="executable" PATCHES=( "${FILESDIR}/${PN}-0.3.0.7-add-executable-flag.patch" ) +CABAL_TEST_REQUIRED_BINS=( + "${PN}" +) + RDEPEND=" >=dev-lang/ghc-8.10.6:= " @@ -32,9 +36,21 @@ DEPEND=" " src_configure() { - local config_flags=( - $(cabal_flag executable executable) - ) + if use executable || use test; then + local exe_flag=--flag=executable + else + local exe_flag=--flag=-executable + fi + + # test-suite preprocessor needs the newly built components + export LD_LIBRARY_PATH="${S}/dist/build/${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" + export PATH="${S}/dist/build/${PN}${PATH+:}${PATH}" + + haskell-cabal_src_configure "${exe_flag}" +} - haskell-cabal_src_configure "${config_flags[@]}" +src_install() { + local components=( "lib:${PN}" ) + use executable && components+=( "exe:${PN}" ) + haskell-cabal_src_install "${components[@]}" } |