eclass: update haskell-cabal.eclass for EAPI 7, sync with ::haskell
authorJack Todaro <jackmtodaro@gmail.com>
Sat, 10 Nov 2018 05:54:22 +0000 (16:54 +1100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sun, 11 Nov 2018 11:33:25 +0000 (11:33 +0000)
Signed-off-by: Jack Todaro <jackmtodaro@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/10390
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/haskell-cabal.eclass

index 473eb6dcbb30d00d46dda01fd2e073050b15a46d..edfdfae5cda342cd24fc253a301a82ee9859ce1d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: haskell-cabal.eclass
@@ -74,7 +74,7 @@ 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
-       2|3|4|5|6) HASKELL_CABAL_EXPF+=" src_configure" ;;
+       2|3|4|5|6|7) HASKELL_CABAL_EXPF+=" src_configure" ;;
        *) ;;
 esac
 
@@ -365,7 +365,7 @@ cabal-configure() {
        if $(ghc-supports-shared-libraries); then
                # Experimental support for dynamically linked binaries.
                # We are enabling it since 7.10.1_rc3
-               if version_is_at_least "7.10.0.20150316" "$(ghc-version)"; then
+               if ver_test "$(ghc-version)" -ge "7.10.0.20150316"; then
                        # we didn't enable it before as it was not stable on all arches
                        cabalconf+=(--enable-shared)
                        # Known to break on ghc-7.8/Cabal-1.18
@@ -428,7 +428,11 @@ cabal-pkg() {
        if [[ -n ${CABAL_HAS_LIBRARIES} ]]; then
                # Newer cabal can generate a package conf for us:
                ./setup register --gen-pkg-config="${T}/${P}.conf"
-               ghc-install-pkg "${T}/${P}.conf"
+               if [[ -d "${T}/${P}.conf" ]]; then
+                       ghc-install-pkg "${T}/${P}.conf"/*
+               else
+                       ghc-install-pkg "${T}/${P}.conf"
+               fi
        fi
 }
 
@@ -590,7 +594,7 @@ cabal_src_install() {
        # remove EPREFIX
        dodir ${ghc_confdir_with_prefix#${EPREFIX}}
        local hint_db="${D}/$(ghc-confdir)"
-       local hint_file="${hint_db}/${PF}.conf"
+       local hint_file="${hint_db}/gentoo-empty-${CATEGORY}-${PF}.conf"
        mkdir -p "${hint_db}" || die
        touch "${hint_file}" || die
 }