diff options
-rw-r--r-- | eclass/ghc-package.eclass | 43 | ||||
-rw-r--r-- | eclass/haskell-cabal.eclass | 4 |
2 files changed, 13 insertions, 34 deletions
diff --git a/eclass/ghc-package.eclass b/eclass/ghc-package.eclass index 7e8a5aa0cba8..5decbaa228e8 100644 --- a/eclass/ghc-package.eclass +++ b/eclass/ghc-package.eclass @@ -4,6 +4,7 @@ # @ECLASS: ghc-package.eclass # @MAINTAINER: # "Gentoo's Haskell Language team" <haskell@gentoo.org> +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 # @AUTHOR: # Original Author: Andres Loeh <kosmikus@gentoo.org> # @BLURB: This eclass helps with the Glasgow Haskell Compiler's package configuration utility. @@ -14,8 +15,9 @@ inherit multiprocessing # Maintain version-testing compatibility with ebuilds not using EAPI 7. case "${EAPI:-0}" in + 0|1|2|3|7) ;; 4|5|6) inherit eapi7-ver ;; - *) ;; + *) die "EAPI ${EAPI} unsupported." ;; esac # GHC uses it's own native code generator. Portage's @@ -56,30 +58,11 @@ ghc-getghcpkg() { # because for some reason the global package file # must be specified ghc-getghcpkgbin() { - if ver_test "$(ghc-version)" -ge "7.9.20141222"; then - # ghc-7.10 stopped supporting single-file database - local empty_db="${T}/empty.conf.d" ghc_pkg="$(ghc-libdir)/bin/ghc-pkg" - if [[ ! -d ${empty_db} ]]; then - "${ghc_pkg}" init "${empty_db}" || die "Failed to initialize empty global db" - fi - echo "$(ghc-libdir)/bin/ghc-pkg" "--global-package-db=${empty_db}" - - elif ver_test "$(ghc-version)" -ge "7.7.20121101"; then - # the ghc-pkg executable changed name in ghc 6.10, as it no longer needs - # the wrapper script with the static flags - # was moved to bin/ subtree by: - # http://www.haskell.org/pipermail/cvs-ghc/2012-September/076546.html - echo '[]' > "${T}/empty.conf" - echo "$(ghc-libdir)/bin/ghc-pkg" "--global-package-db=${T}/empty.conf" - - elif ver_test "$(ghc-version)" -ge "7.5.20120516"; then - echo '[]' > "${T}/empty.conf" - echo "$(ghc-libdir)/ghc-pkg" "--global-package-db=${T}/empty.conf" - - else - echo '[]' > "${T}/empty.conf" - echo "$(ghc-libdir)/ghc-pkg" "--global-conf=${T}/empty.conf" + local empty_db="${T}/empty.conf.d" ghc_pkg="$(ghc-libdir)/bin/ghc-pkg" + if [[ ! -d ${empty_db} ]]; then + "${ghc_pkg}" init "${empty_db}" || die "Failed to initialize empty global db" fi + echo "$(ghc-libdir)/bin/ghc-pkg" "--global-package-db=${empty_db}" } # @FUNCTION: ghc-version @@ -115,15 +98,9 @@ ghc-pm-version() { # @DESCRIPTION: # return version of the Cabal library bundled with ghc ghc-cabal-version() { - if ver_test "$(ghc-version)" -ge "7.9.20141222"; then - # outputs in format: 'version: 1.18.1.5' - set -- `$(ghc-getghcpkg) --package-db=$(ghc-libdir)/package.conf.d.initial field Cabal version` - echo "$2" - else - local cabal_package=`echo "$(ghc-libdir)"/Cabal-*` - # /path/to/ghc/Cabal-${VER} -> ${VER} - echo "${cabal_package/*Cabal-/}" - fi + # outputs in format: 'version: 1.18.1.5' + set -- `$(ghc-getghcpkg) --package-db=$(ghc-libdir)/package.conf.d.initial field Cabal version` + echo "$2" } # @FUNCTION: ghc-is-dynamic diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index b4741a0840c1..5b67f43f0c5a 100644 --- a/eclass/haskell-cabal.eclass +++ b/eclass/haskell-cabal.eclass @@ -4,6 +4,7 @@ # @ECLASS: haskell-cabal.eclass # @MAINTAINER: # Haskell herd <haskell@gentoo.org> +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 # @AUTHOR: # Original author: Andres Loeh <kosmikus@gentoo.org> # Original author: Duncan Coutts <dcoutts@gentoo.org> @@ -120,8 +121,9 @@ HASKELL_CABAL_EXPF="pkg_setup src_compile src_test src_install pkg_postinst pkg_ 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} |