diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37110 -> 37101 bytes | |||
-rw-r--r-- | eclass/distutils-r1.eclass | 12 | ||||
-rw-r--r-- | eclass/haskell-cabal.eclass | 154 | ||||
-rw-r--r-- | eclass/python-any-r1.eclass | 1 | ||||
-rw-r--r-- | eclass/python-utils-r1.eclass | 11 |
5 files changed, 103 insertions, 75 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 643aa2fdf90a..0c5a3e9ef9a1 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index c5c954f49250..07ded8516fdc 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -550,11 +550,11 @@ esetup.py() { # For most of the packages, tests built in BUILD_DIR are good enough. # # The function supports two install modes. The current default is -# the legacy --via-home mode. However, it has problems with newer -# versions of setuptools (50.3.0+). The --via-root mode generally -# works for these packages, and it will probably become the default -# in the future, once we test all affected packages. Please note -# that proper testing sometimes requires unmerging the package first. +# --via-root mode. Previously, the function defaulted to --via-home +# mode but it has been broken by new versions of setuptools (50.3.0+). +# If you find that --via-root does not work but --via-home does, please +# file a bug to let us know. Please note that proper testing sometimes +# requires unmerging the package first. distutils_install_for_testing() { debug-print-function ${FUNCNAME} "${@}" @@ -575,7 +575,7 @@ distutils_install_for_testing() { PATH=${bindir}:${PATH} PYTHONPATH=${libdir}:${PYTHONPATH} - local install_method=home + local install_method=root case ${1} in --via-home) install_method=home diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index 4908e4491e60..6099363bc9a5 100644 --- a/eclass/haskell-cabal.eclass +++ b/eclass/haskell-cabal.eclass @@ -29,6 +29,15 @@ # only used for packages that use libghc internally and _must_ # not pull upper versions # test-suite -- add support for cabal test-suites (introduced in Cabal-1.8) +# rebuild-after-doc-workaround -- enable doctest test failue workaround. +# Symptom: when `./setup haddock` is run in a `build-type: Custom` +# package it might cause cause the test-suite to fail with +# errors like: +# > <command line>: cannot satisfy -package-id singletons-2.7-3Z7pnljD8tU1NrslJodXmr +# Workaround re-reginsters the package to avoid the failure +# (and rebuilds changes). +# FEATURE can be removed once https://github.com/haskell/cabal/issues/7213 +# is fixed. inherit eutils ghc-package multilib toolchain-funcs @@ -53,6 +62,28 @@ inherit eutils ghc-package multilib toolchain-funcs # linking 'setup' faster. : ${GHC_BOOTSTRAP_FLAGS:=} +# @ECLASS-VARIABLE: CABAL_EXTRA_HADDOCK_FLAGS +# @DESCRIPTION: +# User-specified additional parameters passed to 'setup haddock'. +# example: /etc/portage/make.conf: +# CABAL_EXTRA_HADDOCK_FLAGS="--haddock-options=--latex --haddock-options=--pretty-html" +: ${CABAL_EXTRA_HADDOCK_FLAGS:=} + +# @ECLASS-VARIABLE: CABAL_EXTRA_HOOGLE_FLAGS +# @DESCRIPTION: +# User-specified additional parameters passed to 'setup haddock --hoogle'. +# example: /etc/portage/make.conf: +# CABAL_EXTRA_HOOGLE_FLAGS="--haddock-options=--show-all" +: ${CABAL_EXTRA_HOOGLE_FLAGS:=} + +# @ECLASS-VARIABLE: CABAL_EXTRA_HSCOLOUR_FLAGS +# @DESCRIPTION: +# User-specified additional parameters passed to 'setup hscolour'. +# example: /etc/portage/make.conf: +# CABAL_EXTRA_HSCOLOUR_FLAGS="--executables --tests" +: ${CABAL_EXTRA_HSCOLOUR_FLAGS:=} + + # @ECLASS-VARIABLE: CABAL_EXTRA_TEST_FLAGS # @DESCRIPTION: # User-specified additional parameters passed to 'setup test'. @@ -99,6 +130,7 @@ for feature in ${CABAL_FEATURES}; do nocabaldep) CABAL_FROM_GHC=yes;; ghcdeps) CABAL_GHC_CONSTRAINT=yes;; test-suite) CABAL_TEST_SUITE=yes;; + rebuild-after-doc-workaround) CABAL_REBUILD_AFTER_DOC_WORKAROUND=yes;; # does nothing, removed 2016-09-04 bin) ;; @@ -222,43 +254,17 @@ cabal-mksetup() { > "${setup_src}" || die "failed to create default Setup.hs" } -cabal-hscolour() { - set -- hscolour "$@" - echo ./setup "$@" - ./setup "$@" || die "setup hscolour failed" +haskell-cabal-run_verbose() { + echo "$@" + "$@" || die "failed: $@" } -cabal-haddock() { - set -- haddock "$@" - echo ./setup "$@" - ./setup "$@" || die "setup haddock failed" -} - -cabal-hoogle() { - ewarn "hoogle USE flag requires doc USE flag, building without hoogle" -} - -cabal-hscolour-haddock() { - # --hyperlink-source implies calling 'setup hscolour' - set -- haddock --hyperlink-source - echo ./setup "$@" - ./setup "$@" --hyperlink-source || die "setup haddock --hyperlink-source failed" -} - -cabal-hoogle-haddock() { - set -- haddock --hoogle - echo ./setup "$@" - ./setup "$@" || die "setup haddock --hoogle failed" -} - -cabal-hoogle-hscolour-haddock() { - cabal-hscolour-haddock - cabal-hoogle-haddock +cabal-hscolour() { + haskell-cabal-run_verbose ./setup hscolour "$@" } -cabal-hoogle-hscolour() { - ewarn "hoogle USE flag requires doc USE flag, building without hoogle" - cabal-hscolour +cabal-haddock() { + haskell-cabal-run_verbose ./setup haddock "$@" } cabal-die-if-nonempty() { @@ -342,10 +348,34 @@ cabal-configure() { fi # currently cabal does not respect CFLAGS and LDFLAGS on it's own (bug #333217) - # so translate LDFLAGS to ghc parameters (without filtering) + # so translate LDFLAGS to ghc parameters (with mild filtering). local flag - for flag in $CFLAGS; do cabalconf+=(--ghc-option="-optc$flag"); done - for flag in $LDFLAGS; do cabalconf+=(--ghc-option="-optl$flag"); done + for flag in $CFLAGS; do + case "${flag}" in + -flto|-flto=*) + # binutils does not support partial linking yet: + # https://github.com/gentoo-haskell/gentoo-haskell/issues/1110 + # https://sourceware.org/PR12291 + einfo "Filter '${flag}' out of CFLAGS (avoid lto partial linking)" + continue + ;; + esac + + cabalconf+=(--ghc-option="-optc$flag") + done + for flag in $LDFLAGS; do + case "${flag}" in + -flto|-flto=*) + # binutils does not support partial linking yet: + # https://github.com/gentoo-haskell/gentoo-haskell/issues/1110 + # https://sourceware.org/PR12291 + einfo "Filter '${flag}' out of LDFLAGS (avoid lto partial linking)" + continue + ;; + esac + + cabalconf+=(--ghc-option="-optl$flag") + done # disable executable stripping for the executables, as portage will # strip by itself, and pre-stripping gives a QA warning. @@ -512,38 +542,30 @@ cabal_src_compile() { has src_configure ${HASKELL_CABAL_EXPF} || haskell-cabal_src_configure "$@" cabal-build - if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then - if [[ -n "${CABAL_USE_HSCOLOUR}" ]] && use hscolour; then - if [[ -n "${CABAL_USE_HOOGLE}" ]] && use hoogle; then - # hoogle, hscolour and haddock - cabal-hoogle-hscolour-haddock - else - # haddock and hscolour - cabal-hscolour-haddock - fi - else - if [[ -n "${CABAL_USE_HOOGLE}" ]] && use hoogle; then - # hoogle and haddock - cabal-hoogle-haddock - else - # just haddock - cabal-haddock - fi + if [[ -n "$CABAL_USE_HADDOCK" ]] && use doc; then + if [[ -n "$CABAL_USE_HSCOLOUR" ]] && use hscolour; then + # --hyperlink-source implies calling 'setup hscolour' + haddock_args+=(--hyperlink-source) + fi + + cabal-haddock "${haddock_args[@]}" $CABAL_EXTRA_HADDOCK_FLAGS + + if [[ -n "$CABAL_USE_HOOGLE" ]] && use hoogle; then + cabal-haddock --hoogle $CABAL_EXTRA_HOOGLE_FLAGS + fi + if [[ -n "${CABAL_REBUILD_AFTER_DOC_WORKAROUND}" ]]; then + ewarn "rebuild-after-doc-workaround is enabled. This is a" + ewarn "temporary worakround to deal with https://github.com/haskell/cabal/issues/7213" + ewarn "until the upstream issue can be resolved." + cabal-build fi else - if [[ -n "${CABAL_USE_HSCOLOUR}" ]] && use hscolour; then - if [[ -n "${CABAL_USE_HOOGLE}" ]] && use hoogle; then - # hoogle and hscolour - cabal-hoogle-hscolour - else - # just hscolour - cabal-hscolour - fi - else - if [[ -n "${CABAL_USE_HOOGLE}" ]] && use hoogle; then - # just hoogle - cabal-hoogle - fi + if [[ -n "$CABAL_USE_HSCOLOUR" ]] && use hscolour; then + cabal-hscolour $CABAL_EXTRA_HSCOLOUR_FLAGS + fi + + if [[ -n "$CABAL_USE_HOOGLE" ]] && use hoogle; then + ewarn "hoogle USE flag requires doc USE flag, building without hoogle" fi fi } diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index 5f2dc5b8f384..313fe6b40df0 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -174,6 +174,7 @@ _python_any_set_globals() { local usestr deps i PYTHON_PKG_DEP [[ ${PYTHON_REQ_USE} ]] && usestr="[${PYTHON_REQ_USE}]" + _PYTHON_ALLOW_PY27=1 \ _python_set_impls for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 6d482aa106c0..dcc441b82098 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -40,7 +40,6 @@ inherit toolchain-funcs # All supported Python implementations, most preferred last. _PYTHON_ALL_IMPLS=( pypy3 - python2_7 python3_7 python3_8 python3_9 ) readonly _PYTHON_ALL_IMPLS @@ -52,7 +51,7 @@ readonly _PYTHON_ALL_IMPLS _PYTHON_HISTORICAL_IMPLS=( jython2_7 pypy pypy1_{8,9} pypy2_0 - python2_{5,6} + python2_{5..7} python3_{1..6} ) readonly _PYTHON_HISTORICAL_IMPLS @@ -149,7 +148,13 @@ _python_set_impls() { done if [[ ! ${supp[@]} ]]; then - die "No supported implementation in PYTHON_COMPAT." + # special-case python2_7 for python-any-r1 + if [[ ${_PYTHON_ALLOW_PY27} ]] && has python2_7 "${PYTHON_COMPAT[@]}" + then + supp+=( python2_7 ) + else + die "No supported implementation in PYTHON_COMPAT." + fi fi if [[ ${_PYTHON_SUPPORTED_IMPLS[@]} ]]; then |