Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
merged:

  gentoo-staging: 36b7e77385748bbd848fc114f3e5a083c5c0661c
  flora: f9eb34243923b86ff795183c2f90281fd11fe7f7
  faustoo: 01938450417d623e17de399cc18447dc251ca016
  fusion809: 9daec531a164d89ba52d906900d871fddfb92e63
  kit-fixups: 5e82c3502a56d4ba55b9074a8f65c6bba97d003a
  • Loading branch information
danielrobbins committed Jun 28, 2017
0 parents commit 04e2581
Show file tree
Hide file tree
Showing 5,656 changed files with 200,272 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
404 changes: 404 additions & 0 deletions eclass/autotools-utils.eclass

Large diffs are not rendered by default.

613 changes: 613 additions & 0 deletions eclass/autotools.eclass

Large diffs are not rendered by default.

210 changes: 210 additions & 0 deletions eclass/base.eclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# DEPRECATED
# This eclass has been deprecated and must not be used by any new
# ebuilds or eclasses. Replacements for particular phase functions
# in EAPI 2+:
#
# base_src_unpack() - default (or unpacker_src_unpack if unpacker.eclass
# was inherited)
# base_src_prepare() - inherit eutils, inline:
# epatch "${PATCHES[@]}" # if PATCHES defined as array
# epatch ${PATCHES} # if PATCHES defined as string
# epatch_user
# base_src_configure() - default
# base_src_compile() - default
# base_src_install() - default
# base_src_install_docs() - einstalldocs from eutils.eclass

# @ECLASS: base.eclass
# @MAINTAINER:
# QA Team <[email protected]>
# @AUTHOR:
# Original author: Dan Armak <[email protected]>
# @BLURB: The base eclass defines some default functions and variables.
# @DESCRIPTION:
# The base eclass defines some default functions and variables.

if [[ -z ${_BASE_ECLASS} ]]; then
_BASE_ECLASS=1

inherit eutils

BASE_EXPF="src_unpack src_compile src_install"
case "${EAPI:-0}" in
6) die "${ECLASS}.eclass is banned in EAPI ${EAPI}";;
2|3|4|5) BASE_EXPF+=" src_prepare src_configure" ;;
*) ;;
esac

EXPORT_FUNCTIONS ${BASE_EXPF}

# @ECLASS-VARIABLE: DOCS
# @DESCRIPTION:
# Array containing documents passed to dodoc command.
#
# DOCS=( "${S}/doc/document.txt" "${S}/doc/doc_folder/" )

# @ECLASS-VARIABLE: HTML_DOCS
# @DESCRIPTION:
# Array containing documents passed to dohtml command.
#
# HTML_DOCS=( "${S}/doc/document.html" "${S}/doc/html_folder/" )

# @ECLASS-VARIABLE: PATCHES
# @DESCRIPTION:
# PATCHES array variable containing all various patches to be applied.
# This variable is expected to be defined in global scope of ebuild.
# Make sure to specify the full path. This variable is utilised in
# src_unpack/src_prepare phase based on EAPI.
#
# NOTE: if using patches folders with special file suffixes you have to
# define one additional variable EPATCH_SUFFIX="something"
#
# PATCHES=( "${FILESDIR}/mypatch.patch" "${FILESDIR}/patches_folder/" )


# @FUNCTION: base_src_unpack
# @DESCRIPTION:
# The base src_unpack function, which is exported.
# Calls also src_prepare with eapi older than 2.
base_src_unpack() {
debug-print-function $FUNCNAME "$@"

pushd "${WORKDIR}" > /dev/null

if [[ $(type -t unpacker_src_unpack) == "function" ]] ; then
unpacker_src_unpack
elif [[ -n ${A} ]] ; then
unpack ${A}
fi
has src_prepare ${BASE_EXPF} || base_src_prepare

popd > /dev/null
}

# @FUNCTION: base_src_prepare
# @DESCRIPTION:
# The base src_prepare function, which is exported
# EAPI is greater or equal to 2. Here the PATCHES array is evaluated.
base_src_prepare() {
debug-print-function $FUNCNAME "$@"
debug-print "$FUNCNAME: PATCHES=$PATCHES"

local patches_failed=0

pushd "${S}" > /dev/null
if [[ "$(declare -p PATCHES 2>/dev/null 2>&1)" == "declare -a"* ]]; then
for x in "${PATCHES[@]}"; do
debug-print "$FUNCNAME: applying patch from ${x}"
if [[ -d "${x}" ]]; then
# Use standardized names and locations with bulk patching
# Patch directory is ${WORKDIR}/patch
# See epatch() in eutils.eclass for more documentation
EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch}

# in order to preserve normal EPATCH_SOURCE value that can
# be used other way than with base eclass store in local
# variable and restore later
oldval=${EPATCH_SOURCE}
EPATCH_SOURCE=${x}
EPATCH_FORCE=yes
epatch
EPATCH_SOURCE=${oldval}
elif [[ -f "${x}" ]]; then
epatch "${x}"
else
ewarn "QA: File or directory \"${x}\" does not exist."
ewarn "QA: Check your PATCHES array or add missing file/directory."
patches_failed=1
fi
done
[[ ${patches_failed} -eq 1 ]] && die "Some patches failed. See above messages."
else
for x in ${PATCHES}; do
debug-print "$FUNCNAME: patching from ${x}"
epatch "${x}"
done
fi

# Apply user patches
debug-print "$FUNCNAME: applying user patches"
epatch_user

popd > /dev/null
}

# @FUNCTION: base_src_configure
# @DESCRIPTION:
# The base src_configure function, which is exported when
# EAPI is greater or equal to 2. Runs basic econf.
base_src_configure() {
debug-print-function $FUNCNAME "$@"

# there is no pushd ${S} so we can override its place where to run
[[ -x ${ECONF_SOURCE:-.}/configure ]] && econf "$@"
}

# @FUNCTION: base_src_compile
# @DESCRIPTION:
# The base src_compile function, calls src_configure with
# EAPI older than 2.
base_src_compile() {
debug-print-function $FUNCNAME "$@"

has src_configure ${BASE_EXPF} || base_src_configure
base_src_make "$@"
}

# @FUNCTION: base_src_make
# @DESCRIPTION:
# Actual function that runs emake command.
base_src_make() {
debug-print-function $FUNCNAME "$@"

if [[ -f Makefile || -f GNUmakefile || -f makefile ]]; then
emake "$@" || die "died running emake, $FUNCNAME"
fi
}

# @FUNCTION: base_src_install
# @DESCRIPTION:
# The base src_install function. Runs make install and
# installs documents and html documents from DOCS and HTML_DOCS
# arrays.
base_src_install() {
debug-print-function $FUNCNAME "$@"

emake DESTDIR="${D}" "$@" install || die "died running make install, $FUNCNAME"
base_src_install_docs
}

# @FUNCTION: base_src_install_docs
# @DESCRIPTION:
# Actual function that install documentation from
# DOCS and HTML_DOCS arrays.
base_src_install_docs() {
debug-print-function $FUNCNAME "$@"

local x

pushd "${S}" > /dev/null

if [[ "$(declare -p DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then
for x in "${DOCS[@]}"; do
debug-print "$FUNCNAME: docs: creating document from ${x}"
dodoc "${x}" || die "dodoc failed"
done
fi
if [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then
for x in "${HTML_DOCS[@]}"; do
debug-print "$FUNCNAME: docs: creating html document from ${x}"
dohtml -r "${x}" || die "dohtml failed"
done
fi

popd > /dev/null
}

fi
135 changes: 135 additions & 0 deletions eclass/bash-completion-r1.eclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: bash-completion-r1.eclass
# @MAINTAINER:
# [email protected]
# @BLURB: A few quick functions to install bash-completion files
# @EXAMPLE:
#
# @CODE
# EAPI=5
#
# src_configure() {
# econf \
# --with-bash-completion-dir="$(get_bashcompdir)"
# }
#
# src_install() {
# default
#
# newbashcomp contrib/${PN}.bash-completion ${PN}
# }
# @CODE

inherit toolchain-funcs

case ${EAPI:-0} in
0|1|2|3|4|5|6) ;;
*) die "EAPI ${EAPI} unsupported (yet)."
esac

# @FUNCTION: _bash-completion-r1_get_bashdir
# @INTERNAL
# @DESCRIPTION:
# First argument is name of the string in bash-completion.pc
# Second argument is the fallback directory if the string is not found
# @EXAMPLE:
# _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion
_bash-completion-r1_get_bashdir() {
debug-print-function ${FUNCNAME} "${@}"

if $(tc-getPKG_CONFIG) --exists bash-completion &>/dev/null; then
local path
path=$($(tc-getPKG_CONFIG) --variable="${1}" bash-completion) || die
# we need to return unprefixed, so strip from what pkg-config returns
# to us, bug #477692
echo "${path#${EPREFIX}}"
else
echo "${2}"
fi
}

# @FUNCTION: _bash-completion-r1_get_bashcompdir
# @INTERNAL
# @DESCRIPTION:
# Get unprefixed bash-completion completions directory.
_bash-completion-r1_get_bashcompdir() {
debug-print-function ${FUNCNAME} "${@}"

_bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions
}

# @FUNCTION: _bash-completion-r1_get_helpersdir
# @INTERNAL
# @DESCRIPTION:
# Get unprefixed bash-completion helpers directory.
_bash-completion-r1_get_bashhelpersdir() {
debug-print-function ${FUNCNAME} "${@}"

_bash-completion-r1_get_bashdir helpersdir /usr/share/bash-completion/helpers
}

# @FUNCTION: get_bashcompdir
# @DESCRIPTION:
# Get the bash-completion completions directory.
get_bashcompdir() {
debug-print-function ${FUNCNAME} "${@}"

echo "${EPREFIX}$(_bash-completion-r1_get_bashcompdir)"
}

# @FUNCTION: get_bashhelpersdir
# @INTERNAL
# @DESCRIPTION:
# Get the bash-completion helpers directory.
get_bashhelpersdir() {
debug-print-function ${FUNCNAME} "${@}"

echo "${EPREFIX}$(_bash-completion-r1_get_bashhelpersdir)"
}

# @FUNCTION: dobashcomp
# @USAGE: file [...]
# @DESCRIPTION:
# Install bash-completion files passed as args. Has EAPI-dependant failure
# behavior (like doins).
dobashcomp() {
debug-print-function ${FUNCNAME} "${@}"

(
insinto "$(_bash-completion-r1_get_bashcompdir)"
doins "${@}"
)
}

# @FUNCTION: newbashcomp
# @USAGE: file newname
# @DESCRIPTION:
# Install bash-completion file under a new name. Has EAPI-dependant failure
# behavior (like newins).
newbashcomp() {
debug-print-function ${FUNCNAME} "${@}"

(
insinto "$(_bash-completion-r1_get_bashcompdir)"
newins "${@}"
)
}

# @FUNCTION: bashcomp_alias
# @USAGE: <basename> <alias>...
# @DESCRIPTION:
# Alias <basename> completion to one or more commands (<alias>es).
bashcomp_alias() {
debug-print-function ${FUNCNAME} "${@}"

[[ ${#} -lt 2 ]] && die "Usage: ${FUNCNAME} <basename> <alias>..."
local base=${1} f
shift

for f; do
dosym "${base}" "$(_bash-completion-r1_get_bashcompdir)/${f}" \
|| return
done
}
Loading

0 comments on commit 04e2581

Please sign in to comment.