diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-08-02 19:14:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-08-02 19:14:55 +0100 |
commit | b24bd25253fe093f722ab576d29fdc41d04cb1ee (patch) | |
tree | 0fcf2afd9f852c4d4c291cf8afaa2c244d598105 /eclass | |
parent | 121ed4eec41fbf03e1998d09eede1bf449da63b9 (diff) |
gentoo resync : 02.08.2019
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37134 -> 37148 bytes | |||
-rw-r--r-- | eclass/bzr.eclass | 4 | ||||
-rw-r--r-- | eclass/cdrom.eclass | 6 | ||||
-rw-r--r-- | eclass/cvs.eclass | 76 | ||||
-rw-r--r-- | eclass/darcs.eclass | 4 | ||||
-rw-r--r-- | eclass/git-2.eclass | 4 | ||||
-rw-r--r-- | eclass/git-r3.eclass | 4 | ||||
-rw-r--r-- | eclass/golang-vcs.eclass | 4 | ||||
-rw-r--r-- | eclass/kde5-functions.eclass | 14 | ||||
-rw-r--r-- | eclass/llvm.eclass | 2 | ||||
-rw-r--r-- | eclass/mercurial.eclass | 4 | ||||
-rw-r--r-- | eclass/meson.eclass | 5 | ||||
-rw-r--r-- | eclass/python-any-r1.eclass | 8 | ||||
-rw-r--r-- | eclass/ruby-fakegem.eclass | 63 | ||||
-rw-r--r-- | eclass/ruby-ng.eclass | 167 | ||||
-rw-r--r-- | eclass/ruby-utils.eclass | 4 | ||||
-rw-r--r-- | eclass/subversion.eclass | 2 | ||||
-rw-r--r-- | eclass/user.eclass | 17 | ||||
-rw-r--r-- | eclass/vcs-snapshot.eclass | 69 | ||||
-rw-r--r-- | eclass/virtualx.eclass | 7 |
20 files changed, 250 insertions, 214 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex c34c2448c8bb..8339035d1c00 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass index cc46be794214..10bd6bc7e5ad 100644 --- a/eclass/bzr.eclass +++ b/eclass/bzr.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # # @ECLASS: bzr.eclass @@ -21,6 +21,8 @@ EBZR="bzr.eclass" +PROPERTIES+=" live" + if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then DEPEND=">=dev-vcs/bzr-2.6.0[sftp]" else diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass index 7b0eb9c6c3b5..77b9d6ceb209 100644 --- a/eclass/cdrom.eclass +++ b/eclass/cdrom.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: cdrom.eclass @@ -28,9 +28,9 @@ inherit portability # conditionally based on USE="cdinstall". if [[ ${CDROM_OPTIONAL} == "yes" ]] ; then IUSE="cdinstall" - PROPERTIES="cdinstall? ( interactive )" + PROPERTIES+=" cdinstall? ( interactive )" else - PROPERTIES="interactive" + PROPERTIES+=" interactive" fi # @FUNCTION: cdrom_get_cds diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass index e2121f4724f2..26706cd74d1f 100644 --- a/eclass/cvs.eclass +++ b/eclass/cvs.eclass @@ -1,9 +1,10 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: cvs.eclass # @MAINTAINER: # vapier@gentoo.org (and anyone who wants to help) +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: This eclass provides generic cvs fetching functions # @DESCRIPTION: # This eclass provides the generic cvs fetching functions. To use this from an @@ -15,8 +16,6 @@ if [[ -z ${_CVS_ECLASS} ]]; then _CVS_ECLASS=1 -inherit eutils - # TODO: # Implement more auth types (gserver?, kserver?) @@ -174,22 +173,12 @@ inherit eutils # Set this to get a clean copy when updating (passes the # -C option to cvs update) -# @ECLASS-VARIABLE: ECVS_RUNAS -# @DEFAULT_UNSET -# @DESCRIPTION: -# Specifies an alternate (non-root) user to use to run cvs. Currently -# b0rked and wouldn't work with portage userpriv anyway without -# special magic. - -# : ${ECVS_RUNAS:=$(whoami)} +PROPERTIES+=" live" # add cvs to deps # ssh is used for ext auth -# sudo is used to run as a specified user DEPEND="dev-vcs/cvs" -[[ -n ${ECVS_RUNAS} ]] && DEPEND+=" app-admin/sudo" - if [[ ${ECVS_AUTH} == "ext" ]] ; then #default to ssh [[ -z ${CVS_RSH} ]] && export CVS_RSH="ssh" @@ -199,10 +188,14 @@ if [[ ${ECVS_AUTH} == "ext" ]] ; then DEPEND+=" net-misc/openssh" fi +case ${EAPI:-0} in + 4|5|6) ;; + 7) BDEPEND="${DEPEND}"; DEPEND="" ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;; +esac + # called from cvs_src_unpack cvs_fetch() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= - # Make these options local variables so that the global values are # not affected by modifications in this function. @@ -250,15 +243,6 @@ cvs_fetch() { ECVS_UP_OPTS+=" -D ${ECVS_DATE}" fi - # It would be easiest to always be in "run-as mode", logic-wise, - # if sudo didn't ask for a password even when sudo'ing to `whoami`. - - if [[ -z ${ECVS_RUNAS} ]] ; then - run="" - else - run="sudo -u ${ECVS_RUNAS}" - fi - # Create the top dir if needed if [[ ! -d ${ECVS_TOP_DIR} ]] ; then @@ -274,7 +258,7 @@ cvs_fetch() { debug-print "${FUNCNAME}: checkout mode. creating cvs directory" addwrite /foobar addwrite / - ${run} mkdir -p "/${ECVS_TOP_DIR}" + mkdir -p "/${ECVS_TOP_DIR}" export SANDBOX_WRITE="${SANDBOX_WRITE//:\/foobar:\/}" fi @@ -287,11 +271,6 @@ cvs_fetch() { # Disable the sandbox for this dir addwrite "${ECVS_TOP_DIR}" - # Chown the directory and all of its contents - if [[ -n ${ECVS_RUNAS} ]] ; then - ${run} chown -R "${ECVS_RUNAS}" "/${ECVS_TOP_DIR}" - fi - # Determine the CVS command mode (checkout or update) if [[ ! -d ${ECVS_TOP_DIR}/${ECVS_LOCALNAME}/CVS ]] ; then mode=checkout @@ -313,13 +292,13 @@ cvs_fetch() { # Switch servers automagically if needed if [[ ${mode} == "update" ]] ; then cd "/${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" - local oldserver=$(${run} cat CVS/Root) + local oldserver=$(cat CVS/Root) if [[ ${server} != "${oldserver}" ]] ; then einfo "Changing the CVS server from ${oldserver} to ${server}:" debug-print "${FUNCNAME}: Changing the CVS server from ${oldserver} to ${server}:" einfo "Searching for CVS directories ..." - local cvsdirs=$(${run} find . -iname CVS -print) + local cvsdirs=$(find . -iname CVS -print) debug-print "${FUNCNAME}: CVS directories found:" debug-print "${cvsdirs}" @@ -327,7 +306,7 @@ cvs_fetch() { local x for x in ${cvsdirs} ; do debug-print "In ${x}" - ${run} echo "${server}" > "${x}/Root" + echo "${server}" > "${x}/Root" done fi fi @@ -336,9 +315,6 @@ cvs_fetch() { # mess with ~/.cvspass touch "${T}/cvspass" export CVS_PASSFILE="${T}/cvspass" - if [[ -n ${ECVS_RUNAS} ]] ; then - chown "${ECVS_RUNAS}" "${T}/cvspass" - fi # The server string with the password in it, for login (only used for pserver) cvsroot_pass=":${connection}:${ECVS_USER}:${ECVS_PASS}@${ECVS_SERVER}" @@ -352,9 +328,9 @@ cvs_fetch() { fi # Commands to run - cmdlogin=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login ) - cmdupdate=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME} ) - cmdcheckout=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE} ) + cmdlogin=( ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login ) + cmdupdate=( ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME} ) + cmdcheckout=( ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE} ) # Execute commands @@ -482,13 +458,6 @@ EOF unset DISPLAY fi fi - - # Restore ownership. Not sure why this is needed, but someone - # added it in the orig ECVS_RUNAS stuff. - if [[ -n ${ECVS_RUNAS} ]] ; then - chown $(whoami) "${T}/cvspass" - fi - } # @FUNCTION: cvs_src_unpack @@ -508,7 +477,6 @@ cvs_src_unpack() { ECVS_PASS=${ECVS_PASS} ECVS_MODULE=${ECVS_MODULE} ECVS_LOCAL=${ECVS_LOCAL} - ECVS_RUNAS=${ECVS_RUNAS} ECVS_LOCALNAME=${ECVS_LOCALNAME}" [[ -z ${ECVS_MODULE} ]] && die "ERROR: CVS module not set, cannot continue." @@ -562,18 +530,6 @@ cvs_src_unpack() { rm -rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" fi - # Implement some of base_src_unpack's functionality; note however - # that base.eclass may not have been inherited! - if [[ -n ${PATCHES} ]] ; then - debug-print "${FUNCNAME}: PATCHES=${PATCHES}, S=${S}, autopatching" - cd "${S}" - epatch ${PATCHES} - # Make sure we don't try to apply patches more than once, - # since cvs_src_unpack is usually called several times from - # e.g. kde-source_src_unpack - export PATCHES="" - fi - einfo "CVS module ${ECVS_MODULE} is now in ${WORKDIR}" } diff --git a/eclass/darcs.eclass b/eclass/darcs.eclass index 09b718823670..1c1a051f8c1c 100644 --- a/eclass/darcs.eclass +++ b/eclass/darcs.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Authors +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: darcs.eclass @@ -85,6 +85,8 @@ SRC_URI="" # --- end ebuild-configurable settings --- +PROPERTIES+=" live" + case ${EAPI:-0} in [0-6]) # no need to care about 5-HDEPEND and similar DEPEND="dev-vcs/darcs diff --git a/eclass/git-2.eclass b/eclass/git-2.eclass index 5371a612dccf..917163291e63 100644 --- a/eclass/git-2.eclass +++ b/eclass/git-2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: git-2.eclass @@ -20,6 +20,8 @@ esac # This eclass support all EAPIs. EXPORT_FUNCTIONS src_unpack +PROPERTIES+=" live" + DEPEND="dev-vcs/git" # @ECLASS-VARIABLE: EGIT_SOURCEDIR diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass index a1ad0d238dc9..b1c7f7f43abc 100644 --- a/eclass/git-r3.eclass +++ b/eclass/git-r3.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: git-r3.eclass @@ -25,6 +25,8 @@ EXPORT_FUNCTIONS src_unpack if [[ ! ${_GIT_R3} ]]; then +PROPERTIES+=" live" + if [[ ! ${_INHERITED_BY_GIT_2} ]]; then if [[ ${EAPI:-0} != [0123456] ]]; then BDEPEND=">=dev-vcs/git-1.8.2.1[curl]" diff --git a/eclass/golang-vcs.eclass b/eclass/golang-vcs.eclass index 561d1a0c4da1..fb57a1e84ac4 100644 --- a/eclass/golang-vcs.eclass +++ b/eclass/golang-vcs.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: golang-vcs.eclass @@ -26,6 +26,8 @@ if [[ -z ${_GOLANG_VCS} ]]; then _GOLANG_VCS=1 +PROPERTIES+=" live" + # @ECLASS-VARIABLE: EGO_PN # @REQUIRED # @DESCRIPTION: diff --git a/eclass/kde5-functions.eclass b/eclass/kde5-functions.eclass index 2b2455e249e4..a1b930a3eba0 100644 --- a/eclass/kde5-functions.eclass +++ b/eclass/kde5-functions.eclass @@ -36,7 +36,6 @@ export KDE_BUILD_TYPE case ${CATEGORY} in kde-frameworks) [[ ${KDE_BUILD_TYPE} = live ]] && : ${FRAMEWORKS_MINIMAL:=9999} - [[ ${PV} = 5.57* ]] && : ${QT_MINIMAL:=5.11.1} ;; kde-plasma) if [[ ${PV} = 5.15.5 ]]; then @@ -44,17 +43,8 @@ case ${CATEGORY} in : ${QT_MINIMAL:=5.11.1} fi [[ ${PV} = 5.16.3 ]] && : ${FRAMEWORKS_MINIMAL:=5.58.0} - [[ ${PV} = 5.16* ]] && : ${FRAMEWORKS_MINIMAL:=5.60.0} [[ ${KDE_BUILD_TYPE} = live ]] && : ${FRAMEWORKS_MINIMAL:=9999} ;; - kde-apps) - if [[ ${PV} = 18.12.3 ]]; then - : ${FRAMEWORKS_MINIMAL:=5.57.0} - : ${PLASMA_MINIMAL:=5.14.5} - : ${QT_MINIMAL:=5.11.1} - fi - [[ ${PV} = 19.04.3 ]] && : ${FRAMEWORKS_MINIMAL:=5.60.0} - ;; esac # @ECLASS-VARIABLE: QT_MINIMAL @@ -65,7 +55,7 @@ esac # @ECLASS-VARIABLE: FRAMEWORKS_MINIMAL # @DESCRIPTION: # Minimum version of Frameworks to require. This affects add_frameworks_dep. -: ${FRAMEWORKS_MINIMAL:=5.57.0} +: ${FRAMEWORKS_MINIMAL:=5.60.0} # @ECLASS-VARIABLE: PLASMA_MINIMAL # @DESCRIPTION: @@ -75,7 +65,7 @@ esac # @ECLASS-VARIABLE: KDE_APPS_MINIMAL # @DESCRIPTION: # Minimum version of KDE Applications to require. This affects add_kdeapps_dep. -: ${KDE_APPS_MINIMAL:=18.12.3} +: ${KDE_APPS_MINIMAL:=19.04.3} # @ECLASS-VARIABLE: KDE_GCC_MINIMAL # @DEFAULT_UNSET diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass index d61effb5e9c6..eed3fe0014cc 100644 --- a/eclass/llvm.eclass +++ b/eclass/llvm.eclass @@ -81,7 +81,7 @@ if [[ ! ${_LLVM_ECLASS} ]]; then # @INTERNAL # @DESCRIPTION: # Correct values of LLVM slots, newest first. -declare -g -r _LLVM_KNOWN_SLOTS=( 9 8 7 6 5 4 ) +declare -g -r _LLVM_KNOWN_SLOTS=( 10 9 8 7 6 5 4 ) # @FUNCTION: get_llvm_prefix # @USAGE: [-b|-d] [<max_slot>] diff --git a/eclass/mercurial.eclass b/eclass/mercurial.eclass index 9a5bd191c231..faf38306db38 100644 --- a/eclass/mercurial.eclass +++ b/eclass/mercurial.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mercurial.eclass @@ -18,6 +18,8 @@ inherit eutils EXPORT_FUNCTIONS src_unpack +PROPERTIES+=" live" + DEPEND="dev-vcs/mercurial" # @ECLASS-VARIABLE: EHG_REPO_URI diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 7c62cf44f787..cb213e15e12e 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -260,13 +260,12 @@ meson_src_test() { debug-print-function ${FUNCNAME} "$@" local mesontestargs=( - --verbose -C "${BUILD_DIR}" - ) + ) [[ -n ${NINJAOPTS} || -n ${MAKEOPTS} ]] && mesontestargs+=( --num-processes "$(makeopts_jobs ${NINJAOPTS:-${MAKEOPTS}})" - ) + ) # Append additional arguments from ebuild mesontestargs+=("${emesontestargs[@]}") diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index 7a91507a600f..db8f23647cd1 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: python-any-r1.eclass @@ -171,6 +171,12 @@ _python_any_set_globals() { PYTHON_DEPS=${deps} readonly PYTHON_DEPS fi + + if [[ ! ${PYTHON_REQUIRED_USE+1} ]]; then + # fake var to catch mistaken usage + PYTHON_REQUIRED_USE='I-DO-NOT-EXIST-IN-PYTHON-ANY-R1' + readonly PYTHON_REQUIRED_USE + fi } _python_any_set_globals unset -f _python_any_set_globals diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass index e2c333a5e7f4..a6a7654f9e6d 100644 --- a/eclass/ruby-fakegem.eclass +++ b/eclass/ruby-fakegem.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Authors +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: ruby-fakegem.eclass @@ -7,7 +7,8 @@ # @AUTHOR: # Author: Diego E. Pettenò <flameeyes@gentoo.org> # Author: Alex Legler <a3li@gentoo.org> -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 +# Author: Hans de Graaff <graaff@gentoo.org> +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: An eclass for installing Ruby packages to behave like RubyGems. # @DESCRIPTION: # This eclass allows to install arbitrary Ruby libraries (including Gems), @@ -39,7 +40,7 @@ RUBY_FAKEGEM_TASK_DOC="${RUBY_FAKEGEM_TASK_DOC-rdoc}" # - rspec (calls ruby-ng_rspec, adds dev-ruby/rspec:2 to the dependencies) # - rspec3 (calls ruby-ng_rspec, adds dev-ruby/rspec:3 to the dependencies) # - cucumber (calls ruby-ng_cucumber, adds dev-util/cucumber to the -# dependencies; does not work on JRuby). +# dependencies) # - none RUBY_FAKEGEM_RECIPE_TEST="${RUBY_FAKEGEM_RECIPE_TEST-rake}" @@ -56,7 +57,14 @@ RUBY_FAKEGEM_TASK_TEST="${RUBY_FAKEGEM_TASK_TEST-test}" # - rdoc (calls `rdoc-2`, adds dev-ruby/rdoc to the dependencies); # - yard (calls `yard`, adds dev-ruby/yard to the dependencies); # - none -RUBY_FAKEGEM_RECIPE_DOC="${RUBY_FAKEGEM_RECIPE_DOC-rake}" +case ${EAPI} in + 4|5|6) + RUBY_FAKEGEM_RECIPE_DOC="${RUBY_FAKEGEM_RECIPE_DOC-rake}" + ;; + *) + RUBY_FAKEGEM_RECIPE_DOC="${RUBY_FAKEGEM_RECIPE_DOC-rdoc}" + ;; +esac # @ECLASS-VARIABLE: RUBY_FAKEGEM_DOCDIR # @DEFAULT_UNSET @@ -106,11 +114,13 @@ RUBY_FAKEGEM_BINDIR="${RUBY_FAKEGEM_BINDIR-bin}" # Rails generators, or data that needs to be installed as well. case "${EAPI:-0}" in - 0|1|2|3|4|5|6) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; + 0|1|2|3) + die "Unsupported EAPI=${EAPI} (too old) for ruby-fakegem.eclass" ;; + 4|5|6|7) + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; esac @@ -159,10 +169,7 @@ case ${RUBY_FAKEGEM_RECIPE_TEST} in ;; cucumber) IUSE+=" test" - # Unfortunately as of August 2012, cucumber is not supported on - # JRuby. We work it around here to avoid repeating the same - # code over and over again. - USE_RUBY="${USE_RUBY/jruby/}" ruby_add_bdepend "test? ( dev-util/cucumber )" + ruby_add_bdepend "test? ( dev-util/cucumber )" ;; *) RUBY_FAKEGEM_RECIPE_TEST="none" @@ -173,6 +180,13 @@ SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FA ruby_add_bdepend virtual/rubygems ruby_add_rdepend virtual/rubygems +case ${EAPI} in + 4|5|6) + ;; + *) + ruby_add_depend virtual/rubygems + ;; +esac # @FUNCTION: ruby_fakegem_gemsdir # @RETURN: Returns the gem data directory @@ -180,8 +194,6 @@ ruby_add_rdepend virtual/rubygems # This function returns the gems data directory for the ruby # implementation in question. ruby_fakegem_gemsdir() { - has "${EAPI}" 2 && ! use prefix && EPREFIX= - local _gemsitedir=$(ruby_rbconfig_value 'sitelibdir') _gemsitedir=${_gemsitedir//site_ruby/gems} _gemsitedir=${_gemsitedir#${EPREFIX}} @@ -266,14 +278,7 @@ ruby_fakegem_gemspec_gemspec() { # the metadata distributed by the gem itself. This is similar to how # rubygems creates an installation from a .gem file. ruby_fakegem_metadata_gemspec() { - case ${RUBY} in - *jruby) - ${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2 - ;; - *) - ${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2 - ;; - esac + ${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2 } # @FUNCTION: ruby_fakegem_genspec @@ -290,6 +295,15 @@ ruby_fakegem_metadata_gemspec() { # See RUBY_FAKEGEM_NAME and RUBY_FAKEGEM_VERSION for setting name and version. # See RUBY_FAKEGEM_REQUIRE_PATHS for setting extra require paths. ruby_fakegem_genspec() { + case ${EAPI} in + 4|5|6) ;; + *) + eqawarn "Generating generic fallback gemspec *without* dependencies" + eqawarn "This will only work when there are no runtime dependencies" + eqawarn "Set RUBY_FAKEGEM_GEMSPEC to generate a proper specifications file" + ;; + esac + local required_paths="'lib'" for path in ${RUBY_FAKEGEM_REQUIRE_PATHS}; do required_paths="${required_paths}, '${path}'" @@ -332,8 +346,7 @@ ruby_fakegem_binwrapper() { # one or multiple implementations; if we're installing for a # *single* implementation, no need to use “/usr/bin/env ruby” # in the shebang, and we can actually avoid errors when - # calling the script by default (see for instance the - # JRuby-specific commands). + # calling the script by default. local rubycmd= for implementation in $(_ruby_get_all_impls); do # ignore non-enabled implementations diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass index 90c36cd86e40..dd9d3f2418ca 100644 --- a/eclass/ruby-ng.eclass +++ b/eclass/ruby-ng.eclass @@ -8,7 +8,7 @@ # Author: Diego E. Pettenò <flameeyes@gentoo.org> # Author: Alex Legler <a3li@gentoo.org> # Author: Hans de Graaff <graaff@gentoo.org> -# @SUPPORTED_EAPIS: 2 3 4 5 6 +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: An eclass for installing Ruby packages with proper support for multiple Ruby slots. # @DESCRIPTION: # The Ruby eclass is designed to allow an easier installation of Ruby packages @@ -43,7 +43,7 @@ # @DESCRIPTION: # Set the value to "yes" to make the dependency on a Ruby interpreter # optional and then ruby_implementations_depend() to help populate -# DEPEND and RDEPEND. +# BDEPEND, DEPEND and RDEPEND. # @ECLASS-VARIABLE: RUBY_S # @DEFAULT_UNSET @@ -68,20 +68,25 @@ local inherits="" case ${EAPI} in - 2|3|4|5) - inherits="eutils" + 4|5) + inherits="eutils toolchain-funcs" + ;; + 6) + inherits="estack toolchain-funcs" + ;; + *) + inherits="estack" ;; esac -inherit ${inherits} java-utils-2 multilib toolchain-funcs ruby-utils +inherit ${inherits} multilib ruby-utils EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_setup case ${EAPI} in - 0|1) + 0|1|2|3) die "Unsupported EAPI=${EAPI} (too old) for ruby-ng.eclass" ;; - 2|3) ;; - 4|5|6) + 4|5|6|7) # S is no longer automatically assigned when it doesn't exist. S="${WORKDIR}" ;; @@ -203,9 +208,16 @@ ruby_add_rdepend() { case $# in 1) ;; 2) - [[ "${GENTOO_DEV}" == "yes" ]] && eqawarn "You can now use the usual syntax in ruby_add_rdepend for $CATEGORY/$PF" - ruby_add_rdepend "$(_ruby_wrap_conditions "$1" "$2")" - return + case ${EAPI} in + 4|5|6) + [[ "${GENTOO_DEV}" == "yes" ]] && eqawarn "You can now use the usual syntax in ruby_add_rdepend for $CATEGORY/$PF" + ruby_add_rdepend "$(_ruby_wrap_conditions "$1" "$2")" + return + ;; + *) + die "Use the usual depend syntax with a single argument in ruby_add_rdepend" + ;; + esac ;; *) die "bad number of arguments to $0" @@ -218,26 +230,36 @@ ruby_add_rdepend() { # Add the dependency as a test-dependency since we're going to # execute the code during test phase. - DEPEND="${DEPEND} test? ( ${dependency} )" + case ${EAPI} in + 4|5|6) DEPEND="${DEPEND} test? ( ${dependency} )" ;; + *) BDEPEND="${BDEPEND} test? ( ${dependency} )" ;; + esac has test "$IUSE" || IUSE="${IUSE} test" } # @FUNCTION: ruby_add_bdepend # @USAGE: dependencies # @DESCRIPTION: -# Adds the specified dependencies, with use condition(s) to DEPEND, -# taking the current set of ruby targets into account. This makes sure -# that all ruby dependencies of the package are installed for the same -# ruby targets. Use this function for all ruby dependencies instead of -# setting DEPEND yourself. The list of atoms uses the same syntax as -# normal dependencies. +# Adds the specified dependencies, with use condition(s) to DEPEND (or +# BDEPEND in EAPI7), taking the current set of ruby targets into +# account. This makes sure that all ruby dependencies of the package are +# installed for the same ruby targets. Use this function for all ruby +# dependencies instead of setting DEPEND or BDEPEND yourself. The list +# of atoms uses the same syntax as normal dependencies. ruby_add_bdepend() { case $# in 1) ;; 2) - [[ "${GENTOO_DEV}" == "yes" ]] && eqawarn "You can now use the usual syntax in ruby_add_bdepend for $CATEGORY/$PF" - ruby_add_bdepend "$(_ruby_wrap_conditions "$1" "$2")" - return + case ${EAPI} in + 4|5|6) + [[ "${GENTOO_DEV}" == "yes" ]] && eqawarn "You can now use the usual syntax in ruby_add_bdepend for $CATEGORY/$PF" + ruby_add_bdepend "$(_ruby_wrap_conditions "$1" "$2")" + return + ;; + *) + die "Use the usual depend syntax with a single argument in ruby_add_bdepend" + ;; + esac ;; *) die "bad number of arguments to $0" @@ -246,10 +268,34 @@ ruby_add_bdepend() { local dependency=$(_ruby_atoms_samelib "$1") - DEPEND="${DEPEND} $dependency" + case ${EAPI} in + 4|5|6) DEPEND="${DEPEND} $dependency" ;; + *) BDEPEND="${BDEPEND} $dependency" ;; + esac RDEPEND="${RDEPEND}" } +# @FUNCTION: ruby_add_depend +# @USAGE: dependencies +# @DESCRIPTION: +# Adds the specified dependencies to DEPEND in EAPI7, similar to +# ruby_add_bdepend. +ruby_add_depend() { + case ${EAPI} in + 4|5|6) die "only available in EAPI 7 and newer" ;; + *) ;; + esac + + case $# in + 1) ;; + *) die "bad number of arguments to $0" ;; + esac + + local dependency=$(_ruby_atoms_samelib "$1") + + DEPEND="${DEPEND} $dependency" +} + # @FUNCTION: ruby_get_use_implementations # @DESCRIPTION: # Gets an array of ruby use targets enabled by the user @@ -281,7 +327,7 @@ ruby_get_use_targets() { # confuse this function with ruby_implementation_depend(). # # @EXAMPLE: -# EAPI=6 +# EAPI=7 # RUBY_OPTIONAL=yes # # inherit ruby-ng @@ -302,40 +348,25 @@ IUSE+=" $(ruby_get_use_targets)" if [[ ${RUBY_OPTIONAL} != yes ]]; then DEPEND="${DEPEND} $(ruby_implementations_depend)" RDEPEND="${RDEPEND} $(ruby_implementations_depend)" - - case ${EAPI:-0} in - 4|5|6) - REQUIRED_USE+=" || ( $(ruby_get_use_targets) )" - ;; + REQUIRED_USE+=" || ( $(ruby_get_use_targets) )" + case ${EAPI} in + 4|5|6) ;; + *) BDEPEND="${BDEPEND} $(ruby_implementations_depend)" ;; esac fi _ruby_invoke_environment() { old_S=${S} - case ${EAPI} in - 4|5|6) - if [ -z "${RUBY_S}" ]; then - sub_S=${P} - else - sub_S=${RUBY_S} - fi - ;; - *) - sub_S=${S#${WORKDIR}/} - ;; - esac + if [ -z "${RUBY_S}" ]; then + sub_S=${P} + else + sub_S=${RUBY_S} + fi # Special case, for the always-lovely GitHub fetches. With this, # we allow the star glob to just expand to whatever directory it's # called. if [[ "${sub_S}" = *"*"* ]]; then - case ${EAPI} in - 2|3) - #The old method of setting S depends on undefined package - # manager behaviour, so encourage upgrading to EAPI=4. - eqawarn "Using * expansion of S is deprecated. Use EAPI and RUBY_S instead." - ;; - esac pushd "${WORKDIR}"/all &>/dev/null || die # use an array to trigger filename expansion # fun fact: this expansion fails in src_unpack() but the original @@ -402,8 +433,6 @@ ruby-ng_pkg_setup() { # before doing anything; by leaving the parameters empty we know # it's a special case. _ruby_each_implementation - - has ruby_targets_jruby ${IUSE} && use ruby_targets_jruby && java-pkg_setup-vm } # @FUNCTION: ruby-ng_src_unpack @@ -425,7 +454,7 @@ ruby-ng_src_unpack() { _ruby_apply_patches() { case ${EAPI} in - 2|3|4|5) + 4|5) for patch in "${RUBY_PATCHES[@]}"; do if [ -f "${patch}" ]; then epatch "${patch}" @@ -441,6 +470,11 @@ _ruby_apply_patches() { eqawarn "RUBY_PATCHES is no longer supported, use PATCHES instead" fi ;; + *) + if [[ -n ${RUBY_PATCHES[@]} ]]; then + die "RUBY_PATCHES is no longer supported, use PATCHES instead" + fi + ;; esac # This is a special case: instead of executing just in the special @@ -468,7 +502,9 @@ ruby-ng_src_prepare() { # Handle PATCHES and user supplied patches via the default phase case ${EAPI} in - 6) + 4|5) + ;; + *) _ruby_invoke_environment all default ;; esac @@ -524,12 +560,10 @@ _each_ruby_check_install() { # we have a Mach-O object here [[ ${CHOST} == *-darwin ]] && scancmd=scanmacho - has "${EAPI}" 2 && ! use prefix && EPREFIX= - - local libruby_basename=$(${RUBY} -rrbconfig -e 'puts RbConfig::CONFIG["LIBRUBY_SO"]') + local libruby_basename=$(ruby_rbconfig_value 'LIBRUBY_SO') local libruby_soname=$(basename $(${scancmd} -F "%S#F" -qS "${EPREFIX}/usr/$(get_libdir)/${libruby_basename}") 2>/dev/null) - local sitedir=$(${RUBY} -rrbconfig -e 'puts RbConfig::CONFIG["sitedir"]') - local sitelibdir=$(${RUBY} -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]') + local sitedir=$(ruby_rbconfig_value 'sitedir') + local sitelibdir=$(ruby_rbconfig_value 'sitelibdir') # The current implementation lacks libruby (i.e.: jruby) [[ -z ${libruby_soname} ]] && return 0 @@ -578,7 +612,6 @@ ruby_rbconfig_value() { # Installs the specified file(s) into the sitelibdir of the Ruby interpreter in ${RUBY}. doruby() { [[ -z ${RUBY} ]] && die "\$RUBY is not set" - has "${EAPI}" 2 && ! use prefix && EPREFIX= ( # don't want to pollute calling env sitelibdir=$(ruby_rbconfig_value 'sitelibdir') insinto ${sitelibdir#${EPREFIX}} @@ -619,9 +652,6 @@ ruby_get_implementation() { local ruby=${RUBY:-$(type -p ruby 2>/dev/null)} case $(${ruby} --version) in - *jruby*) - echo "jruby" - ;; *rubinius*) echo "rbx" ;; @@ -649,8 +679,8 @@ ruby-ng_rspec() { files="spec" fi - if [[ ${DEPEND} != *"dev-ruby/rspec"* ]]; then - ewarn "Missing dev-ruby/rspec in \${DEPEND}" + if [[ "${DEPEND}${BDEPEND}" != *"dev-ruby/rspec"* ]]; then + ewarn "Missing test dependency dev-ruby/rspec" fi local rspec_params= @@ -680,8 +710,8 @@ ruby-ng_rspec() { # This is simply a wrapper around the cucumber command (executed by $RUBY}) # which also respects TEST_VERBOSE and NOCOLOR environment variables. ruby-ng_cucumber() { - if [[ ${DEPEND} != *"dev-util/cucumber"* ]]; then - ewarn "Missing dev-util/cucumber in \${DEPEND}" + if [[ "${DEPEND}${BDEPEND}" != *"dev-util/cucumber"* ]]; then + ewarn "Missing test dependency dev-util/cucumber" fi local cucumber_params= @@ -703,11 +733,6 @@ ruby-ng_cucumber() { ;; esac - if [[ ${RUBY} == *jruby ]]; then - ewarn "Skipping cucumber tests on JRuby (unsupported)." - return 0 - fi - ${RUBY} -S cucumber ${cucumber_params} "$@" || die "cucumber failed" } @@ -719,8 +744,8 @@ ruby-ng_cucumber() { # their script and we installed a broken wrapper for a while. # This also respects TEST_VERBOSE and NOCOLOR environment variables. ruby-ng_testrb-2() { - if [[ ${DEPEND} != *"dev-ruby/test-unit"* ]]; then - ewarn "Missing dev-ruby/test-unit in \${DEPEND}" + if [[ "${DEPEND}${BDEPEND}" != *"dev-ruby/test-unit"* ]]; then + ewarn "Missing test dependency dev-ruby/test-unit" fi local testrb_params= diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass index 4406724f380f..89d06fd75e33 100644 --- a/eclass/ruby-utils.eclass +++ b/eclass/ruby-utils.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Authors +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: ruby-utils.eclass @@ -28,7 +28,7 @@ if [[ ! ${_RUBY_UTILS} ]]; then # provide for a better first installation experience. # All stable RUBY_TARGETS -RUBY_TARGETS_PREFERENCE="ruby24 ruby23 " +RUBY_TARGETS_PREFERENCE="ruby24 " # All other active ruby targets RUBY_TARGETS_PREFERENCE+="ruby25 ruby26" diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass index 4dd2b48c6ce6..6d26820bc090 100644 --- a/eclass/subversion.eclass +++ b/eclass/subversion.eclass @@ -28,6 +28,8 @@ case ${EAPI:-0} in ;; esac +PROPERTIES+=" live" + DEPEND="|| ( dev-vcs/subversion[http] dev-vcs/subversion[webdav-neon] diff --git a/eclass/user.eclass b/eclass/user.eclass index fdf98caa6099..a3cacb6d5f10 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -157,10 +157,10 @@ enewuser() { euid="next" fi if [[ ${euid} == "next" ]] ; then - for ((euid = 101; euid <= 999; euid++)); do + for ((euid = 999; euid >= 101; euid--)); do [[ -z $(egetent passwd ${euid}) ]] && break done - [[ ${euid} -le 999 ]] || die "${FUNCNAME}: no free UID found" + [[ ${euid} -ge 101 ]] || die "${FUNCNAME}: no free UID found" fi opts+=( -u ${euid} ) einfo " - Userid: ${euid}" @@ -318,10 +318,10 @@ enewgroup() { _enewgroup_next_gid() { if [[ ${egid} == *[!0-9]* ]] ; then # Non numeric - for ((egid = 101; egid <= 999; egid++)) ; do + for ((egid = 999; egid >= 101; egid--)) ; do [[ -z $(egetent group ${egid}) ]] && break done - [[ ${egid} -le 999 ]] || die "${FUNCNAME}: no free GID found" + [[ ${egid} -ge 101 ]] || die "${FUNCNAME}: no free GID found" fi } @@ -445,11 +445,12 @@ egetgroups() { local egroups_arr read -r -a egroups_arr < <(id -G -n "$1") - local defgroup=${egroups_arr[0]} + local g groups=${egroups_arr[0]} # sort supplementary groups to make comparison possible - readarray -t exgroups_arr < <(printf '%s\n' "${egroups_arr[@]:1}" | sort) - local exgroups=${exgroups_arr[*]} - echo "${defgroup}${exgroups:+,${exgroups// /,}}" + while read -r g; do + [[ -n ${g} ]] && groups+=",${g}" + done < <(printf '%s\n' "${egroups_arr[@]:1}" | sort) + echo "${groups}" } # @FUNCTION: esethome diff --git a/eclass/vcs-snapshot.eclass b/eclass/vcs-snapshot.eclass index 316a37773d43..05d963917e25 100644 --- a/eclass/vcs-snapshot.eclass +++ b/eclass/vcs-snapshot.eclass @@ -1,46 +1,49 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: vcs-snapshot.eclass # @MAINTAINER: # mgorny@gentoo.org -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 # @BLURB: support eclass for unpacking VCS snapshot tarballs # @DESCRIPTION: +# THIS ECLASS IS NOT NECESSARY FOR MODERN GITHUB AND GITLAB SNAPSHOTS. +# THEIR DIRECTORY STRUCTURE IS ENTIRELY PREDICTABLE, SO UPDATE YOUR +# EBUILD TO USE /ARCHIVE/ URI AND SET S IF NECESSARY. +# # This eclass provides a convenience src_unpack() which does unpack all # the tarballs in SRC_URI to locations matching their (local) names, # discarding the original parent directory. # -# The typical use case are VCS snapshots, coming from bitbucket -# and similar services. They have hash appended to the directory name -# which makes extracting them a painful experience. But if you just use -# a SRC_URI arrow to rename it (which you're likely have to do anyway), -# vcs-snapshot will just extract it into a matching directory. +# The typical use case are VCS tag snapshots coming from BitBucket +# (but not GitHub or GitLab). They have hash appended to the directory +# name which makes extracting them a painful experience. But if you are +# using a SRC_URI arrow to rename them (which quite likely you have to +# do anyway), vcs-snapshot will just extract them into matching +# directories. # # Please note that this eclass handles only tarballs (.tar, .tar.gz, -# .tar.bz2 & .tar.xz). For any other file format (or suffix) it will -# fall back to regular unpack. Support for additional formats may be -# added at some point so please keep your SRC_URIs clean. -# -# Note: this eclass is no longer needed with the new-style 'archive' -# GitHub URLs. They have sane directory names and stable contents, -# so you should really prefer them. +# .tar.bz2 & .tar.xz). For any other file format (or suffix) it will +# fall back to regular unpack. Support for additional formats may be +# added in the future if necessary. # # @EXAMPLE: # # @CODE -# EAPI=6 +# EAPI=7 # inherit vcs-snapshot # -# SRC_URI="https://github.com/example/${PN}/tarball/v${PV} -> ${P}.tar.gz -# https://github.com/example/${PN}-otherstuff/tarball/v${PV} -> ${P}-otherstuff.tar.gz" +# SRC_URI=" +# https://bitbucket.org/foo/bar/get/${PV}.tar.bz2 -> ${P}.tar.bz2 +# https://bitbucket.org/foo/bar-otherstuff/get/${PV}.tar.bz2 +# -> ${P}-otherstuff.tar.bz2" # @CODE # # and however the tarballs were originally packed, all files will appear # in ${WORKDIR}/${P} and ${WORKDIR}/${P}-otherstuff respectively. case ${EAPI:-0} in - 0|1|2|3|4|5|6) ;; + 0|1|2|3|4|5|6|7) ;; *) die "vcs-snapshot.eclass API in EAPI ${EAPI} not yet established." esac @@ -55,6 +58,7 @@ EXPORT_FUNCTIONS src_unpack vcs-snapshot_src_unpack() { debug-print-function ${FUNCNAME} "${@}" + local renamed_any= local f for f in ${A} @@ -65,10 +69,25 @@ vcs-snapshot_src_unpack() { debug-print "${FUNCNAME}: unpacking ${f} to ${destdir}" - # XXX: check whether the directory structure inside is - # fine? i.e. if the tarball has actually a parent dir. + local l topdirs=() + while read -r l; do + topdirs+=( "${l}" ) + done < <(tar -t -f "${DISTDIR}/${f}" | cut -d/ -f1 | sort -u) + if [[ ${#topdirs[@]} -gt 1 ]]; then + eerror "The archive ${f} contains multiple or no top directory." + eerror "It is impossible for vcs-snapshot to unpack this correctly." + eerror "Top directories found:" + local d + for d in "${topdirs[@]}"; do + eerror " ${d}" + done + die "${FUNCNAME}: Invalid directory structure in archive ${f}" + fi + [[ ${topdirs[0]} != ${f%.tar*} ]] && renamed_any=1 + mkdir "${destdir}" || die # -o (--no-same-owner) to avoid restoring original owner + einfo "Unpacking ${f}" tar -C "${destdir}" -x -o --strip-components 1 \ -f "${DISTDIR}/${f}" || die ;; @@ -80,4 +99,14 @@ vcs-snapshot_src_unpack() { ;; esac done + + if [[ ! ${renamed_any} ]]; then + local w=eerror + [[ ${EAPI} == [0123456] ]] && w=eqawarn + "${w}" "${FUNCNAME} did not find any archives that needed renaming." + "${w}" "Please verify that its usage is really necessary, and remove" + "${w}" "the inherit if it is not." + + [[ ${w} == eerror ]] && die "${FUNCNAME}: Unnecessary usage detected" + fi } diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass index fb6a867a35cc..40eeea5463bc 100644 --- a/eclass/virtualx.eclass +++ b/eclass/virtualx.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: virtualx.eclass @@ -178,7 +178,10 @@ virtx() { # Xvfb is started, else bump the display number # # Azarah - 5 May 2002 - XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i}) + # GNOME GDM may have started X on DISPLAY :0 with a + # lock file /tmp/.X1024-lock, therefore start the search at 1. + # Else a leftover /tmp/.X1-lock will prevent finding an available display. + XDISPLAY=$(i=1; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i}) debug-print "${FUNCNAME}: XDISPLAY=${XDISPLAY}" # We really do not want SANDBOX enabled here |