diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-12-01 03:04:39 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-12-01 03:04:39 +0000 |
commit | 407525b571b48cfd65e1ad7a02d250a927c967c9 (patch) | |
tree | 844bea44d85dc7218f54970af1c42cc9d55c3f1a /eclass | |
parent | 89c6c06b8c42107dd231687a1012354e7d3039fc (diff) |
gentoo resync : 01.12.2017
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 41338 -> 41503 bytes | |||
-rw-r--r-- | eclass/desktop.eclass | 395 | ||||
-rw-r--r-- | eclass/eutils.eclass | 435 | ||||
-rw-r--r-- | eclass/git-r3.eclass | 75 | ||||
-rw-r--r-- | eclass/leechcraft.eclass | 2 | ||||
-rw-r--r-- | eclass/php-ext-pecl-r3.eclass | 8 | ||||
-rw-r--r-- | eclass/qt5-build.eclass | 40 |
7 files changed, 486 insertions, 469 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 03dc3f96d341..6a62566d5825 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass new file mode 100644 index 000000000000..d65b0d0bf074 --- /dev/null +++ b/eclass/desktop.eclass @@ -0,0 +1,395 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: desktop.eclass +# @MAINTAINER: +# base-system@gentoo.org +# @BLURB: support for desktop files, menus, and icons + +if [[ -z ${_DESKTOP_ECLASS} ]]; then +_DESKTOP_ECLASS=1 + +# @FUNCTION: make_desktop_entry +# @USAGE: make_desktop_entry(<command>, [name], [icon], [type], [fields]) +# @DESCRIPTION: +# Make a .desktop file. +# +# @CODE +# binary: what command does the app run with ? +# name: the name that will show up in the menu +# icon: the icon to use in the menu entry +# this can be relative (to /usr/share/pixmaps) or +# a full path to an icon +# type: what kind of application is this? +# for categories: +# https://specifications.freedesktop.org/menu-spec/latest/apa.html +# if unset, function tries to guess from package's category +# fields: extra fields to append to the desktop file; a printf string +# @CODE +make_desktop_entry() { + [[ -z $1 ]] && die "make_desktop_entry: You must specify the executable" + + local exec=${1} + local name=${2:-${PN}} + local icon=${3:-${PN}} + local type=${4} + local fields=${5} + + if [[ -z ${type} ]] ; then + local catmaj=${CATEGORY%%-*} + local catmin=${CATEGORY##*-} + case ${catmaj} in + app) + case ${catmin} in + accessibility) type="Utility;Accessibility";; + admin) type=System;; + antivirus) type=System;; + arch) type="Utility;Archiving";; + backup) type="Utility;Archiving";; + cdr) type="AudioVideo;DiscBurning";; + dicts) type="Office;Dictionary";; + doc) type=Documentation;; + editors) type="Utility;TextEditor";; + emacs) type="Development;TextEditor";; + emulation) type="System;Emulator";; + laptop) type="Settings;HardwareSettings";; + office) type=Office;; + pda) type="Office;PDA";; + vim) type="Development;TextEditor";; + xemacs) type="Development;TextEditor";; + esac + ;; + + dev) + type="Development" + ;; + + games) + case ${catmin} in + action|fps) type=ActionGame;; + arcade) type=ArcadeGame;; + board) type=BoardGame;; + emulation) type=Emulator;; + kids) type=KidsGame;; + puzzle) type=LogicGame;; + roguelike) type=RolePlaying;; + rpg) type=RolePlaying;; + simulation) type=Simulation;; + sports) type=SportsGame;; + strategy) type=StrategyGame;; + esac + type="Game;${type}" + ;; + + gnome) + type="Gnome;GTK" + ;; + + kde) + type="KDE;Qt" + ;; + + mail) + type="Network;Email" + ;; + + media) + case ${catmin} in + gfx) + type=Graphics + ;; + *) + case ${catmin} in + radio) type=Tuner;; + sound) type=Audio;; + tv) type=TV;; + video) type=Video;; + esac + type="AudioVideo;${type}" + ;; + esac + ;; + + net) + case ${catmin} in + dialup) type=Dialup;; + ftp) type=FileTransfer;; + im) type=InstantMessaging;; + irc) type=IRCClient;; + mail) type=Email;; + news) type=News;; + nntp) type=News;; + p2p) type=FileTransfer;; + voip) type=Telephony;; + esac + type="Network;${type}" + ;; + + sci) + case ${catmin} in + astro*) type=Astronomy;; + bio*) type=Biology;; + calc*) type=Calculator;; + chem*) type=Chemistry;; + elec*) type=Electronics;; + geo*) type=Geology;; + math*) type=Math;; + physics) type=Physics;; + visual*) type=DataVisualization;; + esac + type="Education;Science;${type}" + ;; + + sys) + type="System" + ;; + + www) + case ${catmin} in + client) type=WebBrowser;; + esac + type="Network;${type}" + ;; + + *) + type= + ;; + esac + fi + local slot=${SLOT%/*} + if [[ ${slot} == "0" ]] ; then + local desktop_name="${PN}" + else + local desktop_name="${PN}-${slot}" + fi + local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" + #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop + + # Don't append another ";" when a valid category value is provided. + type=${type%;}${type:+;} + + if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then + ewarn "As described in the Icon Theme Specification, icon file extensions are not" + ewarn "allowed in .desktop files if the value is not an absolute path." + icon=${icon%.*} + fi + + cat <<-EOF > "${desktop}" + [Desktop Entry] + Name=${name} + Type=Application + Comment=${DESCRIPTION} + Exec=${exec} + TryExec=${exec%% *} + Icon=${icon} + Categories=${type} + EOF + + if [[ ${fields:-=} != *=* ]] ; then + # 5th arg used to be value to Path= + ewarn "make_desktop_entry: update your 5th arg to read Path=${fields}" + fields="Path=${fields}" + fi + [[ -n ${fields} ]] && printf '%b\n' "${fields}" >> "${desktop}" + + ( + # wrap the env here so that the 'insinto' call + # doesn't corrupt the env of the caller + insinto /usr/share/applications + doins "${desktop}" + ) || die "installing desktop file failed" +} + +# @FUNCTION: make_session_desktop +# @USAGE: <title> <command> [command args...] +# @DESCRIPTION: +# Make a GDM/KDM Session file. The title is the file to execute to start the +# Window Manager. The command is the name of the Window Manager. +# +# You can set the name of the file via the ${wm} variable. +make_session_desktop() { + [[ -z $1 ]] && eerror "$0: You must specify the title" && return 1 + [[ -z $2 ]] && eerror "$0: You must specify the command" && return 1 + + local title=$1 + local command=$2 + local desktop=${T}/${wm:-${PN}}.desktop + shift 2 + + cat <<-EOF > "${desktop}" + [Desktop Entry] + Name=${title} + Comment=This session logs you into ${title} + Exec=${command} $* + TryExec=${command} + Type=XSession + EOF + + ( + # wrap the env here so that the 'insinto' call + # doesn't corrupt the env of the caller + insinto /usr/share/xsessions + doins "${desktop}" + ) +} + +# @FUNCTION: domenu +# @USAGE: <menus> +# @DESCRIPTION: +# Install the list of .desktop menu files into the appropriate directory +# (/usr/share/applications). +domenu() { + ( + # wrap the env here so that the 'insinto' call + # doesn't corrupt the env of the caller + local i j ret=0 + insinto /usr/share/applications + for i in "$@" ; do + if [[ -f ${i} ]] ; then + doins "${i}" + ((ret+=$?)) + elif [[ -d ${i} ]] ; then + for j in "${i}"/*.desktop ; do + doins "${j}" + ((ret+=$?)) + done + else + ((++ret)) + fi + done + exit ${ret} + ) +} + +# @FUNCTION: newmenu +# @USAGE: <menu> <newname> +# @DESCRIPTION: +# Like all other new* functions, install the specified menu as newname. +newmenu() { + ( + # wrap the env here so that the 'insinto' call + # doesn't corrupt the env of the caller + insinto /usr/share/applications + newins "$@" + ) +} + +# @FUNCTION: _iconins +# @INTERNAL +# @DESCRIPTION: +# function for use in doicon and newicon +_iconins() { + ( + # wrap the env here so that the 'insinto' call + # doesn't corrupt the env of the caller + local funcname=$1; shift + local size dir + local context=apps + local theme=hicolor + + while [[ $# -gt 0 ]] ; do + case $1 in + -s|--size) + if [[ ${2%%x*}x${2%%x*} == "$2" ]] ; then + size=${2%%x*} + else + size=${2} + fi + case ${size} in + 16|22|24|32|36|48|64|72|96|128|192|256|512) + size=${size}x${size};; + scalable) + ;; + *) + eerror "${size} is an unsupported icon size!" + exit 1;; + esac + shift 2;; + -t|--theme) + theme=${2} + shift 2;; + -c|--context) + context=${2} + shift 2;; + *) + if [[ -z ${size} ]] ; then + insinto /usr/share/pixmaps + else + insinto /usr/share/icons/${theme}/${size}/${context} + fi + + if [[ ${funcname} == doicon ]] ; then + if [[ -f $1 ]] ; then + doins "${1}" + elif [[ -d $1 ]] ; then + shopt -s nullglob + doins "${1}"/*.{png,svg} + shopt -u nullglob + else + eerror "${1} is not a valid file/directory!" + exit 1 + fi + else + break + fi + shift 1;; + esac + done + if [[ ${funcname} == newicon ]] ; then + newins "$@" + fi + ) || die +} + +# @FUNCTION: doicon +# @USAGE: [options] <icons> +# @DESCRIPTION: +# Install icon into the icon directory /usr/share/icons or into +# /usr/share/pixmaps if "--size" is not set. +# This is useful in conjunction with creating desktop/menu files. +# +# @CODE +# options: +# -s, --size +# !!! must specify to install into /usr/share/icons/... !!! +# size of the icon, like 48 or 48x48 +# supported icon sizes are: +# 16 22 24 32 36 48 64 72 96 128 192 256 512 scalable +# -c, --context +# defaults to "apps" +# -t, --theme +# defaults to "hicolor" +# +# icons: list of icons +# +# example 1: doicon foobar.png fuqbar.svg suckbar.png +# results in: insinto /usr/share/pixmaps +# doins foobar.png fuqbar.svg suckbar.png +# +# example 2: doicon -s 48 foobar.png fuqbar.png blobbar.png +# results in: insinto /usr/share/icons/hicolor/48x48/apps +# doins foobar.png fuqbar.png blobbar.png +# @CODE +doicon() { + _iconins ${FUNCNAME} "$@" +} + +# @FUNCTION: newicon +# @USAGE: [options] <icon> <newname> +# @DESCRIPTION: +# Like doicon, install the specified icon as newname. +# +# @CODE +# example 1: newicon foobar.png NEWNAME.png +# results in: insinto /usr/share/pixmaps +# newins foobar.png NEWNAME.png +# +# example 2: newicon -s 48 foobar.png NEWNAME.png +# results in: insinto /usr/share/icons/hicolor/48x48/apps +# newins foobar.png NEWNAME.png +# @CODE +newicon() { + _iconins ${FUNCNAME} "$@" +} + +fi diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index f35fa5980d7a..7d4193e76b51 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -20,7 +20,7 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI:-0} in 0|1|2|3|4|5|6) - inherit epatch estack ltprune multilib toolchain-funcs + inherit desktop epatch estack ltprune multilib toolchain-funcs ;; esac @@ -115,427 +115,6 @@ edos2unix() { sed -i 's/\r$//' -- "$@" || die } -# @FUNCTION: make_desktop_entry -# @USAGE: make_desktop_entry(<command>, [name], [icon], [type], [fields]) -# @DESCRIPTION: -# Make a .desktop file. -# -# @CODE -# binary: what command does the app run with ? -# name: the name that will show up in the menu -# icon: the icon to use in the menu entry -# this can be relative (to /usr/share/pixmaps) or -# a full path to an icon -# type: what kind of application is this? -# for categories: -# https://specifications.freedesktop.org/menu-spec/latest/apa.html -# if unset, function tries to guess from package's category -# fields: extra fields to append to the desktop file; a printf string -# @CODE -make_desktop_entry() { - [[ -z $1 ]] && die "make_desktop_entry: You must specify the executable" - - local exec=${1} - local name=${2:-${PN}} - local icon=${3:-${PN}} - local type=${4} - local fields=${5} - - if [[ -z ${type} ]] ; then - local catmaj=${CATEGORY%%-*} - local catmin=${CATEGORY##*-} - case ${catmaj} in - app) - case ${catmin} in - accessibility) type="Utility;Accessibility";; - admin) type=System;; - antivirus) type=System;; - arch) type="Utility;Archiving";; - backup) type="Utility;Archiving";; - cdr) type="AudioVideo;DiscBurning";; - dicts) type="Office;Dictionary";; - doc) type=Documentation;; - editors) type="Utility;TextEditor";; - emacs) type="Development;TextEditor";; - emulation) type="System;Emulator";; - laptop) type="Settings;HardwareSettings";; - office) type=Office;; - pda) type="Office;PDA";; - vim) type="Development;TextEditor";; - xemacs) type="Development;TextEditor";; - esac - ;; - - dev) - type="Development" - ;; - - games) - case ${catmin} in - action|fps) type=ActionGame;; - arcade) type=ArcadeGame;; - board) type=BoardGame;; - emulation) type=Emulator;; - kids) type=KidsGame;; - puzzle) type=LogicGame;; - roguelike) type=RolePlaying;; - rpg) type=RolePlaying;; - simulation) type=Simulation;; - sports) type=SportsGame;; - strategy) type=StrategyGame;; - esac - type="Game;${type}" - ;; - - gnome) - type="Gnome;GTK" - ;; - - kde) - type="KDE;Qt" - ;; - - mail) - type="Network;Email" - ;; - - media) - case ${catmin} in - gfx) - type=Graphics - ;; - *) - case ${catmin} in - radio) type=Tuner;; - sound) type=Audio;; - tv) type=TV;; - video) type=Video;; - esac - type="AudioVideo;${type}" - ;; - esac - ;; - - net) - case ${catmin} in - dialup) type=Dialup;; - ftp) type=FileTransfer;; - im) type=InstantMessaging;; - irc) type=IRCClient;; - mail) type=Email;; - news) type=News;; - nntp) type=News;; - p2p) type=FileTransfer;; - voip) type=Telephony;; - esac - type="Network;${type}" - ;; - - sci) - case ${catmin} in - astro*) type=Astronomy;; - bio*) type=Biology;; - calc*) type=Calculator;; - chem*) type=Chemistry;; - elec*) type=Electronics;; - geo*) type=Geology;; - math*) type=Math;; - physics) type=Physics;; - visual*) type=DataVisualization;; - esac - type="Education;Science;${type}" - ;; - - sys) - type="System" - ;; - - www) - case ${catmin} in - client) type=WebBrowser;; - esac - type="Network;${type}" - ;; - - *) - type= - ;; - esac - fi - local slot=${SLOT%/*} - if [[ ${slot} == "0" ]] ; then - local desktop_name="${PN}" - else - local desktop_name="${PN}-${slot}" - fi - local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop" - #local desktop=${T}/${exec%% *:-${desktop_name}}.desktop - - # Don't append another ";" when a valid category value is provided. - type=${type%;}${type:+;} - - if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then - ewarn "As described in the Icon Theme Specification, icon file extensions are not" - ewarn "allowed in .desktop files if the value is not an absolute path." - icon=${icon%.*} - fi - - cat <<-EOF > "${desktop}" - [Desktop Entry] - Name=${name} - Type=Application - Comment=${DESCRIPTION} - Exec=${exec} - TryExec=${exec%% *} - Icon=${icon} - Categories=${type} - EOF - - if [[ ${fields:-=} != *=* ]] ; then - # 5th arg used to be value to Path= - ewarn "make_desktop_entry: update your 5th arg to read Path=${fields}" - fields="Path=${fields}" - fi - [[ -n ${fields} ]] && printf '%b\n' "${fields}" >> "${desktop}" - - ( - # wrap the env here so that the 'insinto' call - # doesn't corrupt the env of the caller - insinto /usr/share/applications - doins "${desktop}" - ) || die "installing desktop file failed" -} - -# @FUNCTION: _eutils_eprefix_init -# @INTERNAL -# @DESCRIPTION: -# Initialized prefix variables for EAPI<3. -_eutils_eprefix_init() { - has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}} -} - -# @FUNCTION: validate_desktop_entries -# @USAGE: [directories] -# @DESCRIPTION: -# Validate desktop entries using desktop-file-utils -validate_desktop_entries() { - eqawarn "validate_desktop_entries is deprecated and should be not be used." - eqawarn ".desktop file validation is done implicitly by Portage now." - - _eutils_eprefix_init - if [[ -x "${EPREFIX}"/usr/bin/desktop-file-validate ]] ; then - einfo "Checking desktop entry validity" - local directories="" - for d in /usr/share/applications $@ ; do - [[ -d ${ED}${d} ]] && directories="${directories} ${ED}${d}" - done - if [[ -n ${directories} ]] ; then - for FILE in $(find ${directories} -name "*\.desktop" \ - -not -path '*.hidden*' | sort -u 2>/dev/null) - do - local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \ - sed -e "s|error: ||" -e "s|${FILE}:|--|g" ) - [[ -n $temp ]] && elog ${temp/--/${FILE/${ED}/}:} - done - fi - echo "" - else - einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo." - fi -} - -# @FUNCTION: make_session_desktop -# @USAGE: <title> <command> [command args...] -# @DESCRIPTION: -# Make a GDM/KDM Session file. The title is the file to execute to start the -# Window Manager. The command is the name of the Window Manager. -# -# You can set the name of the file via the ${wm} variable. -make_session_desktop() { - [[ -z $1 ]] && eerror "$0: You must specify the title" && return 1 - [[ -z $2 ]] && eerror "$0: You must specify the command" && return 1 - - local title=$1 - local command=$2 - local desktop=${T}/${wm:-${PN}}.desktop - shift 2 - - cat <<-EOF > "${desktop}" - [Desktop Entry] - Name=${title} - Comment=This session logs you into ${title} - Exec=${command} $* - TryExec=${command} - Type=XSession - EOF - - ( - # wrap the env here so that the 'insinto' call - # doesn't corrupt the env of the caller - insinto /usr/share/xsessions - doins "${desktop}" - ) -} - -# @FUNCTION: domenu -# @USAGE: <menus> -# @DESCRIPTION: -# Install the list of .desktop menu files into the appropriate directory -# (/usr/share/applications). -domenu() { - ( - # wrap the env here so that the 'insinto' call - # doesn't corrupt the env of the caller - local i j ret=0 - insinto /usr/share/applications - for i in "$@" ; do - if [[ -f ${i} ]] ; then - doins "${i}" - ((ret+=$?)) - elif [[ -d ${i} ]] ; then - for j in "${i}"/*.desktop ; do - doins "${j}" - ((ret+=$?)) - done - else - ((++ret)) - fi - done - exit ${ret} - ) -} - -# @FUNCTION: newmenu -# @USAGE: <menu> <newname> -# @DESCRIPTION: -# Like all other new* functions, install the specified menu as newname. -newmenu() { - ( - # wrap the env here so that the 'insinto' call - # doesn't corrupt the env of the caller - insinto /usr/share/applications - newins "$@" - ) -} - -# @FUNCTION: _iconins -# @INTERNAL -# @DESCRIPTION: -# function for use in doicon and newicon -_iconins() { - ( - # wrap the env here so that the 'insinto' call - # doesn't corrupt the env of the caller - local funcname=$1; shift - local size dir - local context=apps - local theme=hicolor - - while [[ $# -gt 0 ]] ; do - case $1 in - -s|--size) - if [[ ${2%%x*}x${2%%x*} == "$2" ]] ; then - size=${2%%x*} - else - size=${2} - fi - case ${size} in - 16|22|24|32|36|48|64|72|96|128|192|256|512) - size=${size}x${size};; - scalable) - ;; - *) - eerror "${size} is an unsupported icon size!" - exit 1;; - esac - shift 2;; - -t|--theme) - theme=${2} - shift 2;; - -c|--context) - context=${2} - shift 2;; - *) - if [[ -z ${size} ]] ; then - insinto /usr/share/pixmaps - else - insinto /usr/share/icons/${theme}/${size}/${context} - fi - - if [[ ${funcname} == doicon ]] ; then - if [[ -f $1 ]] ; then - doins "${1}" - elif [[ -d $1 ]] ; then - shopt -s nullglob - doins "${1}"/*.{png,svg} - shopt -u nullglob - else - eerror "${1} is not a valid file/directory!" - exit 1 - fi - else - break - fi - shift 1;; - esac - done - if [[ ${funcname} == newicon ]] ; then - newins "$@" - fi - ) || die -} - -# @FUNCTION: doicon -# @USAGE: [options] <icons> -# @DESCRIPTION: -# Install icon into the icon directory /usr/share/icons or into -# /usr/share/pixmaps if "--size" is not set. -# This is useful in conjunction with creating desktop/menu files. -# -# @CODE -# options: -# -s, --size -# !!! must specify to install into /usr/share/icons/... !!! -# size of the icon, like 48 or 48x48 -# supported icon sizes are: -# 16 22 24 32 36 48 64 72 96 128 192 256 512 scalable -# -c, --context -# defaults to "apps" -# -t, --theme -# defaults to "hicolor" -# -# icons: list of icons -# -# example 1: doicon foobar.png fuqbar.svg suckbar.png -# results in: insinto /usr/share/pixmaps -# doins foobar.png fuqbar.svg suckbar.png -# -# example 2: doicon -s 48 foobar.png fuqbar.png blobbar.png -# results in: insinto /usr/share/icons/hicolor/48x48/apps -# doins foobar.png fuqbar.png blobbar.png -# @CODE -doicon() { - _iconins ${FUNCNAME} "$@" -} - -# @FUNCTION: newicon -# @USAGE: [options] <icon> <newname> -# @DESCRIPTION: -# Like doicon, install the specified icon as newname. -# -# @CODE -# example 1: newicon foobar.png NEWNAME.png -# results in: insinto /usr/share/pixmaps -# newins foobar.png NEWNAME.png -# -# example 2: newicon -s 48 foobar.png NEWNAME.png -# results in: insinto /usr/share/icons/hicolor/48x48/apps -# newins foobar.png NEWNAME.png -# @CODE -newicon() { - _iconins ${FUNCNAME} "$@" -} - # @FUNCTION: strip-linguas # @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>] # @DESCRIPTION: @@ -585,6 +164,14 @@ strip-linguas() { export LINGUAS=${newls:1} } +# @FUNCTION: _eutils_eprefix_init +# @INTERNAL +# @DESCRIPTION: +# Initialized prefix variables for EAPI<3. +_eutils_eprefix_init() { + has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}} +} + # @FUNCTION: preserve_old_lib # @USAGE: <libs to preserve> [more libs] # @DESCRIPTION: @@ -869,10 +456,6 @@ optfeature() { fi } -check_license() { - die "you no longer need this as portage supports ACCEPT_LICENSE itself" -} - case ${EAPI:-0} in 0|1|2) diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass index c9d2731a64fe..55a987b79545 100644 --- a/eclass/git-r3.eclass +++ b/eclass/git-r3.eclass @@ -553,6 +553,7 @@ _git-r3_is_local_repo() { git-r3_fetch() { debug-print-function ${FUNCNAME} "$@" + # process repos first since we create repo_name from it local repos if [[ ${1} ]]; then repos=( ${1} ) @@ -562,12 +563,6 @@ git-r3_fetch() { repos=( ${EGIT_REPO_URI} ) fi - local branch=${EGIT_BRANCH:+refs/heads/${EGIT_BRANCH}} - local remote_ref=${2:-${EGIT_COMMIT:-${branch:-HEAD}}} - local local_id=${3:-${CATEGORY}/${PN}/${SLOT%/*}} - local local_ref=refs/git-r3/${local_id}/__main__ - local commit_date=${4:-${EGIT_COMMIT_DATE}} - [[ ${repos[@]} ]] || die "No URI provided and EGIT_REPO_URI unset" local r @@ -591,6 +586,54 @@ git-r3_fetch() { ) fi + # get the default values for the common variables and override them + local branch_name=${EGIT_BRANCH} + local commit_id=${2:-${EGIT_COMMIT}} + local commit_date=${4:-${EGIT_COMMIT_DATE}} + + # support new override API for EAPI 6+ + if ! has "${EAPI:-0}" 0 1 2 3 4 5; then + # get the name and do some more processing: + # 1) kill .git suffix, + # 2) underscore (remaining) non-variable characters, + # 3) add preceding underscore if it starts with a digit, + # 4) uppercase. + local override_name=${GIT_DIR##*/} + override_name=${override_name%.git} + override_name=${override_name//[^a-zA-Z0-9_]/_} + override_name=${override_name^^} + + local varmap=( + REPO:repos + BRANCH:branch_name + COMMIT:commit_id + COMMIT_DATE:commit_date + ) + + local localvar livevar live_warn= + for localvar in "${varmap[@]}"; do + livevar=EGIT_OVERRIDE_${localvar%:*}_${override_name} + localvar=${localvar#*:} + + if [[ -n ${!livevar} ]]; then + [[ ${localvar} == repos ]] && repos=() + live_warn=1 + ewarn "Using ${livevar}=${!livevar}" + declare "${localvar}=${!livevar}" + fi + done + + if [[ ${live_warn} ]]; then + ewarn "No support will be provided." + fi + fi + + # set final variables after applying overrides + local branch=${branch_name:+refs/heads/${branch_name}} + local remote_ref=${commit_id:-${branch:-HEAD}} + local local_id=${3:-${CATEGORY}/${PN}/${SLOT%/*}} + local local_ref=refs/git-r3/${local_id}/__main__ + # try to fetch from the remote local success saved_umask if [[ ${EVCS_UMASK} ]]; then @@ -803,7 +846,7 @@ git-r3_fetch() { } # @FUNCTION: git-r3_checkout -# @USAGE: [<repo-uri> [<checkout-path> [<local-id>]]] +# @USAGE: [<repo-uri> [<checkout-path> [<local-id> [<checkout-paths>...]]]] # @DESCRIPTION: # Check the previously fetched tree to the working copy. # @@ -819,6 +862,12 @@ git-r3_fetch() { # <local-id> needs to specify the local identifier that was used # for respective git-r3_fetch. # +# If <checkout-paths> are specified, then the specified paths are passed +# to 'git checkout' to effect a partial checkout. Please note that such +# checkout will not cause the repository to switch branches, +# and submodules will be skipped at the moment. The submodules matching +# those paths might be checked out in a future version of the eclass. +# # The checkout operation will write to the working copy, and export # the repository state into the environment. If the repository contains # submodules, they will be checked out recursively. @@ -836,6 +885,7 @@ git-r3_checkout() { local out_dir=${2:-${EGIT_CHECKOUT_DIR:-${WORKDIR}/${P}}} local local_id=${3:-${CATEGORY}/${PN}/${SLOT%/*}} + local checkout_paths=( "${@:4}" ) local -x GIT_DIR _git-r3_set_gitdir "${repos[0]}" @@ -883,6 +933,9 @@ git-r3_checkout() { else set -- "${@}" "${new_commit_id}" fi + if [[ ${checkout_paths[@]} ]]; then + set -- "${@}" -- "${checkout_paths[@]}" + fi echo "${@}" >&2 "${@}" || die "git checkout ${remote_ref:-${new_commit_id}} failed" } @@ -905,8 +958,12 @@ git-r3_checkout() { echo " updating from commit: ${old_commit_id}" echo " to commit: ${new_commit_id}" - git --no-pager diff --stat \ + set -- git --no-pager diff --stat \ ${old_commit_id}..${new_commit_id} + if [[ ${checkout_paths[@]} ]]; then + set -- "${@}" -- "${checkout_paths[@]}" + fi + "${@}" else echo " at the commit: ${new_commit_id}" fi @@ -914,7 +971,7 @@ git-r3_checkout() { git update-ref --no-deref refs/git-r3/"${local_id}"/{__old__,__main__} || die # recursively checkout submodules - if [[ -f ${out_dir}/.gitmodules ]]; then + if [[ -f ${out_dir}/.gitmodules && ! ${checkout_paths} ]]; then local submodules _git-r3_set_submodules \ "$(<"${out_dir}"/.gitmodules)" diff --git a/eclass/leechcraft.eclass b/eclass/leechcraft.eclass index 1c80745f524c..ce55a941ce10 100644 --- a/eclass/leechcraft.eclass +++ b/eclass/leechcraft.eclass @@ -18,7 +18,7 @@ # # Thanks for original eclass to Andrian Nord <NightNord@niifaq.ru>. # -# Only EAPI >4 supported +# Only EAPI >=6 is supported case ${EAPI:-0} in 6) ;; diff --git a/eclass/php-ext-pecl-r3.eclass b/eclass/php-ext-pecl-r3.eclass index 43ac788c464f..8df60a372053 100644 --- a/eclass/php-ext-pecl-r3.eclass +++ b/eclass/php-ext-pecl-r3.eclass @@ -8,7 +8,7 @@ # @DESCRIPTION: # This eclass should be used by all dev-php/pecl-* ebuilds as a uniform # way of installing PECL extensions. For more information about PECL, -# see http://pecl.php.net/ +# see https://pecl.php.net/ # @ECLASS-VARIABLE: PHP_EXT_PECL_PKG # @DESCRIPTION: @@ -47,15 +47,15 @@ inherit php-ext-source-r3 EXPORT_FUNCTIONS src_install src_test if [[ -z "${PHP_EXT_PECL_FILENAME}" ]] ; then - SRC_URI="http://pecl.php.net/get/${PHP_EXT_PECL_PKG_V}.tgz" + SRC_URI="https://pecl.php.net/get/${PHP_EXT_PECL_PKG_V}.tgz" else - SRC_URI="http://pecl.php.net/get/${PHP_EXT_PECL_FILENAME}" + SRC_URI="https://pecl.php.net/get/${PHP_EXT_PECL_FILENAME}" fi # Don't leave this laying around in the environment. unset PHP_EXT_PECL_PKG_V -HOMEPAGE="http://pecl.php.net/${PHP_EXT_PECL_PKG}" +HOMEPAGE="https://pecl.php.net/${PHP_EXT_PECL_PKG}" # @FUNCTION: php-ext-pecl-r3_src_install diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass index 11847bcf0139..7462ab2059b3 100644 --- a/eclass/qt5-build.eclass +++ b/eclass/qt5-build.eclass @@ -6,6 +6,7 @@ # qt@gentoo.org # @AUTHOR: # Davide Pesavento <pesa@gentoo.org> +# @SUPPORTED_EAPIS: 6 # @BLURB: Eclass for Qt5 split ebuilds. # @DESCRIPTION: # This eclass contains various functions that are used when building Qt5. @@ -21,9 +22,10 @@ case ${EAPI} in esac # @ECLASS-VARIABLE: QT5_MODULE +# @PRE_INHERIT # @DESCRIPTION: # The upstream name of the module this package belongs to. Used for -# SRC_URI and EGIT_REPO_URI. Must be defined before inheriting the eclass. +# SRC_URI and EGIT_REPO_URI. Must be set before inheriting the eclass. : ${QT5_MODULE:=${PN}} # @ECLASS-VARIABLE: QT5_TARGET_SUBDIRS @@ -50,19 +52,13 @@ esac inherit estack flag-o-matic ltprune toolchain-funcs versionator virtualx HOMEPAGE="https://www.qt.io/" +LICENSE="|| ( GPL-2 GPL-3 LGPL-3 ) FDL-1.3" +SLOT=5/$(get_version_component_range 1-2) QT5_MINOR_VERSION=$(get_version_component_range 2) QT5_PATCH_VERSION=$(get_version_component_range 3) readonly QT5_MINOR_VERSION QT5_PATCH_VERSION -if [[ ${QT5_MINOR_VERSION} -ge 7 ]]; then - LICENSE="|| ( GPL-2 GPL-3 LGPL-3 ) FDL-1.3" -else - LICENSE="|| ( LGPL-2.1 LGPL-3 ) FDL-1.3" -fi - -SLOT=5/$(get_version_component_range 1-2) - case ${PV} in 5.9999) # git dev branch @@ -98,6 +94,7 @@ EGIT_REPO_URI=( [[ ${QT5_BUILD_TYPE} == live ]] && inherit git-r3 # @ECLASS-VARIABLE: QT5_BUILD_DIR +# @OUTPUT_VARIABLE # @DESCRIPTION: # Build directory for out-of-source builds. case ${QT5_BUILD_TYPE} in @@ -131,10 +128,7 @@ EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install sr # Unpacks the sources. qt5-build_src_unpack() { if tc-is-gcc; then - local min_gcc4_minor_version=5 - if [[ ${QT5_MINOR_VERSION} -ge 7 || ${PN} == qtwebengine ]]; then - min_gcc4_minor_version=7 - fi + local min_gcc4_minor_version=7 if [[ $(gcc-major-version) -lt 4 ]] || \ [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt ${min_gcc4_minor_version} ]]; then eerror "GCC version 4.${min_gcc4_minor_version} or later is required to build this package" @@ -268,21 +262,9 @@ qt5-build_src_install() { if [[ ${PN} == qtcore ]]; then pushd "${QT5_BUILD_DIR}" >/dev/null || die - local qmake_install_target=install_qmake - if [[ ${QT5_MINOR_VERSION} -ge 7 ]]; then - # qmake/qmake-aux.pro - qmake_install_target=sub-qmake-qmake-aux-pro-install_subtargets - fi - - local global_docs_install_target= - if [[ ${QT5_MINOR_VERSION} -le 6 && ${QT5_PATCH_VERSION} -le 2 ]]; then - global_docs_install_target=install_global_docs - fi - set -- emake INSTALL_ROOT="${D}" \ - ${qmake_install_target} \ - install_{syncqt,mkspecs} \ - ${global_docs_install_target} + sub-qmake-qmake-aux-pro-install_subtargets \ + install_{syncqt,mkspecs} einfo "Running $*" "$@" @@ -585,7 +567,7 @@ qt5_base_configure() { # prefer system libraries (only common hard deps here) -system-zlib -system-pcre - $([[ ${QT5_MINOR_VERSION} -ge 7 ]] && echo -system-doubleconversion) + -system-doubleconversion # disable everything to prevent automagic deps (part 1) -no-mtdev @@ -603,7 +585,7 @@ qt5_base_configure() { -glib # disable everything to prevent automagic deps (part 2) - $([[ ${QT5_MINOR_VERSION} -ge 7 ]] && echo -no-gtk || echo -no-gtkstyle) + -no-gtk $([[ ${QT5_MINOR_VERSION} -lt 8 ]] && echo -no-pulseaudio -no-alsa) # exclude examples and tests from default build |