From 4df3bf9762850b34cd1ead5c80374d1a0fc3362e Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 12 Jul 2021 08:41:54 +0100 Subject: gentoo resync : 12.07.2021 --- eclass/haskell-cabal.eclass | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) (limited to 'eclass/haskell-cabal.eclass') diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index 5b67f43f0c5a..0e41325b3061 100644 --- a/eclass/haskell-cabal.eclass +++ b/eclass/haskell-cabal.eclass @@ -4,7 +4,7 @@ # @ECLASS: haskell-cabal.eclass # @MAINTAINER: # Haskell herd -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 +# @SUPPORTED_EAPIS: 6 7 8 # @AUTHOR: # Original author: Andres Loeh # Original author: Duncan Coutts @@ -40,7 +40,16 @@ # FEATURE can be removed once https://github.com/haskell/cabal/issues/7213 # is fixed. -inherit eutils ghc-package multilib toolchain-funcs +case ${EAPI} in + # eutils is for eqawarn + 6|7) inherit eutils ;; + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +inherit ghc-package multilib toolchain-funcs + +EXPORT_FUNCTIONS pkg_setup src_configure src_compile src_test src_install pkg_postinst pkg_postrm # @ECLASS-VARIABLE: CABAL_EXTRA_CONFIGURE_FLAGS # @USER_VARIABLE @@ -113,21 +122,11 @@ inherit eutils ghc-package multilib toolchain-funcs # Set to anything else to disable. : ${CABAL_REPORT_OTHER_BROKEN_PACKAGES:=yes} -HASKELL_CABAL_EXPF="pkg_setup src_compile src_test src_install pkg_postinst pkg_postrm" - # 'dev-haskell/cabal' passes those options with ./configure-based # configuration, but most packages don't need/don't accept it: # #515362, #515362 QA_CONFIGURE_OPTIONS+=" --with-compiler --with-hc --with-hc-pkg --with-gcc" -case "${EAPI:-0}" in - 0|1) ;; - 2|3|4|5|6|7) HASKELL_CABAL_EXPF+=" src_configure" ;; - *) die "EAPI ${EAPI} unsupported." ;; -esac - -EXPORT_FUNCTIONS ${HASKELL_CABAL_EXPF} - for feature in ${CABAL_FEATURES}; do case ${feature} in haddock) CABAL_USE_HADDOCK=yes;; @@ -141,9 +140,6 @@ for feature in ${CABAL_FEATURES}; do test-suite) CABAL_TEST_SUITE=yes;; rebuild-after-doc-workaround) CABAL_REBUILD_AFTER_DOC_WORKAROUND=yes;; - # does nothing, removed 2016-09-04 - bin) ;; - *) CABAL_UNKNOWN="${CABAL_UNKNOWN} ${feature}";; esac done @@ -315,7 +311,6 @@ cabal-show-brokens-and-die() { cabal-configure() { local cabalconf=() - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then # We use the bundled with GHC version if exists @@ -452,8 +447,6 @@ cabal-build() { } cabal-copy() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && ED=${D} - set -- copy --destdir="${D}" "$@" echo ./setup "$@" ./setup "$@" || die "setup copy failed" @@ -535,20 +528,8 @@ cabal_src_configure() { # exported function: cabal-style bootstrap configure and compile cabal_src_compile() { - # it's a common mistake when one bumps ebuild to EAPI="2" (and upper) - # and forgets to separate src_compile() to src_configure()/src_compile(). - # Such error leads to default src_configure and we lose all passed flags. - if ! has "${EAPI:-0}" 0 1; then - local passed_flag - for passed_flag in "$@"; do - [[ ${passed_flag} == --flags=* ]] && \ - eqawarn "QA Notice: Cabal option '${passed_flag}' has effect only in src_configure()" - done - fi - cabal-is-dummy-lib && return - has src_configure ${HASKELL_CABAL_EXPF} || haskell-cabal_src_configure "$@" cabal-build if [[ -n "$CABAL_USE_HADDOCK" ]] && use doc; then @@ -616,8 +597,6 @@ haskell-cabal_src_test() { # exported function: cabal-style copy and register cabal_src_install() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= - if ! cabal-is-dummy-lib; then cabal-copy cabal-pkg -- cgit v1.2.3