bump(profiles): sync with upstream

Packages updated:
  eclass
  licenses
  profiles
  scripts
This commit is contained in:
David Michael 2017-02-14 10:20:05 -08:00
parent 2994d100bb
commit 4aff1da21a
1544 changed files with 29532 additions and 80145 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
--- libltdl/config/ltmain.sh 2008-09-07 19:56:33.000000000 +0200
+++ libltdl/config/ltmain.sh.new 2009-02-15 20:37:47.000000000 +0100
--- ltmain.sh
+++ ltmain.sh
@@ -5768,7 +5768,7 @@
test "$hardcode_direct_absolute" = no; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
+ add_dir="-L$ROOT/$libdir"
+ add_dir="-L${SYSROOT}$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
@ -14,7 +14,7 @@
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
+ add_dir="-L$ROOT/$libdir"
+ add_dir="-L${SYSROOT}/$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in

View File

@ -0,0 +1,20 @@
--- ltmain.sh
+++ ltmain.sh
@@ -5768,7 +5768,7 @@
test "$hardcode_direct_absolute" = no; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
+ add_dir="-L${lt_sysroot:-${SYSROOT}}$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
@@ -5785,7 +5785,7 @@
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
+ add_dir="-L${lt_sysroot:-${SYSROOT}}/$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in

View File

@ -0,0 +1,21 @@
--- ltmain.sh
+++ ltmain.sh
@@ -8367,7 +8367,7 @@
test no = "$hardcode_direct_absolute"; then
add=$libdir/$linklib
elif test yes = "$hardcode_minus_L"; then
- add_dir=-L$libdir
+ add_dir=-L${lt_sysroot:-${SYSROOT}}$libdir
add=-l$name
elif test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
@@ -8384,7 +8384,7 @@
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir=-L$libdir
+ add_dir=-L${lt_sysroot:-${SYSROOT}}$libdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in

View File

@ -0,0 +1,29 @@
In Gentoo Prefix we go by Apple's convention to give modules the .bundle
extension.
http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/500-Linking/bs_linking.html
(Above link was removed by Apple, the link below contains a copy:
http://disanji.net/iOS_Doc/#documentation/DeveloperTools/Conceptual/XcodeBuildSystem/500-Linking/bs_linking.html,
in case it disappears also, the relevant quote:
Bundle. Bundles are executable files that can be loaded at runtime by
other products. Plug-ins are implemented using bundles. The term bundle
in this context refers to the binary itself, not to a structured
hierarchy. Bundles have the .bundle extension; for example,
MyBundle.bundle.)
--- configure
+++ configure
@@ -13108,11 +13108,11 @@
version_type=darwin
need_lib_prefix=no
need_version=no
- library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ library_names_spec='${libname}${release}${versuffix}$shared_ext $libname$release$major$shared_ext $libname$shared_ext'
soname_spec='$libname$release$major$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+ shrext_cmds='`test .$module = .yes && echo .bundle || echo .dylib`'
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'

View File

@ -23,7 +23,7 @@ case ${EAPI:-0} in
:;
;;
6)
die "This eclass is not yet ready for EAPI-6"
die "This eclass is not yet ready for EAPI-6. Please help porting it!"
;;
esac
@ -270,7 +270,7 @@ setup_modules() {
fi
if use ssl ; then
MY_CONF+=( --with-ssl="${EPREFIX}"/usr --enable-ssl=${mod_type} )
MY_CONF+=( --with-ssl --enable-ssl=${mod_type} )
MY_MODS+=( ssl )
else
MY_CONF+=( --without-ssl --disable-ssl )
@ -453,6 +453,20 @@ apache-2_src_prepare() {
epatch "${GENTOO_PATCHDIR}"/patches/*.patch
if [[ ${EAPI} = 5 ]] ; then
# Handle patches from ebuild's PATCHES array if one is given
if [[ -n "${PATCHES}" ]] ; then
local patchestype=$(declare -p PATCHES 2>&-)
if [[ "${patchestype}" != "declare -a PATCHES="* ]] ; then
die "Declaring PATCHES as a variable is forbidden. Please use an array instead."
fi
epatch "${PATCHES[@]}"
fi
# Handle user patches
epatch_user
fi
# setup the filesystem layout config
cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \
die "Failed preparing config.layout!"
@ -471,9 +485,16 @@ apache-2_src_prepare() {
# This package really should upgrade to using pcre's .pc file.
cat <<-\EOF >"${T}"/pcre-config
#!/bin/sh
[ "${flag}" = "--version" ] && set -- --modversion
exec ${PKG_CONFIG} libpcre "$@"
#!/bin/bash
flags=()
for flag; do
if [[ ${flag} == "--version" ]]; then
flags+=( --modversion )
else
flags+=( "${flag}" )
fi
done
exec ${PKG_CONFIG} libpcre "${flags[@]}"
EOF
chmod a+x "${T}"/pcre-config
}

View File

@ -24,7 +24,10 @@
# @DESCRIPTION:
# What major version of aspell is this dictionary for?
EXPORT_FUNCTIONS src_compile src_install
case ${EAPI} in
0|1) EXPORT_FUNCTIONS src_compile src_install ;;
*) EXPORT_FUNCTIONS src_configure src_compile src_install ;;
esac
#MY_P=${PN}-${PV%.*}-${PV#*.*.}
MY_P=${P%.*}-${PV##*.}
@ -46,11 +49,20 @@ else
DEPEND="${RDEPEND}"
fi
# @FUNCTION: aspell-dict_src_configure
# @DESCRIPTION:
# The aspell-dict src_configure function which is exported.
aspell-dict_src_configure() {
./configure || die
}
# @FUNCTION: aspell-dict_src_compile
# @DESCRIPTION:
# The aspell-dict src_compile function which is exported.
aspell-dict_src_compile() {
./configure || die
case ${EAPI} in
0|1) aspell-dict_src_configure ;;
esac
emake || die
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
@ -76,32 +76,8 @@ BITCOINCORE_LJR_NAME=ljr
[ -n "${BITCOINCORE_LJR_PV}" ] || BITCOINCORE_LJR_PV="${PV}"
case "${PV}" in
0.10*)
BITCOINCORE_MINOR=10
LIBSECP256K1_DEPEND="=dev-libs/libsecp256k1-0.0.0_pre20141212"
case "${PVR}" in
0.10.2)
BITCOINCORE_RBF_DIFF="16f45600c8c372a738ffef544292864256382601...a23678edc70204599299459a206709a00e039db7"
BITCOINCORE_RBF_PATCHFILE="${MyPN}-rbf-v0.10.2.patch"
;;
*)
BITCOINCORE_RBF_DIFF="16f45600c8c372a738ffef544292864256382601...4890416cde655559eba09d3fd6f79db7d0d6314a"
BITCOINCORE_RBF_PATCHFILE="${MyPN}-rbf-v0.10.2-r1.patch"
;;
esac
BITCOINCORE_XT_DIFF="047a89831760ff124740fe9f58411d57ee087078...d4084b62c42c38bfe302d712b98909ab26ecce2f"
;;
0.11*)
BITCOINCORE_MINOR=11
LIBSECP256K1_DEPEND="=dev-libs/libsecp256k1-0.0.0_pre20150423"
# RBF is bundled with ljr patchset since 0.11.1
if [ "${PVR}" = "0.11.0" ]; then
BITCOINCORE_RBF_DIFF="5f032c75eefb0fe8ff79ed9595da1112c05f5c4a...660b96d24916b8ef4e0677e5d6162e24e2db447e"
BITCOINCORE_RBF_PATCHFILE="${MyPN}-rbf-v0.11.0rc3.patch"
fi
;;
0.12*)
BITCOINCORE_MINOR=12
0.13*)
BITCOINCORE_MINOR=$(get_version_component_range 2)
IUSE="${IUSE} libressl"
OPENSSL_DEPEND="!libressl? ( dev-libs/openssl:0[-bindist] ) libressl? ( dev-libs/libressl )"
if in_bcc_iuse libevent; then
@ -198,7 +174,14 @@ fi
if [ "${BITCOINCORE_NEED_LIBSECP256K1}" = "1" ]; then
BITCOINCORE_COMMON_DEPEND="${BITCOINCORE_COMMON_DEPEND} $LIBSECP256K1_DEPEND"
fi
if [ "${PN}" != "libbitcoinconsensus" ] && ! use_if_iuse test; then
if [ "${PN}" = "libbitcoinconsensus" ]; then
DEPEND="$DEPEND ${BITCOINCORE_COMMON_DEPEND}
test? (
${UNIVALUE_DEPEND}
>=dev-libs/boost-1.52.0[threads(+)]
)
"
else
BITCOINCORE_COMMON_DEPEND="${BITCOINCORE_COMMON_DEPEND}
${UNIVALUE_DEPEND}
>=dev-libs/boost-1.52.0[threads(+)]
@ -220,9 +203,7 @@ if [ "${BITCOINCORE_NEED_LEVELDB}" = "1" ]; then
RDEPEND="${RDEPEND} virtual/bitcoin-leveldb"
fi
if in_bcc_iuse ljr; then
if [ "$BITCOINCORE_SERIES" = "0.10.x" ]; then
DEPEND="${DEPEND} ljr? ( dev-vcs/git )"
elif [ "${BITCOINCORE_LJR_NAME}" = "knots" ]; then
if [ "${BITCOINCORE_LJR_NAME}" = "knots" ]; then
DEPEND="${DEPEND} ljr? ( dev-lang/perl )"
fi
fi
@ -265,12 +246,6 @@ bitcoincore_pkg_pretend() {
$bitcoincore_policymsg_flag && einfo "For more information on any of the above, see ${LJR_PATCH_DESC}"
}
bitcoincore_git_apply() {
local patchfile="$1"
einfo "Applying ${patchfile##*/} ..."
git apply --whitespace=nowarn "${patchfile}" || die
}
bitcoincore_predelete_patch() {
local patchfile="$1"
mkdir -p "${WORKDIR}/pdp"
@ -307,12 +282,9 @@ bitcoincore_prepare() {
fi
if use_if_iuse ljr; then
if [ "${BITCOINCORE_LJR_NAME}" = "knots" ]; then
epatch "$(LJR_PATCH f)"
bitcoincore_predelete_patch "$(LJR_PATCH f)"
bitcoincore_predelete_patch "$(LJR_PATCH branding)"
epatch "$(LJR_PATCH ts)"
elif [ "${BITCOINCORE_SERIES}" = "0.10.x" ]; then
# Regular epatch won't work with binary files
bitcoincore_git_apply "$(LJR_PATCH ljrF)"
else
epatch "$(LJR_PATCH ljrF)"
fi
@ -358,6 +330,10 @@ bitcoincore_prepare() {
;;
esac
done
echo '#!/bin/true' >share/genbuild.sh
mkdir -p src/obj
echo "#define BUILD_SUFFIX gentoo${PVR#${PV}}" >src/obj/build.h
}
bitcoincore_autoreconf() {

View File

@ -4,9 +4,7 @@
# @ECLASS: bsdmk.eclass
# @MAINTAINER:
# Otavio R. Piske "AngusYoung" <angusyoung@gentoo.org>
# Diego Pettenò <flameeyes@gentoo.org>
# Benigno B. Junior <bbj@gentoo.org>
# maintainer-needed@gentoo.org
# @BLURB: Some functions for BSDmake
inherit toolchain-funcs portability flag-o-matic
@ -81,5 +79,5 @@ bsdmk_src_compile() {
# @DESCRIPTION:
# The bsdmk src_install function, which is exported
bsdmk_src_install() {
mkinstall || die "install failed"
mkinstall "$@" || die "install failed"
}

View File

@ -290,13 +290,13 @@ bzr_bootstrap() {
for patch in ${EBZR_PATCHES} ; do
if [[ -f ${patch} ]] ; then
epatch ${patch}
epatch "${patch}"
else
# This loop takes care of wildcarded patches given via
# EBZR_PATCHES in an ebuild
for lpatch in "${FILESDIR}"/${patch} ; do
if [[ -f ${lpatch} ]] ; then
epatch ${lpatch}
epatch "${lpatch}"
else
die "${EBZR}: ${patch} is not found"
fi

View File

@ -0,0 +1,132 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: cargo.eclass
# @MAINTAINER:
# rust@gentoo.org
# @AUTHOR:
# Doug Goldstein <cardoe@gentoo.org>
# @BLURB: common functions and variables for cargo builds
if [[ -z ${_CARGO_ECLASS} ]]; then
_CARGO_ECLASS=1
case ${EAPI} in
6) : ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
EXPORT_FUNCTIONS src_unpack src_compile src_install
IUSE="${IUSE} debug"
[[ ${CATEGORY}/${PN} != dev-util/cargo ]] && DEPEND=">=dev-util/cargo-0.13.0"
ECARGO_HOME="${WORKDIR}/cargo_home"
ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
# @FUNCTION: cargo_crate_uris
# @DESCRIPTION:
# Generates the URIs to put in SRC_URI to help fetch dependencies.
cargo_crate_uris() {
for crate in $*; do
local name version url
name="${crate%-*}"
version="${crate##*-}"
url="https://crates.io/api/v1/crates/${name}/${version}/download -> ${crate}.crate"
echo $url
done
}
# @FUNCTION: cargo_src_unpack
# @DESCRIPTION:
# Unpacks the package and the cargo registry
cargo_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
mkdir -p "${ECARGO_VENDOR}" || die
mkdir -p "${S}" || die
local archive
for archive in ${A}; do
case "${archive}" in
*.crate)
ebegin "Loading ${archive} into Cargo registry"
tar -xf "${DISTDIR}"/${archive} -C "${ECARGO_VENDOR}/" || die
# generate sha256sum of the crate itself as cargo needs this
shasum=$(sha256sum "${DISTDIR}"/${archive} | cut -d ' ' -f 1)
pkg=$(basename ${archive} .crate)
cat <<- EOF > ${ECARGO_VENDOR}/${pkg}/.cargo-checksum.json
{
"package": "${shasum}",
"files": {}
}
EOF
# if this is our target package we need it in ${WORKDIR} too
# to make ${S} (and handle any revisions too)
if [[ ${P} == ${pkg}* ]]; then
tar -xf "${DISTDIR}"/${archive} -C "${WORKDIR}" || die
fi
eend $?
;;
cargo-snapshot*)
ebegin "Unpacking ${archive}"
mkdir -p "${S}"/target/snapshot
tar -xzf "${DISTDIR}"/${archive} -C "${S}"/target/snapshot --strip-components 2 || die
# cargo's makefile needs this otherwise it will try to
# download it
touch "${S}"/target/snapshot/bin/cargo || die
eend $?
;;
*)
unpack ${archive}
;;
esac
done
cargo_gen_config
}
# @FUNCTION: cargo_gen_config
# @DESCRIPTION:
# Generate the $CARGO_HOME/config necessary to use our local registry
cargo_gen_config() {
debug-print-function ${FUNCNAME} "$@"
cat <<- EOF > ${ECARGO_HOME}/config
[source.gentoo]
directory = "${ECARGO_VENDOR}"
[source.crates-io]
replace-with = "gentoo"
local-registry = "/nonexistant"
EOF
}
# @FUNCTION: cargo_src_compile
# @DESCRIPTION:
# Build the package using cargo build
cargo_src_compile() {
debug-print-function ${FUNCNAME} "$@"
export CARGO_HOME="${ECARGO_HOME}"
cargo build -v $(usex debug "" --release) \
|| die "cargo build failed"
}
# @FUNCTION: cargo_src_install
# @DESCRIPTION:
# Installs the binaries generated by cargo
cargo_src_install() {
debug-print-function ${FUNCNAME} "$@"
cargo install --root="${D}/usr" $(usex debug --debug "") \
|| die "cargo install failed"
rm -f "${D}/usr/.crates.toml"
[ -d "${S}/man" ] && doman "${S}/man"
}
fi

View File

@ -0,0 +1,190 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: chromium-2.eclass
# @MAINTAINER:
# Chromium Herd <chromium@gentoo.org>
# @AUTHOR:
# Mike Gilbert <floppym@gentoo.org>
# @BLURB: Shared functions for chromium and google-chrome
inherit eutils linux-info
if [[ ${PN} == chromium ]]; then
IUSE+=" custom-cflags"
fi
# @FUNCTION: chromium_suid_sandbox_check_kernel_config
# @USAGE:
# @DESCRIPTION:
# Ensures the system kernel supports features needed for SUID sandbox to work.
chromium_suid_sandbox_check_kernel_config() {
has "${EAPI:-0}" 0 1 2 3 && die "EAPI=${EAPI} is not supported"
if [[ "${MERGE_TYPE}" == "source" || "${MERGE_TYPE}" == "binary" ]]; then
# Warn if the kernel does not support features needed for sandboxing.
# Bug #363987.
ERROR_PID_NS="PID_NS is required for sandbox to work"
ERROR_NET_NS="NET_NS is required for sandbox to work"
ERROR_USER_NS="USER_NS is required for sandbox to work"
ERROR_SECCOMP_FILTER="SECCOMP_FILTER is required for sandbox to work"
# Warn if the kernel does not support features needed for the browser to work
# (bug #552576, bug #556286).
ERROR_ADVISE_SYSCALLS="CONFIG_ADVISE_SYSCALLS is required for the renderer (bug #552576)"
ERROR_COMPAT_VDSO="CONFIG_COMPAT_VDSO causes segfaults (bug #556286)"
CONFIG_CHECK="~PID_NS ~NET_NS ~SECCOMP_FILTER ~USER_NS ~ADVISE_SYSCALLS ~!COMPAT_VDSO"
check_extra_config
fi
}
# @ECLASS-VARIABLE: CHROMIUM_LANGS
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of language packs available for this package.
_chromium_set_l10n_IUSE() {
[[ ${EAPI:-0} == 0 ]] && die "EAPI=${EAPI} is not supported"
local lang
for lang in ${CHROMIUM_LANGS}; do
# Default to enabled since we bundle them anyway.
# USE-expansion will take care of disabling the langs the user has not
# selected via L10N.
IUSE+=" +l10n_${lang}"
done
}
if [[ ${CHROMIUM_LANGS} ]]; then
_chromium_set_l10n_IUSE
fi
# @FUNCTION: chromium_remove_language_paks
# @USAGE:
# @DESCRIPTION:
# Removes pak files from the current directory for languages that the user has
# not selected via the L10N variable.
# Also performs QA checks to ensure CHROMIUM_LANGS has been set correctly.
chromium_remove_language_paks() {
local lang pak
# Look for missing pak files.
for lang in ${CHROMIUM_LANGS}; do
if [[ ! -e ${lang}.pak ]]; then
# https://bugs.gentoo.org/583762
if [[ ${lang} != sr-ME || ! -e me.pak ]]; then
eqawarn "L10N warning: no .pak file for ${lang} (${lang}.pak not found)"
fi
fi
done
# Bug 588198
rm -f fake-bidi.pak || die
# Look for extra pak files.
# Remove pak files that the user does not want.
for pak in *.pak; do
lang=${pak%.pak}
if [[ ${lang} == en-US ]]; then
continue
fi
# https://bugs.gentoo.org/583762
if [[ ${lang} == me ]]; then
if ! has sr-ME ${CHROMIUM_LANGS}; then
eqawarn "L10N warning: no sr-ME in LANGS"
elif ! use l10n_sr-ME; then
rm "${pak}" || die
fi
continue
fi
if ! has ${lang} ${CHROMIUM_LANGS}; then
eqawarn "L10N warning: no ${lang} in LANGS"
continue
fi
if ! use l10n_${lang}; then
rm "${pak}" || die
fi
done
}
chromium_pkg_die() {
if [[ "${EBUILD_PHASE}" != "compile" ]]; then
return
fi
# Prevent user problems like bug #348235.
eshopts_push -s extglob
if is-flagq '-g?(gdb)?([1-9])'; then
ewarn
ewarn "You have enabled debug info (i.e. -g or -ggdb in your CFLAGS/CXXFLAGS)."
ewarn "This produces very large build files causes the linker to consume large"
ewarn "amounts of memory."
ewarn
ewarn "Please try removing -g{,gdb} before reporting a bug."
ewarn
fi
eshopts_pop
# ccache often causes bogus compile failures, especially when the cache gets
# corrupted.
if has ccache ${FEATURES}; then
ewarn
ewarn "You have enabled ccache. Please try disabling ccache"
ewarn "before reporting a bug."
ewarn
fi
# No ricer bugs.
if use_if_iuse custom-cflags; then
ewarn
ewarn "You have enabled the custom-cflags USE flag."
ewarn "Please disable it before reporting a bug."
ewarn
fi
# If the system doesn't have enough memory, the compilation is known to
# fail. Print info about memory to recognize this condition.
einfo
einfo "$(grep MemTotal /proc/meminfo)"
einfo "$(grep SwapTotal /proc/meminfo)"
einfo
}
# @VARIABLE: EGYP_CHROMIUM_COMMAND
# @DESCRIPTION:
# Path to the gyp_chromium script.
: ${EGYP_CHROMIUM_COMMAND:=build/gyp_chromium}
# @VARIABLE: EGYP_CHROMIUM_DEPTH
# @DESCRIPTION:
# Depth for egyp_chromium.
: ${EGYP_CHROMIUM_DEPTH:=.}
# @FUNCTION: egyp_chromium
# @USAGE: [gyp arguments]
# @DESCRIPTION:
# Calls EGYP_CHROMIUM_COMMAND with depth EGYP_CHROMIUM_DEPTH and given
# arguments. The full command line is echoed for logging.
egyp_chromium() {
set -- "${EGYP_CHROMIUM_COMMAND}" --depth="${EGYP_CHROMIUM_DEPTH}" "$@"
echo "$@"
"$@"
}
# @FUNCTION: gyp_use
# @USAGE: <USE flag> [GYP flag] [true suffix] [false suffix]
# @DESCRIPTION:
# If USE flag is set, echo -D[GYP flag]=[true suffix].
#
# If USE flag is not set, echo -D[GYP flag]=[false suffix].
#
# [GYP flag] defaults to use_[USE flag] with hyphens converted to underscores.
#
# [true suffix] defaults to 1. [false suffix] defaults to 0.
gyp_use() {
local gypflag="-D${2:-use_${1//-/_}}="
usex "$1" "${gypflag}" "${gypflag}" "${3-1}" "${4-0}"
}

View File

@ -1,7 +1,12 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# DEPRECATED
# This eclass has been deprecated and should not be used by any new ebuilds.
# @DEAD
# @ECLASS: chromium.eclass
# @MAINTAINER:
# Chromium Herd <chromium@gentoo.org>
@ -11,6 +16,8 @@
inherit eutils fdo-mime gnome2-utils linux-info
eqawarn "chromium.eclass is deprecated"
if [[ ${CHROMIUM_EXPORT_PHASES} != no ]]; then
EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm
fi
@ -64,23 +71,11 @@ if [[ ${CHROMIUM_LANGS} ]]; then
fi
_chromium_crlang() {
local x
for x in "$@"; do
case $x in
es_LA) echo es-419 ;;
*) echo "${x/_/-}" ;;
esac
done
echo "${@/_/-}"
}
_chromium_syslang() {
local x
for x in "$@"; do
case $x in
es-419) echo es_LA ;;
*) echo "${x/-/_}" ;;
esac
done
echo "${@/-/_}"
}
_chromium_strip_pak() {

View File

@ -1,4 +1,4 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -57,7 +57,7 @@ _CMAKE_UTILS_ECLASS=1
# @ECLASS-VARIABLE: CMAKE_MIN_VERSION
# @DESCRIPTION:
# Specify the minimum required CMake version.
: ${CMAKE_MIN_VERSION:=2.8.12}
: ${CMAKE_MIN_VERSION:=3.6.3}
# @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES
# @DESCRIPTION:
@ -87,7 +87,6 @@ _CMAKE_UTILS_ECLASS=1
# Warn about variables that are declared on the command line
# but not used. Might give false-positives.
# "no" to disable (default) or anything else to enable.
: ${CMAKE_WARN_UNUSED_CLI:=no}
# @ECLASS-VARIABLE: PREFIX
# @DESCRIPTION:
@ -113,11 +112,12 @@ _CMAKE_UTILS_ECLASS=1
# Should be set by user in a per-package basis in /etc/portage/package.env.
case ${EAPI} in
2|3|4|5|6) : ;;
2|4|5) : ${CMAKE_WARN_UNUSED_CLI:=no} ;;
6) : ${CMAKE_WARN_UNUSED_CLI:=yes} ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
inherit toolchain-funcs multilib flag-o-matic eutils versionator
inherit toolchain-funcs multilib flag-o-matic eutils multiprocessing versionator
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
@ -161,7 +161,7 @@ _cmake_use_me_now() {
local arg=$2
[[ ! -z $3 ]] && arg=$3
[[ ${EAPI} == [2345] ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead"
[[ ${EAPI} == [2345] ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead"
local uper capitalised x
[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
@ -184,7 +184,7 @@ _cmake_use_me_now_inverted() {
[[ ! -z $3 ]] && arg=$3
if [[ ${EAPI} != [2345] && "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then
die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead"
die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1<related_CMake_variable>=\"\$(usex $2)\" instead"
fi
local uper capitalised x
@ -242,7 +242,7 @@ _cmake_generator_to_use() {
ninja)
# if ninja is enabled but not installed, the build could fail
# this could happen if ninja is manually enabled (eg. make.conf) but not installed
if ! has_version dev-util/ninja; then
if ! ROOT=/ has_version dev-util/ninja; then
die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR."
fi
generator_name="Ninja"
@ -262,15 +262,18 @@ _cmake_generator_to_use() {
# @FUNCTION: cmake_comment_add_subdirectory
# @USAGE: <subdirectory>
# @DESCRIPTION:
# Comment out an add_subdirectory call in CMakeLists.txt in the current directory
# Comment out one or more add_subdirectory calls in CMakeLists.txt in the current directory
cmake_comment_add_subdirectory() {
if [[ -z ${1} ]]; then
die "comment_add_subdirectory must be passed the directory name to comment"
die "comment_add_subdirectory must be passed at least one directory name to comment"
fi
if [[ -e "CMakeLists.txt" ]]; then
sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${1//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \
-i CMakeLists.txt || die "failed to comment add_subdirectory(${1})"
local d
for d in $@; do
sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \
-i CMakeLists.txt || die "failed to comment add_subdirectory(${d})"
done
fi
}
@ -514,22 +517,34 @@ enable_cmake-utils_src_configure() {
includes="<INCLUDES>"
fi
cat > "${build_rules}" <<- _EOF_ || die
SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${includes} ${CFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
SET (CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> ${includes} ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE)
SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE)
SET (PKG_CONFIG_EXECUTABLE $(type -P $(tc-getPKG_CONFIG)) CACHE FILEPATH "pkg-config executable" FORCE)
_EOF_
local myCC=$(tc-getCC) myCXX=$(tc-getCXX) myFC=$(tc-getFC)
# !!! IMPORTANT NOTE !!!
# Single slash below is intentional. CMake is weird and wants the
# CMAKE_*_VARIABLES split into two elements: the first one with
# compiler path, and the second one with all command-line options,
# space separated.
local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake
cat > ${toolchain_file} <<- _EOF_ || die
SET (CMAKE_C_COMPILER $(tc-getCC))
SET (CMAKE_CXX_COMPILER $(tc-getCXX))
SET (CMAKE_Fortran_COMPILER $(tc-getFC))
SET (CMAKE_ASM_COMPILER "${myCC/ /;}")
SET (CMAKE_C_COMPILER "${myCC/ /;}")
SET (CMAKE_CXX_COMPILER "${myCXX/ /;}")
SET (CMAKE_Fortran_COMPILER "${myFC/ /;}")
SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE)
SET (CMAKE_SYSTEM_PROCESSOR "${CHOST%%-*}")
_EOF_
# We are using the C compiler for assembly by default.
local -x ASMFLAGS=${CFLAGS}
local -x PKG_CONFIG=$(tc-getPKG_CONFIG)
if tc-is-cross-compiler; then
local sysname
case "${KERNEL:-linux}" in
@ -590,11 +605,26 @@ enable_cmake-utils_src_configure() {
local common_config=${BUILD_DIR}/gentoo_common_config.cmake
local libdir=$(get_libdir)
cat > "${common_config}" <<- _EOF_ || die
SET (CMAKE_GENTOO_BUILD ON CACHE BOOL "Indicate Gentoo package build")
SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
_EOF_
[[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
# Wipe the default optimization flags out of CMake
if [[ ${CMAKE_BUILD_TYPE} != Gentoo ]] && ! has "${EAPI}" 2 3 4 5; then
cat >> ${common_config} <<- _EOF_ || die
SET (CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_STATIC_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
_EOF_
fi
# Convert mycmakeargs to an array, for backwards compatibility
# Make the array a local variable since <=portage-2.1.6.x does not
# support global arrays (see bug #297255).
@ -628,7 +658,7 @@ enable_cmake-utils_src_configure() {
-DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}"
"${mycmakeargs_local[@]}"
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
-DCMAKE_INSTALL_DO_STRIP=OFF
$([[ ${EAPI} == [2345] ]] && echo -DCMAKE_INSTALL_DO_STRIP=OFF)
-DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}"
-DCMAKE_TOOLCHAIN_FILE="${toolchain_file}"
"${MYCMAKEARGS}"
@ -659,14 +689,30 @@ _ninjaopts_from_makeopts() {
set -- ${MAKEOPTS}
while (( $# )); do
case $1 in
-j|-l|-k)
ninjaopts+=( $1 $2 )
shift 2
-j|-l)
if [[ $# -eq 1 || $2 == -* ]]; then
if [[ $1 == -j ]]; then
# absurdly high job limit
ninjaopts+=( $1 9999 )
else # -l
# remove load limit (like make does for -l)
ninjaopts+=( $1 0 )
fi
shift 1
else
ninjaopts+=( $1 $2 )
shift 2
fi
;;
-j*|-l*|-k*)
-j*|-l*)
ninjaopts+=( $1 )
shift 1
;;
-k)
# -k 0 = any number of tasks can fail
ninjaopts+=( $1 0 )
shift 1
;;
*) shift ;;
esac
done
@ -735,7 +781,9 @@ enable_cmake-utils_src_test() {
[[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure )
if ctest "${myctestargs[@]}" "$@" ; then
set -- ctest -j "$(makeopts_jobs)" --test-load "$(makeopts_loadavg)" "${myctestargs[@]}" "$@"
echo "$@" >&2
if "$@" ; then
einfo "Tests succeeded."
popd > /dev/null || die
return 0

View File

@ -1,80 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# Author Matthew Kennedy <mkennedy@gentoo.org>
#
# Sundry code common to many Common Lisp related ebuilds.
# Some handy constants
inherit eutils multilib
CLSOURCEROOT=/usr/share/common-lisp/source/
CLSYSTEMROOT=/usr/share/common-lisp/systems/
# Many of our Common Lisp ebuilds are either inspired by, or actually
# use packages and files from the Debian project's archives.
do-debian-credits() {
docinto debian
for i in copyright README.Debian changelog; do
test -f $i && dodoc "${S}"/debian/${i}
done
docinto .
}
# BIG FAT HACK: Since the Portage emerge step kills file timestamp
# information, we need to compensate by ensuring all FASL files are
# more recent than their source files.
# The following `impl-*-timestamp-hack' functions SHOULD NOT be used
# outside of this eclass.
impl-save-timestamp-hack() {
local impl=$1
dodir /usr/share/${impl}
tar cpjf "${D}"/usr/share/${impl}/portage-timestamp-compensate -C "${D}"/usr/$(get_libdir)/${impl} .
}
impl-restore-timestamp-hack() {
local impl=$1
tar xjpfo /usr/share/${impl}/portage-timestamp-compensate -C /usr/$(get_libdir)/${impl}
}
impl-remove-timestamp-hack() {
local impl=$1
rm -rf /usr/$(get_libdir)/${impl} &>/dev/null || true
}
standard-impl-postinst() {
local impl=$1
unregister-common-lisp-implementation cmucl
case ${impl} in
cmucl|sbcl)
impl-restore-timestamp-hack ${impl}
;;
*)
;;
esac
register-common-lisp-implementation ${impl}
}
standard-impl-postrm() {
local impl=$1 impl_binary=$2
if [ ! -x ${impl_binary} ]; then
case ${impl} in
cmucl|sbcl)
impl-remove-timestamp-hack ${impl}
;;
*)
;;
esac
rm -rf /var/cache/common-lisp-controller/*/${impl}
fi
}
# Local Variables: ***
# mode: shell-script ***
# tab-width: 4 ***
# End: ***

View File

@ -1,82 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# Author Matthew Kennedy <mkennedy@gentoo.org>
#
# Sundry code common to many Common Lisp related ebuilds. Some
# implementation use the Portage time stamp hack to ensure their
# installed files have the right modification time relative to each
# other.
inherit eutils multilib
CLSOURCEROOT=/usr/share/common-lisp/source/
CLSYSTEMROOT=/usr/share/common-lisp/systems/
# Many of our Common Lisp ebuilds are either inspired by, or actually
# use packages and files from the Debian project's archives.
do-debian-credits() {
docinto debian
for i in copyright README.Debian changelog; do
test -f $i && dodoc "${S}"/debian/${i}
done
docinto .
}
# BIG FAT HACK: Since the Portage emerge step kills file timestamp
# information, we need to compensate by ensuring all FASL files are
# more recent than their source files.
# The following `impl-*-timestamp-hack' functions SHOULD NOT be used
# outside of this eclass.
# Bug https://bugs.gentoo.org/show_bug.cgi?id=16162 should remove the
# need for this hack.
impl-save-timestamp-hack() {
local impl=$1
dodir /usr/share/${impl}
tar cpjf "${D}"/usr/share/${impl}/portage-timestamp-compensate -C "${D}"/usr/$(get_libdir)/${impl} .
}
impl-restore-timestamp-hack() {
local impl=$1
tar xjpfo /usr/share/${impl}/portage-timestamp-compensate -C /usr/$(get_libdir)/${impl}
}
impl-remove-timestamp-hack() {
local impl=$1
rm -rf /usr/$(get_libdir)/${impl} &>/dev/null || true
}
standard-impl-postinst() {
local impl=$1
case ${impl} in
cmucl|sbcl)
impl-restore-timestamp-hack ${impl}
;;
*)
;;
esac
}
standard-impl-postrm() {
local impl=$1 impl_binary=$2
if [ ! -x ${impl_binary} ]; then
case ${impl} in
cmucl|sbcl)
impl-remove-timestamp-hack ${impl}
;;
*)
;;
esac
rm -rf /var/cache/common-lisp-controller/*/${impl}
fi
}
# Local Variables: ***
# mode: shell-script ***
# tab-width: 4 ***
# End: ***

View File

@ -31,7 +31,7 @@ if [[ -z ${_CUDA_ECLASS} ]]; then
# @FUNCTION: cuda_gccdir
# @USAGE: [-f]
# @RETURN: gcc bindir compatible with current cuda, optionally (-f) prefixed with "--compiler-bindir="
# @RETURN: gcc bindir compatible with current cuda, optionally (-f) prefixed with "--compiler-bindir "
# @DESCRIPTION:
# Helper for determination of the latest gcc bindir supported by
# then current nvidia cuda toolkit.
@ -39,7 +39,7 @@ if [[ -z ${_CUDA_ECLASS} ]]; then
# Example:
# @CODE
# cuda_gccdir -f
# -> --compiler-bindir="/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3"
# -> --compiler-bindir "/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3"
# @CODE
cuda_gccdir() {
debug-print-function ${FUNCNAME} "$@"
@ -47,7 +47,7 @@ cuda_gccdir() {
local gcc_bindir ver args="" flag ret
# Currently we only support the gnu compiler suite
if [[ $(tc-getCXX) != *g++* ]]; then
if ! tc-is-gcc ; then
ewarn "Currently we only support the gnu compiler suite"
return 2
fi
@ -55,7 +55,7 @@ cuda_gccdir() {
while [ "$1" ]; do
case $1 in
-f)
flag="--compiler-bindir="
flag="--compiler-bindir "
;;
*)
;;
@ -110,7 +110,7 @@ cuda_sanitize() {
NVCCFLAGS+=" $(cuda_gccdir -f)"
# Tell nvcc which flags should be used for underlying C compiler
NVCCFLAGS+=" --compiler-options=\"${CXXFLAGS}\" --linker-options=\"${rawldflags// /,}\""
NVCCFLAGS+=" --compiler-options \"${CXXFLAGS}\" --linker-options \"${rawldflags// /,}\""
debug-print "Using ${NVCCFLAGS} for cuda"
export NVCCFLAGS

View File

@ -40,7 +40,16 @@
# }
# @CODE
inherit multilib
case ${EAPI:-0} in
0|2|3|4|5)
inherit multilib
;;
6)
;;
*)
die "EAPI=${EAPI} is not supported by depend.apache.eclass"
;;
esac
# ==============================================================================
# INTERNAL VARIABLES
@ -69,7 +78,8 @@ inherit multilib
# @ECLASS-VARIABLE: APACHE_BASEDIR
# @DESCRIPTION:
# Path to the server root directory.
# This variable is set by the want/need_apache functions.
# This variable is set by the want/need_apache functions (EAPI=0 through 5)
# or depend.apache_pkg_setup (EAPI=6 and later).
# @ECLASS-VARIABLE: APACHE_CONFDIR
# @DESCRIPTION:
@ -89,7 +99,8 @@ inherit multilib
# @ECLASS-VARIABLE: APACHE_MODULESDIR
# @DESCRIPTION:
# Path where we install modules.
# This variable is set by the want/need_apache functions.
# This variable is set by the want/need_apache functions (EAPI=0 through 5)
# or depend.apache_pkg_setup (EAPI=6 and later).
# @ECLASS-VARIABLE: APACHE_DEPEND
# @DESCRIPTION:
@ -122,14 +133,23 @@ _init_apache2() {
# WARNING: Do not use these variables with anything that is put
# into the dependency cache (DEPEND/RDEPEND/etc)
APACHE_VERSION="2"
APXS="/usr/sbin/apxs2"
APXS="/usr/bin/apxs"
APACHE_BIN="/usr/sbin/apache2"
APACHE_CTL="/usr/sbin/apache2ctl"
APACHE_INCLUDEDIR="/usr/include/apache2"
APACHE_BASEDIR="/usr/$(get_libdir)/apache2"
APACHE_CONFDIR="/etc/apache2"
APACHE_MODULES_CONFDIR="${APACHE_CONFDIR}/modules.d"
APACHE_VHOSTS_CONFDIR="${APACHE_CONFDIR}/vhosts.d"
case ${EAPI:-0} in
0|2|3|4|5)
_init_apache2_late
;;
esac
}
_init_apache2_late() {
APACHE_BASEDIR="/usr/$(get_libdir)/apache2"
APACHE_MODULESDIR="${APACHE_BASEDIR}/modules"
}
@ -156,13 +176,28 @@ depend.apache_pkg_setup() {
fi
local myiuse=${1:-apache2}
if has ${myiuse} ${IUSE}; then
if use ${myiuse}; then
_init_apache2
else
_init_no_apache
fi
fi
case ${EAPI:-0} in
0|2|3|4|5)
if has ${myiuse} ${IUSE}; then
if use ${myiuse}; then
_init_apache2
else
_init_no_apache
fi
fi
;;
*)
if in_iuse ${myiuse}; then
if use ${myiuse}; then
_init_apache2
_init_apache2_late
else
_init_no_apache
fi
fi
;;
esac
}
# @FUNCTION: want_apache
@ -210,6 +245,23 @@ want_apache2_2() {
RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
}
# @FUNCTION: want_apache2_4
# @USAGE: [myiuse]
# @DESCRIPTION:
# An ebuild calls this to get the dependency information for optional
# apache-2.4.x support. If the myiuse parameter is not given it defaults to
# apache2.
# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup()
# with the same myiuse parameter.
want_apache2_4() {
debug-print-function $FUNCNAME $*
local myiuse=${1:-apache2}
IUSE="${IUSE} ${myiuse}"
DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_4_DEPEND} )"
RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_4_DEPEND} )"
}
# @FUNCTION: need_apache
# @DESCRIPTION:
# An ebuild calls this to get the dependency information for apache.
@ -275,7 +327,13 @@ has_apache() {
has_apache_threads() {
debug-print-function $FUNCNAME $*
if ! built_with_use www-servers/apache threads; then
case ${EAPI:-0} in
0|1)
die "depend.apache.eclass: has_apache_threads is not supported for EAPI=${EAPI:-0}"
;;
esac
if ! has_version 'www-servers/apache[threads]'; then
return
fi
@ -298,14 +356,20 @@ has_apache_threads() {
has_apache_threads_in() {
debug-print-function $FUNCNAME $*
if ! built_with_use www-servers/apache threads; then
case ${EAPI:-0} in
0|1)
die "depend.apache.eclass: has_apache_threads_in is not supported for EAPI=${EAPI:-0}"
;;
esac
if ! has_version 'www-servers/apache[threads]'; then
return
fi
local myforeign="$1"
local myflag="${2:-threads}"
if ! built_with_use ${myforeign} ${myflag}; then
if ! has_version "${myforeign}[${myflag}]"; then
echo
eerror "You need to enable USE flag '${myflag}' in ${myforeign} to"
eerror "build a thread-safe version of ${CATEGORY}/${PN} for use"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -80,7 +80,7 @@ esac
if [[ ! ${_DISTUTILS_R1} ]]; then
[[ ${EAPI} == [45] ]] && inherit eutils
inherit toolchain-funcs
inherit toolchain-funcs xdg-utils
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
inherit multiprocessing python-r1
@ -242,10 +242,19 @@ esetup.py() {
local die_args=()
[[ ${EAPI} != [45] ]] && die_args+=( -n )
[[ ${BUILD_DIR} ]] && _distutils-r1_create_setup_cfg
set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
echo "${@}" >&2
"${@}" || die "${die_args[@]}" || return ${?}
"${@}" || die "${die_args[@]}"
local ret=${?}
if [[ ${BUILD_DIR} ]]; then
rm "${HOME}"/.pydistutils.cfg || die "${die_args[@]}"
fi
return ${ret}
}
# @FUNCTION: distutils_install_for_testing
@ -315,11 +324,13 @@ _distutils-r1_disable_ez_setup() {
distutils-r1_python_prepare_all() {
debug-print-function ${FUNCNAME} "${@}"
if [[ ${EAPI} != [45] ]]; then
default
else
[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
epatch_user
if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
if [[ ${EAPI} != [45] ]]; then
default
else
[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
epatch_user
fi
fi
# by default, use in-source build if python_prepare() is used
@ -381,9 +392,6 @@ _distutils-r1_create_setup_cfg() {
# make the ebuild writer lives easier
build-scripts = %(build-base)s/scripts
[egg_info]
egg-base = ${BUILD_DIR}
# this is needed by distutils_install_for_testing since
# setuptools like to create .egg files for install --home.
[bdist_egg]
@ -434,7 +442,6 @@ _distutils-r1_copy_egg_info() {
distutils-r1_python_compile() {
debug-print-function ${FUNCNAME} "${@}"
_distutils-r1_create_setup_cfg
_distutils-r1_copy_egg_info
esetup.py build "${@}"
@ -509,9 +516,6 @@ distutils-r1_python_install() {
# enable compilation for the install phase.
local -x PYTHONDONTWRITEBYTECODE=
# re-create setup.cfg with install paths
_distutils-r1_create_setup_cfg
# python likes to compile any module it sees, which triggers sandbox
# failures if some packages haven't compiled their modules yet.
addpredict "${EPREFIX}/usr/$(get_libdir)/${EPYTHON}"
@ -553,8 +557,8 @@ distutils-r1_python_install() {
done
fi
local root=${D}/_${EPYTHON}
[[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D}
local root=${D%/}/_${EPYTHON}
[[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/}
esetup.py install --root="${root}" "${args[@]}"
@ -588,9 +592,11 @@ distutils-r1_python_install_all() {
if declare -p EXAMPLES &>/dev/null; then
[[ ${EAPI} != [45] ]] && die "EXAMPLES are banned in EAPI ${EAPI}"
local INSDESTTREE=/usr/share/doc/${PF}/examples
doins -r "${EXAMPLES[@]}"
docompress -x "${INSDESTTREE}"
(
docinto examples
dodoc -r "${EXAMPLES[@]}"
)
docompress -x "/usr/share/doc/${PF}/examples"
fi
_DISTUTILS_DEFAULT_CALLED=1
@ -628,12 +634,6 @@ distutils-r1_run_phase() {
# in the sys.path_importer_cache)
mkdir -p "${BUILD_DIR}/lib" || die
# We need separate home for each implementation, for .pydistutils.cfg.
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
local -x HOME=${HOME}/${EPYTHON}
mkdir -p "${HOME}" || die
fi
# Set up build environment, bug #513664.
local -x AR=${AR} CC=${CC} CPP=${CPP} CXX=${CXX}
tc-export AR CC CPP CXX
@ -746,6 +746,7 @@ distutils-r1_src_prepare() {
distutils-r1_src_configure() {
python_export_utf8_locale
xdg_environment_reset # Bug 577704
if declare -f python_configure >/dev/null; then
_distutils-r1_run_foreach_impl python_configure

View File

@ -29,12 +29,10 @@ E_ECONF=()
# E_STATE's:
# release [default]
# KEYWORDS arch
# SRC_URI $P.tar.gz
# S $WORKDIR/$P
#
# snap $PV has .200##### datestamp or .### counter
# KEYWORDS ~arch
# SRC_URI $P.tar.bz2
# S $WORKDIR/$P
#
@ -113,11 +111,6 @@ fi
LICENSE="BSD"
SLOT="0"
case ${EKEY_STATE:-${E_STATE}} in
release) KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-interix ~x86-solaris ~x64-solaris";;
snap) KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-interix ~x86-solaris ~x64-solaris";;
live) KEYWORDS="";;
esac
IUSE="nls doc"
DEPEND="doc? ( app-doc/doxygen )

View File

@ -595,6 +595,8 @@ epatch() {
: $(( count++ ))
done
(( EPATCH_N_APPLIED_PATCHES++ ))
# if we had to decompress the patch, delete the temp one
if [[ -n ${PIPE_CMD} ]] ; then
rm -f "${PATCH_TARGET}"
@ -689,7 +691,7 @@ edos2unix() {
# a full path to an icon
# type: what kind of application is this?
# for categories:
# http://standards.freedesktop.org/menu-spec/latest/apa.html
# 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
@ -1060,7 +1062,7 @@ _iconins() {
# !!! 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 scalable
# 16 22 24 32 36 48 64 72 96 128 192 256 512 scalable
# -c, --context
# defaults to "apps"
# -t, --theme
@ -1618,8 +1620,6 @@ optfeature() {
fi
}
fi
check_license() {
die "you no longer need this as portage supports ACCEPT_LICENSE itself"
}
@ -1736,13 +1736,17 @@ epatch_user() {
[[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CHOST}/${check}
[[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${check}
if [[ -d ${EPATCH_SOURCE} ]] ; then
local old_n_applied_patches=${EPATCH_N_APPLIED_PATCHES:-0}
EPATCH_SOURCE=${EPATCH_SOURCE} \
EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" \
EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \
epatch
echo "${EPATCH_SOURCE}" > "${applied}"
has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" epatch_user_death_notice"
if [[ ${old_n_applied_patches} -lt ${EPATCH_N_APPLIED_PATCHES} ]]; then
has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || \
EBUILD_DEATH_HOOKS+=" epatch_user_death_notice"
fi
return 0
fi
done
@ -1839,3 +1843,5 @@ in_iuse() {
;;
esac
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -25,12 +25,12 @@ all-flag-vars() {
setup-allowed-flags() {
ALLOWED_FLAGS=(
-pipe -O '-O[12sg]' -mcpu -march -mtune
'-fstack-protector*' '-fsanitize*'
'-fstack-protector*' '-fsanitize*' '-fstack-check*'
-fbounds-check -fbounds-checking -fno-strict-overflow
-fno-PIE -fno-pie -nopie -fno-unit-at-a-time
-fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time
-g '-g[0-9]' -ggdb '-ggdb[0-9]' '-gdwarf-*' gstabs -gstabs+
-fno-ident -fpermissive -frecord-gcc-switches
'-fdiagnostics*'
'-fdiagnostics*' '-fplugin*'
'-W*' -w
# CPPFLAGS and LDFLAGS
@ -54,7 +54,7 @@ setup-allowed-flags() {
-mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi
-mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel
-mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi
-mfix-r10000 -mno-fix-r10000
-mfix-r10000 -mno-fix-r10000 -mthumb -marm
# gcc 4.5
-mno-fma4 -mno-movbe -mno-xop -mno-lwp
@ -80,7 +80,16 @@ _filter-hardened() {
# thinking about -fPIE.
-fPIC|-fpic|-fPIE|-fpie|-Wl,pie|-pie)
gcc-specs-pie || continue
is-flagq -nopie || append-flags -nopie;;
if ! is-flagq -nopie && ! is-flagq -no-pie ; then
# Support older Gentoo form first (-nopie) before falling
# back to the official gcc-6+ form (-no-pie).
if test-flags -nopie >/dev/null ; then
append-flags -nopie
else
append-flags -no-pie
fi
fi
;;
-fstack-protector)
gcc-specs-ssp || continue
is-flagq -fno-stack-protector || append-flags $(test-flags -fno-stack-protector);;
@ -553,27 +562,8 @@ get-flag() {
return 1
}
# @FUNCTION: has_m64
# @DESCRIPTION:
# This doesn't test if the flag is accepted, it tests if the flag actually
# WORKS. Non-multilib gcc will take both -m32 and -m64. If the flag works
# return code is 0, else the return code is 1.
has_m64() {
eqawarn "${FUNCNAME}: don't use this anymore"
# this doesnt test if the flag is accepted, it tests if the flag
# actually -WORKS-. non-multilib gcc will take both -m32 and -m64!
# please dont replace this function with test_flag in some future
# clean-up!
local temp="$(emktemp)"
echo "int main() { return(0); }" > "${temp}".c
MY_CC=$(tc-getCC)
${MY_CC/ .*/} -m64 -o "$(emktemp)" "${temp}".c > /dev/null 2>&1
local ret=$?
rm -f "${temp}".c
[[ ${ret} != 1 ]] && return 0
return 1
die "${FUNCNAME}: don't use this anymore"
}
has_m32() {

View File

@ -17,9 +17,6 @@ IUSE="X"
DEPEND="X? ( media-gfx/ebdftopcf )"
RDEPEND=""
use X && FONT_SUFFIX="pcf.gz"
use X || FONT_SUFFIX="bdf"
#
# Public functions
#
@ -37,6 +34,9 @@ ebdftopcf() {
# Public inheritable functions
#
font-ebdftopcf_src_compile() {
use X && FONT_SUFFIX="pcf.gz"
use X || FONT_SUFFIX="bdf"
if use X; then
[ -z "${BDFFILES}" ] && BDFFILES="$(find . -name '*.bdf')"
ebdftopcf ${BDFFILES}

View File

@ -4,7 +4,7 @@
# @ECLASS: fox.eclass
# @MAINTAINER:
# mabi@gentoo.org
# maintainer-needed@gentoo.org
# @BLURB: Functionality required the FOX Toolkit and it's applications
# @DESCRIPTION:
# This eclass allows building SLOT-able FOX Toolkit installations
@ -61,7 +61,7 @@ FOX_APPS="adie calculator pathfinder shutterbug"
# @DESCRIPTION:
# Set this to add additional configuration options during src_configure
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
DESCRIPTION="C++ Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
SRC_URI="ftp://ftp.fox-toolkit.org/pub/fox-${FOX_PV}.tar.gz"

View File

@ -2,6 +2,9 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @MAINTAINER:
# maintainer-needed@gentoo.org
# @AUTHOR:
# Diego Pettenò <flameeyes@gentoo.org>
inherit versionator eutils flag-o-matic bsdmk
@ -99,7 +102,15 @@ doperiodic() {
freebsd_get_bmake() {
local bmake
bmake=$(get_bmake)
[[ ${CBUILD} == *-freebsd* ]] || bmake="${bmake} -m /usr/share/mk/freebsd"
if version_is_at_least 11.0 ${RV} ; then
if [[ ${CBUILD} == *-freebsd* ]] ; then
bmake="${bmake} -m /usr/share/mk/system"
else
bmake="${bmake} -m /usr/share/mk/freebsd/system"
fi
else
[[ ${CBUILD} == *-freebsd* ]] || bmake="${bmake} -m /usr/share/mk/freebsd"
fi
echo "${bmake}"
}
@ -130,7 +141,13 @@ freebsd_do_patches() {
epatch "${x}"
done
fi
[[ ${#UPSTREAM_PATCHES[@]} -gt 0 ]] && epatch $(freebsd_upstream_patches -s)
# Upstream patches need to be applied on WORKDIR.
if [[ ${#UPSTREAM_PATCHES[@]} -gt 0 ]] ; then
cd "${WORKDIR}" || die
epatch $(freebsd_upstream_patches -s)
cd "${S}" || die
fi
epatch_user
}
@ -184,7 +201,9 @@ freebsd_src_unpack() {
dummy_mk ${REMOVE_SUBDIRS}
freebsd_do_patches
freebsd_rename_libraries
if ! version_is_at_least 11.0 ${RV} ; then
freebsd_rename_libraries
fi
# Starting from FreeBSD 9.2, its install command supports the -l option and
# they now use it. Emulate it if we are on a system that does not have it.
@ -192,13 +211,45 @@ freebsd_src_unpack() {
export INSTALL_LINK="ln -f"
export INSTALL_SYMLINK="ln -fs"
fi
if version_is_at_least 11.0 ${RV} ; then
export RSYMLINK=" -l s"
fi
# When CC=clang, force use clang-cpp #478810, #595878
if [[ $(tc-getCC) == *clang* ]] ; then
if type -P clang-cpp > /dev/null ; then
export CPP=clang-cpp
else
mkdir "${WORKDIR}"/workaround_clang-cpp || die "Could not create ${WORKDIR}/workaround_clang-cpp"
ln -s "$(type -P clang)" "${WORKDIR}"/workaround_clang-cpp/clang-cpp || die "Could not create clang-cpp symlink."
export CPP="${WORKDIR}/workaround_clang-cpp/clang-cpp"
fi
fi
# Add a special CFLAGS required for multilib support.
use amd64-fbsd && export CFLAGS_x86_fbsd="${CFLAGS_x86_fbsd} -DCOMPAT_32BIT -B/usr/lib32 -L/usr/lib32"
}
freebsd_src_compile() {
use profile && filter-flags "-fomit-frame-pointer"
use profile || mymakeopts="${mymakeopts} NO_PROFILE= "
if version_is_at_least 11.0 ${RV} ; then
if ! use profile ; then
mymakeopts="${mymakeopts} WITHOUT_PROFILE= "
fi
# Disable debugging info, use FEATURES=splitdebug instead.
mymakeopts="${mymakeopts} WITHOUT_DEBUG_FILES= "
# Test does not support yet.
mymakeopts="${mymakeopts} WITHOUT_TESTS= "
# Force set SRCTOP.
mymakeopts="${mymakeopts} SRCTOP=${WORKDIR} "
# Set common option.
mymakeopts="${mymakeopts} WITHOUT_MANCOMPRESS= WITHOUT_INFOCOMPRESS= "
else
use profile || mymakeopts="${mymakeopts} NO_PROFILE= "
mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= "
fi
mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= NO_FSCHG="
mymakeopts="${mymakeopts} NO_FSCHG="
# Make sure to use FreeBSD definitions while crosscompiling
[[ -z "${BMAKE}" ]] && BMAKE="$(freebsd_get_bmake)"
@ -257,11 +308,26 @@ freebsd_multilib_multibuild_wrapper() {
}
freebsd_src_install() {
use profile || mymakeopts="${mymakeopts} NO_PROFILE= "
if version_is_at_least 11.0 ${RV} ; then
if ! use profile ; then
mymakeopts="${mymakeopts} WITHOUT_PROFILE= "
fi
# Disable debugging info, use FEATURES=splitdebug instead.
mymakeopts="${mymakeopts} WITHOUT_DEBUG_FILES= "
# Test does not support yet.
mymakeopts="${mymakeopts} WITHOUT_TESTS= "
# Force set SRCTOP.
mymakeopts="${mymakeopts} SRCTOP=${WORKDIR} "
# Set common option.
mymakeopts="${mymakeopts} WITHOUT_MANCOMPRESS= WITHOUT_INFOCOMPRESS= "
else
use profile || mymakeopts="${mymakeopts} NO_PROFILE= "
mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= "
fi
mymakeopts="${mymakeopts} NO_MANCOMPRESS= NO_INFOCOMPRESS= NO_FSCHG="
mymakeopts="${mymakeopts} NO_FSCHG="
[[ -z "${BMAKE}" ]] && BMAKE="$(freebsd_get_bmake)"
bsdmk_src_install
bsdmk_src_install "$@"
}

View File

@ -197,7 +197,7 @@ games-mods_dosyms() {
games-mods_make_initd() {
cat <<EOF > "${T}"/${MOD_DED_BIN}
#!/sbin/runscript
#!/sbin/openrc-run
$(head -n 2 ${PORTDIR}/header.txt)
# Generated by games-mods.eclass

View File

@ -1,165 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: gdesklets.eclass
# @MAINTAINER:
# gdesklets@gentoo.org
# @AUTHOR:
# Original author: Joe Sapp <nixphoeni@gentoo.org>
# Original author: Mike Gardiner <obz@gentoo.org>
# @BLURB: Installation functions for Desklets and Controls supported by gDesklets
# @DESCRIPTION:
# The gdesklets eclass provides a simple way to create ebuilds for
# globally installing desktop applets ("Desklets") and supporting code
# ("Controls") used in the gDesklets framework (provided by
# gnome-extra/gdesklets-core)
#
# This eclass assumes a package following the instructions at
# http://gdesklets.de/index.php?q=node/2 . Specifically, the package
# should be a Desklet or Control ONLY (and *not* a Sensor). You
# technically could have an ebuild that works around this limitation,
# but no new packages should be added to the tree that do this (mainly
# for ease of maintenance).
# @ECLASS-VARIABLE: DESKLET_NAME
# @DESCRIPTION:
# *Optional* The name of the Desklet, if the package is one. The
# default is to assume a Desklet with the name being ${PN} without the
# "desklet-" prefix.
# @ECLASS-VARIABLE: CONTROL_NAME
# @DESCRIPTION:
# *Optional* The name of the Control, if the package is one.
# @ECLASS-VARIABLE: DOCS
# @DESCRIPTION:
# Anything (like a README) that should be dodoc'd.
# @ECLASS-VARIABLE: SLOT
# @DESCRIPTION:
# Set only if the package is a Control and it provides a different
# interface (i.e. expands to a different install directory) than a
# previous version.
inherit eutils multilib python
if [[ -n "${CONTROL_NAME}" ]]; then
debug-print "Looking for a Control named \"${CONTROL_NAME}\""
MY_PN="${CONTROL_NAME}"
SRC_URI="http://gdesklets.de/files/controls/${MY_PN}/${MY_PN}-${PV}.tar.gz"
unset DESKLET_NAME
else # [[ -n "${DESKLET_NAME}" ]]; then
# Assume an unset DESKLET_NAME means the name is ${PN} without
# the "desklet-" prefix
[[ -z "${DESKLET_NAME}" ]] && DESKLET_NAME="${PN#desklet-}"
debug-print "Looking for a Desklet named \"${DESKLET_NAME}\""
MY_PN="${DESKLET_NAME}"
SRC_URI="http://gdesklets.de/files/desklets/${MY_PN}/${MY_PN}-${PV}.tar.gz"
fi
MY_P="${MY_PN}-${PV}"
S="${WORKDIR}/${MY_PN}"
SLOT="0"
# Ebuild writer shouldn't need to touch these (except maybe RDEPEND)
IUSE=""
RDEPEND=">=gnome-extra/gdesklets-core-0.36.1-r3"
GDESKLETS_INST_DIR="${ROOT}usr/$(get_libdir)/gdesklets"
# @FUNCTION: gdesklets_src_install
# @DESCRIPTION:
# Installs a Desklet or Control depending on which is set of
# CONTROL_NAME or DESKLET_NAME
gdesklets_src_install() {
debug-print-function $FUNCNAME $*
# Disable compilation of included python modules (for Controls)
python_disable_pyc
# Avoid sandbox violations caused by misbehaving packages (bug #128289)
addwrite "${ROOT}/root/.gnome2"
# Both Displays and Controls only need to be readable
insopts -m0744
debug-print-section docs_install
# Install some docs if so requested (and then delete them so they
# don't get copied into the installation directory)
[[ -n "${DOCS}" ]] && dodoc ${DOCS} && \
rm -f ${DOCS} \
debug-print "Installed and deleted ${DOCS}"
# LICENSE doesn't need to get installed if it exists
find . -name LICENSE -delete
if [[ -n "${DESKLET_NAME}" ]]; then
debug-print-section display_install
# Base installation directory for displays from this desklet
INSDIR="${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME}"
debug-print "Installing into ${INSDIR}"
debug-print "Exiting Display-specific installation code"
elif [[ -n "${CONTROL_NAME}" ]]; then
debug-print-section control_install
# Unique name for this Control and its interface
CTRL_DIRNAME=$( "${GDESKLETS_INST_DIR}/gdesklets-control-getid" `pwd` 2> /dev/null )
einfo "Installing Control ${CTRL_DIRNAME}"
# Base installation directory for this Control
INSDIR="${GDESKLETS_INST_DIR}/Controls/${CTRL_DIRNAME}"
debug-print "Installing into ${INSDIR}"
# Mercilessly delete all existing compiled code
find . -iname '*.py[co]' -delete
debug-print "Exiting Control-specific installation code"
else
die "nothing to install, is the ebuild written correctly?"
fi
debug-print-section common_install
# Create the proper subdirectory in the global Controls or
# Displays directory
dodir "${INSDIR}"
insinto "${INSDIR}"
doins -r *
}
# @FUNCTION: gdesklets_pkg_postinst
# @DESCRIPTION:
# Marks the Control for rebuilding on Python version change and
# compiles the Python code or display a useful message to the user,
# depending on which of CONTROL_NAME or DESKLET_NAME is set.
gdesklets_pkg_postinst() {
# The only time compilation of python modules should occur is
# for Controls, since Displays are run from inside the sandbox
# (and therefore can't be compiled).
if [[ -n "${CONTROL_NAME}" ]]; then
CTRL_DIRNAME=$( "${GDESKLETS_INST_DIR}/gdesklets-control-getid" `pwd` 2> /dev/null )
python_need_rebuild
python_mod_optimize "${GDESKLETS_INST_DIR}/Controls/${CTRL_DIRNAME}"
else
einfo "Each user can now add this desklet to their desktop through the"
einfo "gDesklets shell or the command line (.display files can be"
einfo "found in ${GDESKLETS_INST_DIR}/Displays/${DESKLET_NAME})."
fi
}
EXPORT_FUNCTIONS src_install pkg_postinst

View File

@ -11,7 +11,7 @@
# @DESCRIPTION:
# Helper eclass to handle ghc installation/upgrade/deinstallation process.
inherit versionator
inherit multiprocessing versionator
# @FUNCTION: ghc-getghc
# @DESCRIPTION:
@ -106,20 +106,6 @@ ghc-cabal-version() {
fi
}
# @FUNCTION: ghc-sanecabal
# @DESCRIPTION:
# check if a standalone Cabal version is available for the
# currently used ghc; takes minimal version of Cabal as
# an optional argument
ghc-sanecabal() {
local f
local version
if [[ -z "$1" ]]; then version="1.0.1"; else version="$1"; fi
for f in $(ghc-confdir)/cabal-*; do
[[ -f "${f}" ]] && version_is_at_least "${version}" "${f#*cabal-}" && return
done
return 1
}
# @FUNCTION: ghc-is-dynamic
# @DESCRIPTION:
# checks if ghc is built against dynamic libraries
@ -193,6 +179,25 @@ ghc-libdir() {
echo "${_GHC_LIBDIR_CACHE}"
}
# @FUNCTION: ghc-make-args
# @DESCRIPTION:
# Returns default arguments passed along 'ghc --make'
# build mode. Used mainly to enable parallel build mode.
ghc-make-args() {
local ghc_make_args=()
# parallel on all available cores
if ghc-supports-smp && ghc-supports-parallel-make; then
# It should have been just -j$(makeopts_jobs)
# but GHC does not yet have nice defaults:
# https://ghc.haskell.org/trac/ghc/ticket/9221#comment:57
# SMP is a requirement for parallel GC's gen0
# 'qb' balancing.
echo "-j$(makeopts_jobs) +RTS -A256M -qb0 -RTS"
ghc_make_args=()
fi
echo "${ghc_make_args[@]}"
}
# @FUNCTION: ghc-confdir
# @DESCRIPTION:
# returns the (Gentoo) library configuration directory, we

View File

@ -4,8 +4,7 @@
# @ECLASS: git-2.eclass
# @MAINTAINER:
# Michał Górny <mgorny@gentoo.org>
# Donnie Berkholz <dberkholz@gentoo.org>
# maintainer-needed@gentoo.org
# @BLURB: Eclass for fetching and unpacking git repositories.
# @DESCRIPTION:
# Eclass for easing maitenance of live ebuilds using git as remote repository.

View File

@ -159,12 +159,53 @@ fi
#
# It can be overriden via env using ${PN}_LIVE_COMMIT variable.
# @ECLASS-VARIABLE: EGIT_COMMIT_DATE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Attempt to check out the repository state for the specified timestamp.
# The date should be in format understood by 'git rev-list'.
#
# The eclass will select the last commit with commit date preceding
# the specified date. When merge commits are found, only first parents
# will be considered in order to avoid switching into external branches
# (assuming that merges are done correctly). In other words, each merge
# will be considered alike a single commit with date corresponding
# to the merge commit date.
#
# It can be overriden via env using ${PN}_LIVE_COMMIT_DATE variable.
# @ECLASS-VARIABLE: EGIT_CHECKOUT_DIR
# @DESCRIPTION:
# The directory to check the git sources out to.
#
# EGIT_CHECKOUT_DIR=${WORKDIR}/${P}
# @ECLASS-VARIABLE: EGIT_SUBMODULES
# @DEFAULT_UNSET
# @DESCRIPTION:
# An array of inclusive and exclusive wildcards on submodule names,
# stating which submodules are fetched and checked out. Exclusions
# start with '-', and exclude previously matched submodules.
#
# If unset, all submodules are enabled. Empty list disables all
# submodules. In order to use an exclude-only list, start the array
# with '*'.
#
# Remember that wildcards need to be quoted in order to prevent filename
# expansion.
#
# Examples:
# @CODE
# # Disable all submodules
# EGIT_SUBMODULES=()
#
# # Include only foo and bar
# EGIT_SUBMODULES=( foo bar )
#
# # Use all submodules except for test-* but include test-lib
# EGIT_SUBMODULES=( '*' '-test-*' test-lib )
# @CODE
# @FUNCTION: _git-r3_env_setup
# @INTERNAL
# @DESCRIPTION:
@ -205,24 +246,39 @@ _git-r3_env_setup() {
die "Invalid EGIT_MIN_CLONE_TYPE=${EGIT_MIN_CLONE_TYPE}"
esac
if [[ ${EGIT_SUBMODULES[@]+1} && $(declare -p EGIT_SUBMODULES) != "declare -a"* ]]
then
die 'EGIT_SUBMODULES must be an array.'
fi
local esc_pn livevar
esc_pn=${PN//[-+]/_}
[[ ${esc_pn} == [0-9]* ]] && esc_pn=_${esc_pn}
livevar=${esc_pn}_LIVE_REPO
EGIT_REPO_URI=${!livevar:-${EGIT_REPO_URI}}
EGIT_REPO_URI=${!livevar-${EGIT_REPO_URI}}
[[ ${!livevar} ]] \
&& ewarn "Using ${livevar}, no support will be provided"
livevar=${esc_pn}_LIVE_BRANCH
EGIT_BRANCH=${!livevar:-${EGIT_BRANCH}}
EGIT_BRANCH=${!livevar-${EGIT_BRANCH}}
[[ ${!livevar} ]] \
&& ewarn "Using ${livevar}, no support will be provided"
livevar=${esc_pn}_LIVE_COMMIT
EGIT_COMMIT=${!livevar:-${EGIT_COMMIT}}
EGIT_COMMIT=${!livevar-${EGIT_COMMIT}}
[[ ${!livevar} ]] \
&& ewarn "Using ${livevar}, no support will be provided"
livevar=${esc_pn}_LIVE_COMMIT_DATE
EGIT_COMMIT_DATE=${!livevar-${EGIT_COMMIT_DATE}}
[[ ${!livevar} ]] \
&& ewarn "Using ${livevar}, no support will be provided"
if [[ ${EGIT_COMMIT} && ${EGIT_COMMIT_DATE} ]]; then
die "EGIT_COMMIT and EGIT_COMMIT_DATE can not be specified simultaneously"
fi
# Migration helpers. Remove them when git-2 is removed.
if [[ ${EGIT_SOURCEDIR} ]]; then
@ -243,7 +299,8 @@ _git-r3_env_setup() {
if [[ ${EGIT_HAS_SUBMODULES} ]]; then
eerror "EGIT_HAS_SUBMODULES has been removed. The eclass no longer needs"
eerror "to switch the clone type in order to support submodules and therefore"
eerror "submodules are detected and fetched automatically."
eerror "submodules are detected and fetched automatically. If you need to"
eerror "disable or filter submodules, see EGIT_SUBMODULES."
die "EGIT_HAS_SUBMODULES is no longer necessary."
fi
@ -296,7 +353,7 @@ _git-r3_set_gitdir() {
git/*) repo_name=${repo_name#git/};;
# gentoo.org
gitroot/*) repo_name=${repo_name#gitroot/};;
# google code, sourceforge
# sourceforge
p/*) repo_name=${repo_name#p/};;
# kernel.org
pub/scm/*) repo_name=${repo_name#pub/scm/};;
@ -311,7 +368,7 @@ _git-r3_set_gitdir() {
GIT_DIR=${EGIT3_STORE_DIR}/${repo_name}
if [[ ! -d ${EGIT3_STORE_DIR} ]]; then
if [[ ! -d ${EGIT3_STORE_DIR} && ! ${EVCS_OFFLINE} ]]; then
(
addwrite /
mkdir -p "${EGIT3_STORE_DIR}"
@ -320,6 +377,14 @@ _git-r3_set_gitdir() {
addwrite "${EGIT3_STORE_DIR}"
if [[ ! -d ${GIT_DIR} ]]; then
if [[ ${EVCS_OFFLINE} ]]; then
eerror "A clone of the following repository is required to proceed:"
eerror " ${1}"
eerror "However, networking activity has been disabled using EVCS_OFFLINE and there"
eerror "is no local clone available."
die "No local clone of ${1}. Unable to proceed with EVCS_OFFLINE."
fi
local saved_umask
if [[ ${EVCS_UMASK} ]]; then
saved_umask=$(umask)
@ -357,15 +422,36 @@ _git-r3_set_submodules() {
l=${l#submodule.}
local subname=${l%%.url=*}
# filter out on EGIT_SUBMODULES
if declare -p EGIT_SUBMODULES &>/dev/null; then
local p l_res res=
for p in "${EGIT_SUBMODULES[@]}"; do
if [[ ${p} == -* ]]; then
p=${p#-}
l_res=
else
l_res=1
fi
[[ ${subname} == ${p} ]] && res=${l_res}
done
if [[ ! ${res} ]]; then
einfo "Skipping submodule \e[1m${subname}\e[22m"
continue
fi
fi
# skip modules that have 'update = none', bug #487262.
local upd=$(echo "${data}" | git config -f /dev/fd/0 \
submodule."${subname}".update)
[[ ${upd} == none ]] && continue
# https://github.com/git/git/blob/master/refs.c#L39
# for now, we just filter /. because of #572312
local enc_subname=${subname//\/.//_}
[[ ${enc_subname} == .* ]] && enc_subname=_${enc_subname#.}
# https://github.com/git/git/blob/master/refs.c#L31
# we are more restrictive than git itself but that should not
# cause any issues, #572312, #606950
# TODO: check escaped names for collisions
local enc_subname=${subname//[^a-zA-Z0-9-]/_}
submodules+=(
"${enc_subname}"
@ -434,44 +520,8 @@ _git-r3_is_local_repo() {
[[ ${uri} == file://* || ${uri} == /* ]]
}
# @FUNCTION: _git-r3_find_head
# @USAGE: <head-ref>
# @INTERNAL
# @DESCRIPTION:
# Given a ref to which remote HEAD was fetched, try to find
# a branch matching the commit. Expects 'git show-ref'
# or 'git ls-remote' output on stdin.
_git-r3_find_head() {
debug-print-function ${FUNCNAME} "$@"
local head_ref=${1}
local head_hash=$(git rev-parse --verify "${1}" || die)
local matching_ref
# TODO: some transports support peeking at symbolic remote refs
# find a way to use that rather than guessing
# (based on guess_remote_head() in git-1.9.0/remote.c)
local h ref
while read h ref; do
# look for matching head
if [[ ${h} == ${head_hash} ]]; then
# either take the first matching ref, or master if it is there
if [[ ! ${matching_ref} || ${ref} == refs/heads/master ]]; then
matching_ref=${ref}
fi
fi
done
if [[ ! ${matching_ref} ]]; then
die "Unable to find a matching branch for remote HEAD (${head_hash})"
fi
echo "${matching_ref}"
}
# @FUNCTION: git-r3_fetch
# @USAGE: [<repo-uri> [<remote-ref> [<local-id>]]]
# @USAGE: [<repo-uri> [<remote-ref> [<local-id> [<commit-date>]]]]
# @DESCRIPTION:
# Fetch new commits to the local clone of repository.
#
@ -494,6 +544,9 @@ _git-r3_find_head() {
# This default should be fine unless you are fetching multiple trees
# from the same repository in the same ebuild.
#
# <commit-id> requests attempting to use repository state as of specific
# date. For more details, see EGIT_COMMIT_DATE.
#
# The fetch operation will affect the EGIT_STORE only. It will not touch
# the working copy, nor export any environment variables.
# If the repository contains submodules, they will be fetched
@ -501,8 +554,6 @@ _git-r3_find_head() {
git-r3_fetch() {
debug-print-function ${FUNCNAME} "$@"
[[ ${EVCS_OFFLINE} ]] && return
local repos
if [[ ${1} ]]; then
repos=( ${1} )
@ -516,6 +567,7 @@ git-r3_fetch() {
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"
@ -537,143 +589,137 @@ git-r3_fetch() {
umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}"
fi
for r in "${repos[@]}"; do
einfo "Fetching \e[1m${r}\e[22m ..."
if [[ ! ${EVCS_OFFLINE} ]]; then
einfo "Fetching \e[1m${r}\e[22m ..."
local fetch_command=( git fetch "${r}" )
local clone_type=${EGIT_CLONE_TYPE}
local fetch_command=( git fetch "${r}" )
local clone_type=${EGIT_CLONE_TYPE}
if [[ ${r} == https://* ]] && ! ROOT=/ has_version 'dev-vcs/git[curl]'; then
eerror "git-r3: fetching from https:// requested. In order to support https,"
eerror "dev-vcs/git needs to be built with USE=curl. Example solution:"
eerror
eerror " echo dev-vcs/git curl >> /etc/portage/package.use"
eerror " emerge -1v dev-vcs/git"
die "dev-vcs/git built with USE=curl required."
fi
if [[ ${r} == https://code.google.com/* ]]; then
# Google Code has special magic on top of git that:
# 1) can't handle shallow clones at all,
# 2) fetches duplicately when tags are pulled in with branch
# so automatically switch to single+tags mode.
if [[ ${clone_type} == shallow ]]; then
einfo " Google Code does not support shallow clones"
einfo " using \e[1mEGIT_CLONE_TYPE=single+tags\e[22m"
clone_type=single+tags
elif [[ ${clone_type} == single ]]; then
einfo " git-r3: Google Code does not send tags properly in 'single' mode"
einfo " using \e[1mEGIT_CLONE_TYPE=single+tags\e[22m"
clone_type=single+tags
fi
fi
if [[ ${clone_type} == mirror ]]; then
fetch_command+=(
--prune
# mirror the remote branches as local branches
"+refs/heads/*:refs/heads/*"
# pull tags explicitly in order to prune them properly
"+refs/tags/*:refs/tags/*"
# notes in case something needs them
"+refs/notes/*:refs/notes/*"
# and HEAD in case we need the default branch
# (we keep it in refs/git-r3 since otherwise --prune interferes)
"+HEAD:refs/git-r3/HEAD"
)
else # single or shallow
local fetch_l fetch_r
if [[ ${remote_ref} == HEAD ]]; then
# HEAD
fetch_l=HEAD
elif [[ ${remote_ref} == refs/* ]]; then
# regular branch, tag or some other explicit ref
fetch_l=${remote_ref}
else
# tag or commit id...
# let ls-remote figure it out
local tagref=$(git ls-remote "${r}" "refs/tags/${remote_ref}")
# if it was a tag, ls-remote obtained a hash
if [[ ${tagref} ]]; then
# tag
fetch_l=refs/tags/${remote_ref}
else
# commit id
# so we need to fetch the whole branch
if [[ ${branch} ]]; then
fetch_l=${branch}
else
fetch_l=HEAD
fi
# fetching by commit in shallow mode? can't do.
if [[ ${clone_type} == shallow ]]; then
clone_type=single
fi
fi
fi
if [[ ${fetch_l} == HEAD ]]; then
fetch_r=refs/git-r3/HEAD
else
fetch_r=${fetch_l}
fi
fetch_command+=(
"+${fetch_l}:${fetch_r}"
)
if [[ ${clone_type} == single+tags ]]; then
fetch_command+=(
# pull tags explicitly as requested
"+refs/tags/*:refs/tags/*"
)
fi
fi
if [[ ${clone_type} == shallow ]]; then
if _git-r3_is_local_repo; then
# '--depth 1' causes sandbox violations with local repos
# bug #491260
clone_type=single
elif [[ ! $(git rev-parse --quiet --verify "${fetch_r}") ]]
if [[ ${r} == http://* || ${r} == https://* ]] &&
[[ ! ${EGIT_CURL_WARNED} ]] &&
! ROOT=/ has_version 'dev-vcs/git[curl]'
then
# use '--depth 1' when fetching a new branch
fetch_command+=( --depth 1 )
ewarn "git-r3: fetching from HTTP(S) requested. In order to support HTTP(S),"
ewarn "dev-vcs/git needs to be built with USE=curl. Example solution:"
ewarn
ewarn " echo dev-vcs/git curl >> /etc/portage/package.use"
ewarn " emerge -1v dev-vcs/git"
ewarn
ewarn "HTTP(S) URIs will be skipped."
EGIT_CURL_WARNED=1
fi
else # non-shallow mode
if [[ -f ${GIT_DIR}/shallow ]]; then
fetch_command+=( --unshallow )
fi
fi
set -- "${fetch_command[@]}"
echo "${@}" >&2
if "${@}"; then
if [[ ${clone_type} == mirror ]]; then
# find remote HEAD and update our HEAD properly
git symbolic-ref HEAD \
"$(_git-r3_find_head refs/git-r3/HEAD \
< <(git show-ref --heads || die))" \
|| die "Unable to update HEAD"
fetch_command+=(
--prune
# mirror the remote branches as local branches
"+refs/heads/*:refs/heads/*"
# pull tags explicitly in order to prune them properly
"+refs/tags/*:refs/tags/*"
# notes in case something needs them
"+refs/notes/*:refs/notes/*"
# and HEAD in case we need the default branch
# (we keep it in refs/git-r3 since otherwise --prune interferes)
"+HEAD:refs/git-r3/HEAD"
)
else # single or shallow
if [[ ${fetch_l} == HEAD ]]; then
# find out what branch we fetched as HEAD
local head_branch=$(_git-r3_find_head \
refs/git-r3/HEAD \
< <(git ls-remote --heads "${r}" || die))
local fetch_l fetch_r
# and move it to its regular place
git update-ref --no-deref "${head_branch}" \
refs/git-r3/HEAD \
|| die "Unable to sync HEAD branch ${head_branch}"
git symbolic-ref HEAD "${head_branch}" \
|| die "Unable to update HEAD"
if [[ ${remote_ref} == HEAD ]]; then
# HEAD
fetch_l=HEAD
elif [[ ${remote_ref} == refs/* ]]; then
# regular branch, tag or some other explicit ref
fetch_l=${remote_ref}
else
# tag or commit id...
# let ls-remote figure it out
local tagref=$(git ls-remote "${r}" "refs/tags/${remote_ref}")
# if it was a tag, ls-remote obtained a hash
if [[ ${tagref} ]]; then
# tag
fetch_l=refs/tags/${remote_ref}
else
# commit id
# so we need to fetch the whole branch
if [[ ${branch} ]]; then
fetch_l=${branch}
else
fetch_l=HEAD
fi
# fetching by commit in shallow mode? can't do.
if [[ ${clone_type} == shallow ]]; then
clone_type=single
fi
fi
fi
# checkout by date does not make sense in shallow mode
if [[ ${commit_date} && ${clone_type} == shallow ]]; then
clone_type=single
fi
if [[ ${fetch_l} == HEAD ]]; then
fetch_r=refs/git-r3/HEAD
else
fetch_r=${fetch_l}
fi
fetch_command+=(
"+${fetch_l}:${fetch_r}"
)
if [[ ${clone_type} == single+tags ]]; then
fetch_command+=(
# pull tags explicitly as requested
"+refs/tags/*:refs/tags/*"
)
fi
fi
# now let's see what the user wants from us
if [[ ${clone_type} == shallow ]]; then
if _git-r3_is_local_repo; then
# '--depth 1' causes sandbox violations with local repos
# bug #491260
clone_type=single
elif [[ ! $(git rev-parse --quiet --verify "${fetch_r}") ]]
then
# use '--depth 1' when fetching a new branch
fetch_command+=( --depth 1 )
fi
else # non-shallow mode
if [[ -f ${GIT_DIR}/shallow ]]; then
fetch_command+=( --unshallow )
fi
fi
set -- "${fetch_command[@]}"
echo "${@}" >&2
"${@}" || continue
if [[ ${clone_type} == mirror || ${fetch_l} == HEAD ]]; then
# update our HEAD to match our remote HEAD ref
git symbolic-ref HEAD refs/git-r3/HEAD \
|| die "Unable to update HEAD"
fi
fi
# now let's see what the user wants from us
if [[ ${commit_date} ]]; then
local dated_commit_id=$(
git rev-list --first-parent --before="${commit_date}" \
-n 1 "${remote_ref}"
)
if [[ ${?} -ne 0 ]]; then
die "Listing ${remote_ref} failed (wrong ref?)."
elif [[ ! ${dated_commit_id} ]]; then
die "Unable to find commit for date ${commit_date}."
else
set -- git update-ref --no-deref "${local_ref}" "${dated_commit_id}"
fi
else
local full_remote_ref=$(
git rev-parse --verify --symbolic-full-name "${remote_ref}"
)
@ -686,15 +732,24 @@ git-r3_fetch() {
# otherwise, we were likely given a commit id
set -- git update-ref --no-deref "${local_ref}" "${remote_ref}"
fi
fi
echo "${@}" >&2
if ! "${@}"; then
echo "${@}" >&2
if ! "${@}"; then
if [[ ${EVCS_OFFLINE} ]]; then
eerror "A clone of the following repository is required to proceed:"
eerror " ${r}"
eerror "However, networking activity has been disabled using EVCS_OFFLINE and the local"
eerror "clone does not have requested ref:"
eerror " ${remote_ref}"
die "Local clone of ${r} does not have requested ref: ${remote_ref}. Unable to proceed with EVCS_OFFLINE."
else
die "Referencing ${remote_ref} failed (wrong ref?)."
fi
success=1
break
fi
success=1
break
done
if [[ ${saved_umask} ]]; then
umask "${saved_umask}" || die
@ -779,11 +834,7 @@ git-r3_checkout() {
einfo "Checking out \e[1m${repos[0]}\e[22m to \e[1m${out_dir}\e[22m ..."
if ! git cat-file -e refs/git-r3/"${local_id}"/__main__; then
if [[ ${EVCS_OFFLINE} ]]; then
die "No local clone of ${repos[0]}. Unable to work with EVCS_OFFLINE."
else
die "Logic error: no local clone of ${repos[0]}. git-r3_fetch not used?"
fi
die "Logic error: no local clone of ${repos[0]}. git-r3_fetch not used?"
fi
local remote_ref=$(
git symbolic-ref --quiet refs/git-r3/"${local_id}"/__main__
@ -806,9 +857,7 @@ git-r3_checkout() {
# setup 'alternates' to avoid copying objects
echo "${orig_repo}/objects" > "${GIT_DIR}"/objects/info/alternates || die
# now copy the refs
# [htn]* safely catches heads, tags, notes without complaining
# on non-existing ones, and omits internal 'git-r3' ref
cp -R "${orig_repo}"/refs/[htn]* "${GIT_DIR}"/refs/ || die
cp -R "${orig_repo}"/refs/* "${GIT_DIR}"/refs/ || die
# (no need to copy HEAD, we will set it via checkout)

View File

@ -124,7 +124,7 @@ get_ada_dep() {
# This function is used to check whether the requested gnat profile matches the
# requested Ada standard
# !!ATTN!!
# This must match dependencies as specified in vitrual/ada !!!
# This must match dependencies as specified in virtual/ada !!!
#
# params:
# $1 - the requested gnat profile in usual form (e.g. x86_64-pc-linux-gnu-gnat-gcc-4.1)

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,9 @@
# Copyright 1999-2015 Gentoo Foundation
## Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# Authors: George Shapovalov <george@gentoo.org>
# Steve Arnold <nerdboy@gentoo.org>
# $Header: $
#
# Author: George Shapovalov <george@gentoo.org>
# Author: Steve Arnold <nerdboy@gentoo.org>
# Belongs to: ada herd <ada@gentoo.org>
#
# Notes:
@ -19,19 +18,27 @@
#WANT_AUTOMAKE="1.8"
#WANT_AUTOCONF="2.1"
inherit eutils versionator toolchain-funcs flag-o-matic multilib autotools \
libtool fixheadtails gnuconfig pax-utils
inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs versionator
EXPORT_FUNCTIONS pkg_setup pkg_postinst pkg_postrm src_unpack src_compile src_install
FEATURES=${FEATURES/multilib-strict/}
EXPORT_FUNCTIONS="pkg_setup pkg_postinst pkg_postrm src_unpack src_configure src_compile src_install"
IUSE="nls"
# multilib is supported via profiles now, multilib usevar is deprecated
DEPEND=">=app-eselect/eselect-gnat-1.3
sys-devel/bc
"
RDEPEND="app-eselect/eselect-gnat
virtual/libiconv
nls? ( virtual/libintl )"
RDEPEND="app-eselect/eselect-gnat"
DEPEND="${RDEPEND}
>=app-eselect/eselect-gnat-1.3-r1
>=sys-libs/glibc-2.12
>=sys-devel/binutils-2.23
sys-devel/bc
>=sys-devel/bison-1.875
>=sys-devel/flex-2.5.4
nls? ( sys-devel/gettext )"
# Note!
# It may not be safe to source this at top level. Only source inside local
@ -140,7 +147,7 @@ is_multilib() {
[[ ${GCCMAJOR} < 3 ]] && return 1
case ${CTARGET} in
mips64*|powerpc64*|s390x*|sparc64*|x86_64*)
has_multilib_profile || use multilib ;;
has_multilib_profile ;;
*) false ;;
esac
}
@ -200,7 +207,7 @@ create_eselect_conf() {
echo " bin_prefix=${CTARGET}" >> "${D}/${gnat_config_file}"
for abi in $(get_all_abis) ; do
add_profile_eselect_conf "${D}/${gnat_config_file}" "${abi}"
add_profile_eselect_conf "${gnat_config_file}" "${abi}"
done
}
@ -213,7 +220,7 @@ should_we_eselect_gnat() {
# if the current config is invalid, we definitely want a new one
# Note: due to bash quirkiness, the following must not be 1 line
local curr_config
curr_config=$(eselect gnat show | grep ${CTARGET} | awk '{ print $1 }') || return 0
curr_config=$(eselect --colour=no gnat show | grep ${CTARGET} | awk '{ print $1 }') || return 0
[[ -z ${curr_config} ]] && return 0
# The logic is basically "try to keep the same profile if possible"
@ -246,7 +253,7 @@ do_gnat_config() {
elog "Ada handling in Gentoo allows you to have multiple gnat variants"
elog "installed in parallel and automatically manage Ada libs."
elog "Please take a look at the Ada project page for some documentation:"
elog "https://www.gentoo.org/proj/en/prog_lang/ada/index.xml"
elog "http://www.gentoo.org/proj/en/prog_lang/ada/index.xml"
}
@ -309,12 +316,11 @@ gnatbuild_pkg_postinst() {
elog
. ${GnatCommon} || die "failed to source common code"
if [[ ! -f ${PRIMELIST} ]] || [[ ! -s ${PRIMELIST} ]]; then
mkdir -p ${SETTINGSDIR}
echo "${gnat_profile}" > ${PRIMELIST}
elog "The list of primary compilers was empty and got assigned ${gnat_profile}."
fi
elog "Please edit ${PRIMELIST} and list there gnat profiles intended"
elog "for common use, one per line."
elog "for common use."
}
@ -333,7 +339,10 @@ gnatbuild_pkg_postrm() {
# common unpack stuff
gnatbuild_src_unpack() {
debug-print-function ${FUNCNAME} $@
[ -z "$1" ] && gnatbuild_src_unpack all
if [[ -z "$1" ]]; then
gnatbuild_src_unpack all
return $?
fi
while [ "$1" ]; do
case $1 in
@ -417,6 +426,12 @@ gnatbuild_src_unpack() {
done
}
# for now just dont run default configure
gnatbuild_src_configure() {
# do nothing
:
}
# it would be nice to split configure and make steps
# but both need to operate inside specially tuned evironment
# so just do sections for now (as in eclass section of handbook)
@ -441,7 +456,14 @@ gnatbuild_src_compile() {
# so many paths are not identical to the installed ones.
# Plus it was simplified even more in new releases.
if [[ ${BOOT_SLOT} > 4.1 ]] ; then
GNATLIB="${GNATBOOT}/lib"
case $(tc-arch) in
arm)
GNATLIB="${GNATBOOT}/lib/gcc/${BOOT_TARGET}/${BOOT_SLOT}"
;;
*)
GNATLIB="${GNATBOOT}/lib"
;;
esac
else
GNATLIB="${GNATBOOT}/lib/gnatgcc/${BOOT_TARGET}/${BOOT_SLOT}"
fi
@ -465,10 +487,10 @@ gnatbuild_src_compile() {
export ADA_OBJECTS_PATH="${GNATLIB}/adalib"
export ADA_INCLUDE_PATH="${GNATLIB}/adainclude"
# einfo "CC=${CC},
# ADA_INCLUDE_PATH=${ADA_INCLUDE_PATH},
# LDFLAGS=${LDFLAGS},
# PATH=${PATH}"
einfo "CC=${CC},
ADA_INCLUDE_PATH=${ADA_INCLUDE_PATH},
LDFLAGS=${LDFLAGS},
PATH=${PATH}"
while [ "$1" ]; do
case $1 in
@ -492,9 +514,9 @@ gnatbuild_src_compile() {
fi
if version_is_at_least 4.6 ; then
confgcc+=( $(use_enable lto) )
else
confgcc+=( --disable-lto )
confgcc="${confgcc} --enable-lto"
elif tc_version_is_at_least 4.5 ; then
confgcc="${confgcc} --disable-lto --disable-plugin"
fi
# reasonably sane globals (from toolchain)
@ -503,9 +525,13 @@ gnatbuild_src_compile() {
--with-system-zlib \
--disable-checking \
--disable-werror \
--disable-libgomp \
--disable-libmudflap \
--disable-libssp \
--disable-altivec \
--disable-fixed-point \
--disable-libgcj \
--disable-libcilkrts \
--disable-libsanitizer \
--disable-libunwind-exceptions"
if in_iuse openmp ; then
@ -518,19 +544,19 @@ gnatbuild_src_compile() {
then
case $(tc-arch) in
arm)
confgcc+=( --disable-libgomp )
confgcc="${confgcc} --disable-libgomp"
;;
*)
confgcc+=( $(use_enable openmp libgomp) )
confgcc="${confgcc} $(use_enable openmp libgomp)"
;;
esac
else
# Force disable as the configure script can be dumb #359855
confgcc+=( --disable-libgomp )
confgcc="${confgcc} --disable-libgomp"
fi
else
# For gcc variants where we don't want openmp (e.g. kgcc)
confgcc+=( --disable-libgomp )
confgcc="${confgcc} --disable-libgomp"
fi
# ACT's gnat-gpl does not like libada for whatever reason..
@ -542,8 +568,11 @@ gnatbuild_src_compile() {
fi
# set some specifics available in later versions
if version_is_at_least 4.3 ; then
if version_is_at_least 4.7 ; then
einfo "setting gnat thread model"
confgcc="${confgcc} --enable-threads=posix"
confgcc="${confgcc} --enable-shared=boehm-gc,ada,libada"
elif version_is_at_least 4.3 ; then
confgcc="${confgcc} --enable-threads=gnat"
confgcc="${confgcc} --enable-shared=boehm-gc,ada,libada"
else
@ -567,23 +596,33 @@ gnatbuild_src_compile() {
einfo "confgcc=${confgcc}"
# need to strip graphite flags or we'll get the
export gcc_cv_lto_plugin=1 # okay to build, default to opt-in
export gcc_cv_prog_makeinfo_modern=no
export ac_cv_have_x='have_x=yes ac_x_includes= ac_x_libraries='
export gcc_cv_libc_provides_ssp=yes
# need to strip graphite/lto flags or we'll get the
# dreaded C compiler cannot create executables...
# error.
strip-flags -floop-interchange -floop-strip-mine -floop-block
strip-flags
replace-flags -O? -O2
filter-flags '-mabi*' -m31 -m32 -m64
filter-flags -frecord-gcc-switches
filter-flags -mno-rtm -mno-htm
#filter-flags -floop-interchange -floop-strip-mine -floop-block
#filter-flags -fuse-linker-plugin -flto*
cd "${GNATBUILD}"
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" "${S}"/configure \
--prefix=${PREFIX} \
--bindir=${BINPATH} \
--includedir=${INCLUDEPATH} \
CC="${CC}" CFLAGS="${CFLAGS}" CXXFLAGS="${CFLAGS}" "${S}"/configure \
--prefix="${PREFIX}" \
--bindir="${BINPATH}" \
--includedir="${INCLUDEPATH}" \
--libdir="${LIBPATH}" \
--libexecdir="${LIBEXECPATH}" \
--datadir=${DATAPATH} \
--mandir=${DATAPATH}/man \
--infodir=${DATAPATH}/info \
--program-prefix=gnat \
--enable-languages="c,ada" \
--datadir="${DATAPATH}" \
--mandir="${DATAPATH}"/man \
--infodir="${DATAPATH}"/info \
--enable-languages=c,ada \
--with-gcc \
${confgcc} || die "configure failed"
;;
@ -606,13 +645,19 @@ gnatbuild_src_compile() {
gnatmake xsinfo && \
gnatmake xeinfo && \
gnatmake xnmake || die "building helper tools"
mv xeinfo xnmake xsinfo xtreeprs bin/
;;
bootstrap)
debug-print-section bootstrap
# and, finally, the build itself
cd "${GNATBUILD}"
emake bootstrap || die "bootstrap failed"
emake \
LDFLAGS="${LDFLAGS}" \
LIBPATH="${LIBPATH}" \
CC="${CC}" \
bootstrap-lean || die "bootstrap failed"
;;
gnatlib_and_tools)
@ -692,10 +737,16 @@ gnatbuild_src_install() {
cd "${GNATBUILD}"
make DESTDIR="${D}" install || die
# Disable RANDMMAP so PCH works. #301299
pax-mark r "${D}"${LIBEXECPATH}/{gnat1,cc1,cc1plus}
# Quiet QA warnings, wait for adacore exec stack patch in gcc 7
export QA_EXECSTACK="${BINPATH:1}/gnatls ${BINPATH:1}/gnatname
${BINPATH:1}/gnatmake ${BINPATH:1}/gnatclean ${BINPATH:1}/gnat"
if use doc ; then
if (( $(bc <<< "${GNATBRANCH} > 4.3") )) ; then
#make a convenience info link
elog "Yay! Math is good."
ewarn "Yay! Math works."
dosym gnat_ugn.info ${DATAPATH}/info/gnat.info
fi
fi
@ -728,9 +779,9 @@ gnatbuild_src_install() {
# force gnatgcc to use its own specs - versions prior to 3.4.6 read specs
# from system gcc location. Do the simple wrapper trick for now
# !ATTN! change this if eselect-gnat starts to follow eselect-compiler
cd "${D}${BINPATH}"
if [[ ${GCCVER} < 3.4.6 ]] ; then
# gcc 4.1 uses builtin specs. What about 4.0?
cd "${D}${BINPATH}"
mv gnatgcc gnatgcc_2wrap
cat > gnatgcc << EOF
#! /bin/bash
@ -742,6 +793,11 @@ BINDIR=\$(dirname \$0)
\${BINDIR}/gnatgcc_2wrap -specs="${LIBPATH}/specs" -I"${LIBPATH}/include" \$@
EOF
chmod a+x gnatgcc
else
local i
for i in cpp gcc gcov ; do
ln -s ${i} gnat${i}
done
fi
# earlier gnat's generate some Makefile's at generic location, need to
@ -751,7 +807,7 @@ EOF
# use gid of 0 because some stupid ports don't have
# the group 'root' set to gid 0 (toolchain.eclass)
chown -R root:0 "${D}${LIBPATH}"
# chown -R root:0 "${D}${LIBPATH}"
;;
cleanup)
@ -774,9 +830,6 @@ EOF
"${D}${LIBEXECPATH}"/liblto_plugin.la \
|| die "sed update of .la file failed!"
fi
# add config directory (bug 440660)
keepdir /etc/ada
;;
prep_env)

View File

@ -101,6 +101,14 @@ gnome2_environment_reset() {
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
if has ${EAPI:-0} 6; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
# Stop relying on random DISPLAY variable values, bug #534312
unset DISPLAY
fi
}
# @FUNCTION: gnome2_gconf_savelist

View File

@ -10,31 +10,31 @@
# Exports portage base functions used by ebuilds written for packages using the
# GNOME framework. For additional functions, see gnome2-utils.eclass.
# @ECLASS-VARIABLE: GNOME2_EAUTORECONF
# @DEFAULT_UNSET
# @DESCRIPTION:
# Run eautoreconf instead of only elibtoolize
GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
[[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
inherit eutils libtool gnome.org gnome2-utils xdg
case "${EAPI:-0}" in
4|5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
6)
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
# @ECLASS-VARIABLE: G2CONF
# @ECLASS-VARIABLE: DOCS
# @DEFAULT_UNSET
# @DESCRIPTION:
# Extra configure opts passed to econf.
# Deprecated, pass extra arguments to gnome2_src_configure.
G2CONF=${G2CONF:-""}
# @ECLASS-VARIABLE: GNOME2_LA_PUNT
# @DESCRIPTION:
# Should we delete ALL the .la files?
# NOT to be used without due consideration.
if has ${EAPI:-0} 4; then
GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
else
GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
fi
# String containing documents passed to dodoc command for eapi4.
# In eapi5 we rely on einstalldocs (from eutils.eclass) and for newer EAPIs we
# follow PMS spec.
# @ECLASS-VARIABLE: ELTCONF
# @DEFAULT_UNSET
@ -42,36 +42,63 @@ fi
# Extra options passed to elibtoolize
ELTCONF=${ELTCONF:-""}
# @ECLASS-VARIABLE: DOCS
# @ECLASS-VARIABLE: G2CONF
# @DEFAULT_UNSET
# @DESCRIPTION:
# String containing documents passed to dodoc command.
# Extra configure opts passed to econf.
# Deprecated, pass extra arguments to gnome2_src_configure.
# Banned in eapi6 and newer.
if has ${EAPI:-0} 4 5; then
G2CONF=${G2CONF:-""}
fi
# @ECLASS-VARIABLE: GCONF_DEBUG
# @DEFAULT_UNSET
# @DESCRIPTION:
# @DESCRIPTION:
# Whether to handle debug or not.
# Some gnome applications support various levels of debugging (yes, no, minimum,
# etc), but using --disable-debug also removes g_assert which makes debugging
# harder. This variable should be set to yes for such packages for the eclass
# etc), but using --disable-debug also removes g_assert which makes debugging
# harder. This variable should be set to yes for such packages for the eclass
# to handle it properly. It will enable minimal debug with USE=-debug.
# Note that this is most commonly found in configure.ac as GNOME_DEBUG_CHECK.
#
# Banned since eapi6 as upstream is moving away from this obsolete macro in favor
# of autoconf-archive macros, that do not expose this issue (bug #270919)
if has ${EAPI:-0} 4 5; then
if [[ ${GCONF_DEBUG} != "no" ]]; then
IUSE="debug"
fi
fi
# @ECLASS-VARIABLE: GNOME2_ECLASS_GIO_MODULES
# @INTERNAL
# @DESCRIPTION:
# Array containing glib GIO modules
if [[ ${GCONF_DEBUG} != "no" ]]; then
IUSE="debug"
# @ECLASS-VARIABLE: GNOME2_LA_PUNT
# @DESCRIPTION:
# For eapi4 it sets if we should delete ALL or none of the .la files
# For eapi5 and newer it relies on prune_libtool_files (from eutils.eclass)
# for this. Available values for GNOME2_LA_PUNT:
# - "no": will not clean any .la files
# - "yes": will run prune_libtool_files --modules
# - If it is not set, it will run prune_libtool_files
if has ${EAPI:-0} 4; then
GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
else
GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
fi
# @FUNCTION: gnome2_src_unpack
# @DESCRIPTION:
# Stub function for old EAPI.
gnome2_src_unpack() {
unpack ${A}
cd "${S}"
if has ${EAPI:-0} 4 5; then
unpack ${A}
cd "${S}"
else
die "gnome2_src_unpack is banned from eapi6"
fi
}
# @FUNCTION: gnome2_src_prepare
@ -85,31 +112,47 @@ gnome2_src_prepare() {
gnome2_environment_reset
# Prevent scrollkeeper access violations
gnome2_omf_fix
# We stop to run it from eapi6 as scrollkeeper helpers from
# rarian are not running anything and, then, access violations
# shouldn't occur.
has ${EAPI:-0} 4 5 && gnome2_omf_fix
# Disable all deprecation warnings
gnome2_disable_deprecation_warning
# Run libtoolize
# Run libtoolize or eautoreconf, bug #591584
# https://bugzilla.gnome.org/show_bug.cgi?id=655517
elibtoolize ${ELTCONF}
if [[ ${GNOME2_EAUTORECONF} == 'yes' ]]; then
eautoreconf
else
elibtoolize ${ELTCONF}
fi
}
# @FUNCTION: gnome2_src_configure
# @DESCRIPTION:
# Gnome specific configure handling
gnome2_src_configure() {
# Deprecated for a long time now, see Gnome team policies
# Deprecated for a long time now and banned since eapi6, see Gnome team policies
if [[ -n ${G2CONF} ]] ; then
eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
if has ${EAPI:-0} 4 5; then
eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
else
die "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
fi
fi
local g2conf=()
# Update the GNOME configuration options
if [[ ${GCONF_DEBUG} != 'no' ]] ; then
if use debug ; then
g2conf+=( --enable-debug=yes )
if has ${EAPI:-0} 4 5; then
if [[ ${GCONF_DEBUG} != 'no' ]] ; then
if use debug ; then
g2conf+=( --enable-debug=yes )
fi
fi
else
if [[ -n ${GCONF_DEBUG} ]] ; then
die "GCONF_DEBUG is banned since eapi6 in favor of each ebuild taking care of the proper handling of debug configure option"
fi
fi
@ -139,7 +182,7 @@ gnome2_src_configure() {
g2conf+=( --disable-scrollkeeper )
fi
# Pass --disable-silent-rules when possible (not needed for eapi5), bug #429308
# Pass --disable-silent-rules when possible (not needed since eapi5), bug #429308
if has ${EAPI:-0} 4; then
if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --disable-silent-rules )
@ -166,22 +209,36 @@ gnome2_src_configure() {
g2conf+=( --enable-compile-warnings=minimum )
fi
# Pass --docdir with proper directory, bug #482646
if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
# Pass --docdir with proper directory, bug #482646 (not needed since eapi6)
if has ${EAPI:-0} 4 5; then
if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
fi
fi
# Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
addwrite "$(unset HOME; echo ~)/.gnome2"
if has ${EAPI:-0} 4 5; then
addwrite "$(unset HOME; echo ~)/.gnome2"
else
addpredict "$(unset HOME; echo ~)/.gnome2"
fi
econf ${g2conf[@]} ${G2CONF} "$@"
if has ${EAPI:-0} 4 5; then
econf ${g2conf[@]} ${G2CONF} "$@"
else
econf ${g2conf[@]} "$@"
fi
}
# @FUNCTION: gnome2_src_compile
# @DESCRIPTION:
# Only default src_compile for now
gnome2_src_compile() {
emake
if has ${EAPI:-0} 4 5; then
emake
else
default
fi
}
# @FUNCTION: gnome2_src_install
@ -189,27 +246,39 @@ gnome2_src_compile() {
# Gnome specific install. Handles typical GConf and scrollkeeper setup
# in packages and removal of .la files if requested
gnome2_src_install() {
# if this is not present, scrollkeeper-update may segfault and
# create bogus directories in /var/lib/
local sk_tmp_dir="/var/lib/scrollkeeper"
dodir "${sk_tmp_dir}" || die "dodir failed"
# we must delay gconf schema installation due to sandbox
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
debug-print "Installing with 'make install'"
emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
local sk_tmp_dir="/var/lib/scrollkeeper"
# scrollkeeper-update from rarian doesn't do anything. Then, since eapi6
# we stop taking care of it
#
# if this is not present, scrollkeeper-update may segfault and
# create bogus directories in /var/lib/
if has ${EAPI:-0} 4 5; then
dodir "${sk_tmp_dir}" || die "dodir failed"
emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
else
default
fi
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
# Handle documentation as 'default' for eapi5 and newer, bug #373131
# Handle documentation as 'default' for eapi5, bug #373131
# Since eapi6 this is handled by default on its own plus MAINTAINERS and HACKING
# files that are really common in gnome packages (bug #573390)
if has ${EAPI:-0} 4; then
# Manual document installation
if [[ -n "${DOCS}" ]]; then
dodoc ${DOCS} || die "dodoc failed"
fi
else
elif has ${EAPI:-0} 5; then
einstalldocs
else
local d
for d in HACKING MAINTAINERS; do
[[ -s "${d}" ]] && dodoc "${d}"
done
fi
# Do not keep /var/lib/scrollkeeper because:

View File

@ -32,13 +32,13 @@ then
elif [[ "${PV}" == "9999" ]]
then
GO_MONO_P=${P}
EGIT_REPO_URI="http://github.com/mono/${GIT_PN}.git"
EGIT_REPO_URI="https://github.com/mono/${GIT_PN}.git"
SRC_URI=""
inherit autotools git
elif [[ "${PV%.9999}" != "${PV}" ]]
then
GO_MONO_P=${P}
EGIT_REPO_URI="http://github.com/mono/${GIT_PN}.git"
EGIT_REPO_URI="https://github.com/mono/${GIT_PN}.git"
EGIT_BRANCH="mono-$(get_version_component_range 1)-$(get_version_component_range 2)${GO_MONO_SUB_BRANCH}"
SRC_URI=""
inherit autotools git

View File

@ -24,6 +24,10 @@ if [[ -z ${_GOLANG_BASE} ]]; then
_GOLANG_BASE=1
DEPEND=">=dev-lang/go-1.4.2:="
# Do not complain about CFLAGS etc since go projects do not use them.
QA_FLAGS_IGNORED='.*'
STRIP_MASK="*.a"
# @ECLASS-VARIABLE: EGO_PN

View File

@ -98,8 +98,8 @@ fi
DESCRIPTION="${BUILD_GST_PLUGINS} plugin for gstreamer"
HOMEPAGE="http://gstreamer.freedesktop.org/"
SRC_URI="http://gstreamer.freedesktop.org/src/${GST_ORG_MODULE}/${GST_ORG_MODULE}-${PV}.tar.${GST_TARBALL_SUFFIX}"
HOMEPAGE="https://gstreamer.freedesktop.org/"
SRC_URI="https://gstreamer.freedesktop.org/src/${GST_ORG_MODULE}/${GST_ORG_MODULE}-${PV}.tar.${GST_TARBALL_SUFFIX}"
LICENSE="GPL-2"
case ${GST_ORG_PVP} in

View File

@ -26,7 +26,7 @@
inherit eutils multilib multilib-minimal toolchain-funcs versionator xdg-utils
case "${EAPI:-0}" in
5)
5|6)
;;
0|1|2|3|4)
die "EAPI=\"${EAPI:-0}\" is not supported anymore"
@ -77,8 +77,8 @@ fi
DESCRIPTION="${BUILD_GST_PLUGINS} plugin for gstreamer"
HOMEPAGE="http://gstreamer.freedesktop.org/"
SRC_URI="http://gstreamer.freedesktop.org/src/${GST_ORG_MODULE}/${GST_ORG_MODULE}-${PV}.tar.${GST_TARBALL_SUFFIX}"
HOMEPAGE="https://gstreamer.freedesktop.org/"
SRC_URI="https://gstreamer.freedesktop.org/src/${GST_ORG_MODULE}/${GST_ORG_MODULE}-${PV}.tar.${GST_TARBALL_SUFFIX}"
LICENSE="GPL-2"
case ${GST_ORG_PVP} in
@ -171,7 +171,7 @@ gstreamer_get_plugin_dir() {
# @USAGE: gstreamer_system_link gst-libs/gst/audio:gstreamer-audio [...]
# @DESCRIPTION:
# Walks through makefiles in order to make sure build will link against system
# librairies.
# libraries.
# Takes a list of path fragments and corresponding pkgconfig libraries
# separated by colon (:). Will replace the path fragment by the output of
# pkgconfig.

View File

@ -20,13 +20,8 @@
# haddock -- for documentation generation
# hscolour -- generation of colourised sources
# hoogle -- generation of documentation search index
# alex -- lexer/scanner generator
# happy -- parser generator
# c2hs -- C interface generator
# cpphs -- C preprocessor clone written in Haskell
# profile -- if package supports to build profiling-enabled libraries
# bootstrap -- only used for the cabal package itself
# bin -- the package installs binaries
# lib -- the package installs libraries
# nocabaldep -- don't add dependency on cabal.
# only used for packages that _must_ not pull the dependency
@ -36,7 +31,7 @@
# not pull upper versions
# test-suite -- add support for cabal test-suites (introduced in Cabal-1.8)
inherit eutils ghc-package multilib multiprocessing
inherit eutils ghc-package multilib toolchain-funcs
# @ECLASS-VARIABLE: CABAL_EXTRA_CONFIGURE_FLAGS
# @DESCRIPTION:
@ -59,6 +54,13 @@ inherit eutils ghc-package multilib multiprocessing
# linking 'setup' faster.
: ${GHC_BOOTSTRAP_FLAGS:=}
# @ECLASS-VARIABLE: CABAL_EXTRA_TEST_FLAGS
# @DESCRIPTION:
# User-specified additional parameters passed to 'setup test'.
# example: /etc/portage/make.conf:
# CABAL_EXTRA_TEST_FLAGS="-v3 --show-details=streaming"
: ${CABAL_EXTRA_TEST_FLAGS:=}
# @ECLASS-VARIABLE: CABAL_DEBUG_LOOSENING
# @DESCRIPTION:
# Show debug output for 'cabal_chdeps' function if set.
@ -84,17 +86,16 @@ for feature in ${CABAL_FEATURES}; do
haddock) CABAL_USE_HADDOCK=yes;;
hscolour) CABAL_USE_HSCOLOUR=yes;;
hoogle) CABAL_USE_HOOGLE=yes;;
alex) CABAL_USE_ALEX=yes;;
happy) CABAL_USE_HAPPY=yes;;
c2hs) CABAL_USE_C2HS=yes;;
cpphs) CABAL_USE_CPPHS=yes;;
profile) CABAL_USE_PROFILE=yes;;
bootstrap) CABAL_BOOTSTRAP=yes;;
bin) CABAL_HAS_BINARIES=yes;;
lib) CABAL_HAS_LIBRARIES=yes;;
nocabaldep) CABAL_FROM_GHC=yes;;
ghcdeps) CABAL_GHC_CONSTRAINT=yes;;
test-suite) CABAL_TEST_SUITE=yes;;
# does nothing, removed 2016-09-04
bin) ;;
*) CABAL_UNKNOWN="${CABAL_UNKNOWN} ${feature}";;
esac
done
@ -119,25 +120,10 @@ fi
if [[ -n "${CABAL_USE_HOOGLE}" ]]; then
# enabled only in ::haskell
#IUSE="${IUSE} hoogle"
CABAL_USE_HOOGLE=
fi
if [[ -n "${CABAL_USE_ALEX}" ]]; then
DEPEND="${DEPEND} dev-haskell/alex"
fi
if [[ -n "${CABAL_USE_HAPPY}" ]]; then
DEPEND="${DEPEND} dev-haskell/happy"
fi
if [[ -n "${CABAL_USE_C2HS}" ]]; then
DEPEND="${DEPEND} dev-haskell/c2hs"
fi
if [[ -n "${CABAL_USE_CPPHS}" ]]; then
DEPEND="${DEPEND} dev-haskell/cpphs"
fi
if [[ -n "${CABAL_USE_PROFILE}" ]]; then
IUSE="${IUSE} profile"
fi
@ -146,15 +132,6 @@ if [[ -n "${CABAL_TEST_SUITE}" ]]; then
IUSE="${IUSE} test"
fi
# We always use a standalone version of Cabal, rather than the one that comes
# with GHC. But of course we can't depend on cabal when building cabal itself.
if [[ -z ${CABAL_MIN_VERSION} ]]; then
CABAL_MIN_VERSION=1.1.4
fi
if [[ -z "${CABAL_BOOTSTRAP}" && -z "${CABAL_FROM_GHC}" ]]; then
DEPEND="${DEPEND} >=dev-haskell/cabal-${CABAL_MIN_VERSION}"
fi
# returns the version of cabal currently in use.
# Rarely it's handy to pin cabal version from outside.
: ${_CABAL_VERSION_CACHE:=""}
@ -190,13 +167,6 @@ cabal-bootstrap() {
setupmodule="${S}/Setup.hs"
fi
if [[ -z "${CABAL_BOOTSTRAP}" && -z "${CABAL_FROM_GHC}" ]] && ! ghc-sanecabal "${CABAL_MIN_VERSION}"; then
eerror "The package dev-haskell/cabal is not correctly installed for"
eerror "the currently active version of ghc ($(ghc-version)). Please"
eerror "run haskell-updater or re-build dev-haskell/cabal."
die "cabal is not correctly installed"
fi
# We build the setup program using the latest version of
# cabal that we have installed
cabalpackage=Cabal-$(cabal-version)
@ -211,6 +181,7 @@ cabal-bootstrap() {
make_setup() {
set -- -package "${cabalpackage}" --make "${setupmodule}" \
$(ghc-make-args) \
"${setup_bootstrap_args[@]}" \
${HCFLAGS} \
${GHC_BOOTSTRAP_FLAGS} \
@ -342,20 +313,7 @@ cabal-configure() {
if [[ -n "${CABAL_USE_PROFILE}" ]] && use profile; then
cabalconf+=(--enable-library-profiling)
fi
if [[ -n "${CABAL_USE_ALEX}" ]]; then
cabalconf+=(--with-alex=${EPREFIX}/usr/bin/alex)
fi
if [[ -n "${CABAL_USE_HAPPY}" ]]; then
cabalconf+=(--with-happy=${EPREFIX}/usr/bin/happy)
fi
if [[ -n "${CABAL_USE_C2HS}" ]]; then
cabalconf+=(--with-c2hs=${EPREFIX}/usr/bin/c2hs)
fi
if [[ -n "${CABAL_USE_CPPHS}" ]]; then
cabalconf+=(--with-cpphs=${EPREFIX}/usr/bin/cpphs)
fi
if [[ -n "${CABAL_TEST_SUITE}" ]]; then
cabalconf+=($(use_enable test tests))
fi
@ -364,23 +322,16 @@ cabal-configure() {
cabalconf+=($(cabal-constraint "ghc"))
fi
cabalconf+=(--ghc-options="$(ghc-make-args)")
local option
for option in ${HCFLAGS}
do
cabalconf+=(--ghc-option="$option")
done
# parallel on all available cores
if ghc-supports-parallel-make; then
local max_jobs=$(makeopts_jobs)
# limit to very small value, as parallelism
# helps slightly, but makes things severely worse
# when amount of threads is Very Large.
[[ ${max_jobs} -gt 4 ]] && max_jobs=4
cabalconf+=(--ghc-option=-j"$max_jobs")
fi
# toolchain
cabalconf+=(--with-ar="$(tc-getAR)")
# Building GHCi libs on ppc64 causes "TOC overflow".
if use ppc64; then
@ -511,9 +462,6 @@ haskell-cabal_pkg_setup() {
if [[ -n ${CABAL_HAS_LIBRARIES} ]]; then
[[ ${RDEPEND} == *dev-lang/ghc* ]] || eqawarn "QA Notice: A library does not have runtime dependency on dev-lang/ghc."
fi
if [[ -z "${CABAL_HAS_BINARIES}" ]] && [[ -z "${CABAL_HAS_LIBRARIES}" ]]; then
eqawarn "QA Notice: Neither bin nor lib are in CABAL_FEATURES."
fi
if [[ -n "${CABAL_UNKNOWN}" ]]; then
eqawarn "QA Notice: Unknown entry in CABAL_FEATURES: ${CABAL_UNKNOWN}"
fi
@ -602,13 +550,25 @@ haskell-cabal_src_compile() {
}
haskell-cabal_src_test() {
local cabaltest=()
pushd "${S}" > /dev/null || die
if cabal-is-dummy-lib; then
einfo ">>> No tests for dummy library: ${CATEGORY}/${PF}"
else
einfo ">>> Test phase [cabal test]: ${CATEGORY}/${PF}"
set -- test "$@"
# '--show-details=streaming' appeared in Cabal-1.20
if ./setup test --help | grep -q -- "'streaming'"; then
cabaltest+=(--show-details=streaming)
fi
set -- test \
"${cabaltest[@]}" \
${CABAL_TEST_FLAGS} \
${CABAL_EXTRA_TEST_FLAGS} \
"$@"
echo ./setup "$@"
./setup "$@" || die "cabal test failed"
fi

View File

@ -1,184 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# Help manage the horde project http://www.horde.org/
#
# Author: Mike Frysinger <vapier@gentoo.org>
# CVS additions by Chris Aniszczyk <zx@mea-culpa.net>
# SNAP additions by Jonathan Polansky <jpolansky@lsit.ucsb.edu>
#
# This eclass provides generic functions to make the writing of horde
# ebuilds fairly trivial since there are many horde applications and
# they all share the same basic install process.
# EHORDE_SNAP
# This variable tracks whether the user is using a snapshot version
#
# EHORDE_SNAP_BRANCH
# You set this via the ebuild to whatever branch you wish to grab a
# snapshot of. Typically this is 'HEAD' or 'RELENG'.
#
# EHORDE_CVS
# This variable tracks whether the user is using a cvs version
inherit webapp eutils
[[ ${PN} != ${PN/-cvs} ]] && inherit cvs
IUSE="vhosts"
EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst
[[ -z ${HORDE_PN} ]] && HORDE_PN="${PN/horde-}"
[[ -z ${HORDE_MAJ} ]] && HORDE_MAJ=""
EHORDE_CVS="false"
EHORDE_SNAP="false"
if [[ ${PN} != ${PN/-cvs} ]] ; then
EHORDE_CVS="true"
HORDE_PN=${HORDE_PN/-cvs}
ECVS_SERVER="anoncvs.horde.org:/repository"
ECVS_MODULE="${HORDE_PN}"
ECVS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src/${PN}"
ECVS_USER="cvsread"
ECVS_PASS="horde"
SRC_URI=""
S=${WORKDIR}/${HORDE_PN}
elif [[ ${PN} != ${PN/-snap} ]] ; then
EHORDE_SNAP="true"
EHORDE_SNAP_BRANCH=${EHORDE_SNAP_BRANCH:-HEAD}
SNAP_PV=${PV:0:4}-${PV:4:2}-${PV:6:2}
HORDE_PN=${HORDE_PN/-snap}
SRC_URI="http://ftp.horde.org/pub/snaps/${SNAP_PV}/${HORDE_PN}-${EHORDE_SNAP_BRANCH}-${SNAP_PV}.tar.gz"
S=${WORKDIR}/${HORDE_PN}
else
SRC_URI="http://ftp.horde.org/pub/${HORDE_PN}/${HORDE_PN}${HORDE_MAJ}-${PV/_/-}.tar.gz"
S=${WORKDIR}/${HORDE_PN}${HORDE_MAJ}-${PV/_/-}
fi
HOMEPAGE="http://www.horde.org/${HORDE_PN}"
LICENSE="LGPL-2"
# INSTALL_DIR is used by webapp.eclass when USE=-vhosts
INSTALL_DIR="/horde"
[[ ${HORDE_PN} != "horde" && ${HORDE_PN} != "horde-groupware" && ${HORDE_PN} != "horde-webmail" ]] && INSTALL_DIR="${INSTALL_DIR}/${HORDE_PN}"
HORDE_APPLICATIONS="${HORDE_APPLICATIONS} ."
horde_pkg_setup() {
webapp_pkg_setup
if [[ ! -z ${HORDE_PHP_FEATURES} ]] ; then
local param
if [[ ${HORDE_PHP_FEATURES:0:2} = "-o" ]] ; then
param="-o"
HORDE_PHP_FEATURES=${HORDE_PHP_FEATURES:2}
fi
if ! built_with_use ${param} dev-lang/php ${HORDE_PHP_FEATURES} ; then
echo
if [[ ${param} == "-o" ]] ; then
eerror "You MUST re-emerge php with at least one of"
else
eerror "You MUST re-emerge php with all of"
fi
eerror "the following options in your USE:"
eerror " ${HORDE_PHP_FEATURES}"
die "current php install cannot support ${HORDE_PN}"
fi
fi
}
horde_src_unpack() {
if [[ ${EHORDE_CVS} = "true" ]] ; then
cvs_src_unpack
else
unpack ${A}
fi
cd "${S}"
[[ -n ${EHORDE_PATCHES} ]] && epatch ${EHORDE_PATCHES}
for APP in ${HORDE_APPLICATIONS}
do
[[ -f ${APP}/test.php ]] && chmod 000 ${APP}/test.php
done
}
horde_src_install() {
webapp_src_preinst
local destdir=${MY_HTDOCSDIR}
# Work-around when dealing with CVS sources
[[ ${EHORDE_CVS} = "true" ]] && cd ${HORDE_PN}
# Install docs and then delete them (except for CREDITS which
# many horde apps include in their help page #121003)
dodoc README docs/*
mv docs/CREDITS "${T}"/
rm -rf COPYING LICENSE README docs/*
mv "${T}"/CREDITS docs/
dodir ${destdir}
cp -r . "${D}"/${destdir}/ || die "install files"
for APP in ${HORDE_APPLICATIONS}
do
for DISTFILE in ${APP}/config/*.dist
do
if [[ -f ${DISTFILE/.dist/} ]] ; then
webapp_configfile "${MY_HTDOCSDIR}"/${DISTFILE/.dist/}
fi
done
if [[ -f ${APP}/config/conf.php ]] ; then
webapp_serverowned "${MY_HTDOCSDIR}"/${APP}/config/conf.php
webapp_configfile "${MY_HTDOCSDIR}"/${APP}/config/conf.php
fi
done
[[ -n ${HORDE_RECONFIG} ]] && webapp_hook_script ${HORDE_RECONFIG}
[[ -n ${HORDE_POSTINST} ]] && webapp_postinst_txt en ${HORDE_POSTINST}
webapp_src_install
}
horde_pkg_postinst() {
if [ -e ${ROOT}/usr/share/doc/${PF}/INSTALL* ] ; then
elog "Please read the INSTALL file in /usr/share/doc/${PF}."
fi
einfo "Before this package will work, you have to setup the configuration files."
einfo "Please review the config/ subdirectory of ${HORDE_PN} in the webroot."
if [ -e ${ROOT}/usr/share/doc/${PF}/SECURITY* ] ; then
ewarn
ewarn "Users are HIGHLY recommended to consult the SECURITY guide in"
ewarn "/usr/share/doc/${PF} before going into production with Horde."
fi
if [[ ${HORDE_PN} != "horde" && ${HORDE_PN} != "horde-groupware" && ${HORDE_PN} != "horde-webmail" ]] ; then
ewarn
ewarn "Make sure ${HORDE_PN} is accounted for in Horde's root"
ewarn " config/registry.php"
fi
if [[ ${EHORDE_CVS} = "true" ]] ; then
ewarn
ewarn "Use these CVS versions at your own risk."
ewarn "They tend to break things when working with the non CVS versions of horde."
fi
if use vhosts ; then
ewarn
ewarn "When installing Horde into a vhost dir, you will need to use the"
ewarn "-d option so that it is installed into the proper location."
fi
webapp_pkg_postinst
}

View File

@ -170,34 +170,6 @@ QA_PREBUILT="${INTEL_SDP_DIR}/*"
#
# e.g. amd64-multilib -> INTEL_ARCH="intel64 ia32"
# @FUNCTION: _isdp_link_eclipse_plugins
# @INTERNAL
# @DESCRIPTION:
# Creating necessary links to use intel compiler with eclipse
_isdp_link_eclipse_plugins() {
debug-print-function ${FUNCNAME} "${@}"
local c f
pushd ${INTEL_SDP_DIR}/eclipse_support > /dev/null || die
for c in cdt*; do
local cv=${c#cdt} ev=3.$(( ${cv:0:1} - 1))
if has_version "dev-util/eclipse-sdk:${ev}"; then
einfo "Linking eclipse (v${ev}) plugin cdt (v${cv})"
for f in cdt${cv}/eclipse/features/*; do
dodir /usr/$(get_libdir)/eclipse-${ev}/features
dosym "${INTEL_SDP_EDIR}"/eclipse_support/${f} \
/usr/$(get_libdir)/eclipse-${ev}/features/ || die
done
for f in cdt${cv}/eclipse/plugins/*; do
dodir /usr/$(get_libdir)/eclipse-${ev}/plugins
dosym "${INTEL_SDP_EDIR}"/eclipse_support/${f} \
/usr/$(get_libdir)/eclipse-${ev}/plugins/ || die
done
fi
done
popd > /dev/null || die
}
# @FUNCTION: _isdp_big-warning
# @USAGE: [pre-check | test-failed]
# @INTERNAL
@ -458,16 +430,6 @@ intel-sdp_src_install() {
eend
fi
if path_exists "${INTEL_SDP_DIR}"/eclipse_support; then
if has eclipse ${IUSE} && use eclipse; then
_isdp_link_eclipse_plugins
else
ebegin "Cleaning out eclipse plugin"
find "${INTEL_SDP_DIR}"/eclipse_support -delete || die
eend
fi
fi
if path_exists "${INTEL_SDP_DIR}"/man; then
path_exists "${INTEL_SDP_DIR}"/man/en_US/man1/* && \
doman "${INTEL_SDP_DIR}"/man/en_US/man1/*

View File

@ -245,12 +245,12 @@ java-ant_bsfix_files() {
done
# for javadoc target and all in one pass, we need the new rewriter.
local rewriter3="/usr/share/javatoolkit/xml-rewrite-3.py"
local rewriter3="${EPREFIX}/usr/share/javatoolkit/xml-rewrite-3.py"
if [[ ! -f ${rewriter3} ]]; then
rewriter3="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py"
rewriter3="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py"
fi
local rewriter4="/usr/$(get_libdir)/javatoolkit/bin/build-xml-rewrite"
local rewriter4="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/build-xml-rewrite"
if [[ -x ${rewriter4} && ${JAVA_ANT_ENCODING} ]]; then
[[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] && local gcp="-g"
@ -458,8 +458,8 @@ java-ant_ignore-system-classes() {
# @DESCRIPTION:
# Run the right xml-rewrite binary with the given arguments
java-ant_xml-rewrite() {
local gen2="/usr/bin/xml-rewrite-2.py"
local gen2_1="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-2.py"
local gen2="${EPREFIX}/usr/bin/xml-rewrite-2.py"
local gen2_1="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-2.py"
# gen1 is deprecated
if [[ -x "${gen2}" ]]; then
${gen2} "${@}" || die "${gen2} failed"

View File

@ -1,50 +0,0 @@
# Copyright 2004-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: java-mvn-src.eclass
# @MAINTAINER:
# java@gentoo.org
# @AUTHOR:
# Java maintainers (java@gentoo.org)
# @BLURB: Eclass for Java packages from bare sources exported by Maven
# @DESCRIPTION:
# This class is intended to build pure Java packages from the sources exported
# from the source:jar goal of Maven 2. These archives contain bare Java source
# files, with no build instructions or additional resource files. They are
# unsuitable for packages that require resources besides compiled class files.
# The benefit is that for artifacts developed with Maven, these source files
# are often released together with binary packages, whereas the full build
# environment might be contained in some revision control system or not
# available at all.
inherit java-pkg-simple
# @ECLASS-VARIABLE: GROUP_ID
# @DESCRIPTION:
# The groupId of the artifact, in dotted notation. Default value is ${PN}.
: ${GROUP_ID:=${PN}}
# @ECLASS-VARIABLE: ARTIFACT_ID
# @DESCRIPTION:
# The artifactId of the artifact. Default value is ${PN}.
: ${ARTIFACT_ID:=${PN}}
# @ECLASS-VARIABLE: MAVEN2_REPOSITORIES
# @DESCRIPTION:
# The repositories to search for the artifacts. Must follow Maven2 layout.
# Default value is the following string:
# "http://repo2.maven.org/maven2 http://download.java.net/maven/2"
: ${MAVEN2_REPOSITORIES:="http://repo2.maven.org/maven2 http://download.java.net/maven/2"}
# @ECLASS-VARIABLE: RELATIVE_SRC_URI
# @DESCRIPTION:
# The path of the source artifact relative to the root of the repository.
# Will be set by the eclass to follow Maven 2 repository layout.
RELATIVE_SRC_URI=${GROUP_ID//./\/}/${ARTIFACT_ID}/${PV}/${ARTIFACT_ID}-${PV}-sources.jar
# Look for source jar in all listed repositories
for repo in ${MAVEN2_REPOSITORIES}; do
SRC_URI="${SRC_URI} ${repo}/${RELATIVE_SRC_URI}"
done
unset repo

View File

@ -76,6 +76,9 @@ java-pkg-2_src_prepare() {
java-pkg-2_src_compile() {
if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then
# auto generate classpath
java-pkg_gen-cp EANT_GENTOO_CLASSPATH
[[ "${EANT_FILTER_COMPILER}" ]] && \
java-pkg_filter-compiler ${EANT_FILTER_COMPILER}
local antflags="${EANT_BUILD_TARGET:=jar}"

View File

@ -88,6 +88,9 @@ S="${WORKDIR}"
java-pkg-simple_src_compile() {
local sources=sources.lst classes=target/classes apidoc=target/api
# auto generate classpath
java-pkg_gen-cp JAVA_GENTOO_CLASSPATH
# gather sources
find ${JAVA_SRC_DIR:-*} -name \*.java > ${sources}
mkdir -p ${classes} || die "Could not create target directory"

View File

@ -1,4 +1,4 @@
# Copyright 2004-2015 Gentoo Foundation
# Copyright 2004-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -23,6 +23,9 @@ IUSE="elibc_FreeBSD"
# Make sure we use java-config-2
export WANT_JAVA_CONFIG="2"
# Prefix variables are only available for EAPI>=3
has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
# @VARIABLE: JAVA_PKG_PORTAGE_DEP
# @INTERNAL
# @DESCRIPTION:
@ -37,7 +40,7 @@ has "${EAPI}" 0 1 && JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1.2.7"
# This is a convience variable to be used from the other java eclasses. This is
# the version of java-config we want to use. Usually the latest stable version
# so that ebuilds can use new features without depending on specific versions.
JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.2.0 ${JAVA_PKG_PORTAGE_DEP}"
JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.2.0-r3 ${JAVA_PKG_PORTAGE_DEP}"
has source ${JAVA_PKG_IUSE} && JAVA_PKG_E_DEPEND="${JAVA_PKG_E_DEPEND} source? ( app-arch/zip )"
# @ECLASS-VARIABLE: JAVA_PKG_WANT_BOOTCLASSPATH
@ -275,7 +278,7 @@ java-pkg_addres() {
# be it a unit test or a regular java class.
#
# You can use this function by either:
# - calling it yourself in java_prepare() and feeding java-pkg_rm_files with
# - calling it yourself in src_prepare() and feeding java-pkg_rm_files with
# the list of files you wish to remove.
# - defining an array in the ebuild named JAVA_RM_FILES with the list of files
# you wish to remove.
@ -338,7 +341,7 @@ java-pkg_dojar() {
if [[ -e "${jar}" ]] ; then
# Don't overwrite if jar has already been installed with the same
# name
local dest="${D}${JAVA_PKG_JARDEST}/${jar_basename}"
local dest="${ED}${JAVA_PKG_JARDEST}/${jar_basename}"
if [[ -e "${dest}" ]]; then
ewarn "Overwriting ${dest}"
fi
@ -348,15 +351,17 @@ java-pkg_dojar() {
#but first check class version when in strict mode.
is-java-strict && java-pkg_verify-classes "${jar}"
INSDESTTREE="${JAVA_PKG_JARDEST}" \
doins "${jar}" || die "failed to install ${jar}"
java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}"
debug-print "installed ${jar} to ${D}${JAVA_PKG_JARDEST}"
(
insinto "${JAVA_PKG_JARDEST}"
doins "${jar}"
) || die "failed to install ${jar}"
java-pkg_append_ JAVA_PKG_CLASSPATH "${EPREFIX}/${JAVA_PKG_JARDEST}/${jar_basename}"
debug-print "installed ${jar} to ${ED}${JAVA_PKG_JARDEST}"
# make a symlink to the original jar if it's symlink
else
# TODO use dosym, once we find something that could use it
# -nichoj
ln -s "$(readlink "${jar}")" "${D}${JAVA_PKG_JARDEST}/${jar_basename}"
ln -s "$(readlink "${jar}")" "${ED}${JAVA_PKG_JARDEST}/${jar_basename}"
debug-print "${jar} is a symlink, linking accordingly"
fi
else
@ -493,9 +498,11 @@ java-pkg_doso() {
if [[ -e "${lib}" ]] ; then
# install if it isn't a symlink
if [[ ! -L "${lib}" ]] ; then
INSDESTTREE="${JAVA_PKG_LIBDEST}" \
INSOPTIONS="-m0755" \
doins "${lib}" || die "failed to install ${lib}"
(
insinto "${JAVA_PKG_LIBDEST}"
insopts -m0755
doins "${lib}"
) || die "failed to install ${lib}"
java-pkg_append_ JAVA_PKG_LIBRARY "${JAVA_PKG_LIBDEST}"
debug-print "Installing ${lib} to ${JAVA_PKG_LIBDEST}"
# otherwise make a symlink to the symlink's origin
@ -724,8 +731,10 @@ java-pkg_dosrc() {
done
# Install the zip
INSDESTTREE=${JAVA_PKG_SOURCESPATH} \
doins ${zip_path} || die "Failed to install source"
(
insinto "${JAVA_PKG_SOURCESPATH}"
doins ${zip_path}
) || die "Failed to install source"
JAVA_SOURCES="${JAVA_PKG_SOURCESPATH}/${zip_name}"
@ -822,10 +831,13 @@ java-pkg_dolauncher() {
echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}"
cat "${var_tmp}" >> "${target}"
rm -f "${var_tmp}"
echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
echo "source ${EPREFIX}/usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
if [[ -n "${target_dir}" ]]; then
DESTTREE="${target_dir}" dobin "${target}"
(
into "${target_dir}"
dobin "${target}"
)
local ret=$?
return ${ret}
else
@ -864,9 +876,11 @@ java-pkg_dowar() {
fi
# Install those files like you mean it
INSOPTIONS="-m 0644" \
INSDESTTREE=${JAVA_PKG_WARDEST} \
(
insopts -m0644
insinto "${JAVA_PKG_WARDEST}"
doins ${warpath}
)
done
}
@ -1734,7 +1748,7 @@ java-pkg_register-ant-task() {
local TASK_NAME="${1:-${JAVA_PKG_NAME}}"
dodir /usr/share/ant/${TASKS_DIR}
touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
touch "${ED}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
}
# @FUNCTION: java-pkg_ant-tasks-depend
@ -1856,7 +1870,14 @@ ejunit4() {
# src_prepare Searches for bundled jars
# Don't call directly, but via java-pkg-2_src_prepare!
java-utils-2_src_prepare() {
java-pkg_func-exists java_prepare && java_prepare
case ${EAPI:-0} in
[0-5])
java-pkg_func-exists java_prepare && java_prepare ;;
*)
java-pkg_func-exists java_prepare &&
eqawarn "java_prepare is no longer called, define src_prepare instead."
eapply_user ;;
esac
# Check for files in JAVA_RM_FILES array.
if [[ ${JAVA_RM_FILES[@]} ]]; then
@ -2171,10 +2192,6 @@ java-pkg_init() {
I_WANT_GLOBAL_JAVA_OPTIONS="true"
fi
if java-pkg_func-exists ant_src_unpack; then
java-pkg_announce-qa-violation "Using old ant_src_unpack. Should be src_unpack"
fi
java-pkg_switch-vm
PATH=${JAVA_HOME}/bin:${PATH}
@ -2323,14 +2340,14 @@ java-pkg_init_paths_() {
JAVA_PKG_NAME="${PN}-${SLOT%/*}"
fi
JAVA_PKG_SHAREPATH="${DESTTREE}/share/${JAVA_PKG_NAME}"
JAVA_PKG_SHAREPATH="/usr/share/${JAVA_PKG_NAME}"
JAVA_PKG_SOURCESPATH="${JAVA_PKG_SHAREPATH}/sources/"
JAVA_PKG_ENV="${D}${JAVA_PKG_SHAREPATH}/package.env"
JAVA_PKG_VIRTUALS_PATH="${DESTTREE}/share/java-config-2/virtuals"
JAVA_PKG_VIRTUAL_PROVIDER="${D}/${JAVA_PKG_VIRTUALS_PATH}/${JAVA_PKG_NAME}"
JAVA_PKG_ENV="${ED}${JAVA_PKG_SHAREPATH}/package.env"
JAVA_PKG_VIRTUALS_PATH="/usr/share/java-config-2/virtuals"
JAVA_PKG_VIRTUAL_PROVIDER="${ED}${JAVA_PKG_VIRTUALS_PATH}/${JAVA_PKG_NAME}"
[[ -z "${JAVA_PKG_JARDEST}" ]] && JAVA_PKG_JARDEST="${JAVA_PKG_SHAREPATH}/lib"
[[ -z "${JAVA_PKG_LIBDEST}" ]] && JAVA_PKG_LIBDEST="${DESTTREE}/$(get_libdir)/${JAVA_PKG_NAME}"
[[ -z "${JAVA_PKG_LIBDEST}" ]] && JAVA_PKG_LIBDEST="/usr/$(get_libdir)/${JAVA_PKG_NAME}"
[[ -z "${JAVA_PKG_WARDEST}" ]] && JAVA_PKG_WARDEST="${JAVA_PKG_SHAREPATH}/webapps"
# TODO maybe only print once?
@ -2875,3 +2892,29 @@ java-pkg_clean() {
find "${@}" '(' -name '*.class' -o -name '*.jar' ')' -type f -delete -print || die
fi
}
# @FUNCTION: java-pkg_gen-cp
# @INTERNAL
# @DESCRIPTION:
# Java package generate classpath will create a classpath based on
# special variable CP_DEPEND in the ebuild.
#
# @CODE
# Parameters:
# $1 - classpath variable either EANT_GENTOO_CLASSPATH or JAVA_GENTOO_CLASSPATH
# @CODE
java-pkg_gen-cp() {
debug-print-function ${FUNCNAME} "${@}"
local atom
for atom in ${CP_DEPEND}; do
if [[ ${atom} =~ /(([[:alnum:]+_-]+)-[0-9]+(\.[0-9]+)*[a-z]?(_[[:alnum:]]+)?(-r[0-9]*)?|[[:alnum:]+_-]+):([[:alnum:]+_.-]+) ]]; then
atom=${BASH_REMATCH[2]:-${BASH_REMATCH[1]}}
[[ ${BASH_REMATCH[6]} != 0 ]] && atom+=-${BASH_REMATCH[6]}
local regex="(^|\s|,)${atom}($|\s|,)"
[[ ${!1} =~ ${regex} ]] || declare -g ${1}+=${!1:+,}${atom}
else
die "Invalid CP_DEPEND atom ${atom}, ensure a SLOT is included"
fi
done
}

View File

@ -14,7 +14,7 @@
inherit java-utils-2
DEPEND=">=dev-java/java-config-2.2.0"
DEPEND=">=dev-java/java-config-2.2.0-r3"
RDEPEND="${DEPEND}"
S="${WORKDIR}"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -10,15 +10,19 @@
# This eclass provides functionality which assists with installing
# virtual machines, and ensures that they are recognized by java-config.
inherit eutils fdo-mime multilib pax-utils prefix
case ${EAPI:-0} in
5|6) ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
inherit fdo-mime multilib pax-utils prefix
EXPORT_FUNCTIONS pkg_setup pkg_postinst pkg_prerm pkg_postrm
RDEPEND="
>=dev-java/java-config-2.2.0
app-eselect/eselect-java"
>=dev-java/java-config-2.2.0-r3
>=app-eselect/eselect-java-0.2.0"
DEPEND="${RDEPEND}"
has "${EAPI}" 0 1 && DEPEND="${DEPEND} >=sys-apps/portage-2.1"
export WANT_JAVA_CONFIG=2
@ -66,11 +70,10 @@ java-vm-2_pkg_setup() {
# @DESCRIPTION:
# default pkg_postinst
#
# Set the generation-2 system VM and Java plugin, if it isn't set or the
# setting is invalid. Also update mime database.
# Set the generation-2 system VM, if it isn't set or the setting is
# invalid. Also update mime database.
java-vm-2_pkg_postinst() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT=${ROOT}
# Note that we cannot rely on java-config here, as it will silently recognize
# e.g. icedtea6-bin as valid system VM if icedtea6 is set but invalid (e.g. due
# to the migration to icedtea-6)
@ -84,64 +87,10 @@ java-vm-2_pkg_postinst() {
fi
fi
if [[ "${_install_mozilla_plugin_called}" = 1 ]]; then
java-vm_check-nsplugin
java_mozilla_clean_
fi
fdo-mime_desktop_database_update
}
# @FUNCTION: java-vm_check-nsplugin
# @INTERNAL
# @DESCRIPTION:
# Check if the nsplugin needs updating
java-vm_check-nsplugin() {
local libdir
if [[ ${VMHANDLE} =~ emul-linux-x86 ]]; then
libdir=lib32
else
libdir=lib
fi
has ${EAPI:-0} 0 1 2 && ! use prefix && EPREFIX=
# Install a default nsplugin if we don't already have one
if in_iuse nsplugin && use nsplugin; then
if [[ ! -f "${ROOT}${EPREFIX}"/usr/${libdir}/nsbrowser/plugins/javaplugin.so ]]; then
einfo "No system nsplugin currently set."
java-vm_set-nsplugin
else
einfo "System nsplugin is already set, not changing it."
fi
einfo "You can change nsplugin with eselect java-nsplugin."
fi
}
# @FUNCTION: java-vm_set-nsplugin
# @INTERNAL
# @DESCRIPTION:
# Set the nsplugin implemetation.
java-vm_set-nsplugin() {
local extra_args
if use amd64; then
if [[ ${VMHANDLE} =~ emul-linux-x86 ]]; then
extra_args="32bit"
else
extra_args="64bit"
fi
einfo "Setting ${extra_args} nsplugin to ${VMHANDLE}"
else
einfo "Setting nsplugin to ${VMHANDLE}..."
fi
eselect java-nsplugin set ${extra_args} ${VMHANDLE}
}
# @FUNCTION: java-vm-2_pkg_prerm
# @DESCRIPTION:
# default pkg_prerm
@ -149,7 +98,6 @@ java-vm_set-nsplugin() {
# Warn user if removing system-vm.
java-vm-2_pkg_prerm() {
# Although REPLACED_BY_VERSION is EAPI=4, we shouldn't need to check EAPI for this use case
if [[ "$(GENTOO_VM="" java-config -f 2>/dev/null)" == "${VMHANDLE}" && -z "${REPLACED_BY_VERSION}" ]]; then
ewarn "It appears you are removing your system-vm!"
ewarn "Please run java-config -L to list available VMs,"
@ -184,33 +132,43 @@ java_set_default_vm_() {
# @FUNCTION: get_system_arch
# @DESCRIPTION:
# Get Java specific arch name.
#
# NOTE the mips and sparc values are best guesses. Oracle uses sparcv9
# but does OpenJDK use sparc64? We don't support OpenJDK on sparc or any
# JVM on mips though so it doesn't matter much.
get_system_arch() {
local sarch
sarch=$(echo ${ARCH} | sed -e s/[i]*.86/i386/ -e s/x86_64/amd64/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/)
if [ -z "${sarch}" ]; then
sarch=$(uname -m | sed -e s/[i]*.86/i386/ -e s/x86_64/amd64/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/)
fi
echo ${sarch}
local abi=${1-${ABI}}
case $(get_abi_CHOST ${abi}) in
mips*l*) echo mipsel ;;
mips*) echo mips ;;
ppc64le*) echo ppc64le ;;
*)
case ${abi} in
*_fbsd) get_system_arch ${abi%_fbsd} ;;
arm64) echo aarch64 ;;
hppa) echo parisc ;;
sparc32) echo sparc ;;
sparc64) echo sparcv9 ;;
x86*) echo i386 ;;
*) echo ${abi} ;;
esac ;;
esac
}
# @FUNCTION: set_java_env
# @DESCRIPTION:
# Installs a vm env file.
# DEPRECATED, use java-vm_install-env instead.
# TODO rename to something more evident, like install_env_file
set_java_env() {
debug-print-function ${FUNCNAME} $*
if has ${EAPI:-0} 0 1 2 && ! use prefix ; then
ED="${D}"
EPREFIX=""
fi
local platform="$(get_system_arch)"
local env_file="${ED}${JAVA_VM_CONFIG_DIR}/${VMHANDLE}"
local old_env_file="${ED}/etc/env.d/java/20${P}"
if [[ ${1} ]]; then
local source_env_file="${1}"
else
@ -248,8 +206,49 @@ set_java_env() {
# Make the symlink
dodir "${JAVA_VM_DIR}"
dosym ${java_home#${EPREFIX}} ${JAVA_VM_DIR}/${VMHANDLE} \
|| die "Failed to make VM symlink at ${JAVA_VM_DIR}/${VMHANDLE}"
dosym ${java_home#${EPREFIX}} ${JAVA_VM_DIR}/${VMHANDLE}
}
# @FUNCTION: java-vm_install-env
# @DESCRIPTION:
#
# Installs a Java VM environment file. The source can be specified but
# defaults to ${FILESDIR}/${VMHANDLE}.env.sh.
#
# Environment variables within this file will be resolved. You should
# escape the $ when referring to variables that should be resolved later
# such as ${JAVA_HOME}. Subshells may be used but avoid using double
# quotes. See icedtea-bin.env.sh for a good example.
java-vm_install-env() {
debug-print-function ${FUNCNAME} "$*"
local env_file="${ED}${JAVA_VM_CONFIG_DIR}/${VMHANDLE}"
local source_env_file="${1-${FILESDIR}/${VMHANDLE}.env.sh}"
if [[ ! -f "${source_env_file}" ]]; then
die "Unable to find the env file: ${source_env_file}"
fi
dodir "${JAVA_VM_CONFIG_DIR}"
# Here be dragons! ;) -- Chewi
eval echo "\"$(cat <<< "$(sed 's:":\\":g' "${source_env_file}")")\"" > "${env_file}" ||
die "failed to create Java env file"
(
echo "VMHANDLE=\"${VMHANDLE}\""
echo "BUILD_ONLY=\"${JAVA_VM_BUILD_ONLY}\""
[[ ${JAVA_PROVIDE} ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\"" || true
) >> "${env_file}" || die "failed to append to Java env file"
local java_home=$(unset JAVA_HOME; source "${env_file}"; echo ${JAVA_HOME})
[[ -z ${java_home} ]] && die "No JAVA_HOME defined in ${env_file}"
# Make the symlink
dodir "${JAVA_VM_DIR}"
dosym "${java_home#${EPREFIX}}" "${JAVA_VM_DIR}/${VMHANDLE}"
}
@ -281,10 +280,8 @@ java-vm_set-pax-markings() {
local executables=( "${1}"/bin/* )
[[ -d "${1}"/jre ]] && executables+=( "${1}"/jre/bin/* )
# Ensure a PaX header is created.
local pax_markings="C"
# Usally disabeling MPROTECT is sufficent.
local pax_markings+="m"
# Usually disabling MPROTECT is sufficient.
local pax_markings="m"
# On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
use x86 && pax_markings+="sp"
@ -309,15 +306,13 @@ java-vm_set-pax-markings() {
# @CODE
java-vm_revdep-mask() {
if has ${EAPI:-0} 0 1 2 && ! use prefix; then
ED="${D}"
EPREFIX=
fi
debug-print-function ${FUNCNAME} "$*"
local VMROOT="${1-"${EPREFIX}"/opt/${P}}"
dodir /etc/revdep-rebuild/
echo "SEARCH_DIRS_MASK=\"${VMROOT}\""> "${ED}/etc/revdep-rebuild/61-${VMHANDLE}"
dodir /etc/revdep-rebuild
echo "SEARCH_DIRS_MASK=\"${VMROOT}\"" >> "${ED}/etc/revdep-rebuild/61-${VMHANDLE}" \
|| die "Failed to write revdep-rebuild mask file"
}
@ -335,8 +330,6 @@ java-vm_sandbox-predict() {
debug-print-function ${FUNCNAME} "$*"
[[ -z "${1}" ]] && die "${FUNCNAME} takes at least one argument"
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
local path path_arr=("$@")
# subshell this to prevent IFS bleeding out dependant on bash version.
# could use local, which *should* work, but that requires a lot of testing.
@ -345,57 +338,3 @@ java-vm_sandbox-predict() {
echo "SANDBOX_PREDICT=\"${path}\"" > "${ED}/etc/sandbox.d/20${VMHANDLE}" \
|| die "Failed to write sandbox control file"
}
# @FUNCTION: java_get_plugin_dir_
# @INTERNAL
# @DESCRIPTION:
# Get the java plugin dir.
java_get_plugin_dir_() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EPREFIX=
echo "${EPREFIX}"/usr/$(get_libdir)/nsbrowser/plugins
}
# @FUNCTION: install_mozilla_plugin
# @DESCRIPTION:
# Register a netscape java-plugin.
install_mozilla_plugin() {
_install_mozilla_plugin_called=1
local plugin="${1}"
local variant="${2}"
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
if [[ ! -f "${ED}/${plugin}" ]]; then
die "Cannot find mozilla plugin at ${ED}/${plugin}"
fi
if [[ -n "${variant}" ]]; then
variant="-${variant}"
fi
local plugin_dir="/usr/share/java-config-2/nsplugin"
dodir "${plugin_dir}"
dosym "${plugin}" "${plugin_dir}/${VMHANDLE}${variant}-javaplugin.so"
}
# @FUNCTION: java_mozilla_clean_
# @INTERNAL
# @DESCRIPTION:
# Because previously some ebuilds installed symlinks outside of pkg_install
# and are left behind, which forces you to manualy remove them to select the
# jdk/jre you want to use for java
java_mozilla_clean_() {
local plugin_dir=$(java_get_plugin_dir_)
for file in ${plugin_dir}/javaplugin_*; do
rm -f ${file}
done
for file in ${plugin_dir}/libjavaplugin*; do
rm -f ${file}
done
}

View File

@ -131,6 +131,12 @@ OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}"
# @ECLASS-VARIABLE: WEBKIT_REQUIRED
# @DESCRIPTION:
# Is qtwebkit required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
# @DESCRIPTION:
# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
@ -160,7 +166,7 @@ KDE_HANDBOOK="${KDE_HANDBOOK:-never}"
# translations. (Mostly all kde ebuilds does not ship documentation
# and translations in live ebuilds)
if [[ ${KDE_BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
# Kdebase actualy provides the handbooks even for live stuff
# Kdebase actually provides the handbooks even for live stuff
[[ ${KDEBASE} == kde-base ]] || KDE_HANDBOOK=never
KDE_LINGUAS=""
fi
@ -258,6 +264,22 @@ case ${MULTIMEDIA_REQUIRED} in
esac
unset qtmultimediadepend
# WebKit dependencies
qtwebkitdepend="
>=dev-qt/qtwebkit-${QT_MINIMAL}:4
"
case ${WEBKIT_REQUIRED} in
always)
COMMONDEPEND+=" ${qtwebkitdepend}"
;;
optional)
IUSE+=" +webkit"
COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
;;
*) ;;
esac
unset qtwebkitdepend
# CppUnit dependencies
cppuintdepend="
dev-util/cppunit
@ -287,11 +309,17 @@ kdecommondepend="
>=dev-qt/qtsql-${QT_MINIMAL}:4[qt3support]
>=dev-qt/qtsvg-${QT_MINIMAL}:4
>=dev-qt/qttest-${QT_MINIMAL}:4
>=dev-qt/qtwebkit-${QT_MINIMAL}:4
"
if [[ ${PN} != kdelibs ]]; then
kdecommondepend+=" $(add_kdebase_dep kdelibs)"
local _kdelibsuse
case ${WEBKIT_REQUIRED} in
always) _kdelibsuse="[webkit]" ;;
optional) _kdelibsuse="[webkit?]" ;;
*) ;;
esac
kdecommondepend+=" >=kde-frameworks/kdelibs-4.14.22:4${_kdelibsuse}"
unset _kdelibsuse
if [[ ${KDEBASE} = kdevelop ]]; then
if [[ ${PN} != kdevplatform ]]; then
# @ECLASS-VARIABLE: KDEVPLATFORM_REQUIRED
@ -333,13 +361,13 @@ fi
# add a dependency over kde4-l10n
if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} ]]; then
for _lingua in ${KDE_LINGUAS}; do
for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do
# if our package has linguas, pull in kde4-l10n with selected lingua enabled,
# but only for selected ones.
# this can't be done on one line because if user doesn't use any localisation
# then he is probably not interested in kde4-l10n at all.
kderdepend+="
linguas_${_lingua}? ( $(add_kdeapps_dep kde4-l10n "linguas_${_lingua}(+)") )
l10n_${_lingua}? ( $(add_kdeapps_dep kde4-l10n "l10n_${_lingua}(+)") )
"
done
unset _lingua
@ -350,7 +378,7 @@ kdehandbookdepend="
app-text/docbook-xsl-stylesheets
"
kdehandbookrdepend="
$(add_kdebase_dep kdelibs 'handbook')
kde-frameworks/kdelibs:4[handbook]
"
case ${KDE_HANDBOOK} in
always)
@ -358,11 +386,14 @@ case ${KDE_HANDBOOK} in
[[ ${PN} != kdelibs ]] && kderdepend+=" ${kdehandbookrdepend}"
;;
optional)
if [[ ${PN} == kdesu ]] ; then
IUSE+=" handbook"
else
IUSE+=" +handbook"
fi
case ${PN} in
kcontrol | kdesu | knetattach)
IUSE+=" handbook"
;;
*)
IUSE+=" +handbook"
;;
esac
kdedepend+=" handbook? ( ${kdehandbookdepend} )"
[[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( ${kdehandbookrdepend} )"
;;
@ -430,10 +461,6 @@ _calculate_src_uri() {
case ${KDEBASE} in
kde-base)
case ${PV} in
4.4.11.1)
# KDEPIM 4.4, special case
# TODO: Remove this part when KDEPIM 4.4 gets out of the tree
SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" ;;
4.4.20*)
# KDEPIM 4.4 no-akonadi branch, special case
# TODO: Remove this part when KDEPIM 4.4 gets out of the tree
@ -441,29 +468,14 @@ _calculate_src_uri() {
4.?.[6-9]? | 4.??.[6-9]?)
# Unstable KDE SC releases
SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;;
4.11.19)
# Part of 15.04.1 actually, sigh. Not stable for next release!
SRC_URI="mirror://kde/Attic/applications/15.04.1/src/${_kmname_pv}.tar.xz" ;;
4.11.22)
# Part of 15.08.0 actually, sigh. Not stable for next release!
SRC_URI="mirror://kde/stable/applications/15.08.0/src/${_kmname_pv}.tar.xz" ;;
SRC_URI="mirror://kde/Attic/applications/15.08.0/src/${_kmname_pv}.tar.xz" ;;
4.14.3)
# Last SC release
SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;;
4.14.8)
# Part of 15.04.1 actually, sigh. Not stable for next release!
SRC_URI="mirror://kde/Attic/applications/15.04.1/src/${_kmname_pv}.tar.xz" ;;
4.14.10)
# Part of 15.04.3 actually, sigh. Not stable for next release!
SRC_URI="mirror://kde/Attic/applications/15.04.3/src/${_kmname_pv}.tar.xz" ;;
4.14.16)
# Part of 15.12.1 actually, sigh. Not stable for next release!
SRC_URI="mirror://kde/stable/applications/15.12.1/src/${_kmname_pv}.tar.xz" ;;
4.14.18)
# Part of 15.12.3 actually, sigh. Not stable for next release!
SRC_URI="mirror://kde/stable/applications/15.12.3/src/${_kmname_pv}.tar.xz" ;;
15.04.3)
# Files moved to Attic
# Part of 15.04.3 actually, sigh. Used by last version of KDE PIM 4.
SRC_URI="mirror://kde/Attic/applications/15.04.3/src/${_kmname_pv}.tar.xz" ;;
??.?.[6-9]? | ??.??.[4-9]?)
# Unstable KDE Applications releases
@ -478,6 +490,7 @@ _calculate_src_uri() {
case ${KDEVELOP_VERSION} in
4.[123].[6-9]*) SRC_URI="mirror://kde/unstable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.xz" ;;
4.7.3) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;;
4.7.4) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/${P}.tar.xz" ;;
*) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.xz" ;;
esac
;;
@ -569,7 +582,7 @@ _calculate_live_repo() {
# @DESCRIPTION:
# This variable allows easy overriding of default kde mirror service
# (anongit) with anything else you might want to use.
EGIT_MIRROR=${EGIT_MIRROR:=git://anongit.kde.org}
EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org}
# @ECLASS-VARIABLE: EGIT_REPONAME
# @DESCRIPTION:
@ -632,7 +645,7 @@ kde4-base_pkg_setup() {
# In theory should be in pkg_pretend but we check it only for kdelibs there
# and for others we do just quick scan in pkg_setup because pkg_pretend
# executions consume quite some time (ie. when merging 300 packages at once will cause 300 checks)
if [[ ${MERGE_TYPE} != binary ]]; then
if [[ ${MERGE_TYPE} != binary ]] && tc-is-gcc; then
[[ $(gcc-major-version) -lt 4 ]] || \
( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 6 ]] ) \
&& die "Sorry, but gcc-4.6 and earlier wont work for some KDE packages."
@ -833,7 +846,7 @@ kde4-base_src_test() {
debug-print " kde4-base.eclass docs for details... Applying workaround."
_test_runner
else
VIRTUALX_COMMAND="_test_runner" virtualmake
virtx _test_runner
fi
else
_test_runner
@ -908,16 +921,6 @@ kde4-base_pkg_postinst() {
einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
echo
fi
# for all 3rd party soft tell user that he SHOULD install kdebase-startkde or kdebase-runtime-meta
if [[ ${KDEBASE} != kde-base ]] && \
! has_version 'kde-apps/kdebase-runtime-meta'; then
if [[ ${KDE_REQUIRED} == always ]] || ( [[ ${KDE_REQUIRED} == optional ]] && use kde ); then
echo
ewarn "WARNING! Your system configuration does not contain \"kde-apps/kdebase-runtime-meta\"."
ewarn "With this setting you are unsupported by KDE team."
ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID."
fi
fi
fi
}

View File

@ -17,9 +17,9 @@ inherit versionator
# @ECLASS-VARIABLE: EAPI
# @DESCRIPTION:
# Currently kde4 eclasses support EAPI 5.
# Currently kde4 eclasses support EAPI 5 and 6.
case ${EAPI} in
5) : ;;
5|6) : ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
@ -36,7 +36,7 @@ esac
# @DESCRIPTION:
# This gets set to a non-zero value when a package is considered a kde or
# kdevelop ebuild.
if [[ ${CATEGORY} = kde-base || ${CATEGORY} = kde-apps || ${CATEGORY} = kde-frameworks ]]; then
if [[ ${CATEGORY} = kde-base || ${CATEGORY} == kde-plasma || ${CATEGORY} = kde-apps || ${CATEGORY} = kde-frameworks ]]; then
debug-print "${ECLASS}: KDEBASE ebuild recognized"
KDEBASE=kde-base
elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
@ -76,6 +76,27 @@ case ${KDE_SCM} in
*) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
esac
# @FUNCTION: kde4_lingua_to_l10n
# @USAGE: <lingua>...
# @INTERNAL
# @DESCRIPTION:
# Output l10n flag name(s) (without prefix(es)) appropriate for given KDE
# locale(s).
kde4_lingua_to_l10n() {
local l
for l; do
case ${l} in
ca@valencia) echo ca-valencia;;
sr@ijekavian) echo sr-ijekavsk;;
sr@ijekavianlatin) echo sr-Latn-ijekavsk;;
sr@latin|sr@Latn) echo sr-Latn;;
uz@cyrillic) echo uz-Cyrl;;
*@*) die "${FUNCNAME}: Unhandled KDE_LINGUAS: ${l}";;
*) echo "${l/_/-}";;
esac
done
}
# @ECLASS-VARIABLE: KDE_LINGUAS
# @DESCRIPTION:
# This is a whitespace-separated list of translations this ebuild supports.
@ -86,8 +107,8 @@ esac
#
# Example: KDE_LINGUAS="de en_GB nl"
if [[ ${KDE_BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
for _lingua in ${KDE_LINGUAS}; do
IUSE="${IUSE} linguas_${_lingua}"
for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do
IUSE="${IUSE} l10n_${_lingua}"
done
fi
@ -139,7 +160,7 @@ comment_all_add_subdirectory() {
# @FUNCTION: enable_selected_linguas
# @DESCRIPTION:
# Enable translations based on LINGUAS settings and translations supported by
# Enable translations based on L10N settings and translations supported by
# the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po
# but this default can be overridden by defining KDE_LINGUAS_DIR.
enable_selected_linguas() {
@ -147,11 +168,6 @@ enable_selected_linguas() {
local x
# if there is no linguas defined we enable everything
if ! $(env | grep -q "^LINGUAS="); then
return 0
fi
# @ECLASS-VARIABLE: KDE_LINGUAS_DIR
# @DESCRIPTION:
# Specified folder where application translations are located.
@ -171,7 +187,7 @@ enable_selected_linguas() {
# @FUNCTION: enable_selected_doc_linguas
# @DESCRIPTION:
# Enable only selected linguas enabled doc folders.
# Enable only selected L10N enabled doc folders.
enable_selected_doc_linguas() {
debug-print-function ${FUNCNAME} "$@"
@ -195,11 +211,6 @@ enable_selected_doc_linguas() {
-e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
-i CMakeLists.txt || die 'failed to comment out all handbooks'
else
# if there is no linguas defined we enable everything (i.e. comment out nothing)
if ! $(env | grep -q "^LINGUAS="); then
return 0
fi
# Disable subdirectories recursively
comment_all_add_subdirectory "${handbookdir}"
@ -213,7 +224,7 @@ enable_selected_doc_linguas() {
# Add requested translations
local lingua
for lingua in en ${KDE_LINGUAS}; do
if [[ ${lingua} = en ]] || use linguas_${lingua}; then
if [[ ${lingua} = en ]] || use "l10n_$(kde4_lingua_to_l10n "${lingua}")"; then
if [[ -d ${handbookdir}/${translationdir//%lingua/${lingua}} ]]; then
sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
-e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
@ -376,7 +387,7 @@ _enable_selected_linguas_dir() {
done
for lingua in ${KDE_LINGUAS}; do
if use linguas_${lingua} ; then
if use "l10n_$(kde4_lingua_to_l10n ${lingua})" ; then
if [[ -d ${lingua} ]]; then
linguas="${linguas} ${lingua}"
sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \

View File

@ -1,24 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: kde4-meta-pkg.eclass
# @MAINTAINER:
# kde@gentoo.org
# @BLURB: This eclass contains boilerplate for kde 4.X meta packages
# @DESCRIPTION:
# This eclass should only be used for defining meta packages for KDE4.
if [[ -z ${_KDE4_META_PKG_ECLASS} ]]; then
_KDE4_META_PKG_ECLASS=1
inherit kde4-functions
HOMEPAGE="https://www.kde.org/"
LICENSE="metapackage"
IUSE="aqua"
SLOT=4
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
@ -185,6 +185,9 @@ kde4-meta_src_extract() {
if [[ ${PV} =~ 4.4.11 ]]; then
postfix="bz2"
KMTARPARAMS+=" --bzip2"
elif [[ ${PV} =~ _pre ]]; then
postfix="gz"
KMTARPARAMS+=" --gz"
else
postfix="xz"
KMTARPARAMS+=" --xz"
@ -198,6 +201,9 @@ kde4-meta_src_extract() {
# Detect real toplevel dir from tarball name - it will be used upon extraction
# and in _list_needed_subdirectories
topdir="${tarball%.tar.*}/"
if [[ ${topdir} =~ _pre ]]; then
topdir="${topdir%-$PV*}/"
fi
ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
@ -470,7 +476,7 @@ kde4-meta_change_cmakelists() {
case ${KMNAME} in
kde-workspace)
# COLLISION PROTECT section
# Install the startkde script just once, as a part of kde-base/kdebase-startkde,
# Install the startkde script just once, as a part of kde-plasma/kdebase-startkde,
# not as a part of every package.
if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
# The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.

View File

@ -17,16 +17,44 @@ inherit toolchain-funcs versionator
# @ECLASS-VARIABLE: EAPI
# @DESCRIPTION:
# Currently EAPI 5 and 6 is supported.
# Currently EAPI 6 is supported.
case ${EAPI} in
5|6) ;;
6) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
# determine the build type
if [[ ${PV} = *9999* ]]; then
KDE_BUILD_TYPE="live"
else
KDE_BUILD_TYPE="release"
fi
export KDE_BUILD_TYPE
case ${CATEGORY} in
kde-frameworks)
[[ ${KDE_BUILD_TYPE} = live ]] && : ${FRAMEWORKS_MINIMAL:=9999}
;;
kde-plasma)
if ! [[ $(get_version_component_range 2) -le 8 && $(get_version_component_range 3) -lt 50 ]]; then
: ${QT_MINIMAL:=5.7.1}
fi
if [[ ${KDE_BUILD_TYPE} = live ]]; then
: ${FRAMEWORKS_MINIMAL:=9999}
: ${QT_MINIMAL:=5.7.1}
fi
;;
esac
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
# Minimal Qt version to require for the package.
: ${QT_MINIMAL:=5.6.1}
# @ECLASS-VARIABLE: FRAMEWORKS_MINIMAL
# @DESCRIPTION:
# Minimal Frameworks version to require for the package.
: ${FRAMEWORKS_MINIMAL:=5.17.0}
: ${FRAMEWORKS_MINIMAL:=5.29.0}
# @ECLASS-VARIABLE: PLASMA_MINIMAL
# @DESCRIPTION:
@ -35,13 +63,13 @@ esac
# @ECLASS-VARIABLE: KDE_APPS_MINIMAL
# @DESCRIPTION:
# Minimal KDE Applicaions version to require for the package.
# Minimal KDE Applications version to require for the package.
: ${KDE_APPS_MINIMAL:=14.12.0}
# @ECLASS-VARIABLE: KDE_GCC_MINIMAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# Minimal GCC version to require for the package.
: ${KDE_GCC_MINIMAL:=4.8}
# @ECLASS-VARIABLE: KDEBASE
# @DESCRIPTION:
@ -49,6 +77,8 @@ esac
# kdevelop ebuild.
if [[ ${KMNAME-${PN}} = kdevelop ]]; then
KDEBASE=kdevelop
elif [[ ${KMNAME} = kde-l10n || ${PN} = kde-l10n ]]; then
KDEBASE=kdel10n
fi
debug-print "${ECLASS}: ${KDEBASE} ebuild recognized"
@ -63,29 +93,31 @@ case ${KDE_SCM} in
*) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
esac
# determine the build type
if [[ ${PV} = *9999* ]]; then
KDE_BUILD_TYPE="live"
else
KDE_BUILD_TYPE="release"
fi
export KDE_BUILD_TYPE
# @FUNCTION: _check_gcc_version
# @INTERNAL
# @DESCRIPTION:
# Determine if the current GCC version is acceptable, otherwise die.
_check_gcc_version() {
if [[ ${MERGE_TYPE} != binary ]]; then
if [[ ${MERGE_TYPE} != binary && -v KDE_GCC_MINIMAL ]] && tc-is-gcc; then
local version=$(gcc-version)
local major=${version%.*}
local minor=${version#*.}
local min_major=${KDE_GCC_MINIMAL%.*}
local min_minor=${KDE_GCC_MINIMAL#*.}
debug-print "GCC version check activated"
debug-print "Version detected:"
debug-print " - Full: ${version}"
debug-print " - Major: ${major}"
debug-print " - Minor: ${minor}"
debug-print "Version required:"
debug-print " - Major: ${min_major}"
debug-print " - Minor: ${min_minor}"
[[ ${major} -lt ${min_major} ]] || \
( [[ ${major} -eq ${min_major} && ${minor} -lt ${min_minor} ]] ) \
&& die "Sorry, but gcc-${KDE_GCC_MINIMAL} or later is required for this package."
&& die "Sorry, but gcc-${KDE_GCC_MINIMAL} or later is required for this package (found ${version})."
fi
}
@ -136,6 +168,10 @@ _add_category_dep() {
add_frameworks_dep() {
debug-print-function ${FUNCNAME} "$@"
if [[ $# -gt 4 ]]; then
die "${FUNCNAME} was called with too many arguments"
fi
local version
if [[ -n ${3} ]]; then
@ -164,6 +200,10 @@ add_frameworks_dep() {
add_plasma_dep() {
debug-print-function ${FUNCNAME} "$@"
if [[ $# -gt 4 ]]; then
die "${FUNCNAME} was called with too many arguments"
fi
local version
if [[ -n ${3} ]]; then
@ -192,6 +232,10 @@ add_plasma_dep() {
add_kdeapps_dep() {
debug-print-function ${FUNCNAME} "$@"
if [[ $# -gt 4 ]]; then
die "${FUNCNAME} was called with too many arguments"
fi
local version
if [[ -n ${3} ]]; then
@ -225,15 +269,24 @@ add_kdeapps_dep() {
add_qt_dep() {
debug-print-function ${FUNCNAME} "$@"
if [[ $# -gt 4 ]]; then
die "${FUNCNAME} was called with too many arguments"
fi
local version
local slot=${4}
if [[ -n ${3} ]]; then
version=${3}
elif [[ -z "${version}" ]] ; then
elif [[ -z "${version}" ]]; then
version=${QT_MINIMAL}
fi
_add_category_dep dev-qt "${1}" "${2}" "${version}" "${4}"
if [[ -z ${slot} ]]; then
slot="5"
fi
_add_category_dep dev-qt "${1}" "${2}" "${version}" "${slot}"
}
# @FUNCTION: get_kde_version
@ -252,6 +305,26 @@ get_kde_version() {
fi
}
# @FUNCTION: kde_l10n2lingua
# @USAGE: <l10n>...
# @INTERNAL
# @DESCRIPTION:
# Output KDE lingua flag name(s) (without prefix(es)) appropriate for
# given l10n(s).
kde_l10n2lingua() {
local l
for l; do
case ${l} in
ca-valencia) echo ca@valencia;;
sr-ijekavsk) echo sr@ijekavian;;
sr-Latn-ijekavsk) echo sr@ijekavianlatin;;
sr-Latn) echo sr@latin;;
uz-Cyrl) echo uz@cyrillic;;
*) echo "${l/-/_}";;
esac
done
}
# @FUNCTION: punt_bogus_dep
# @USAGE: <prefix> <dependency>
# @DESCRIPTION:
@ -260,6 +333,10 @@ punt_bogus_dep() {
local prefix=${1}
local dep=${2}
if [[ ! -e "CMakeLists.txt" ]]; then
return
fi
pcregrep -Mni "(?s)find_package\s*\(\s*${prefix}[^)]*?${dep}.*?\)" CMakeLists.txt > "${T}/bogus${dep}"
# pcregrep returns non-zero on no matches/error
@ -274,7 +351,7 @@ punt_bogus_dep() {
sed -e "${first},${last}s/${dep}//" -i CMakeLists.txt || die
if [[ ${length} = 1 ]] ; then
sed -e "/find_package\s*(\s*${prefix}\s*\(REQUIRED\)*\s*\(COMPONENTS\)*\s*)/I d" -i CMakeLists.txt || die
sed -e "/find_package\s*(\s*${prefix}\(\s\+\(REQUIRED\|CONFIG\|COMPONENTS\|\${[A-Z0-9_]*}\)\)\+\s*)/Is/^/# removed by kde5-functions.eclass - /" -i CMakeLists.txt || die
fi
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -18,6 +18,8 @@ HOMEPAGE="https://www.kde.org/"
LICENSE="metapackage"
SLOT="5"
RDEPEND+=" !kde-apps/${PN}:4"
if [[ ${KDE_BLOCK_SLOT4} = true && ${CATEGORY} = kde-apps ]]; then
RDEPEND+=" !kde-apps/${PN}:4"
fi
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -27,12 +27,11 @@ if [[ ${KDE_BUILD_TYPE} = live ]]; then
esac
fi
EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
if [[ -v KDE_GCC_MINIMAL ]]; then
EXPORT_FUNCTIONS pkg_pretend
fi
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
# Minimal Qt version to require for the package.
: ${QT_MINIMAL:=5.4.2}
EXPORT_FUNCTIONS pkg_setup pkg_nofetch src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
# @ECLASS-VARIABLE: KDE_AUTODEPS
# @DESCRIPTION:
@ -52,21 +51,12 @@ EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure src_
# Otherwise, add debug to IUSE to control building with that flag.
: ${KDE_DEBUG:=true}
# @ECLASS-VARIABLE: KDE_DOXYGEN
# @ECLASS-VARIABLE: KDE_DESIGNERPLUGIN
# @DESCRIPTION:
# If set to "false", do nothing.
# Otherwise, add "doc" to IUSE, add appropriate dependencies, and generate and
# install API documentation.
if [[ ${CATEGORY} = kde-frameworks ]]; then
: ${KDE_DOXYGEN:=true}
else
: ${KDE_DOXYGEN:=false}
fi
# @ECLASS-VARIABLE: KDE_DOX_DIR
# @DESCRIPTION:
# Defaults to ".". Otherwise, use alternative KDE doxygen path.
: ${KDE_DOX_DIR:=.}
# Otherwise, add "designer" to IUSE to toggle build of designer plugins
# and add the necessary DEPENDs.
: ${KDE_DESIGNERPLUGIN:=false}
# @ECLASS-VARIABLE: KDE_EXAMPLES
# @DESCRIPTION:
@ -96,20 +86,25 @@ fi
# For any other value, add test to IUSE and add a dependency on dev-qt/qttest:5.
# If set to "optional", configure with -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON
# when USE=!test.
# If set to "forceoptional", remove a Qt5Test dependency from the root
# CMakeLists.txt in addition to the above.
# If set to "forceoptional", remove a Qt5Test dependency and comment test
# subdirs from the root CMakeLists.txt in addition to the above.
# If set to "forceoptional-recursive", remove a Qt5Test dependency and comment
# test subdirs from *any* CMakeLists.txt in addition to the above.
if [[ ${CATEGORY} = kde-frameworks ]]; then
: ${KDE_TEST:=true}
else
: ${KDE_TEST:=false}
fi
# @ECLASS-VARIABLE: KDE_PUNT_BOGUS_DEPS
# @ECLASS-VARIABLE: KDE_L10N
# @DESCRIPTION:
# If set to "false", do nothing.
# For any other value, do black magic to make hardcoded-but-optional dependencies
# optional again. An upstream solution is preferable and this is a last resort.
: ${KDE_PUNT_BOGUS_DEPS:=false}
# This is an array of translations this ebuild supports. These translations
# are automatically added to IUSE.
if [[ ${KDEBASE} = kdel10n ]]; then
if [[ -n ${KDE_L10N} ]]; then
IUSE="${IUSE} $(printf 'l10n_%s ' ${KDE_L10N[@]})"
fi
fi
# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
# @DESCRIPTION:
@ -118,44 +113,68 @@ fi
# add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND.
: ${KDE_SELINUX_MODULE:=none}
# @ECLASS-VARIABLE: KDE_SUBSLOT
# @DESCRIPTION:
# If set to "false", do nothing.
# If set to "true", add a subslot to the package, where subslot is either
# defined as major.minor version for kde-*/ categories or ${PV} if other.
# For any other value, that value will be used as subslot.
: ${KDE_SUBSLOT:=false}
# @ECLASS-VARIABLE: KDE_UNRELEASED
# @INTERNAL
# @DESCRIPTION
# An array of $CATEGORY-$PV pairs of packages that are unreleased upstream.
# Any package matching this will have fetch restriction enabled, and receive
# a proper error message via pkg_nofetch.
KDE_UNRELEASED=( )
if [[ ${KDEBASE} = kdevelop ]]; then
HOMEPAGE="https://www.kdevelop.org/"
elif [[ ${KDEBASE} = kdel10n ]]; then
HOMEPAGE="http://l10n.kde.org"
elif [[ ${KMNAME} = kdepim ]]; then
HOMEPAGE="https://www.kde.org/applications/office/kontact/"
else
HOMEPAGE="https://www.kde.org/"
fi
LICENSE="GPL-2"
SLOT=5
if [[ ${CATEGORY} = kde-frameworks ]]; then
SLOT=5/$(get_version_component_range 1-2)
else
SLOT=5
KDE_SUBSLOT=true
fi
case ${KDE_SUBSLOT} in
false) ;;
true)
case ${CATEGORY} in
kde-frameworks | \
kde-plasma | \
kde-apps)
SLOT+="/$(get_version_component_range 1-2)"
;;
*)
SLOT+="/${PV}"
;;
esac
;;
*)
SLOT+="/${KDE_SUBSLOT}"
;;
esac
case ${KDE_AUTODEPS} in
false) ;;
*)
if [[ ${KDE_BUILD_TYPE} = live ]]; then
case ${CATEGORY} in
kde-frameworks)
FRAMEWORKS_MINIMAL=9999
;;
kde-plasma)
FRAMEWORKS_MINIMAL=9999
;;
*) ;;
esac
fi
DEPEND+=" $(add_frameworks_dep extra-cmake-modules)"
RDEPEND+=" >=kde-frameworks/kf-env-3"
RDEPEND+=" >=kde-frameworks/kf-env-4"
COMMONDEPEND+=" $(add_qt_dep qtcore)"
if [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma && ${PN} != polkit-kde-agent ]]; then
RDEPEND+="
!kde-apps/kde4-l10n[-minimal(-)]
!<kde-apps/kde4-l10n-15.08.0-r1
"
RDEPEND+=" !<kde-apps/kde4-l10n-15.12.3-r1"
fi
if [[ ${KDE_BLOCK_SLOT4} = true && ${CATEGORY} = kde-apps ]]; then
@ -164,17 +183,6 @@ case ${KDE_AUTODEPS} in
;;
esac
case ${KDE_DOXYGEN} in
false) ;;
*)
IUSE+=" doc"
DEPEND+=" doc? (
$(add_frameworks_dep kapidox)
app-doc/doxygen
)"
;;
esac
case ${KDE_DEBUG} in
false) ;;
*)
@ -182,6 +190,17 @@ case ${KDE_DEBUG} in
;;
esac
case ${KDE_DESIGNERPLUGIN} in
false) ;;
*)
IUSE+=" designer"
DEPEND+=" designer? (
$(add_frameworks_dep kdesignerplugin)
$(add_qt_dep designer)
)"
;;
esac
case ${KDE_EXAMPLES} in
false) ;;
*)
@ -221,6 +240,25 @@ if [[ -n ${KMNAME} && ${KMNAME} != ${PN} && ${KDE_BUILD_TYPE} = release ]]; then
S=${WORKDIR}/${KMNAME}-${PV}
fi
if [[ -n ${KDEBASE} && ${KDEBASE} = kdevelop && ${KDE_BUILD_TYPE} = release ]]; then
if [[ -n ${KMNAME} ]]; then
S=${WORKDIR}/${KMNAME}-${PV%.0} # kdevelop missing trailing .0 in first release
else
S=${WORKDIR}/${PN}-${PV%.0} # kdevelop missing trailing .0 in first release
fi
fi
_kde_is_unreleased() {
local pair
for pair in "${KDE_UNRELEASED[@]}" ; do
if [[ "${pair}" = "${CATEGORY}-${PV}" ]]; then
return 0
fi
done
return 1
}
# Determine fetch location for released tarballs
_calculate_src_uri() {
debug-print-function ${FUNCNAME} "$@"
@ -239,8 +277,7 @@ _calculate_src_uri() {
kjs | \
kjsembed | \
kmediaplayer | \
kross | \
krunner)
kross)
_kmname="portingAids/${_kmname}"
;;
esac
@ -275,6 +312,44 @@ _calculate_src_uri() {
esac
;;
esac
if [[ -z ${SRC_URI} && -n ${KDEBASE} ]] ; then
local _kdebase
case ${PN} in
kdevelop-pg-qt)
_kdebase=${PN} ;;
*)
_kdebase=${KDEBASE} ;;
esac
case ${PV} in
*.*.[6-9]? )
SRC_URI="mirror://kde/unstable/${_kdebase}/${PV}/src/${_kmname}-${PV}.tar.xz"
RESTRICT+=" mirror"
;;
*)
SRC_URI="mirror://kde/stable/${_kdebase}/${PV}/src/${_kmname}-${PV%.0}.tar.xz" ;;
esac
unset _kdebase
fi
if [[ ${KDEBASE} = kdel10n ]] ; then
local uri_base="${SRC_URI/${_kmname}-${PV}.tar.xz/}kde-l10n/kde-l10n"
SRC_URI=""
for my_l10n in ${KDE_L10N[@]} ; do
case ${my_l10n} in
sr | sr-ijekavsk | sr-Latn-ijekavsk | sr-Latn)
SRC_URI="${SRC_URI} l10n_${my_l10n}? ( ${uri_base}-sr-${PV}.tar.xz )"
;;
*)
SRC_URI="${SRC_URI} l10n_${my_l10n}? ( ${uri_base}-$(kde_l10n2lingua ${my_l10n})-${PV}.tar.xz )"
;;
esac
done
fi
if _kde_is_unreleased ; then
RESTRICT+=" fetch"
fi
}
# Determine fetch location for live sources
@ -289,7 +364,7 @@ _calculate_live_repo() {
# @DESCRIPTION:
# This variable allows easy overriding of default kde mirror service
# (anongit) with anything else you might want to use.
EGIT_MIRROR=${EGIT_MIRROR:=git://anongit.kde.org}
EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org}
local _kmname
@ -331,9 +406,7 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
# Do some basic settings
kde5_pkg_pretend() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${MERGE_TYPE} != binary ]]; then
_check_gcc_version
fi
_check_gcc_version
}
# @FUNCTION: kde5_pkg_setup
@ -341,9 +414,37 @@ kde5_pkg_pretend() {
# Do some basic settings
kde5_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${MERGE_TYPE} != binary ]]; then
_check_gcc_version
_check_gcc_version
}
# @FUNCTION: kde5_pkg_nofetch
# @DESCRIPTION:
# Display package publication status
kde5_pkg_nofetch() {
if ! _kde_is_unreleased ; then
return
fi
eerror " _ _ _ _ ____ _____ _ _____ _ ____ _____ ____ "
eerror "| | | | \ | | _ \| ____| | | ____| / \ / ___|| ____| _ \ "
eerror "| | | | \| | |_) | _| | | | _| / _ \ \___ \| _| | | | |"
eerror "| |_| | |\ | _ <| |___| |___| |___ / ___ \ ___) | |___| |_| |"
eerror " \___/|_| \_|_| \_\_____|_____|_____/_/ \_\____/|_____|____/ "
eerror " "
eerror " ____ _ ____ _ __ _ ____ _____ "
eerror "| _ \ / \ / ___| |/ / / \ / ___| ____|"
eerror "| |_) / _ \| | | ' / / _ \| | _| _| "
eerror "| __/ ___ \ |___| . \ / ___ \ |_| | |___ "
eerror "|_| /_/ \_\____|_|\_\/_/ \_\____|_____|"
eerror
eerror "${CATEGORY}/${P} has not been released to the public yet"
eerror "and is only available to packagers right now."
eerror ""
eerror "This is not a bug. Please do not file bugs or contact upstream about this."
eerror ""
eerror "Please consult the upstream release schedule to see when this "
eerror "package is scheduled to be released:"
eerror "https://community.kde.org/Schedules"
}
# @FUNCTION: kde5_src_unpack
@ -358,6 +459,16 @@ kde5_src_unpack() {
git-r3_src_unpack
;;
esac
elif [[ ${KDEBASE} = kdel10n ]]; then
local l10npart=5
[[ ${PN} = kde4-l10n ]] && l10npart=4
mkdir -p "${S}" || die "Failed to create source dir ${S}"
cd "${S}"
for my_tar in ${A}; do
tar -xpf "${DISTDIR}/${my_tar}" --xz \
"${my_tar/.tar.xz/}/CMakeLists.txt" "${my_tar/.tar.xz/}/${l10npart}" 2> /dev/null ||
elog "${my_tar}: tar extract command failed at least partially - continuing"
done
else
default
fi
@ -369,6 +480,42 @@ kde5_src_unpack() {
kde5_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${KDEBASE} = kdel10n ]]; then
local l10npart=5
[[ ${PN} = kde4-l10n ]] && l10npart=4
# move known variant subdirs to root dir, currently sr@*
use_if_iuse l10n_sr-ijekavsk && _l10n_variant_subdir2root sr-ijekavsk sr
use_if_iuse l10n_sr-Latn-ijekavsk && _l10n_variant_subdir2root sr-Latn-ijekavsk sr
use_if_iuse l10n_sr-Latn && _l10n_variant_subdir2root sr-Latn sr
if use_if_iuse l10n_sr; then
rm -rf kde-l10n-sr-${PV}/${l10npart}/sr/sr@* || die "Failed to cleanup L10N=sr"
_l10n_variant_subdir_buster sr
elif [[ -d kde-l10n-sr-${PV} ]]; then
# having any variant selected means parent lingua will be unpacked as well
rm -r kde-l10n-sr-${PV} || die "Failed to remove sr parent lingua"
fi
cat <<-EOF > CMakeLists.txt || die
project(${PN})
cmake_minimum_required(VERSION 2.8.12)
EOF
# add all l10n directories to cmake
if [[ -n ${A} ]]; then
cat <<-EOF >> CMakeLists.txt || die
$(printf "add_subdirectory( %s )\n" \
`find . -mindepth 1 -maxdepth 1 -type d | sed -e "s:^\./::"`)
EOF
fi
# for KF5: drop KDE4-based part; for KDE4: drop KF5-based part
case ${l10npart} in
5) find -maxdepth 2 -type f -name CMakeLists.txt -exec \
sed -i -e "/add_subdirectory(4)/ s/^/#DONT/" {} + || die ;;
4) find -maxdepth 2 -type f -name CMakeLists.txt -exec \
sed -i -e "/add_subdirectory(5)/ s/^/#DONT/" {} + || die ;;
esac
fi
cmake-utils_src_prepare
# only build examples when required
@ -385,28 +532,35 @@ kde5_src_prepare() {
fi
fi
# drop translations when nls is not wanted
if [[ -d po ]] && in_iuse nls && ! use nls ; then
rm -r po || die
fi
# enable only the requested translations
# when required
if [[ ${KDE_BUILD_TYPE} = release ]] ; then
if [[ -d po ]] ; then
pushd po > /dev/null || die
for lang in *; do
if [[ -d ${lang} ]] && ! has ${lang} ${LINGUAS} ; then
rm -r ${lang} || die
if [[ -e CMakeLists.txt ]] ; then
cmake_comment_add_subdirectory ${lang}
fi
elif ! has ${lang/.po/} ${LINGUAS} ; then
if [[ ${lang} != CMakeLists.txt ]] ; then
rm ${lang} || die
fi
if [[ -d po && -v LINGUAS ]] ; then
pushd po > /dev/null || die
local lang
for lang in *; do
if [[ -d ${lang} ]] && ! has ${lang} ${LINGUAS} ; then
rm -r ${lang} || die
if [[ -e CMakeLists.txt ]] ; then
cmake_comment_add_subdirectory ${lang}
fi
done
popd > /dev/null || die
fi
elif [[ -f ${lang} ]] && ! has ${lang/.po/} ${LINGUAS} ; then
if [[ ${lang} != CMakeLists.txt && ${lang} != ${PN}.pot ]] ; then
rm ${lang} || die
fi
fi
done
popd > /dev/null || die
fi
if [[ ${KDE_HANDBOOK} != false && -d ${KDE_DOC_DIR} && ${CATEGORY} != kde-apps ]] ; then
if [[ ${KDE_BUILD_TYPE} = release && ${CATEGORY} != kde-apps ]] ; then
if [[ ${KDE_HANDBOOK} != false && -d ${KDE_DOC_DIR} && -v LINGUAS ]] ; then
pushd ${KDE_DOC_DIR} > /dev/null || die
local lang
for lang in *; do
if ! has ${lang} ${LINGUAS} ; then
cmake_comment_add_subdirectory ${lang}
@ -414,39 +568,30 @@ kde5_src_prepare() {
done
popd > /dev/null || die
fi
else
rm -rf po
fi
# in frameworks, tests = manual tests so never build them
if [[ ${CATEGORY} = kde-frameworks ]]; then
if [[ ${CATEGORY} = kde-frameworks ]] && [[ ${PN} != extra-cmake-modules ]]; then
cmake_comment_add_subdirectory tests
fi
case ${KDE_PUNT_BOGUS_DEPS} in
false) ;;
*)
if ! use_if_iuse test ; then
punt_bogus_dep Qt5 Test
fi
if ! use_if_iuse handbook ; then
punt_bogus_dep KF5 DocTools
fi
;;
esac
# only build unit tests when required
if ! use_if_iuse test ; then
if [[ ${KDE_TEST} = forceoptional ]] ; then
punt_bogus_dep Qt5 Test
# if forceoptional, also cover non-kde categories
cmake_comment_add_subdirectory autotests
cmake_comment_add_subdirectory test
cmake_comment_add_subdirectory tests
cmake_comment_add_subdirectory autotests test tests
elif [[ ${KDE_TEST} = forceoptional-recursive ]] ; then
punt_bogus_dep Qt5 Test
local d
for d in $(find . -type d -name "autotests" -or -name "tests" -or -name "test" -or -name "unittests"); do
pushd ${d%/*} > /dev/null || die
punt_bogus_dep Qt5 Test
cmake_comment_add_subdirectory autotests test tests
popd > /dev/null || die
done
elif [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma || ${CATEGORY} = kde-apps ]] ; then
cmake_comment_add_subdirectory autotests
cmake_comment_add_subdirectory test
cmake_comment_add_subdirectory tests
cmake_comment_add_subdirectory autotests test tests
fi
fi
}
@ -476,6 +621,10 @@ kde5_src_configure() {
cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON )
fi
if ! use_if_iuse designer && [[ ${KDE_DESIGNERPLUGIN} != false ]] ; then
cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Designer=ON )
fi
# install mkspecs in the same directory as qt stuff
cmakeargs+=(-DKDE_INSTALL_USE_QT_SYS_PATHS=ON)
@ -492,11 +641,6 @@ kde5_src_compile() {
debug-print-function ${FUNCNAME} "$@"
cmake-utils_src_compile "$@"
# Build doxygen documentation if applicable
if use_if_iuse doc ; then
kgenapidox ${KDE_DOX_DIR} || die
fi
}
# @FUNCTION: kde5_src_test
@ -536,11 +680,6 @@ kde5_src_test() {
kde5_src_install() {
debug-print-function ${FUNCNAME} "$@"
# Install doxygen documentation if applicable
if use_if_iuse doc ; then
dodoc -r apidocs/html
fi
cmake-utils_src_install
# We don't want ${PREFIX}/share/doc/HTML to be compressed,
@ -568,6 +707,23 @@ kde5_pkg_postinst() {
gnome2_icon_cache_update
xdg_pkg_postinst
if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
if [[ ${KDE_BUILD_TYPE} = live ]]; then
echo
einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
einfo "Use it at your own risk."
einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
fi
# for kf5-based applications tell user that he SHOULD NOT be using kde-plasma/plasma-workspace:4
if [[ ${KDEBASE} != kde-base || ${CATEGORY} = kde-apps ]] && \
has_version 'kde-plasma/plasma-workspace:4'; then
echo
ewarn "WARNING! Your system configuration still contains \"kde-plasma/plasma-workspace:4\","
ewarn "indicating a Plasma 4 setup. With this setting you are unsupported by KDE team."
ewarn "Please consider upgrading to Plasma 5."
fi
fi
}
# @FUNCTION: kde5_pkg_postrm
@ -580,4 +736,42 @@ kde5_pkg_postrm() {
xdg_pkg_postrm
}
_l10n_variant_subdir2root() {
local l10npart=5
[[ ${PN} = kde4-l10n ]] && l10npart=4
local lingua=$(kde_l10n2lingua ${1})
local src=kde-l10n-${2}-${PV}
local dest=kde-l10n-${lingua}-${PV}/${l10npart}
# create variant rootdir structure from parent lingua and adapt it
mkdir -p ${dest} || die "Failed to create ${dest}"
mv ${src}/${l10npart}/${2}/${lingua} ${dest}/${lingua} || die "Failed to create ${dest}/${lingua}"
cp -f ${src}/CMakeLists.txt kde-l10n-${lingua}-${PV} || die "Failed to prepare L10N=${1} subdir"
echo "add_subdirectory(${lingua})" > ${dest}/CMakeLists.txt ||
die "Failed to prepare ${dest}/CMakeLists.txt"
cp -f ${src}/${l10npart}/${2}/CMakeLists.txt ${dest}/${lingua} ||
die "Failed to create ${dest}/${lingua}/CMakeLists.txt"
sed -e "s/${2}/${lingua}/" -i ${dest}/${lingua}/CMakeLists.txt ||
die "Failed to prepare ${dest}/${lingua}/CMakeLists.txt"
_l10n_variant_subdir_buster ${1}
}
_l10n_variant_subdir_buster() {
local l10npart=5
[[ ${PN} = kde4-l10n ]] && l10npart=4
local dir=kde-l10n-$(kde_l10n2lingua ${1})-${PV}/${l10npart}/$(kde_l10n2lingua ${1})
case ${l10npart} in
5) sed -e "/^add_subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" ;;
4) sed -e "/^macro.*subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" ;;
esac
for subdir in $(find ${dir} -mindepth 1 -maxdepth 1 -type d | sed -e "s:^\./::"); do
if [[ ${subdir##*/} != "cmake_modules" ]] ; then
echo "add_subdirectory(${subdir##*/})" >> ${dir}/CMakeLists.txt || die
fi
done
}
fi

View File

@ -2,86 +2,190 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
# Description: kernel.eclass rewrite for a clean base regarding the 2.6
# series of kernel with back-compatibility for 2.4
#
# Original author: John Mylchreest <johnm@gentoo.org>
# Maintainer: kernel@gentoo.org
#
# @ECLASS: kernel-2.eclass
# @MAINTAINER:
# Gentoo Kernel project <kernel@gentoo.org>
# @AUTHOR:
# John Mylchreest <johnm@gentoo.org>
# Mike Pagano <mpagano@gentoo.org>
# <so many, many others, please add yourself>
# @BLURB: Eclass for kernel packages
# @DESCRIPTION:
# This is the kernel.eclass rewrite for a clean base regarding the 2.6
# series of kernel with back-compatibility for 2.4
# Please direct your bugs to the current eclass maintainer :)
# added functionality:
# unipatch - a flexible, singular method to extract, add and remove patches.
# A Couple of env vars are available to effect usage of this eclass
# These are as follows:
#
# K_USEPV - When setting the EXTRAVERSION variable, it should
# add PV to the end.
# this is useful for thigns like wolk. IE:
# EXTRAVERSION would be something like : -wolk-4.19-r1
# K_NOSETEXTRAVERSION - if this is set then EXTRAVERSION will not be
# automatically set within the kernel Makefile
# K_NOUSENAME - if this is set then EXTRAVERSION will not include the
# first part of ${PN} in EXTRAVERSION
# K_NOUSEPR - if this is set then EXTRAVERSION will not include the
# anything based on ${PR}.
# K_PREPATCHED - if the patchset is prepatched (ie: mm-sources,
# ck-sources, ac-sources) it will use PR (ie: -r5) as
# the patchset version for
# and not use it as a true package revision
# K_EXTRAEINFO - this is a new-line seperated list of einfo displays in
# postinst and can be used to carry additional postinst
# messages
# K_EXTRAELOG - same as K_EXTRAEINFO except using elog instead of einfo
# K_EXTRAEWARN - same as K_EXTRAEINFO except using ewarn instead of einfo
# K_SYMLINK - if this is set, then forcably create symlink anyway
#
# K_BASE_VER - for git-sources, declare the base version this patch is
# based off of.
# K_DEFCONFIG - Allow specifying a different defconfig target.
# If length zero, defaults to "defconfig".
# K_WANT_GENPATCHES - Apply genpatches to kernel source. Provide any
# combination of "base", "extras" or "experimental".
# K_EXP_GENPATCHES_PULL - If set, we pull "experimental" regardless of the USE FLAG
# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST.
# K_EXP_GENPATCHES_NOUSE - If set, no USE flag will be provided for "experimental";
# as a result the user cannot choose to apply those patches.
# K_EXP_GENPATCHES_LIST - A list of patches to pick from "experimental" to apply when
# the USE flag is unset and K_EXP_GENPATCHES_PULL is set.
# K_GENPATCHES_VER - The version of the genpatches tarball(s) to apply.
# A value of "5" would apply genpatches-2.6.12-5 to
# my-sources-2.6.12.ebuild
# K_SECURITY_UNSUPPORTED- If set, this kernel is unsupported by Gentoo Security
# K_DEBLOB_AVAILABLE - A value of "0" will disable all of the optional deblob
# code. If empty, will be set to "1" if deblobbing is
# possible. Test ONLY for "1".
# K_DEBLOB_TAG - This will be the version of deblob script. It's a upstream SVN tag
# such asw -gnu or -gnu1.
# K_PREDEBLOBBED - This kernel was already deblobbed elsewhere.
# If false, either optional deblobbing will be available
# or the license will note the inclusion of freedist
# code.
# K_LONGTERM - If set, the eclass will search for the kernel source
# in the long term directories on the upstream servers
# as the location has been changed by upstream
# K_KDBUS_AVAILABLE - If set, the ebuild contains the option of installing the
# kdbus patch. This patch is not installed without the 'kdbus'
# and 'experimental' use flags.
# H_SUPPORTEDARCH - this should be a space separated list of ARCH's which
# can be supported by the headers ebuild
# @ECLASS-VARIABLE: K_USEPV
# @DEFAULT_UNSET
# @DESCRIPTION:
# When setting the EXTRAVERSION variable, it should
# add PV to the end.
# this is useful for things like wolk. IE:
# EXTRAVERSION would be something like : -wolk-4.19-r1
# UNIPATCH_LIST - space delimetered list of patches to be applied to the
# kernel
# UNIPATCH_EXCLUDE - an addition var to support exlusion based completely
# on "<passedstring>*" and not "<passedno#>_*"
# - this should _NOT_ be used from the ebuild as this is
# reserved for end users passing excludes from the cli
# UNIPATCH_DOCS - space delimemeted list of docs to be installed to
# the doc dir
# UNIPATCH_STRICTORDER - if this is set places patches into directories of
# order, so they are applied in the order passed
# @ECLASS-VARIABLE: K_NOSETEXTRAVERSION
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set then EXTRAVERSION will not be
# automatically set within the kernel Makefile
# @ECLASS-VARIABLE: K_NOUSENAME
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set then EXTRAVERSION will not include the
# first part of ${PN} in EXTRAVERSION
# @ECLASS-VARIABLE: K_NOUSEPR
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set then EXTRAVERSION will not include the
# anything based on ${PR}.
# @ECLASS-VARIABLE: K_PREPATCHED
# @DEFAULT_UNSET
# @DESCRIPTION:
# if the patchset is prepatched (ie: mm-sources,
# ck-sources, ac-sources) it will use PR (ie: -r5) as
# the patchset version for
# and not use it as a true package revision
# @ECLASS-VARIABLE: K_EXTRAEINFO
# @DEFAULT_UNSET
# @DESCRIPTION:
# this is a new-line seperated list of einfo displays in
# postinst and can be used to carry additional postinst
# messages
# @ECLASS-VARIABLE: K_EXTRAELOG
# @DEFAULT_UNSET
# @DESCRIPTION:
# same as K_EXTRAEINFO except using elog instead of einfo
# @ECLASS-VARIABLE: K_EXTRAEWARN
# @DEFAULT_UNSET
# @DESCRIPTION:
# same as K_EXTRAEINFO except using ewarn instead of einfo
# @ECLASS-VARIABLE: K_SYMLINK
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set, then forcably create symlink anyway
# @ECLASS-VARIABLE: K_BASE_VER
# @DEFAULT_UNSET
# @DESCRIPTION:
# for git-sources, declare the base version this patch is
# based off of.
# @ECLASS-VARIABLE: K_DEFCONFIG
# @DEFAULT_UNSET
# @DESCRIPTION:
# Allow specifying a different defconfig target.
# If length zero, defaults to "defconfig".
# @ECLASS-VARIABLE: K_WANT_GENPATCHES
# @DEFAULT_UNSET
# @DESCRIPTION:
# Apply genpatches to kernel source. Provide any
# combination of "base", "extras" or "experimental".
# @ECLASS-VARIABLE: K_EXP_GENPATCHES_PULL
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, we pull "experimental" regardless of the USE FLAG
# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST.
# @ECLASS-VARIABLE: K_EXP_GENPATCHES_NOUSE
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, no USE flag will be provided for "experimental";
# as a result the user cannot choose to apply those patches.
# @ECLASS-VARIABLE: K_EXP_GENPATCHES_LIST
# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of patches to pick from "experimental" to apply when
# the USE flag is unset and K_EXP_GENPATCHES_PULL is set.
# @ECLASS-VARIABLE: K_FROM_GIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, this variable signals that the kernel sources derives
# from a git tree and special handling will be applied so that
# any patches that are applied will actually apply.
# @ECLASS-VARIABLE: K_GENPATCHES_VER
# @DEFAULT_UNSET
# @DESCRIPTION:
# The version of the genpatches tarball(s) to apply.
# A value of "5" would apply genpatches-2.6.12-5 to
# my-sources-2.6.12.ebuild
# @ECLASS-VARIABLE: K_SECURITY_UNSUPPORTED
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, this kernel is unsupported by Gentoo Security
# to the current eclass maintainer :)
# @ECLASS-VARIABLE: K_DEBLOB_AVAILABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# A value of "0" will disable all of the optional deblob
# code. If empty, will be set to "1" if deblobbing is
# possible. Test ONLY for "1".
# @ECLASS-VARIABLE: K_DEBLOB_TAG
# @DEFAULT_UNSET
# @DESCRIPTION:
# This will be the version of deblob script. It's a upstream SVN tag
# such asw -gnu or -gnu1.
# @ECLASS-VARIABLE: K_PREDEBLOBBED
# @DEFAULT_UNSET
# @DESCRIPTION:
# This kernel was already deblobbed elsewhere.
# If false, either optional deblobbing will be available
# or the license will note the inclusion of freedist code.
# @ECLASS-VARIABLE: K_LONGTERM
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, the eclass will search for the kernel source
# in the long term directories on the upstream servers
# as the location has been changed by upstream
# @ECLASS-VARIABLE: H_SUPPORTEDARCH
# @DEFAULT_UNSET
# @DESCRIPTION:
# this should be a space separated list of ARCH's which
# can be supported by the headers ebuild
# @ECLASS-VARIABLE: UNIPATCH_LIST
# @DEFAULT_UNSET
# @DESCRIPTION:
# space delimetered list of patches to be applied to the kernel
# @ECLASS-VARIABLE: UNIPATCH_EXCLUDE
# @DEFAULT_UNSET
# @DESCRIPTION:
# An addition var to support exlusion based completely
# on "<passedstring>*" and not "<passedno#>_*"
# this should _NOT_ be used from the ebuild as this is
# reserved for end users passing excludes from the cli
# @ECLASS-VARIABLE: UNIPATCH_DOCS
# @DEFAULT_UNSET
# @DESCRIPTION:
# space delimemeted list of docs to be installed to
# the doc dir
# @ECLASS-VARIABLE: UNIPATCH_STRICTORDER
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set places patches into directories of
# order, so they are applied in the order passed
# Changing any other variable in this eclass is not supported; you can request
# for additional variables to be added by contacting the current maintainer.
# If you do change them, there is a chance that we will not fix resulting bugs;
@ -90,7 +194,15 @@
PYTHON_COMPAT=( python{2_6,2_7} )
inherit eutils toolchain-funcs versionator multilib python-any-r1
EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
case ${EAPI:-0} in
0|1)
EXPORT_FUNCTIONS src_{unpack,compile,install,test} \
pkg_{setup,preinst,postinst,postrm} ;;
2|3|4|5)
EXPORT_FUNCTIONS src_{unpack,prepare,compile,install,test} \
pkg_{setup,preinst,postinst,postrm} ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
# Added by Daniel Ostrow <dostrow@gentoo.org>
# This is an ugly hack to get around an issue with a 32-bit userland on ppc64.
@ -105,6 +217,8 @@ fi
HOMEPAGE="https://www.kernel.org/ https://www.gentoo.org/ ${HOMEPAGE}"
: ${LICENSE:="GPL-2"}
has "${EAPI:-0}" 0 1 2 && ED=${D} EPREFIX= EROOT=${ROOT}
# This is the latest KV_PATCH of the deblob tool available from the
# libre-sources upstream. If you bump this, you MUST regenerate the Manifests
# for ALL kernel-2 consumer packages where deblob is available.
@ -116,11 +230,14 @@ RESTRICT="binchecks strip"
# set LINUX_HOSTCFLAGS if not already set
: ${LINUX_HOSTCFLAGS:="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"}
# debugging functions
#==============================================================
# @FUNCTION: debug-print-kernel2-variables
# @USAGE:
# @DESCRIPTION:
# this function exists only to help debug kernel-2.eclass
# if you are adding new functionality in, put a call to it
# at the start of src_unpack, or during SRC_URI/dep generation.
debug-print-kernel2-variables() {
for v in PVR CKV OKV KV KV_FULL KV_MAJOR KV_MINOR KV_PATCH RELEASETYPE \
RELEASE UNIPATCH_LIST_DEFAULT UNIPATCH_LIST_GENPATCHES \
@ -129,8 +246,11 @@ debug-print-kernel2-variables() {
done
}
#Eclass functions only from here onwards ...
#==============================================================
# @FUNCTION: handle_genpatches
# @USAGE: [--set-unipatch-list]
# @DESCRIPTION:
# add genpatches to list of patches to apply if wanted
handle_genpatches() {
local tarball want_unipatch_list
[[ -z ${K_WANT_GENPATCHES} || -z ${K_GENPATCHES_VER} ]] && return 1
@ -184,11 +304,14 @@ handle_genpatches() {
done
}
# @FUNCTION: detect_version
# @USAGE:
# @DESCRIPTION:
# this function will detect and set
# - OKV: Original Kernel Version (2.6.0/2.6.0-test11)
# - KV: Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1)
# - EXTRAVERSION: The additional version appended to OKV (-gentoo/-gentoo-r1)
detect_version() {
# this function will detect and set
# - OKV: Original Kernel Version (2.6.0/2.6.0-test11)
# - KV: Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1)
# - EXTRAVERSION: The additional version appended to OKV (-gentoo/-gentoo-r1)
# We've already run, so nothing to do here.
[[ -n ${KV_FULL} ]] && return 0
@ -345,7 +468,7 @@ detect_version() {
KV_FULL=${OKV}${EXTRAVERSION}
# we will set this for backwards compatibility.
S=${WORKDIR}/linux-${KV_FULL}
S="${WORKDIR}"/linux-${KV_FULL}
KV=${KV_FULL}
# -rc-git pulls can be achieved by specifying CKV
@ -413,6 +536,13 @@ detect_version() {
handle_genpatches
}
# @FUNCTION: kernel_is
# @USAGE: <conditional version | version>
# @DESCRIPTION:
# user for comparing kernel versions
# or just identifying a version
# e.g kernel_is 2 4
# e.g kernel_is ge 4.8.11
# Note: duplicated in linux-info.eclass
kernel_is() {
# ALL of these should be set before we can safely continue this function.
@ -440,10 +570,18 @@ kernel_is() {
[ ${test} ${operator} ${value} ]
}
# @FUNCTION: kernel_is_2_4
# @USAGE:
# @DESCRIPTION:
# return true if kernel is version 2.4
kernel_is_2_4() {
kernel_is 2 4
}
# @FUNCTION: kernel_is_2_6
# @USAGE:
# @DESCRIPTION:
# return true if kernel is version 2.6
kernel_is_2_6() {
kernel_is 2 6 || kernel_is 2 5
}
@ -465,10 +603,6 @@ if [[ ${ETYPE} == sources ]]; then
DESCRIPTION="Sources based on the Linux Kernel."
IUSE="symlink build"
if [[ -n ${K_KDBUS_AVAILABLE} ]]; then
IUSE="${IUSE} kdbus"
fi
# Bug #266157, deblob for libre support
if [[ -z ${K_PREDEBLOBBED} ]] ; then
# Bug #359865, force a call to detect_version if needed
@ -524,29 +658,40 @@ if [[ ${ETYPE} == sources ]]; then
elif [[ ${ETYPE} == headers ]]; then
DESCRIPTION="Linux system headers"
IUSE="crosscompile_opts_headers-only"
# Since we should NOT honour KBUILD_OUTPUT in headers
# lets unset it here.
unset KBUILD_OUTPUT
SLOT="0"
else
eerror "Unknown ETYPE=\"${ETYPE}\", must be \"sources\" or \"headers\""
die "Unknown ETYPE=\"${ETYPE}\", must be \"sources\" or \"headers\""
fi
# Cross-compile support functions
#==============================================================
# @FUNCTION: kernel_header_destdir
# @USAGE:
# @DESCRIPTION:
# return header destination directory
kernel_header_destdir() {
[[ ${CTARGET} == ${CHOST} ]] \
&& echo /usr/include \
|| echo /usr/${CTARGET}/usr/include
}
# @FUNCTION: cross_pre_c_headers
# @USAGE:
# @DESCRIPTION:
# set use if necessary for cross compile support
cross_pre_c_headers() {
use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]]
}
# @FUNCTION: env_setup_xmakeopts
# @USAGE:
# @DESCRIPTION:
# set the ARCH/CROSS_COMPILE when cross compiling
env_setup_xmakeopts() {
# Kernel ARCH != portage ARCH
export KARCH=$(tc-arch-kernel)
@ -562,8 +707,11 @@ env_setup_xmakeopts() {
export xmakeopts
}
# Unpack functions
#==============================================================
# @FUNCTION: unpack_2_4
# @USAGE:
# @DESCRIPTION:
# unpack and generate .config for 2.4 kernels
unpack_2_4() {
# this file is required for other things to build properly,
# so we autogenerate it
@ -573,6 +721,11 @@ unpack_2_4() {
echo ">>> version.h compiled successfully."
}
# @FUNCTION: unpack_2_6
# @USAGE:
# @DESCRIPTION:
# unpack and generate .config for 2.6 kernels
unpack_2_6() {
# this file is required for other things to build properly, so we
# autogenerate it ... generate a .config to keep version.h build from
@ -594,6 +747,11 @@ unpack_2_6() {
rm -f .config >/dev/null
}
# @FUNCTION: universal_unpack
# @USAGE:
# @DESCRIPTION:
# unpack kernel sources
universal_unpack() {
debug-print "Inside universal_unpack"
@ -633,21 +791,35 @@ universal_unpack() {
}
# @FUNCTION: unpack_set_extraversion
# @USAGE:
# @DESCRIPTION:
# handle EXTRAVERSION
unpack_set_extraversion() {
cd "${S}"
sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile
cd "${OLDPWD}"
}
# @FUNCTION: unpack_fix_install_path
# @USAGE:
# @DESCRIPTION:
# Should be done after patches have been applied
# Otherwise patches that modify the same area of Makefile will fail
unpack_fix_install_path() {
cd "${S}"
sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile
}
# Compile Functions
#==============================================================
# @FUNCTION: compile_headers
# @USAGE:
# @DESCRIPTION:
# header compilation
compile_headers() {
env_setup_xmakeopts
@ -667,13 +839,13 @@ compile_headers() {
# autoconf.h isnt generated unless it already exists. plus, we have
# no guarantee that any headers are installed on the system...
[[ -f ${ROOT}/usr/include/linux/autoconf.h ]] \
[[ -f ${EROOT}usr/include/linux/autoconf.h ]] \
|| touch include/linux/autoconf.h
# if K_DEFCONFIG isn't set, force to "defconfig"
# needed by mips
if [[ -z ${K_DEFCONFIG} ]]; then
if [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.16) ]]; then
if kernel_is ge 2 6 16 ; then
case ${CTARGET} in
powerpc64*) K_DEFCONFIG="ppc64_defconfig";;
powerpc*) K_DEFCONFIG="pmac32_defconfig";;
@ -688,7 +860,7 @@ compile_headers() {
# symlink in /usr/include/, and make defconfig will fail, so we have
# to force an include path with $S.
HOSTCFLAGS="${HOSTCFLAGS} -I${S}/include/"
ln -sf asm-${KARCH} "${S}"/include/asm
ln -sf asm-${KARCH} "${S}"/include/asm || die
cross_pre_c_headers && return 0
make ${K_DEFCONFIG} HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "defconfig failed (${K_DEFCONFIG})"
@ -700,12 +872,16 @@ compile_headers() {
fi
}
# @FUNCTION: compile_headers_tweak_config
# @USAGE:
# @DESCRIPTION:
# some targets can be very very picky, so let's finesse the
# .config based upon any info we may have
compile_headers_tweak_config() {
# some targets can be very very picky, so let's finesse the
# .config based upon any info we may have
case ${CTARGET} in
sh*)
sed -i '/CONFIG_CPU_SH/d' .config
sed -i '/CONFIG_CPU_SH/d' .config || die
echo "CONFIG_CPU_SH${CTARGET:2:1}=y" >> .config
return 0;;
esac
@ -715,15 +891,24 @@ compile_headers_tweak_config() {
}
# install functions
#==============================================================
# @FUNCTION: install_universal
# @USAGE:
# @DESCRIPTION:
# Fix permissions in tarball
install_universal() {
# Fix silly permissions in tarball
cd "${WORKDIR}"
chown -R 0:0 * >& /dev/null
chmod -R a+r-w+X,u+w *
cd ${OLDPWD}
}
# @FUNCTION: install_headers
# @USAGE:
# @DESCRIPTION:
# Install headers
install_headers() {
local ddir=$(kernel_header_destdir)
@ -731,10 +916,10 @@ install_headers() {
# of this crap anymore :D
if kernel_is ge 2 6 18 ; then
env_setup_xmakeopts
emake headers_install INSTALL_HDR_PATH="${D}"/${ddir}/.. ${xmakeopts} || die
emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/.. ${xmakeopts} || die
# let other packages install some of these headers
rm -rf "${D}"/${ddir}/scsi #glibc/uclibc/etc...
rm -rf "${ED}"${ddir}/scsi || die #glibc/uclibc/etc...
return 0
fi
@ -742,15 +927,15 @@ install_headers() {
# $S values where the cmdline to cp is too long
pushd "${S}" >/dev/null
dodir ${ddir}/linux
cp -pPR "${S}"/include/linux "${D}"/${ddir}/ || die
rm -rf "${D}"/${ddir}/linux/modules
cp -pPR "${S}"/include/linux "${ED}"${ddir}/ || die
rm -rf "${ED}"${ddir}/linux/modules || die
dodir ${ddir}/asm
cp -pPR "${S}"/include/asm/* "${D}"/${ddir}/asm
cp -pPR "${S}"/include/asm/* "${ED}"${ddir}/asm || die
if kernel_is 2 6 ; then
dodir ${ddir}/asm-generic
cp -pPR "${S}"/include/asm-generic/* "${D}"/${ddir}/asm-generic
cp -pPR "${S}"/include/asm-generic/* "${ED}"${ddir}/asm-generic || die
fi
# clean up
@ -759,6 +944,11 @@ install_headers() {
popd >/dev/null
}
# @FUNCTION: install_sources
# @USAGE:
# @DESCRIPTION:
# Install sources
install_sources() {
local file
@ -777,14 +967,7 @@ install_sources() {
done
fi
if [[ ! -f ${S}/patches.txt ]]; then
# patches.txt is empty so lets use our ChangeLog
[[ -f ${FILESDIR}/../ChangeLog ]] && \
echo "Please check the ebuild ChangeLog for more details." \
> "${S}"/patches.txt
fi
mv ${WORKDIR}/linux* "${D}"/usr/src
mv "${WORKDIR}"/linux* "${ED}"usr/src || die
if [[ -n "${UNIPATCH_DOCS}" ]] ; then
for i in ${UNIPATCH_DOCS}; do
@ -793,16 +976,23 @@ install_sources() {
fi
}
# pkg_preinst functions
#==============================================================
# @FUNCTION: preinst_headers
# @USAGE:
# @DESCRIPTION:
# Headers preinst steps
preinst_headers() {
local ddir=$(kernel_header_destdir)
[[ -L ${ddir}/linux ]] && rm ${ddir}/linux
[[ -L ${ddir}/asm ]] && rm ${ddir}/asm
[[ -L ${EPREFIX}${ddir}/linux ]] && { rm "${EPREFIX}"${ddir}/linux || die; }
[[ -L ${EPREFIX}${ddir}/asm ]] && { rm "${EPREFIX}"${ddir}/asm || die; }
}
# pkg_postinst functions
#==============================================================
# @FUNCTION: postinst_sources
# @USAGE:
# @DESCRIPTION:
# Sources post installation function.
# see inline comments
postinst_sources() {
local MAKELINK=0
@ -819,21 +1009,19 @@ postinst_sources() {
# if we are to forcably symlink, delete it if it already exists first.
if [[ ${K_SYMLINK} > 0 ]]; then
[[ -h ${ROOT}usr/src/linux ]] && rm ${ROOT}usr/src/linux
[[ -h ${EROOT}usr/src/linux ]] && { rm "${EROOT}"usr/src/linux || die; }
MAKELINK=1
fi
# if the link doesnt exist, lets create it
[[ ! -h ${ROOT}usr/src/linux ]] && MAKELINK=1
[[ ! -h ${EROOT}usr/src/linux ]] && MAKELINK=1
if [[ ${MAKELINK} == 1 ]]; then
cd "${ROOT}"usr/src
ln -sf linux-${KV_FULL} linux
cd ${OLDPWD}
ln -sf linux-${KV_FULL} "${EROOT}"usr/src/linux || die
fi
# Don't forget to make directory for sysfs
[[ ! -d ${ROOT}sys ]] && kernel_is 2 6 && mkdir ${ROOT}sys
[[ ! -d ${EROOT}sys ]] && kernel_is 2 6 && { mkdir "${EROOT}"sys || die ; }
echo
elog "If you are upgrading from a previous kernel, you may be interested"
@ -893,7 +1081,12 @@ postinst_sources() {
}
# pkg_setup functions
#==============================================================
# @FUNCTION: setup_headers
# @USAGE:
# @DESCRIPTION:
# Determine if ${PN} supports arch
setup_headers() {
[[ -z ${H_SUPPORTEDARCH} ]] && H_SUPPORTEDARCH=${PN/-*/}
for i in ${H_SUPPORTEDARCH}; do
@ -909,8 +1102,11 @@ setup_headers() {
fi
}
# unipatch
#==============================================================
# @FUNCTION: unipatch
# @USAGE: <list of patches to apply>
# @DESCRIPTION:
# Universal function that will apply patches to source
unipatch() {
local i x y z extention PIPE_CMD UNIPATCH_DROP KPATCH_DIR PATCH_DEPTH ELINE
local STRICT_COUNT PATCH_LEVEL myLC_ALL myLANG
@ -927,7 +1123,8 @@ unipatch() {
# We're gonna need it when doing patches with a predefined patchlevel
eshopts_push -s extglob
# This function will unpack all passed tarballs, add any passed patches, and remove any passed patchnumbers
# This function will unpack all passed tarballs, add any passed patches,
# and remove any passed patchnumbers
# usage can be either via an env var or by params
# although due to the nature we pass this within this eclass
# it shall be by param only.
@ -1031,13 +1228,6 @@ unipatch() {
UNIPATCH_DROP+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch"
fi
fi
# if kdbus use flag is not set, drop the kdbus patch
if [[ $UNIPATCH_DROP != *"5015_kdbus*.patch"* ]]; then
if ! has kdbus ${IUSE} || ! use kdbus; then
UNIPATCH_DROP="${UNIPATCH_DROP} 5015_kdbus*.patch"
fi
fi
fi
done
@ -1089,13 +1279,13 @@ unipatch() {
# #
# https://bugs.gentoo.org/show_bug.cgi?id=507656 #
####################################################################
if [[ ${PN} == "git-sources" ]] ; then
if [[ -n ${K_FROM_GIT} ]] ; then
if [[ ${KV_MAJOR} -gt 3 || ( ${KV_MAJOR} -eq 3 && ${KV_PATCH} -gt 15 ) &&
${RELEASETYPE} == -rc ]] ; then
ebegin "Applying ${i/*\//} (-p1)"
if [ $(patch -p1 --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -le 2 ]; then
eend 0
rm ${STDERR_T}
rm ${STDERR_T} || die
break
else
eend 1
@ -1119,7 +1309,7 @@ unipatch() {
echo "=======================================================" >> ${STDERR_T}
if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then
eend 0
rm ${STDERR_T}
rm ${STDERR_T} || die
break
else
eend 1
@ -1153,9 +1343,9 @@ unipatch() {
local tmp
for x in ${KPATCH_DIR}; do
for i in ${UNIPATCH_DOCS}; do
if [[ -f "${x}/${i}" ]] ; then
if [[ -f ${x}/${i} ]] ; then
tmp="${tmp} ${i}"
cp -f "${x}/${i}" "${T}"/
cp -f "${x}/${i}" "${T}"/ || die
fi
done
done
@ -1169,8 +1359,9 @@ unipatch() {
eshopts_pop
}
# getfilevar accepts 2 vars as follows:
# getfilevar <VARIABLE> <CONFIGFILE>
# @FUNCTION: getfilevar
# @USAGE: <variable> <configfile>
# @DESCRIPTION:
# pulled from linux-info
getfilevar() {
@ -1195,10 +1386,14 @@ getfilevar() {
fi
}
# @FUNCTION: detect_arch
# @USAGE:
# @DESCRIPTION:
# This function sets ARCH_URI and ARCH_PATCH
# with the neccessary info for the arch sepecific compatibility
# patchsets.
detect_arch() {
# This function sets ARCH_URI and ARCH_PATCH
# with the neccessary info for the arch sepecific compatibility
# patchsets.
local ALL_ARCH LOOP_ARCH COMPAT_URI i
@ -1225,9 +1420,13 @@ detect_arch() {
done
}
# @FUNCTION: headers___fix
# @USAGE:
# @DESCRIPTION:
# Voodoo to partially fix broken upstream headers.
# note: do not put inline/asm/volatile together (breaks "inline asm volatile")
headers___fix() {
# Voodoo to partially fix broken upstream headers.
# note: do not put inline/asm/volatile together (breaks "inline asm volatile")
sed -i \
-e '/^\#define.*_TYPES_H/{:loop n; bloop}' \
-e 's:\<\([us]\(8\|16\|32\|64\)\)\>:__\1:g' \
@ -1237,8 +1436,11 @@ headers___fix() {
"$@"
}
# common functions
#==============================================================
# @FUNCTION: kernel-2_src_unpack()
# @USAGE:
# @DESCRIPTION:
# unpack sources, handle genpatches, deblob
kernel-2_src_unpack() {
universal_unpack
debug-print "Doing unipatch"
@ -1254,8 +1456,9 @@ kernel-2_src_unpack() {
# we run misc `make` functions below
[[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
debug-print "Doing epatch_user"
epatch_user
case ${EAPI:-0} in
0|1) kernel-2_src_prepare ;;
esac
debug-print "Doing unpack_set_extraversion"
@ -1295,6 +1498,27 @@ kernel-2_src_unpack() {
fi
}
# @FUNCTION: kernel-2_src_prepare
# @USAGE:
# @DESCRIPTION:
# Apply any user patches
kernel-2_src_prepare() {
debug-print "Applying any user patches"
# apply any user patches
case ${EAPI:-0} in
0|1|2|3|4|5) epatch_user ;;
6) eapply_user ;;
esac
}
# @FUNCTION: kernel-2_src_compile
# @USAGE:
# @DESCRIPTION:
# conpile headers or run deblob script
kernel-2_src_compile() {
cd "${S}"
[[ ${ETYPE} == headers ]] && compile_headers
@ -1306,6 +1530,9 @@ kernel-2_src_compile() {
fi
}
# @FUNCTION: kernel-2_src_test
# @USAGE:
# @DESCRIPTION:
# if you leave it to the default src_test, it will run make to
# find whether test/check targets are present; since "make test"
# actually produces a few support files, they are installed even
@ -1314,20 +1541,40 @@ kernel-2_src_compile() {
# Avoid this altogether by making the function moot.
kernel-2_src_test() { :; }
# @FUNCTION: kernel-2_pkg_preinst
# @DESCRIPTION:
# if ETYPE = headers, call preinst_headers
kernel-2_pkg_preinst() {
[[ ${ETYPE} == headers ]] && preinst_headers
}
# @FUNCTION: kernel-2_src_install
# @USAGE:
# @DESCRIPTION:
# Install headers or sources dependant on ETYPE
kernel-2_src_install() {
install_universal
[[ ${ETYPE} == headers ]] && install_headers
[[ ${ETYPE} == sources ]] && install_sources
}
# @FUNCTION: kernel-2_pkg_postinst
# @USAGE:
# @DESCRIPTION:
# call postinst_sources for ETYPE = sources
kernel-2_pkg_postinst() {
[[ ${ETYPE} == sources ]] && postinst_sources
}
# @FUNCTION: kernel-2_pkg_setup
# @USAGE:
# @DESCRIPTION:
# check for supported kernel version, die if ETYPE is unknown, call setup_headers
# if necessary
kernel-2_pkg_setup() {
if kernel_is 2 4; then
if [[ $(gcc-major-version) -ge 4 ]] ; then
@ -1344,21 +1591,35 @@ kernel-2_pkg_setup() {
fi
ABI="${KERNEL_ABI}"
if [[ ${ETYPE} != sources ]] && [[ ${ETYPE} != headers ]]; then
eerror "Unknown ETYPE=\"${ETYPE}\", must be \"sources\" or \"headers\""
die "Unknown ETYPE=\"${ETYPE}\", must be \"sources\" or \"headers\""
fi
[[ ${ETYPE} == headers ]] && setup_headers
[[ ${ETYPE} == sources ]] && echo ">>> Preparing to unpack ..."
}
# @FUNCTION: kernel-2_pkg_postrm
# @USAGE:
# @DESCRIPTION:
# Notify the user that after a depclean, there may be sources
# left behind that need to be manually cleaned
kernel-2_pkg_postrm() {
# This warning only makes sense for kernel sources.
[[ ${ETYPE} == headers ]] && return 0
# If there isn't anything left behind, then don't complain.
[[ -e ${ROOT}usr/src/linux-${KV_FULL} ]] || return 0
[[ -e ${EROOT}usr/src/linux-${KV_FULL} ]] || return 0
echo
ewarn "Note: Even though you have successfully unmerged "
ewarn "your kernel package, directories in kernel source location: "
ewarn "${ROOT}usr/src/linux-${KV_FULL}"
ewarn "${EROOT}usr/src/linux-${KV_FULL}"
ewarn "with modified files will remain behind. By design, package managers"
ewarn "will not remove these modified files and the directories they reside in."
echo
ewarn "For more detailed kernel removal instructions, please see: "
ewarn "https://wiki.gentoo.org/wiki/Kernel/Removal"
echo
}

View File

@ -0,0 +1,31 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: kodi-addon.eclass
# @MAINTAINER:
# candrews@integralblue.com
# @BLURB: Helper for correct building and (importantly) installing Kodi addon packages.
# @DESCRIPTION:
# Provides a src_configure function for correct CMake configuration
inherit multilib cmake-utils
case "${EAPI:-0}" in
4|5|6)
EXPORT_FUNCTIONS src_configure
;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
# @FUNCTION: kodi-addon_src_configure
# @DESCRIPTION:
# Configure handling for Kodi addons
kodi-addon_src_configure() {
mycmakeargs+=(
-DCMAKE_INSTALL_LIBDIR=$(get_libdir)/kodi
)
cmake-utils_src_configure
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2012 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -77,7 +77,7 @@ l10n_for_each_disabled_locale_do() {
# Example: l10n_find_plocales_changes "${S}/src/translations" "${PN}_" '.ts'
l10n_find_plocales_changes() {
[[ $# -ne 3 ]] && die "Exactly 3 arguments are needed!"
einfo "Looking in ${1} for new locales ..."
ebegin "Looking in ${1} for new locales"
pushd "${1}" >/dev/null || die "Cannot access ${1}"
local current= x=
for x in ${2}*${3} ; do
@ -86,11 +86,16 @@ l10n_find_plocales_changes() {
current+="${x} "
done
popd >/dev/null
if [[ ${PLOCALES} != ${current%[[:space:]]} ]] ; then
einfo "There are changes in locales! This ebuild should be updated to:"
einfo "PLOCALES=\"${current%[[:space:]]}\""
# RHS will be sorted with single spaces so ensure the LHS is too
# before attempting to compare them for equality. See bug #513242.
# Run them both through the same sorting algorithm so we don't have
# to worry about them being the same.
if [[ "$(printf '%s\n' ${PLOCALES} | LC_ALL=C sort)" != "$(printf '%s\n' ${current} | LC_ALL=C sort)" ]] ; then
eend 1 "There are changes in locales! This ebuild should be updated to:"
eerror "PLOCALES=\"${current%[[:space:]]}\""
return 1
else
einfo "Done"
eend 0
fi
}

View File

@ -96,6 +96,10 @@ latex-package_has_tetex_3() {
# for a TeX installation
latex-package_src_doinstall() {
debug-print function $FUNCNAME $*
# Avoid generating font cache outside of the sandbox
export VARTEXFONTS="${T}/fonts"
# This actually follows the directions for a "single-user" system
# at http://www.ctan.org/installationadvice/ modified for gentoo.
[ -z "$1" ] && latex-package_src_install all
@ -134,6 +138,7 @@ latex-package_src_doinstall() {
if ! in_iuse doc || use doc ; then
for i in `find . -maxdepth 1 -type f -name "*.${1}"`
do
[ -n "${LATEX_PACKAGE_SKIP}" ] && has ${i##*/} ${LATEX_PACKAGE_SKIP} && continue
einfo "Making documentation: $i"
if pdflatex ${LATEX_DOC_ARGUMENTS} --interaction=batchmode $i &> /dev/null ; then
pdflatex ${LATEX_DOC_ARGUMENTS} --interaction=batchmode $i &> /dev/null || die

View File

@ -138,7 +138,7 @@ elibtoolize() {
local x
local dirs=()
local do_portage="no"
local do_reversedeps="no"
local do_reversedeps="yes"
local do_only_patches="no"
local do_uclibc="yes"
local deptoremove=

View File

@ -445,7 +445,6 @@ get_version() {
# KV_DIR will contain the full path to the sources directory we should use
[ -z "${get_version_warning_done}" ] && \
qeinfo "Determining the location of the kernel source code"
[ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})"
[ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}"
if [ -z "${KV_DIR}" ]
@ -539,7 +538,6 @@ get_version() {
done
fi
[ -h "${OUTPUT_DIR}" ] && KV_OUT_DIR="$(readlink -f ${OUTPUT_DIR})"
[ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}"
if [ -n "${KV_OUT_DIR}" ];
then

View File

@ -566,6 +566,9 @@ linux-mod_pkg_setup() {
return
fi
# External modules use kernel symbols (bug #591832)
CONFIG_CHECK+=" !TRIM_UNUSED_KSYMS"
linux-info_pkg_setup;
require_configured_kernel
check_kernel_built;
@ -592,7 +595,7 @@ linux-mod_pkg_setup_binary() {
[[ ${config:0:1} == "~" ]] && optional=''
new_CONFIG_CHECK="${new_CONFIG_CHECK} ${optional}${config}"
done
export CONFIG_CHECK="${new_CONFIG_CHECK}"
CONFIG_CHECK="${new_CONFIG_CHECK}"
linux-info_pkg_setup;
}

View File

@ -0,0 +1,65 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: mate-desktop.org.eclass
# @MAINTAINER:
# mate@gentoo.org
# @AUTHOR:
# Authors: NP-Hardass <NP-Hardass@gentoo.org> based upon the gnome.org eclass.
# @BLURB: Helper eclass for mate-desktop.org hosted archives
# @DESCRIPTION:
# Provide a default SRC_URI and EGIT_REPO_URI for MATE packages as well as
# exporting some useful values like the MATE_BRANCH
# EAPIs < 6 are banned.
case "${EAPI:-0}" in
6) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
if [[ ${PV} == 9999 ]]; then
inherit git-r3
fi
inherit versionator
# @ECLASS-VARIABLE: MATE_TARBALL_SUFFIX
# @INTERNAL
# @DESCRIPTION:
# All projects hosted on mate-desktop.org provide tarballs as tar.xz.
# Undefined in live ebuilds.
[[ ${PV} != 9999 ]] && : ${MATE_TARBALL_SUFFIX:="xz"}
# @ECLASS-VARIABLE: MATE_DESKTOP_ORG_PN
# @DESCRIPTION:
# Name of the package as hosted on mate-desktop.org.
# Leave unset if package name matches PN.
: ${MATE_DESKTOP_ORG_PN:=$PN}
# @ECLASS-VARIABLE: MATE_DESKTOP_ORG_PV
# @DESCRIPTION:
# Package version string as listed on mate-desktop.org.
# Leave unset if package version string matches PV.
: ${MATE_DESKTOP_ORG_PV:=$PV}
# @ECLASS-VARIABLE: MATE_BRANCH
# @DESCRIPTION:
# Major and minor numbers of the version number, unless live.
# If live ebuild, will be set to '9999'.
: ${MATE_BRANCH:=$(get_version_component_range 1-2)}
# Set SRC_URI or EGIT_REPO_URI based on whether live
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="
https://github.com/mate-desktop/${MATE_DESKTOP_ORG_PN}.git
git://github.com/mate-desktop/${MATE_DESKTOP_ORG_PN}.git
http://github.com/mate-desktop/${MATE_DESKTOP_ORG_PN}.git
"
SRC_URI=""
else
SRC_URI="http://pub.mate-desktop.org/releases/${MATE_BRANCH}/${MATE_DESKTOP_ORG_PN}-${MATE_DESKTOP_ORG_PV}.tar.${MATE_TARBALL_SUFFIX}"
fi
# Set HOMEPAGE for all ebuilds
HOMEPAGE="http://mate-desktop.org"

View File

@ -0,0 +1,151 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: mate.eclass
# @MAINTAINER:
# mate@gentoo.org
# @AUTHOR:
# Authors: NP-Hardass <NP-Hardass@gentoo.org> based upon the gnome2
# and autotools-utils eclasses
# @BLURB: Provides phases for MATE based packages.
# @DESCRIPTION:
# Exports portage base functions used by ebuilds written for packages using the
# MATE framework. Occassionally acts as a wrapper to gnome2 due to the
# fact that MATE is a GNOME fork. For additional functions, see gnome2-utils.eclass.
# Check EAPI only
case "${EAPI:-0}" in
6) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
# Inherit happens below after declaration of GNOME2_LA_PUNT
# @ECLASS-VARIABLE: MATE_LA_PUNT
# @DESCRIPTION:
# Available values for MATE_LA_PUNT:
# - "no": will not clean any .la files
# - "yes": will run prune_libtool_files --modules
# - If it is not set, it will run prune_libtool_files
# MATE_LA_PUNT is a stub to GNOME2_LA_PUNT
GNOME2_LA_PUNT=${MATE_LA_PUNT:-""}
inherit gnome2 autotools mate-desktop.org
case "${EAPI:-0}" in
6) EXPORT_FUNCTIONS src_prepare src_configure src_install pkg_preinst pkg_postinst pkg_postrm ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
# Autotools requires our MATE m4 files
DEPEND=">=mate-base/mate-common-${MATE_BRANCH}"
# @FUNCTION: mate_py_cond_func_wrap
# @DESCRIPTION:
# Wraps a function for conditional python use, to run for each
# python implementation in the build directory.
# This function should only be used if the ebuild also inherits the
# python-r1 eclass
mate_py_cond_func_wrap() {
if [[ ! ${_PYTHON_R1} ]]; then
die "This function requires the inheritence of the python-r1 eclass"
fi
if use python; then
python_foreach_impl run_in_build_dir "$@"
else
$@
fi
}
# @ECLASS-VARIABLE: MATE_FORCE_AUTORECONF
# @DESCRIPTION:
# Available values for MATE_FORCE_AUTORECONF:
# - true: will always run eautoreconf
# - false: will default to automatic detect
# - If it is not set, it will default to false
: ${MATE_FORCE_AUTORECONF:="false"}
# @FUNCTION: ematedocize
# @DESCRIPTION:
# A wrapper around mate-doc-common
ematedocize() {
ebegin "Running mate-doc-common --copy"
mate-doc-common --copy || die
eend $?
}
# @FUNCTION: want_mate_doc
# @DESCRIPTION:
# Returns true/false based on whether eautoreconf should call
# ematedocize
want_mate_doc() {
grep -q USE_COMMON_DOC_BUILD autogen.sh
}
# @FUNCTION: mate_src_prepare
# @DESCRIPTION:
# Call gnome2_src_prepare to handle environment setup and patching, then
# call eautoreconf if necessary
mate_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
local force_autoreconf=${MATE_FORCE_AUTORECONF}
[[ ${PV} == 9999 ]] && force_autoreconf="true"
gen_chksum() {
find '(' -name 'Makefile.am' \
-o -name 'configure.ac' \
-o -name 'configure.in' ')' \
-exec cksum {} + | sort -k2
}
local chksum=$(gen_chksum)
gnome2_src_prepare "$@"
if [[ "${force_autoreconf}" == "true" ]] || [[ ${chksum} != $(gen_chksum) ]]; then
want_mate_doc && ematedocize
AT_NOELIBTOOLIZE="yes" eautoreconf # gnome2_src_prepare calls elibtoolize
fi
}
# @FUNCTION: mate_src_configure
# @DESCRIPTION:
# MATE specific configure handling
# Stub to gnome2_src_configure()
mate_src_configure() {
gnome2_src_configure "$@"
}
# @FUNCTION: mate_src_install
# @DESCRIPTION:
# MATE specific install. Stub to gnome2_src_install
mate_src_install() {
gnome2_src_install "$@"
}
# @FUNCTION: mate_pkg_preinst
# @DESCRIPTION:
# Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
# Stub to gnome2_pkg_preinst
mate_pkg_preinst() {
gnome2_pkg_preinst "$@"
}
# @FUNCTION: mate_pkg_postinst
# @DESCRIPTION:
# Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
# database updates.
# Stub to gnome2_pkg_postinst
mate_pkg_postinst() {
gnome2_pkg_postinst "$@"
}
# @FUNCTION: mate_pkg_postrm
# @DESCRIPTION:
# Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
# Stub to gnome2_pkg_postrm
mate_pkg_postrm() {
gnome2_pkg_postrm "$@"
}

View File

@ -4,7 +4,7 @@
# @ECLASS: mercurial.eclass
# @MAINTAINER:
# Christoph Junghans <ottxor@gentoo.org>
# Christoph Junghans <junghans@gentoo.org>
# Dirkjan Ochtman <djc@gentoo.org>
# @AUTHOR:
# Next gen author: Krzysztof Pawlik <nelchael@gentoo.org>

View File

@ -1,104 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# mozconfig.eclass: the new mozilla.eclass
inherit multilib flag-o-matic mozcoreconf-2
# use-flags common among all mozilla ebuilds
IUSE="+alsa +dbus debug libnotify startup-notification system-sqlite wifi"
# XXX: GConf is used for setting the default browser
# revisit to make it optional with GNOME 3
# pango[X] is needed for pangoxft.h
# freedesktop-icon-theme is needed for bug 341697
RDEPEND="app-arch/zip
app-arch/unzip
>=app-text/hunspell-1.2
dev-libs/expat
>=dev-libs/libevent-1.4.7
>=x11-libs/cairo-1.8[X]
>=x11-libs/gtk+-2.8.6:2
>=x11-libs/pango-1.10.1[X]
virtual/jpeg:0
alsa? ( media-libs/alsa-lib )
virtual/freedesktop-icon-theme
dbus? ( >=dev-libs/dbus-glib-0.72 )
libnotify? ( >=x11-libs/libnotify-0.4 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
wifi? ( net-wireless/wireless-tools )"
DEPEND="${RDEPEND}"
mozconfig_config() {
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
if ! $(mozversion_is_new_enough) ; then
mozconfig_use_enable alsa ogg
mozconfig_use_enable alsa wave
mozconfig_use_enable libnotify
mozconfig_use_enable debug debugger-info-modules
if has +ipc ${IUSE}; then
mozconfig_use_enable ipc
fi
if [[ ${PN} != thunderbird ]] ; then
mozconfig_annotate 'places' --enable-storage --enable-places --enable-places_bookmarks
mozconfig_annotate '' --enable-oji --enable-mathml
mozconfig_annotate 'broken' --disable-mochitest
fi
if use system-sqlite; then
mozconfig_annotate '' --with-sqlite-prefix="${EPREFIX}"/usr
fi
if use amd64 || use x86 || use arm || use sparc; then
mozconfig_annotate '' --enable-tracejit
fi
fi
mozconfig_use_enable dbus
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
fi
mozconfig_use_enable startup-notification
mozconfig_use_enable system-sqlite
mozconfig_use_enable wifi necko-wifi
if $(mozversion_is_new_enough) ; then
mozconfig_annotate 'required' --enable-ogg
mozconfig_annotate 'required' --enable-wave
mozconfig_annotate 'required' --with-system-libvpx
elif has +webm ${IUSE} && use webm; then
if ! use alsa; then
echo "Enabling alsa support due to webm request"
mozconfig_annotate '+webm -alsa' --enable-ogg
mozconfig_annotate '+webm -alsa' --enable-wave
mozconfig_annotate '+webm' --enable-webm
mozconfig_annotate '+webm' --with-system-libvpx
else
mozconfig_use_enable webm
mozconfig_annotate '+webm' --with-system-libvpx
fi
else
mozconfig_annotate '' --disable-webm
mozconfig_annotate '' --disable-system-libvpx
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
mozconfig_annotate '' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomevfs
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
}

View File

@ -51,7 +51,7 @@ IUSE="${IUSE} dbus debug gstreamer pulseaudio startup-notification system-cairo
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
RDEPEND=">=app-text/hunspell-1.2:=
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7

View File

@ -1,232 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozconfig-v5.33.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v5
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
case ${EAPI} in
0|1|2|3|4) die "EAPI=${EAPI} not supported"
esac
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="jit". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if optional jit support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug gstreamer pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.14:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.13:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
virtual/libffi
gstreamer? (
>=media-libs/gstreamer-1.2.3:1.0
>=media-libs/gst-plugins-base-1.2.3:1.0
>=media-libs/gst-plugins-good-1.2.3:1.0
>=media-plugins/gst-plugins-libav-1.1.0_pre20130128-r1:1.0
)
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-51.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-sqlite? ( >=dev-db/sqlite-3.8.6:3[secure-delete,debug=] )
system-libvpx? ( =media-libs/libvpx-1.3.0*[postproc] )
"
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-wireless/wireless-tools )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v5.33
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--enable-pango \
--enable-svg \
--with-system-bz2
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
# These are forced-on for webm support
mozconfig_annotate 'required' --enable-ogg
mozconfig_annotate 'required' --enable-wave
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
mozconfig_use_enable jit yarr-jit
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomevfs
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate '' --disable-gconf
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc; then
# We must force-enable jemalloc 3 via .mozconfig
echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-jemalloc
mozconfig_annotate '' --enable-replace-malloc
fi
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
if use gstreamer; then
mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
else
mozconfig_annotate '' --disable-gstreamer
fi
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_enable system-icu intl-api
mozconfig_use_with system-libvpx
}

View File

@ -1,232 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozconfig-v5.33.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v5
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
case ${EAPI} in
0|1|2|3|4) die "EAPI=${EAPI} not supported"
esac
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="jit". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if optional jit support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug gstreamer pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.14:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
gstreamer? (
>=media-libs/gstreamer-1.2.3:1.0
>=media-libs/gst-plugins-base-1.2.3:1.0
>=media-libs/gst-plugins-good-1.2.3:1.0
>=media-plugins/gst-plugins-libav-1.1.0_pre20130128-r1:1.0
)
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-51.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-sqlite? ( >=dev-db/sqlite-3.8.7.4:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )
"
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-wireless/wireless-tools )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v5.33
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--enable-pango \
--enable-svg \
--with-system-bz2
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
# These are forced-on for webm support
mozconfig_annotate 'required' --enable-ogg
mozconfig_annotate 'required' --enable-wave
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
mozconfig_use_enable jit yarr-jit
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomevfs
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate '' --disable-gconf
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc; then
# We must force-enable jemalloc 3 via .mozconfig
echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-jemalloc
mozconfig_annotate '' --enable-replace-malloc
fi
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
if use gstreamer; then
mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
else
mozconfig_annotate '' --disable-gstreamer
fi
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_enable system-icu intl-api
mozconfig_use_with system-libvpx
}

View File

@ -1,231 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozconfig-v5.33.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v5
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
case ${EAPI} in
0|1|2|3|4) die "EAPI=${EAPI} not supported"
esac
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="jit". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if optional jit support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug gstreamer +jemalloc3 pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.16:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
gstreamer? (
>=media-libs/gstreamer-1.2.3:1.0
>=media-libs/gst-plugins-base-1.2.3:1.0
>=media-libs/gst-plugins-good-1.2.3:1.0
>=media-plugins/gst-plugins-libav-1.1.0_pre20130128-r1:1.0
)
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-51.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-sqlite? ( >=dev-db/sqlite-3.8.8.2:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )
"
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-wireless/wireless-tools )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v5.33
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--enable-pango \
--enable-svg \
--with-system-bz2
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
# These are forced-on for webm support
mozconfig_annotate 'required' --enable-ogg
mozconfig_annotate 'required' --enable-wave
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomevfs
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate '' --disable-gconf
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc3; then
# We must force-enable jemalloc 3 via .mozconfig
echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-jemalloc
mozconfig_annotate '' --enable-replace-malloc
fi
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
if use gstreamer; then
mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
else
mozconfig_annotate '' --disable-gstreamer
fi
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_enable system-icu intl-api
mozconfig_use_with system-libvpx
}

View File

@ -51,7 +51,7 @@ IUSE="${IUSE} dbus debug gstreamer gstreamer-0 +jemalloc3 neon pulseaudio selinu
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
RDEPEND=">=app-text/hunspell-1.2:=
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7

View File

@ -1,240 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozconfig-v5.33.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v5
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
case ${EAPI} in
0|1|2|3|4) die "EAPI=${EAPI} not supported"
esac
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="jit". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if optional jit support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug gstreamer gstreamer-0 +jemalloc3 pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.16:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
gstreamer? (
>=media-libs/gstreamer-1.4.5:1.0
>=media-libs/gst-plugins-base-1.4.5:1.0
>=media-libs/gst-plugins-good-1.4.5:1.0
>=media-plugins/gst-plugins-libav-1.4.5:1.0
)
gstreamer-0? (
>=media-libs/gstreamer-0.10.25:0.10
media-plugins/gst-plugins-meta:0.10[ffmpeg]
)
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-51.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-sqlite? ( >=dev-db/sqlite-3.8.9:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )
"
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-wireless/wireless-tools )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# only one of gstreamer and gstreamer-0 can be enabled at a time, so set REQUIRED_USE to signify this
REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v5.33
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--enable-pango \
--enable-svg \
--with-system-bz2
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
# These are forced-on for webm support
mozconfig_annotate 'required' --enable-ogg
mozconfig_annotate 'required' --enable-wave
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomevfs
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate '' --disable-gconf
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc3; then
# We must force-enable jemalloc 3 via .mozconfig
echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-jemalloc
mozconfig_annotate '' --enable-replace-malloc
fi
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
if use gstreamer ; then
mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
elif use gstreamer-0 ; then
mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
else
mozconfig_annotate '' --disable-gstreamer
fi
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_with system-icu intl-api
mozconfig_use_with system-libvpx
}

View File

@ -1,263 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozconfig-v6.40.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
case ${EAPI} in
0|1|2|3|4) die "EAPI=${EAPI} not supported"
esac
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="jit". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if optional jit support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk3 support via IUSE="gtk3". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if gtk3 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug gstreamer gstreamer-0 +jemalloc3 pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.17:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
gstreamer? (
>=media-libs/gstreamer-1.4.5:1.0
>=media-libs/gst-plugins-base-1.4.5:1.0
>=media-libs/gst-plugins-good-1.4.5:1.0
>=media-plugins/gst-plugins-libav-1.4.5:1.0
)
gstreamer-0? (
>=media-libs/gstreamer-0.10.25:0.10
media-plugins/gst-plugins-meta:0.10[ffmpeg]
)
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-51.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-sqlite? ( >=dev-db/sqlite-3.8.9:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
IUSE+=" +gtk3"
else
IUSE+=" gtk3"
fi
RDEPEND+="
gtk3? ( >=x11-libs/gtk+-3.14.0:3 )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-wireless/wireless-tools )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# only one of gstreamer and gstreamer-0 can be enabled at a time, so set REQUIRED_USE to signify this
REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v5.33
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--enable-pango \
--enable-svg \
--with-system-bz2
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
mozconfig_annotate 'gtk3 use flag' --enable-default-toolkit=$(usex gtk3 cairo-gtk3 cairo-gtk2)
else
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
fi
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
# These are forced-on for webm support
mozconfig_annotate 'required' --enable-ogg
mozconfig_annotate 'required' --enable-wave
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomevfs
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate '' --disable-gconf
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc3; then
# We must force-enable jemalloc 3 via .mozconfig
echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-jemalloc
mozconfig_annotate '' --enable-replace-malloc
fi
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
if use gstreamer ; then
mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
elif use gstreamer-0 ; then
mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
else
mozconfig_annotate '' --disable-gstreamer
fi
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_enable system-icu intl-api
mozconfig_use_with system-libvpx
}

View File

@ -1,263 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozconfig-v6.40.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
case ${EAPI} in
0|1|2|3|4) die "EAPI=${EAPI} not supported"
esac
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="jit". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if optional jit support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk3 support via IUSE="gtk3". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if gtk3 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug gstreamer gstreamer-0 +jemalloc3 pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.17:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
gstreamer? (
>=media-libs/gstreamer-1.4.5:1.0
>=media-libs/gst-plugins-base-1.4.5:1.0
>=media-libs/gst-plugins-good-1.4.5:1.0
>=media-plugins/gst-plugins-libav-1.4.5:1.0
)
gstreamer-0? (
>=media-libs/gstreamer-0.10.25:0.10
media-plugins/gst-plugins-meta:0.10[ffmpeg]
)
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-51.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-sqlite? ( >=dev-db/sqlite-3.8.10.1:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
IUSE+=" +gtk3"
else
IUSE+=" gtk3"
fi
RDEPEND+="
gtk3? ( >=x11-libs/gtk+-3.14.0:3 )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-wireless/wireless-tools )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# only one of gstreamer and gstreamer-0 can be enabled at a time, so set REQUIRED_USE to signify this
REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v5.33
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--enable-pango \
--enable-svg \
--with-system-bz2
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
mozconfig_annotate 'gtk3 use flag' --enable-default-toolkit=$(usex gtk3 cairo-gtk3 cairo-gtk2)
else
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
fi
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
# These are forced-on for webm support
mozconfig_annotate 'required' --enable-ogg
mozconfig_annotate 'required' --enable-wave
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomevfs
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate '' --disable-gconf
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc3; then
# We must force-enable jemalloc 3 via .mozconfig
echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-jemalloc
mozconfig_annotate '' --enable-replace-malloc
fi
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
if use gstreamer ; then
mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
elif use gstreamer-0 ; then
mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
else
mozconfig_annotate '' --disable-gstreamer
fi
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_with system-icu intl-api
mozconfig_use_with system-libvpx
}

View File

@ -61,7 +61,7 @@ IUSE="${IUSE} dbus debug +gstreamer gstreamer-0 +jemalloc3 neon pulseaudio selin
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
RDEPEND=">=app-text/hunspell-1.2:=
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7

View File

@ -15,7 +15,7 @@
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v4,
# and so ebuilds inheriting this eclass do not need to inherit that.
case ${EAPI} in
@ -23,12 +23,11 @@ case ${EAPI} in
die "EAPI=${EAPI} not supported"
;;
5)
# not needed for EAPI6 and above
inherit multilib
;;
esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v3
inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
@ -72,13 +71,14 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v3
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug ffmpeg +gstreamer gstreamer-0 +jemalloc3 neon pulseaudio selinux startup-notification system-cairo
system-icu system-jpeg system-libevent system-sqlite system-libvpx"
system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
# media-libs/libcanberra is dlopen'ed rather than linked
RDEPEND=">=app-text/hunspell-1.2
RDEPEND=">=app-text/hunspell-1.2:=
dev-libs/atk
dev-libs/expat
>=x11-libs/cairo-1.10[X]
@ -89,6 +89,7 @@ RDEPEND=">=app-text/hunspell-1.2
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
media-libs/libcanberra:*[pulseaudio?]
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
@ -119,11 +120,20 @@ RDEPEND=">=app-text/hunspell-1.2
system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-51.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( =dev-libs/libevent-2.0*:0= )
system-libevent? ( >=dev-libs/libevent-2.0:0= )
system-sqlite? ( >=dev-db/sqlite-3.9.1:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )
system-harfbuzz? ( >=media-libs/harfbuzz-1.1.3:0=[graphite,icu] >=media-gfx/graphite2-1.3.8 )
"
if [[ ${PV/45.0*/} == "" ]]; then
RDEPEND+="
system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )"
else
# 45.1.0 and above bumped the libvpx requirement
RDEPEND+="
system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
IUSE+=" +gtk3"
@ -180,8 +190,11 @@ DEPEND="app-arch/zip
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# only one of gstreamer and gstreamer-0 can be enabled at a time, so set REQUIRED_USE to signify this
REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
# only one of gstreamer and gstreamer-0 can be enabled at a time, so set REQUIRED_USE to signify this.
# also force system-icu if system-harfbuzz is set to avoid any potential ABI issues
REQUIRED_USE="
?? ( gstreamer gstreamer-0 )
system-harfbuzz? ( system-icu )"
# only one of gtk3 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
@ -205,6 +218,19 @@ REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
# }
mozconfig_config() {
# Migrated from mozcoreconf-v3
mozconfig_annotate 'more disable_update_strip' \
--disable-pedantic \
--disable-installer \
--disable-strip-libs
if [[ ${PN} != seamonkey ]]; then
mozconfig_annotate 'basic_profile' \
--disable-profilelocking \
--enable-single-profile \
--disable-profilesharing
fi
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
@ -327,6 +353,8 @@ mozconfig_config() {
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_with system-libvpx
mozconfig_use_with system-harfbuzz
mozconfig_use_with system-harfbuzz system-graphite2
# Modifications to better support ARM, bug 553364
if use neon ; then
@ -344,3 +372,44 @@ mozconfig_config() {
fi
fi
}
# @FUNCTION: mozconfig_install_prefs
# @DESCRIPTION:
# Set preferences into the prefs.js file specified as a parameter to
# the function. This sets both some common prefs to all mozilla
# packages, and any prefs that may relate to the use flags administered
# by mozconfig_config().
#
# Call this within src_install() phase, after copying the template
# prefs file (if any) from ${FILESDIR}
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_install() {
# cp "${FILESDIR}"/gentoo-default-prefs.js \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
# || die
#
# mozconfig_install_prefs \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
#
# ...
# }
mozconfig_install_prefs() {
local prefs_file="${1}"
einfo "Adding prefs from mozconfig to ${prefs_file}"
# set dictionary path, to use system hunspell
echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
>>"${prefs_file}" || die
# force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
if use system-harfbuzz ; then
echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
>>"${prefs_file}" || die
fi
}

View File

@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozconfig-v6.44.eclass
# @ECLASS: mozconfig-v6.46.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
@ -18,12 +18,17 @@
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
case ${EAPI} in
0|1|2|3|4) die "EAPI=${EAPI} not supported"
0|1|2|3|4)
die "EAPI=${EAPI} not supported"
;;
5)
inherit multilib
;;
esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
@ -54,6 +59,19 @@ esac
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk2-only support via IUSE="gtk2".
#
# Note that this option conflicts directly with MOZCONFIG_OPTIONAL_GTK3, both
# variables cannot be set at the same time and this variable will be ignored if
# MOZCONFIG_OPTIONAL_GTK3 is set.
#
# Leave the variable UNSET if gtk2-only support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
@ -65,22 +83,21 @@ esac
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug ffmpeg +gstreamer gstreamer-0 +jemalloc3 neon pulseaudio selinux startup-notification system-cairo
system-icu system-jpeg system-libevent system-sqlite system-libvpx"
IUSE="${IUSE} dbus debug +jemalloc neon pulseaudio selinux +skia startup-notification system-cairo
system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2
RDEPEND=">=app-text/hunspell-1.2:=
dev-libs/atk
dev-libs/expat
>=dev-libs/libevent-1.4.7
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.17:0=[apng]
>=media-libs/libpng-1.6.21:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
@ -93,17 +110,7 @@ RDEPEND=">=app-text/hunspell-1.2
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
ffmpeg? ( virtual/ffmpeg )
gstreamer? (
>=media-libs/gstreamer-1.4.5:1.0
>=media-libs/gst-plugins-base-1.4.5:1.0
>=media-libs/gst-plugins-good-1.4.5:1.0
>=media-plugins/gst-plugins-libav-1.4.5:1.0
)
gstreamer-0? (
>=media-libs/gstreamer-0.10.25:0.10
media-plugins/gst-plugins-meta:0.10[ffmpeg]
)
virtual/ffmpeg
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
@ -112,14 +119,16 @@ RDEPEND=">=app-text/hunspell-1.2
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-51.1:= )
system-icu? ( >=dev-libs/icu-56.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( =dev-libs/libevent-2.0* )
system-sqlite? ( >=dev-db/sqlite-3.9.1:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.3.0:0=[postproc] )
system-libevent? ( >=dev-libs/libevent-2.0:0= )
system-sqlite? ( >=dev-db/sqlite-3.13.0:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
system-harfbuzz? ( >=media-libs/harfbuzz-1.2.6:0=[graphite,icu] >=media-gfx/graphite2-1.3.8 )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
MOZCONFIG_OPTIONAL_GTK2ONLY=
if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
IUSE+=" +gtk3"
else
@ -127,6 +136,14 @@ if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
fi
RDEPEND+="
gtk3? ( >=x11-libs/gtk+-3.4.0:3 )"
elif [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_GTK2ONLY} = "enabled" ]]; then
IUSE+=" +gtk2"
else
IUSE+=" gtk2"
fi
RDEPEND+="
!gtk2? ( >=x11-libs/gtk+-3.4.0:3 )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
inherit qmake-utils
@ -170,18 +187,24 @@ fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
sys-apps/findutils
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# only one of gstreamer and gstreamer-0 can be enabled at a time, so set REQUIRED_USE to signify this
REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
# force system-icu if system-harfbuzz is selected, to avoid potential ABI issues
REQUIRED_USE="
system-harfbuzz? ( system-icu )"
# only one of gtk3 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
REQUIRED_USE+=" ?? ( gtk3 qt5 )"
# only one of gtk2 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
REQUIRED_USE+=" ?? ( gtk2 qt5 )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
@ -189,7 +212,7 @@ REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
#
# Example:
#
# inherit mozconfig-v5.33
# inherit mozconfig-v6.46
#
# src_configure() {
# mozconfig_init
@ -203,8 +226,6 @@ mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--enable-pango \
--enable-svg \
--with-system-bz2
if has bindist ${IUSE}; then
@ -239,20 +260,16 @@ mozconfig_config() {
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
# These are forced-on for webm support
mozconfig_annotate 'required' --enable-ogg
mozconfig_annotate 'required' --enable-wave
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
if use system-libevent; then
mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
fi
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
@ -263,7 +280,7 @@ mozconfig_config() {
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate 'Gentoo default' --disable-skia
mozconfig_use_enable skia
mozconfig_annotate '' --disable-gconf
mozconfig_annotate '' --with-intl-api
@ -276,6 +293,13 @@ mozconfig_config() {
toolkit_comment="gtk3 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if ! use gtk2 ; then
toolkit="cairo-gtk3"
else
toolkit_comment="gtk2 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
if use qt5; then
toolkit="cairo-qt"
@ -295,26 +319,19 @@ mozconfig_config() {
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc3; then
# We must force-enable jemalloc 3 via .mozconfig
echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-jemalloc
if use elibc_glibc && use jemalloc; then
# We must force-enable jemalloc 4 via .mozconfig
echo "export MOZ_JEMALLOC4=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-replace-malloc
fi
mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
# Instead of the standard --build= and --host=, mozilla uses --host instead
# of --build, and --target intstead of --host.
# Note, mozilla also has --build but it does not do what you think it does.
# Set both --target and --host as mozilla uses python to guess values otherwise
mozconfig_annotate '' --target="${CHOST}"
mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
use ffmpeg || mozconfig_annotate '-ffmpeg' --disable-ffmpeg
if use gstreamer ; then
use ffmpeg && einfo "${PN} will not use ffmpeg unless gstreamer:1.0 is not available at runtime"
mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
elif use gstreamer-0 ; then
use ffmpeg && einfo "${PN} will not use ffmpeg unless gstreamer:0.10 is not available at runtime"
mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
else
mozconfig_annotate '' --disable-gstreamer
fi
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
@ -322,6 +339,8 @@ mozconfig_config() {
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_with system-libvpx
mozconfig_use_with system-harfbuzz
mozconfig_use_with system-harfbuzz system-graphite2
# Modifications to better support ARM, bug 553364
if use neon ; then
@ -339,3 +358,52 @@ mozconfig_config() {
fi
fi
}
# @FUNCTION: mozconfig_install_prefs
# @DESCRIPTION:
# Set preferences into the prefs.js file specified as a parameter to
# the function. This sets both some common prefs to all mozilla
# packages, and any prefs that may relate to the use flags administered
# by mozconfig_config().
#
# Call this within src_install() phase, after copying the template
# prefs file (if any) from ${FILESDIR}
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_install() {
# cp "${FILESDIR}"/gentoo-default-prefs.js \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
# || die
#
# mozconfig_install_prefs \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
#
# ...
# }
mozconfig_install_prefs() {
local prefs_file="${1}"
einfo "Adding prefs from mozconfig to ${prefs_file}"
# set dictionary path, to use system hunspell
echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
>>"${prefs_file}" || die
# force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
if use system-harfbuzz ; then
echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
>>"${prefs_file}" || die
fi
# force cairo as the canvas renderer if USE=skia is disabled
if ! use skia ; then
echo "lockPref(\"gfx.canvas.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
echo "lockPref(\"gfx.content.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
fi
}

View File

@ -0,0 +1,415 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozconfig-v6.46.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
case ${EAPI} in
0|1|2|3|4)
die "EAPI=${EAPI} not supported"
;;
5)
inherit multilib
;;
esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# deterministic jit support via IUSE="jit". The upstream default will be used
# otherwise, which is generally to enable jit unless support for the platform
# is missing.
#
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk3 support via IUSE="gtk3". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if gtk3 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk2-only support via IUSE="gtk2".
#
# Note that this option conflicts directly with MOZCONFIG_OPTIONAL_GTK3, both
# variables cannot be set at the same time and this variable will be ignored if
# MOZCONFIG_OPTIONAL_GTK3 is set.
#
# Leave the variable UNSET if gtk2-only support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional qt5 support via IUSE="qt5". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if qt5 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug +jemalloc neon pulseaudio selinux +skia startup-notification system-cairo
system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2:=
dev-libs/atk
dev-libs/expat
>=x11-libs/cairo-1.10[X]
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.25:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
virtual/ffmpeg
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-56.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( >=dev-libs/libevent-2.0:0= )
system-sqlite? ( >=dev-db/sqlite-3.14.1:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
system-harfbuzz? ( >=media-libs/harfbuzz-1.2.6:0=[graphite,icu] >=media-gfx/graphite2-1.3.8 )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
MOZCONFIG_OPTIONAL_GTK2ONLY=
if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
IUSE+=" +gtk3"
else
IUSE+=" gtk3"
fi
RDEPEND+="
gtk3? ( >=x11-libs/gtk+-3.4.0:3 )
!gtk3? ( >=x11-libs/gtk+-2.18:2 )"
elif [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_GTK2ONLY} = "enabled" ]]; then
IUSE+=" +gtk2"
else
IUSE+=" gtk2"
fi
RDEPEND+="
gtk2? ( >=x11-libs/gtk+-2.18:2 )
!gtk2? ( >=x11-libs/gtk+-3.4.0:3 )"
else
RDEPEND+="
>=x11-libs/gtk+-2.18:2"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
inherit qmake-utils
if [[ ${MOZCONFIG_OPTIONAL_QT5} = "enabled" ]]; then
IUSE+=" +qt5"
else
IUSE+=" qt5"
fi
RDEPEND+="
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtnetwork:5
dev-qt/qtprintsupport:5
dev-qt/qtwidgets:5
dev-qt/qtxml:5
dev-qt/qtdeclarative:5
)"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? (
kernel_linux? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-misc/networkmanager )
)"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
sys-apps/findutils
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# force system-icu if system-harfbuzz is selected, to avoid potential ABI issues
REQUIRED_USE="
system-harfbuzz? ( system-icu )"
# only one of gtk3 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
REQUIRED_USE+=" ?? ( gtk3 qt5 )"
# only one of gtk2 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
REQUIRED_USE+=" ?? ( gtk2 qt5 )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--with-system-bz2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
# Enable position independent executables
mozconfig_annotate 'enabled by Gentoo' --enable-pie
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use kernel_linux && use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
if use system-libevent; then
mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
fi
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_use_enable skia
mozconfig_annotate '' --disable-gconf
mozconfig_annotate '' --with-intl-api
# default toolkit is cairo-gtk2, optional use flags can change this
local toolkit="cairo-gtk2"
local toolkit_comment=""
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
if use gtk3; then
toolkit="cairo-gtk3"
toolkit_comment="gtk3 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if ! use gtk2 ; then
toolkit="cairo-gtk3"
else
toolkit_comment="gtk2 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
if use qt5; then
toolkit="cairo-qt"
toolkit_comment="qt5 use flag"
# need to specify these vars because the qt5 versions are not found otherwise,
# and setting --with-qtdir overrides the pkg-config include dirs
local i
for i in qmake moc rcc; do
echo "export HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \
>> "${S}"/.mozconfig || die
done
echo 'unset QTDIR' >> "${S}"/.mozconfig || die
mozconfig_annotate '+qt5' --disable-gio
fi
fi
mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit}
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc; then
# We must force-enable jemalloc 4 via .mozconfig
echo "export MOZ_JEMALLOC4=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-replace-malloc
fi
# Instead of the standard --build= and --host=, mozilla uses --host instead
# of --build, and --target intstead of --host.
# Note, mozilla also has --build but it does not do what you think it does.
# Set both --target and --host as mozilla uses python to guess values otherwise
mozconfig_annotate '' --target="${CHOST}"
mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_with system-libvpx
mozconfig_use_with system-harfbuzz
mozconfig_use_with system-harfbuzz system-graphite2
# Modifications to better support ARM, bug 553364
if use neon ; then
mozconfig_annotate '' --with-fpu=neon
mozconfig_annotate '' --with-thumb=yes
mozconfig_annotate '' --with-thumb-interwork=no
fi
if [[ ${CHOST} == armv* ]] ; then
mozconfig_annotate '' --with-float-abi=hard
mozconfig_annotate '' --enable-skia
if ! use system-libvpx ; then
sed -i -e "s|softfp|hard|" \
"${S}"/media/libvpx/moz.build
fi
fi
}
# @FUNCTION: mozconfig_install_prefs
# @DESCRIPTION:
# Set preferences into the prefs.js file specified as a parameter to
# the function. This sets both some common prefs to all mozilla
# packages, and any prefs that may relate to the use flags administered
# by mozconfig_config().
#
# Call this within src_install() phase, after copying the template
# prefs file (if any) from ${FILESDIR}
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_install() {
# cp "${FILESDIR}"/gentoo-default-prefs.js \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
# || die
#
# mozconfig_install_prefs \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
#
# ...
# }
mozconfig_install_prefs() {
local prefs_file="${1}"
einfo "Adding prefs from mozconfig to ${prefs_file}"
# set dictionary path, to use system hunspell
echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
>>"${prefs_file}" || die
# force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
if use system-harfbuzz ; then
echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
>>"${prefs_file}" || die
fi
# force cairo as the canvas renderer if USE=skia is disabled
if ! use skia ; then
echo "lockPref(\"gfx.canvas.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
echo "lockPref(\"gfx.content.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
fi
}

View File

@ -0,0 +1,265 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# @ECLASS: mozcoreconf-v4.eclass
# @MAINTAINER:
# Mozilla team <mozilla@gentoo.org>
# @BLURB: core options and configuration functions for mozilla
# @DESCRIPTION:
#
# inherit mozconfig-v6.* or above for mozilla configuration support
# @ECLASS-VARIABLE: MOZILLA_FIVE_HOME
# @DESCRIPTION:
# This is an eclass-generated variable that defines the rpath that the mozilla
# product will be installed in. Read-only
if [[ ! ${_MOZCORECONF} ]]; then
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE='ncurses,sqlite,ssl,threads'
inherit multilib toolchain-funcs flag-o-matic python-any-r1 versionator
IUSE="${IUSE} custom-cflags custom-optimization"
DEPEND="virtual/pkgconfig
${PYTHON_DEPS}"
# @FUNCTION: mozconfig_annotate
# @DESCRIPTION:
# add an annotated line to .mozconfig
#
# Example:
# mozconfig_annotate "building on ultrasparc" --enable-js-ultrasparc
# => ac_add_options --enable-js-ultrasparc # building on ultrasparc
mozconfig_annotate() {
declare reason=$1 x ; shift
[[ $# -gt 0 ]] || die "mozconfig_annotate missing flags for ${reason}\!"
for x in ${*}; do
echo "ac_add_options ${x} # ${reason}" >>.mozconfig
done
}
# @FUNCTION: mozconfig_use_enable
# @DESCRIPTION:
# add a line to .mozconfig based on a USE-flag
#
# Example:
# mozconfig_use_enable truetype freetype2
# => ac_add_options --enable-freetype2 # +truetype
mozconfig_use_enable() {
declare flag=$(use_enable "$@")
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
# @FUNCTION mozconfig_use_with
# @DESCRIPTION
# add a line to .mozconfig based on a USE-flag
#
# Example:
# mozconfig_use_with kerberos gss-api /usr/$(get_libdir)
# => ac_add_options --with-gss-api=/usr/lib # +kerberos
mozconfig_use_with() {
declare flag=$(use_with "$@")
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
# @FUNCTION mozconfig_use_extension
# @DESCRIPTION
# enable or disable an extension based on a USE-flag
#
# Example:
# mozconfig_use_extension gnome gnomevfs
# => ac_add_options --enable-extensions=gnomevfs
mozconfig_use_extension() {
declare minus=$(use $1 || echo -)
mozconfig_annotate "${minus:-+}$1" --enable-extensions=${minus}${2}
}
moz_pkgsetup() {
# Ensure we use C locale when building
export LANG="C"
export LC_ALL="C"
export LC_MESSAGES="C"
export LC_CTYPE="C"
# Ensure we use correct toolchain
export HOST_CC="$(tc-getBUILD_CC)"
export HOST_CXX="$(tc-getBUILD_CXX)"
tc-export CC CXX LD PKG_CONFIG
# Ensure that we have a sane build enviroment
export MOZILLA_CLIENT=1
export BUILD_OPT=1
export NO_STATIC_LIB=1
export USE_PTHREADS=1
export ALDFLAGS=${LDFLAGS}
# ensure MOZCONFIG is not defined
eval unset MOZCONFIG
# set MOZILLA_FIVE_HOME
export MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
# nested configure scripts in mozilla products generate unrecognized options
# false positives when toplevel configure passes downwards.
export QA_CONFIGURE_OPTIONS=".*"
if [[ $(gcc-major-version) -eq 3 ]]; then
ewarn "Unsupported compiler detected, DO NOT file bugs for"
ewarn "outdated compilers. Bugs opened with gcc-3 will be closed"
ewarn "invalid."
fi
python-any-r1_pkg_setup
}
# @FUNCTION: mozconfig_init
# @DESCRIPTION:
# Initialize mozilla configuration and populate with core settings.
# This should be called in src_configure before any other mozconfig_* functions.
mozconfig_init() {
declare enable_optimize pango_version myext x
declare XUL=$([[ ${PN} == xulrunner ]] && echo true || echo false)
declare FF=$([[ ${PN} == firefox ]] && echo true || echo false)
declare SM=$([[ ${PN} == seamonkey ]] && echo true || echo false)
declare TB=$([[ ${PN} == thunderbird ]] && echo true || echo false)
####################################
#
# Setup the initial .mozconfig
# See http://www.mozilla.org/build/configure-build.html
#
####################################
case ${PN} in
*xulrunner)
cp xulrunner/config/mozconfig .mozconfig \
|| die "cp xulrunner/config/mozconfig failed" ;;
*firefox)
cp browser/config/mozconfig .mozconfig \
|| die "cp browser/config/mozconfig failed" ;;
seamonkey)
# Must create the initial mozconfig to enable application
: >.mozconfig || die "initial mozconfig creation failed"
mozconfig_annotate "" --enable-application=suite ;;
*thunderbird)
# Must create the initial mozconfig to enable application
: >.mozconfig || die "initial mozconfig creation failed"
mozconfig_annotate "" --enable-application=mail ;;
esac
####################################
#
# CFLAGS setup and ARCH support
#
####################################
# Set optimization level
if [[ ${ARCH} == hppa ]]; then
mozconfig_annotate "more than -O0 causes a segfault on hppa" --enable-optimize=-O0
elif [[ ${ARCH} == x86 ]]; then
mozconfig_annotate "less then -O2 causes a segfault on x86" --enable-optimize=-O2
elif use custom-optimization || [[ ${ARCH} =~ (alpha|ia64) ]]; then
# Set optimization level based on CFLAGS
if is-flag -O0; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O0
elif [[ ${ARCH} == ppc ]] && has_version '>=sys-libs/glibc-2.8'; then
mozconfig_annotate "more than -O1 segfaults on ppc with glibc-2.8" --enable-optimize=-O1
elif is-flag -O4; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O4
elif is-flag -O3; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O3
elif is-flag -O1; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O1
elif is-flag -Os; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-Os
else
mozconfig_annotate "Gentoo's default optimization" --enable-optimize=-O2
fi
else
# Enable Mozilla's default
mozconfig_annotate "mozilla default" --enable-optimize
fi
# Strip optimization so it does not end up in compile string
filter-flags '-O*'
# Strip over-aggressive CFLAGS
use custom-cflags || strip-flags
# Additional ARCH support
case "${ARCH}" in
alpha)
# Historically we have needed to add -fPIC manually for 64-bit.
# Additionally, alpha should *always* build with -mieee for correct math
# operation
append-flags -fPIC -mieee
;;
ia64)
# Historically we have needed to add this manually for 64-bit
append-flags -fPIC
;;
ppc64)
append-flags -fPIC -mminimal-toc
;;
esac
# We need to append flags for gcc-6 support
if [[ $(gcc-major-version) -ge 6 ]]; then
append-cxxflags -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2
fi
# Go a little faster; use less RAM
append-flags "$MAKEEDIT_FLAGS"
# Use the MOZILLA_FIVE_HOME for the rpath
append-ldflags -Wl,-rpath="${MOZILLA_FIVE_HOME}",--enable-new-dtags
# Set MOZILLA_FIVE_HOME in mozconfig
mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
####################################
#
# mozconfig setup
#
####################################
mozconfig_annotate disable_update_strip \
--disable-updater \
--disable-strip \
--disable-install-strip
# jemalloc won't build with older glibc
! has_version ">=sys-libs/glibc-2.4" && mozconfig_annotate "we have old glibc" --disable-jemalloc
}
# @FUNCTION: mozconfig_final
# @DESCRIPTION:
# Display a table describing all configuration options paired
# with reasons, then clean up extensions list.
# This should be called in src_configure at the end of all other mozconfig_* functions.
mozconfig_final() {
declare ac opt hash reason
echo
echo "=========================================================="
echo "Building ${PF} with the following configuration"
grep ^ac_add_options .mozconfig | while read ac opt hash reason; do
[[ -z ${hash} || ${hash} == \# ]] \
|| die "error reading mozconfig: ${ac} ${opt} ${hash} ${reason}"
printf " %-30s %s\n" "${opt}" "${reason:-mozilla.org default}"
done
echo "=========================================================="
echo
# Resolve multiple --enable-extensions down to one
declare exts=$(sed -n 's/^ac_add_options --enable-extensions=\([^ ]*\).*/\1/p' \
.mozconfig | xargs)
sed -i '/^ac_add_options --enable-extensions/d' .mozconfig
echo "ac_add_options --enable-extensions=${exts// /,}" >> .mozconfig
}
_MOZCORECONF=1
fi

View File

@ -1,123 +0,0 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
inherit nsplugins multilib
if [[ ${PN: -4} != "-bin" ]] ; then
IUSE="moznopango"
fi
# update_mozilla_launcher_symlinks
# --------------------------------
# Create or remove the following symlinks in /usr/bin:
#
# firefox -> firefox-bin
# thunderbird -> thunderbird-bin
# mozilla -> mozilla-bin
# sunbird -> sunbird-bin
# seamonkey -> seamonkey-bin
#
# The symlinks are removed if they're found to be dangling. They are
# created according to the following rules:
#
# - If there's a -bin symlink in /usr/bin, and no corresponding
# non-bin symlink, then create one.
#
# - Can't do this in src_install otherwise it overwrites the one
# for the non-bin package.
#
# - Link to the -bin symlink so it's easier to detect when to
# remove the symlink.
#
# NOTE: This eclass does *not* manage the launcher stubs in /usr/bin except
# when a -bin package is installed and the corresponding from-source
# package is not installed. The usual stubs are actually installed in
# src_install so they are included in the package inventory.
#
update_mozilla_launcher_symlinks() {
local f browsers="mozilla firefox thunderbird sunbird seamonkey"
cd "${ROOT}"/usr/bin
# Remove launcher symlinks that no longer apply
for f in ${browsers}; do
if [[ -L ${f} && ! -f ${f} ]]; then
einfo "Removing dangling ${f} launcher"
rm -f ${f}
fi
done
# Create new symlinks
for f in ${browsers}; do
if [[ -e ${f}-bin && ! -e ${f} ]]; then
einfo "Adding link from ${f}-bin to ${f}"
ln -s ${f}-bin ${f}
fi
done
}
# install_mozilla_launcher_stub name libdir
# -----------------------------------------
# Install a stub called /usr/bin/$name that executes mozilla-launcher
#
# Note: $PLUGINS_DIR comes from nsplugins (specifically the deprecated section).
#
install_mozilla_launcher_stub() {
[[ -n $2 ]] || die "install_launcher_stub requires two arguments"
declare name=$1
declare libdir=$2
# If we use xulrunner, the name of the binary should be the same
if [[ ${name: -3} == "xul" ]]; then
name=${name/xul/}
declare appname=xulrunner
declare xulparams="export XUL_PARAMS=${libdir}/application.ini"
declare libdir="/usr/$(get_libdir)/xulrunner-1.9"
else
declare appname=${name}
fi
dodir /usr/bin
if [[ ${PN: -4} == "-bin" ]] || ! use moznopango; then
cat <<EOF >"${D}"/usr/bin/${name}
#!/bin/sh
#
# Stub script to run mozilla-launcher. We used to use a symlink here
# but OOo brokenness makes it necessary to use a stub instead:
# https://bugs.gentoo.org/show_bug.cgi?id=78890
export MOZILLA_LAUNCHER=${appname}
export MOZILLA_LIBDIR=${libdir}
export MOZ_PLUGIN_PATH=\${MOZ_PLUGIN_PATH:-/usr/$(get_libdir)/$PLUGINS_DIR}
${xulparams}
exec /usr/libexec/mozilla-launcher "\$@"
EOF
else
cat <<EOF >"${D}"/usr/bin/${name}
#!/bin/sh
#
# Stub script to run mozilla-launcher. We used to use a symlink here
# but OOo brokenness makes it necessary to use a stub instead:
# https://bugs.gentoo.org/show_bug.cgi?id=78890
export MOZILLA_LAUNCHER=${appname}
export MOZILLA_LIBDIR=${libdir}
export MOZ_PLUGIN_PATH=\${MOZ_PLUGIN_PATH:-/usr/$(get_libdir)/$PLUGINS_DIR}
export MOZ_DISABLE_PANGO=1
${xulparams}
exec /usr/libexec/mozilla-launcher "\$@"
EOF
fi
chmod 0755 "${D}"/usr/bin/${name}
}
warn_mozilla_launcher_stub() {
elog "Not all locales support the disabling of pango."
elog "If your locale does not support disabling pango,"
elog "please open a bug report on https://bugs.gentoo.org"
elog "Then we can filter around the problem with those"
elog "specific locales."
}

View File

@ -0,0 +1,376 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: mozlinguas-v2.eclass
# @MAINTAINER:
# mozilla@gentoo.org
# @AUTHOR:
# Nirbheek Chauhan <nirbheek@gentoo.org>
# Ian Stakenvicius <axs@gentoo.org>
# @BLURB: Handle language packs for mozilla products
# @DESCRIPTION:
# Sets IUSE according to MOZ_LANGS (language packs available). Also exports
# src_unpack, src_compile and src_install for use in ebuilds, and provides
# supporting functions for langpack generation and installation.
inherit mozextension
case "${EAPI:-0}" in
0|1)
die "EAPI ${EAPI:-0} does not support the '->' SRC_URI operator";;
2|3|4|5|6)
EXPORT_FUNCTIONS src_unpack src_compile src_install;;
*)
die "EAPI ${EAPI} is not supported, contact eclass maintainers";;
esac
# @ECLASS-VARIABLE: MOZ_LANGS
# @DESCRIPTION:
# Array containing the list of language pack xpis available for
# this release. The list can be updated with scripts/get_langs.sh from the
# mozilla overlay.
: ${MOZ_LANGS:=()}
# @ECLASS-VARIABLE: MOZ_PV
# @DESCRIPTION:
# Ebuild package version converted to equivalent upstream version.
# Defaults to ${PV}, and should be overridden for alphas, betas, and RCs
: ${MOZ_PV:="${PV}"}
# @ECLASS-VARIABLE: MOZ_PN
# @DESCRIPTION:
# Ebuild package name converted to equivalent upstream name.
# Defaults to ${PN}, and should be overridden for binary ebuilds.
: ${MOZ_PN:="${PN}"}
# @ECLASS-VARIABLE: MOZ_P
# @DESCRIPTION:
# Ebuild package name + version converted to upstream equivalent.
# Defaults to ${MOZ_PN}-${MOZ_PV}
: ${MOZ_P:="${MOZ_PN}-${MOZ_PV}"}
# @ECLASS-VARIABLE: MOZ_FTP_URI
# @DESCRIPTION:
# The ftp URI prefix for the release tarballs and language packs.
: ${MOZ_FTP_URI:=""}
# @ECLASS-VARIABLE: MOZ_HTTP_URI
# @DESCRIPTION:
# The http URI prefix for the release tarballs and language packs.
: ${MOZ_HTTP_URI:=""}
# @ECLASS-VARIABLE: MOZ_LANGPACK_HTTP_URI
# @DESCRIPTION:
# An alternative http URI if it differs from official mozilla URI.
# Defaults to whatever MOZ_HTTP_URI was set to.
: ${MOZ_LANGPACK_HTTP_URI:=${MOZ_HTTP_URI}}
# @ECLASS-VARIABLE: MOZ_LANGPACK_PREFIX
# @DESCRIPTION:
# The relative path till the lang code in the langpack file URI.
# Defaults to ${MOZ_PV}/linux-i686/xpi/
: ${MOZ_LANGPACK_PREFIX:="${MOZ_PV}/linux-i686/xpi/"}
# @ECLASS-VARIABLE: MOZ_LANGPACK_SUFFIX
# @DESCRIPTION:
# The suffix after the lang code in the langpack file URI.
# Defaults to '.xpi'
: ${MOZ_LANGPACK_SUFFIX:=".xpi"}
# @ECLASS-VARIABLE: MOZ_LANGPACK_UNOFFICIAL
# @DESCRIPTION:
# The status of the langpack, used to differentiate within
# Manifests and on Gentoo mirrors as to when the langpacks are
# generated officially by Mozilla or if they were generated
# unofficially by others (ie the Gentoo mozilla team). When
# this var is set, the distfile will have a .unofficial.xpi
# suffix.
: ${MOZ_LANGPACK_UNOFFICIAL:=""}
# @ECLASS-VARIABLE: MOZ_GENERATE_LANGPACKS
# @DESCRIPTION:
# This flag specifies whether or not the langpacks should be
# generated directly during the build process, rather than
# being downloaded and installed from upstream pre-built
# extensions. Primarily it supports pre-release builds.
# Defaults to empty.
: ${MOZ_GENERATE_LANGPACKS:=""}
# @ECLASS-VARIABLE: MOZ_L10N_SOURCEDIR
# @DESCRIPTION:
# The path that l10n sources can be found at, once unpacked.
# Defaults to ${WORKDIR}/l10n-sources
: ${MOZ_L10N_SOURCEDIR:="${WORKDIR}/l10n-sources"}
# @ECLASS-VARIABLE: MOZ_L10N_URI_PREFIX
# @DESCRIPTION:
# The full URI prefix of the distfile for each l10n locale. The
# AB_CD and MOZ_L10N_URI_SUFFIX will be appended to this to complete the
# SRC_URI when MOZ_GENERATE_LANGPACKS is set. If empty, nothing will
# be added to SRC_URI.
# Defaults to empty.
: ${MOZ_L10N_URI_PREFIX:=""}
# @ECLASS-VARIABLE: MOZ_L10N_URI_SUFFIX
# @DESCRIPTION:
# The suffix of l10n source distfiles.
# Defaults to '.tar.xz'
: ${MOZ_L10N_URI_SUFFIX:=".tar.xz"}
# @ECLASS-VARIABLE: MOZ_FORCE_UPSTREAM_L10N
# @DESCRIPTION:
# Set this to use upstream langpaks even if the package normally
# shouldn't (ie it is an alpha or beta package)
: ${MOZ_FORCE_UPSTREAM_L10N:=""}
# @ECLASS-VARIABLE: MOZ_TOO_REGIONALIZED_FOR_L10N
# @INTERNAL
# @DESCRIPTION:
# Upstream identifiers that should not contain region subtags in L10N
MOZ_TOO_REGIONALIZED_FOR_L10N=( fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO nn-NO pa-IN sv-SE )
# Add l10n_* to IUSE according to available language packs
# No language packs for alphas and betas
if ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]] ; then
if ! [[ ${PV} =~ alpha|beta ]] || { [[ ${PN} == seamonkey ]] && ! [[ ${PV} =~ alpha ]] ; } || [[ -n ${MOZ_FORCE_UPSTREAM_L10N} ]] ; then
[[ -z ${MOZ_FTP_URI} ]] && [[ -z ${MOZ_LANGPACK_HTTP_URI} ]] && die "No URI set to download langpacks, please set one of MOZ_{FTP,HTTP_LANGPACK}_URI"
for x in "${MOZ_LANGS[@]}" ; do
# en and en_US are handled internally
if [[ ${x} == en ]] || [[ ${x} == en-US ]]; then
continue
fi
# strip region subtag if $x is in the list
if has ${x} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then
xflag=${x%%-*}
else
xflag=${x}
fi
SRC_URI+=" l10n_${xflag/[_@]/-}? ("
[[ -n ${MOZ_FTP_URI} ]] && SRC_URI+="
${MOZ_FTP_URI}/${MOZ_LANGPACK_PREFIX}${x}${MOZ_LANGPACK_SUFFIX} -> ${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi"
[[ -n ${MOZ_LANGPACK_HTTP_URI} ]] && SRC_URI+="
${MOZ_LANGPACK_HTTP_URI}/${MOZ_LANGPACK_PREFIX}${x}${MOZ_LANGPACK_SUFFIX} -> ${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi"
SRC_URI+=" )"
IUSE+=" l10n_${xflag/[_@]/-}"
# We used to do some magic if specific/generic locales were missing, but
# we stopped doing that due to bug 325195.
done
fi
else
for x in "${MOZ_LANGS[@]}" ; do
# en and en_US are handled internally
if [[ ${x} == en ]] || [[ ${x} == en-US ]]; then
continue
fi
# strip region subtag if $x is in the list
if has ${x} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then
xflag=${x%%-*}
else
xflag=${x}
fi
# Do NOT grab l10n sources from hg tip at this time, since it is a moving target
# if [[ ${PV} =~ alpha ]]; then
# # Please note that this URI is not deterministic - digest breakage could occur
# SRC_URI+=" l10n_${xflag/[_@]/-}? ( http://hg.mozilla.org/releases/l10n/mozilla-aurora/ach/archive/tip.tar.bz2 -> ${MOZ_P}-l10n-${x}.tar.bz2 )"
# elif [[ ${PV} =~ beta ]] && ! [[ ${PN} == seamonkey ]]; then
# # Please note that this URI is not deterministic - digest breakage could occur
# SRC_URI+=" l10n_${xflag/[_@]/-}? ( http://hg.mozilla.org/releases/l10n/mozilla-beta/ach/archive/tip.tar.bz2 -> ${MOZ_P}-l10n-${x}.tar.bz2 )"
# elif [[ -n ${MOZ_L10N_URI_PREFIX} ]]; then
if [[ -n ${MOZ_L10N_URI_PREFIX} ]]; then
SRC_URI+=" l10n_${xflag/[_@]/-}? ( ${MOZ_L10N_URI_PREFIX}${x}${MOZ_L10N_URI_SUFFIX} )"
fi
IUSE+=" l10n_${xflag/[_@]/-}"
done
fi
unset x xflag
# @FUNCTION: mozlinguas_export
# @INTERNAL
# @DESCRIPTION:
# Generate the list of language packs called "mozlinguas"
# This list is used to unpack and install the xpi language packs
mozlinguas_export() {
if [[ ${PN} == seamonkey ]] ; then
[[ ${PV} =~ alpha ]] && ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]] && return
else
[[ ${PV} =~ alpha|beta ]] && ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]] && return
fi
local lingua lflag
mozlinguas=()
# Set mozlinguas based on the enabled l10n_* USE flags.
for lingua in "${MOZ_LANGS[@]}"; do
# strip region subtag if $x is in the list
if has ${lingua} en en-US; then
# For mozilla products, en and en_US are handled internally
continue
elif has ${lingua} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then
lflag=${lingua%%-*}
else
lflag=${lingua}
fi
use l10n_${lflag/[_@]/-} && mozlinguas+=( ${lingua} )
done
# Compatibility code - Check LINGUAS and warn if anything set there isn't enabled via l10n
for lingua in ${LINGUAS}; do
if has ${lingua//[_@]/-} en en-US; then
# For mozilla products, en and en_US are handled internally
continue
# If this language is supported by ${P},
elif has ${lingua} "${MOZ_LANGS[@]//-/_}"; then
# Warn the language is missing, if it isn't already there
has ${lingua//[_@]/-} "${mozlinguas[@]//[_@]/-}" || \
ewarn "LINGUAS value ${lingua} is not enabled using L10N use flags"
continue
# For each short lingua that isn't in MOZ_LANGS,
# We used to add *all* long MOZ_LANGS to the mozlinguas list,
# but we stopped doing that due to bug 325195.
else
:
fi
ewarn "Sorry, but ${P} does not support the ${lingua} locale"
done
}
# @FUNCTION: mozlinguas_src_unpack
# @DESCRIPTION:
# Unpack xpi language packs according to the user's LINGUAS settings
mozlinguas_src_unpack() {
local x
if ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]]; then
mozlinguas_export
for x in "${mozlinguas[@]}"; do
# FIXME: Add support for unpacking xpis to portage
xpi_unpack "${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi"
done
if [[ "${mozlinguas[*]}" != "" && "${mozlinguas[*]}" != "en" ]]; then
einfo "Selected language packs (first will be default): ${mozlinguas[*]}"
fi
fi
}
# For the phase function export
mozlinguas-v2_src_unpack() {
mozlinguas_src_unpack
}
# @FUNCTION: mozlinguas_mozconfig
# @DESCRIPTION:
# if applicable, add the necessary flag to .mozconfig to support
# the generation of locales. Note that this function requires
# mozconfig_annontate to already be declared via an inherit of
# mozconfig or mozcoreconf.
mozlinguas_mozconfig() {
if [[ -n ${MOZ_GENERATE_LANGPACKS} ]]; then
if declare -f mozconfig_annotate >/dev/null ; then
mozconfig_annotate 'for building locales' --with-l10n-base=${MOZ_L10N_SOURCEDIR}
else
die "Could not configure l10n-base, mozconfig_annotate not declared -- missing inherit?"
fi
fi
}
# @FUNCTION: mozlinguas_src_compile
# @DESCRIPTION:
# if applicable, build the selected locales.
mozlinguas_src_compile() {
if [[ -n ${MOZ_GENERATE_LANGPACKS} ]]; then
# leverage BUILD_OBJ_DIR if set otherwise assume PWD.
local x y targets=( "langpack" ) localedir="${BUILD_OBJ_DIR:-.}"
case ${PN} in
*firefox)
localedir+="/browser/locales"
;;
seamonkey)
localedir+="/suite/locales"
;;
*thunderbird)
localedir+="/mail/locales"
targets+=( "calendar-langpack" )
;;
*) die "Building locales for ${PN} is not supported."
esac
pushd "${localedir}" > /dev/null || die
mozlinguas_export
for x in "${mozlinguas[@]}"; do for y in "${targets[@]}"; do
emake ${y}-${x} LOCALE_MERGEDIR="./${y}-${x}"
done; done
popd > /dev/null || die
fi
}
# For the phase function export
mozlinguas-v2_src_compile() {
mozlinguas_src_compile
}
# @FUNCTION: mozlinguas_xpistage_langpacks
# @DESCRIPTION:
# Add extra langpacks to the xpi-stage dir for prebuilt plugins
#
# First argument is the path to the extension
# Second argument is the prefix of the source (same as first if unspecified)
# Remaining arguments are the modules in the extension that are localized
# (basename of first if unspecified)
#
# Example - installing extra langpacks for lightning:
# src_install() {
# ... # general installation steps
# mozlinguas_xpistage_langpacks \
# "${BUILD_OBJ_DIR}"/dist/xpi-stage/lightning \
# "${WORKDIR}"/lightning \
# lightning calendar
# ... # proceed with installation from the xpi-stage dir
# }
mozlinguas_xpistage_langpacks() {
local l c modpath="${1}" srcprefix="${1}" modules=( "${1##*/}" )
shift
if [[ -n ${1} ]] ; then srcprefix="${1}" ; shift ; fi
if [[ -n ${1} ]] ; then modules=( $@ ) ; fi
mozlinguas_export
mkdir -p "${modpath}/chrome" || die
for l in "${mozlinguas[@]}"; do for c in "${modules[@]}" ; do
if [[ -e "${srcprefix}-${l}/chrome/${c}-${l}" ]]; then
cp -RLp -t "${modpath}/chrome" "${srcprefix}-${l}/chrome/${c}-${l}" || die
grep "locale ${c} ${l} chrome/" "${srcprefix}-${l}/chrome.manifest" \
>>"${modpath}/chrome.manifest" || die
elif [[ -e "${srcprefix}/chrome/${c}-${l}" ]]; then
cp -RLp -t "${modpath}/chrome" "${srcprefix}/chrome/${c}-${l}" || die
grep "locale ${c} ${l} chrome/" "${srcprefix}/chrome.manifest" \
>>"${modpath}/chrome.manifest" || die
else
ewarn "Locale ${l} was not found for ${c}, skipping."
fi
done; done
}
# @FUNCTION: mozlinguas-v2_src_install
# @DESCRIPTION:
# Install xpi language packs according to the user's L10N settings
# NOTE - uses ${BUILD_OBJ_DIR} or PWD if unset, for source-generated langpacks
mozlinguas_src_install() {
local x
mozlinguas_export
if [[ -n ${MOZ_GENERATE_LANGPACKS} ]] && [[ -n ${mozlinguas[*]} ]]; then
local repopath="${WORKDIR}/${PN}-generated-langpacks"
mkdir -p "${repopath}" || die
pushd "${BUILD_OBJ_DIR:-.}"/dist/*/xpi > /dev/null || die
for x in "${mozlinguas[@]}"; do
cp "${MOZ_P}.${x}.langpack.xpi" \
"${repopath}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi" || die
xpi_unpack "${repopath}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}.xpi"
done
popd > /dev/null || die
fi
for x in "${mozlinguas[@]}"; do
xpi_install "${WORKDIR}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}"
done
}
# For the phase function export
mozlinguas-v2_src_install() {
mozlinguas_src_install
}

View File

@ -225,6 +225,20 @@ number_abis() {
echo $#
}
# @FUNCTION: get_exeext
# @DESCRIPTION:
# Returns standard executable program suffix (null, .exe, etc.)
# for the current platform identified by CHOST.
#
# Example:
# get_exeext
# Returns: null string (almost everywhere) || .exe (mingw*) || ...
get_exeext() {
case ${CHOST} in
*-cygwin*|mingw*|*-mingw*) echo ".exe";;
esac
}
# @FUNCTION: get_libname
# @USAGE: [version]
# @DESCRIPTION:
@ -238,11 +252,12 @@ get_libname() {
local libname
local ver=$1
case ${CHOST} in
*-cygwin|mingw*|*-mingw*) libname="dll";;
*-darwin*) libname="dylib";;
*-mint*) libname="irrelevant";;
hppa*-hpux*) libname="sl";;
*) libname="so";;
*-cygwin*) libname="dll.a";; # import lib
mingw*|*-mingw*) libname="dll";;
*-darwin*) libname="dylib";;
*-mint*) libname="irrelevant";;
hppa*-hpux*) libname="sl";;
*) libname="so";;
esac
if [[ -z $* ]] ; then
@ -250,6 +265,7 @@ get_libname() {
else
for ver in "$@" ; do
case ${CHOST} in
*-cygwin*) echo ".${ver}.${libname}";;
*-darwin*) echo ".${ver}.${libname}";;
*-mint*) echo ".${libname}";;
*) echo ".${libname}.${ver}";;

View File

@ -53,27 +53,60 @@ bashpid() {
sh -c 'echo ${PPID}'
}
# @FUNCTION: get_nproc
# @USAGE: [${fallback:-1}]
# @DESCRIPTION:
# Attempt to figure out the number of processing units available.
# If the value can not be determined, prints the provided fallback
# instead. If no fallback is provided, defaults to 1.
get_nproc() {
local nproc
# GNU
if type -P nproc &>/dev/null; then
nproc=$(nproc)
fi
# BSD
if [[ -z ${nproc} ]] && type -P sysctl &>/dev/null; then
nproc=$(sysctl -n hw.ncpu 2>/dev/null)
fi
# fallback to python2.6+
# note: this may fail (raise NotImplementedError)
if [[ -z ${nproc} ]] && type -P python &>/dev/null; then
nproc=$(python -c 'import multiprocessing; print(multiprocessing.cpu_count());' 2>/dev/null)
fi
if [[ -n ${nproc} ]]; then
echo "${nproc}"
else
echo "${1:-1}"
fi
}
# @FUNCTION: makeopts_jobs
# @USAGE: [${MAKEOPTS}]
# @USAGE: [${MAKEOPTS}] [${inf:-999}]
# @DESCRIPTION:
# Searches the arguments (defaults to ${MAKEOPTS}) and extracts the jobs number
# specified therein. Useful for running non-make tools in parallel too.
# i.e. if the user has MAKEOPTS=-j9, this will echo "9" -- we can't return the
# number as bash normalizes it to [0, 255]. If the flags haven't specified a
# -j flag, then "1" is shown as that is the default `make` uses. Since there's
# no way to represent infinity, we return 999 if the user has -j without a number.
# no way to represent infinity, we return ${inf} (defaults to 999) if the user
# has -j without a number.
makeopts_jobs() {
[[ $# -eq 0 ]] && set -- ${MAKEOPTS}
[[ $# -eq 0 ]] && set -- "${MAKEOPTS}"
# This assumes the first .* will be more greedy than the second .*
# since POSIX doesn't specify a non-greedy match (i.e. ".*?").
local jobs=$(echo " $* " | sed -r -n \
-e 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p' \
-e 's:.*[[:space:]](-j|--jobs)[[:space:]].*:999:p')
-e 's:.*[[:space:]](-[a-z]*j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p' \
-e "s:.*[[:space:]](-[a-z]*j|--jobs)[[:space:]].*:${2:-999}:p")
echo ${jobs:-1}
}
# @FUNCTION: makeopts_loadavg
# @USAGE: [${MAKEOPTS}]
# @USAGE: [${MAKEOPTS}] [${inf:-999}]
# @DESCRIPTION:
# Searches the arguments (defaults to ${MAKEOPTS}) and extracts the value set
# for load-average. For make and ninja based builds this will mean new jobs are
@ -81,15 +114,17 @@ makeopts_jobs() {
# get excessive due to I/O and not just due to CPU load.
# Be aware that the returned number might be a floating-point number. Test
# whether your software supports that.
# If no limit is specified or --load-average is used without a number, ${inf}
# (defaults to 999) is returned.
makeopts_loadavg() {
[[ $# -eq 0 ]] && set -- ${MAKEOPTS}
[[ $# -eq 0 ]] && set -- "${MAKEOPTS}"
# This assumes the first .* will be more greedy than the second .*
# since POSIX doesn't specify a non-greedy match (i.e. ".*?").
local lavg=$(echo " $* " | sed -r -n \
-e 's:.*[[:space:]](-l|--(load-average|max-load)[=[:space:]])[[:space:]]*([0-9]+|[0-9]+\.[0-9]+).*:\3:p' \
-e 's:.*[[:space:]](-l|--(load-average|max-load))[[:space:]].*:999:p')
# Default to 999 since the default is to not use a load limit.
echo ${lavg:-999}
-e 's:.*[[:space:]](-[a-z]*l|--(load-average|max-load)[=[:space:]])[[:space:]]*([0-9]+|[0-9]+\.[0-9]+).*:\3:p' \
-e "s:.*[[:space:]](-[a-z]*l|--(load-average|max-load))[[:space:]].*:${2:-999}:p")
# Default to ${inf} since the default is to not use a load limit.
echo ${lavg:-${2:-999}}
}
# @FUNCTION: multijob_init
@ -104,11 +139,16 @@ multijob_init() {
# Setup a pipe for children to write their pids to when they finish.
# We have to allocate two fd's because POSIX has undefined behavior
# when you open a FIFO for simultaneous read/write. #487056
# when using one single fd for both read and write. #487056
# However, opening an fd for read or write only will block until the
# opposite end is opened as well. Thus we open the first fd for both
# read and write to not block ourselve, but use it for reading only.
# The second fd really is opened for write only, as Cygwin supports
# just one single read fd per FIFO. #583962
local pipe="${T}/multijob.pipe"
mkfifo -m 600 "${pipe}"
redirect_alloc_fd mj_write_fd "${pipe}"
redirect_alloc_fd mj_read_fd "${pipe}"
redirect_alloc_fd mj_write_fd "${pipe}" '>'
rm -f "${pipe}"
# See how many children we can fork based on the user's settings.

View File

@ -26,7 +26,7 @@ EXPORT_FUNCTIONS src_unpack src_install
# @ECLASS-VARIABLE: MYSPELL_THES
# @DESCRIPTION:
# Array variable containing list of all thesarus files.
# MYSPELL_HYPH=( "file.dat" "dir/file2.idx" )
# MYSPELL_THES=( "file.dat" "dir/file2.idx" )
# Basically no extra deps needed.
# Unzip is required for .oxt libreoffice extensions
@ -64,7 +64,7 @@ myspell-r2_src_install() {
debug-print-function ${FUNCNAME} "$@"
local x target
# Following the debian directory layout here.
# DICT: /usr/share/hunspell
# THES: /usr/share/mythes

View File

@ -16,7 +16,7 @@
# the src_prepare, src_configure, src_compile, and src_install
# phase hooks.
inherit cmake-utils flag-o-matic multilib prefix eutils
inherit cmake-utils flag-o-matic multilib prefix eutils toolchain-funcs
#
# HELPER FUNCTIONS:
@ -243,6 +243,10 @@ configure_cmake_standard() {
if mysql_version_is_at_least "10.1.2" ; then
mycmakeargs+=( $(mysql-cmake_use_plugin cracklib CRACKLIB_PASSWORD_CHECK ) )
fi
# The build forces this to be defined when cross-compiling. We pass it
# all the time for simplicity and to make sure it is actually correct.
mycmakeargs+=( -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) )
else
mycmakeargs+=( $(cmake-utils_use_with extraengine FEDERATED_STORAGE_ENGINE) )
fi

View File

@ -319,12 +319,10 @@ mysql-multilib-r1_src_prepare() {
if in_iuse tokudb ; then
# Don't build bundled xz-utils
if [[ -d "${S}/storage/tokudb/ft-index" ]] ; then
rm -f "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake" || die
touch "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake" || die
echo > "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake" || die
sed -i 's/ build_lzma//' "${S}/storage/tokudb/ft-index/ft/CMakeLists.txt" || die
elif [[ -d "${S}/storage/tokudb/PerconaFT" ]] ; then
rm "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die
touch "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die
echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die
sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die
sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die
fi
@ -340,6 +338,11 @@ mysql-multilib-r1_src_prepare() {
rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga"
fi
# Remove the centos and rhel selinux policies to support mysqld_safe under SELinux
if [[ -d "${S}/support-files/SELinux" ]] ; then
echo > "${S}/support-files/SELinux/CMakeLists.txt" || die
fi
if [[ "${EAPI}x" == "5x" ]] ; then
epatch_user
else
@ -384,7 +387,6 @@ multilib_src_configure() {
-DINSTALL_MANDIR=share/man
-DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql
-DINSTALL_MYSQLSHAREDIR=share/mysql
-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test
-DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
-DINSTALL_SBINDIR=sbin
-DINSTALL_SCRIPTDIR=share/mysql/scripts
@ -402,8 +404,17 @@ multilib_src_configure() {
-DWITH_DEFAULT_FEATURE_SET=0
-DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)"
-DENABLE_STATIC_LIBS=$(usex static-libs)
# The build forces this to be defined when cross-compiling. We pass it
# all the time for simplicity and to make sure it is actually correct.
-DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
)
if use test ; then
mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test )
else
mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
fi
if in_iuse systemd ; then
mycmakeargs+=( -DWITH_SYSTEMD=$(usex systemd) )
fi
@ -537,11 +548,16 @@ mysql-multilib-r1_src_install() {
multilib_src_install() {
debug-print-function ${FUNCNAME} "$@"
if multilib_is_native_abi; then
# Make sure the vars are correctly initialized
mysql_init_vars
cmake-utils_src_install
# Make sure the vars are correctly initialized
mysql_init_vars
cmake-utils_src_install
# Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used
if [[ -f "${D}${MY_INCLUDEDIR}/private/config.h" ]] ; then
rm "${D}${MY_INCLUDEDIR}/private/config.h" || die
fi
if multilib_is_native_abi; then
# Convenience links
einfo "Making Convenience links for mysqlcheck multi-call binary"
@ -627,7 +643,6 @@ multilib_src_install() {
fi
done
else
cmake-utils_src_install
if [[ "${PN}" == "mariadb" ]] && use server ; then
insinto /usr/include/mysql/private
doins "${S}"/sql/*.h
@ -805,11 +820,29 @@ mysql-multilib-r1_pkg_config() {
local maxtry=15
if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
MYSQL_ROOT_PASSWORD="$(mysql-multilib-r1_getoptval 'client mysql' password)"
local tmp_mysqld_password_source=
for tmp_mysqld_password_source in mysql client; do
einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
MYSQL_ROOT_PASSWORD="$(mysql-multilib-r1_getoptval "${tmp_mysqld_password_source}" password)"
if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
MYSQL_ROOT_PASSWORD=
continue
fi
einfo "Found password in '${tmp_mysqld_password_source}' section!"
break
fi
done
# Sometimes --show is required to display passwords in some implementations of my_print_defaults
if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
MYSQL_ROOT_PASSWORD="$(mysql-multilib-r1_getoptval 'client mysql' password --show)"
MYSQL_ROOT_PASSWORD="$(mysql-multilib-r1_getoptval "${tmp_mysqld_password_source}" password --show)"
fi
unset tmp_mysqld_password_source
fi
MYSQL_TMPDIR="$(mysql-multilib-r1_getoptval mysqld tmpdir)"
# These are dir+prefix
@ -906,7 +939,7 @@ mysql-multilib-r1_pkg_config() {
local cmd
local initialize_options
if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] && mysql_version_is_at_least "5.7.6" ; then
if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] && version_is_at_least "5.7.6" ; then
# --initialize-insecure will not set root password
# --initialize would set a random one in the log which we don't need as we set it ourselves
cmd="${EROOT}usr/sbin/mysqld"

View File

@ -86,10 +86,9 @@ oasis_src_configure() {
[ -n "${OASIS_BUILD_TESTS}" ] && confargs="${confargs} $(use_enable test tests)"
[ -n "${OASIS_NO_DEBUG}" ] || confargs="${confargs} $(oasis_use_enable debug debug)"
${OASIS_SETUP_COMMAND:-ocaml setup.ml} -configure \
--prefix "${EPREFIX}/usr" \
--libdir "${EPREFIX}/usr/$(get_libdir)" \
--docdir "${EPREFIX}${OASIS_DOC_DIR}" \
--destdir "${D}" \
--prefix "${ED}/usr" \
--libdir "${ED}/usr/$(get_libdir)" \
--docdir "${ED}${OASIS_DOC_DIR}" \
$(oasis_use_enable ocamlopt is_native) \
${confargs} \
${oasis_configure_opts} \

View File

@ -72,14 +72,23 @@ RDEPEND=""
for i in ${OFFICE_IMPLEMENTATIONS[@]}; do
IUSE+=" office_implementation_${i}"
RDEPEND+="
office_implementation_${i}? (
|| (
app-office/${i}${OFFICE_REQ_USE}
app-office/${i}-bin${OFFICE_REQ_USE}
if [[ ${i} == "openoffice" ]]; then
# special only binary
RDEPEND+="
office_implementation_openoffice? (
app-office/openoffice-bin${OFFICE_REQ_USE}
)
)
"
"
else
RDEPEND+="
office_implementation_${i}? (
|| (
app-office/${i}${OFFICE_REQ_USE}
app-office/${i}-bin${OFFICE_REQ_USE}
)
)
"
fi
done
REQUIRED_USE="|| ( "

View File

@ -42,7 +42,6 @@ SLOT="${OFED_VER}"
# Defines array of ofed version supported by eclass
OFED_VERSIONS=(
"1.5.4.1"
"3.5"
"3.12"
)
@ -52,10 +51,10 @@ OFED_VERSIONS=(
# function that creates blockers list for ofed
block_other_ofed_versions() {
local slot
RDEPEND="${RDEPEND} !sys-infiniband/${PN}:0"
RDEPEND="${RDEPEND} !sys-fabric/${PN}:0"
for slot in ${OFED_VERSIONS[@]}; do
if [[ ${slot} != ${SLOT} ]]; then
RDEPEND+=" !sys-infiniband/${PN}:${slot}"
RDEPEND+=" !sys-fabric/${PN}:${slot}"
fi
done
}
@ -70,14 +69,7 @@ fi
case ${PN} in
ofed)
case ${PV} in
1.5.*|1.5.*.*)
MY_PN="ofa_kernel"
;;
*)
MY_PN="compat-rdma"
;;
esac
MY_PN="compat-rdma"
;;
*)
MY_PN="${PN}"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@ -6,8 +6,8 @@
# @MAINTAINER:
# The Gentoo Linux Hardened Team <hardened@gentoo.org>
# @AUTHOR:
# Original Author: Kevin F. Quinn <kevquinn@gentoo.org>
# Modifications for bugs #365825, #431092, #520198, @ ECLASS markup: Anthony G. Basile <blueness@gentoo.org>
# Author: Kevin F. Quinn <kevquinn@gentoo.org>
# Author: Anthony G. Basile <blueness@gentoo.org>
# @BLURB: functions to provide PaX markings for hardened kernels
# @DESCRIPTION:
#
@ -77,16 +77,14 @@ pax-mark() {
# _pax_list_files einfo "$@"
for f in "$@"; do
# First try paxctl -> this might try to create/convert program headers.
# First try paxctl
if type -p paxctl >/dev/null; then
einfo "PT_PAX marking -${flags} ${f} with paxctl"
# First, try modifying the existing PAX_FLAGS header.
# We try modifying the existing PT_PAX_FLAGS header.
paxctl -q${flags} "${f}" >/dev/null 2>&1 && continue
# Second, try creating a PT_PAX header (works on ET_EXEC).
# Even though this is less safe, most exes need it. #463170
paxctl -qC${flags} "${f}" >/dev/null 2>&1 && continue
# Third, try stealing the (unused under PaX) PT_GNU_STACK header
paxctl -qc${flags} "${f}" >/dev/null 2>&1 && continue
# We no longer try to create/convert a PT_PAX_FLAGS header, bug #590422
# paxctl -qC${flags} "${f}" >/dev/null 2>&1 && continue
# paxctl -qc${flags} "${f}" >/dev/null 2>&1 && continue
fi
# Next try paxctl-ng -> this will not create/convert any program headers.

View File

@ -131,12 +131,31 @@ perl_delete_emptybsdir() {
# @DESCRIPTION:
# Look through ${D} for .packlist text files containing the temporary installation
# folder (i.e. ${D}). If the pattern is found, silently replace it with `/'.
# Remove duplicate entries; then validate all entries in the packlist against ${D}
# and prune entries that do not correspond to installed files.
perl_fix_packlist() {
debug-print-function $FUNCNAME "$@"
local packlist_temp="${T}/.gentoo_packlist_temp"
find "${D}" -type f -name '.packlist' -print0 | while read -rd '' f ; do
if file "${f}" | grep -q -i " text" ; then
einfo "Fixing packlist file /${f#${D}}"
# remove the temporary build dir path
sed -i -e "s:${D}:/:g" "${f}"
# remove duplicate entries
sort -u "${f}" > "${packlist_temp}"
mv "${packlist_temp}" "${f}"
# remove files that dont exist
cat "${f}" | while read -r entry; do
if [ ! -e "${D}/${entry}" ]; then
einfo "Pruning surplus packlist entry ${entry}"
grep -v -x -F "${entry}" "${f}" > "${packlist_temp}"
mv "${packlist_temp}" "${f}"
fi
done
fi
done
}
@ -279,3 +298,24 @@ perl_check_env() {
eerror "Your environment settings may lead to undefined behavior and/or build failures."
die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details."
}
# @FUNCTION: perl_doexamples
# @USAGE: perl_doexamples "file_1" "file_2"
# @DESCRIPTION:
# Install example files ready-to-run.
# Is called under certain circumstances in perl-module.eclass src_install
# (see the documentation there).
#
perl_doexamples() {
debug-print-function $FUNCNAME "$@"
einfo "Installing examples into /usr/share/doc/${PF}/examples"
# no compression since we want ready-to-run scripts
docompress -x /usr/share/doc/${PF}/examples
docinto examples/
dodoc -r $@
# is there a way to undo "docinto" ?
}

View File

@ -131,6 +131,20 @@ LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"
# (EAPI=6) This variable sets the module author name for the calculation of
# SRC_URI. Named MODULE_AUTHOR in EAPI=5.
# @ECLASS-VARIABLE: DIST_SECTION
# @DESCRIPTION:
# (EAPI=6) This variable sets the module section for the calculation of
# SRC_URI. Only required in rare cases for very special snowflakes.
# Named MODULE_SECTION in EAPI=5.
# @ECLASS-VARIABLE: DIST_EXAMPLES
# @DESCRIPTION:
# (EAPI=6) This Bash array allows passing a list of example files to be installed
# in /usr/share/doc/${PF}/examples. If set before inherit, automatically adds
# a use-flag examples, if not you'll have to add the useflag in your ebuild.
# Examples are installed only if the useflag examples exists and is activated.
if [[ ${EAPI:-0} == 5 ]]; then
if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
: ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
@ -158,6 +172,8 @@ else
SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}"
[[ -z "${HOMEPAGE}" ]] && \
HOMEPAGE="http://search.cpan.org/dist/${DIST_NAME}/"
[[ -z "${DIST_EXAMPLES}" ]] || IUSE+=" examples"
fi
SRC_PREP="no"
@ -419,6 +435,12 @@ perl-module_src_install() {
[[ -s ${f} ]] && dodoc ${f}
done
if [[ ${EAPI:-0} != 5 ]] ; then
if in_iuse examples && use examples ; then
[[ ${#DIST_EXAMPLES[@]} -eq 0 ]] || perl_doexamples "${DIST_EXAMPLES[@]}"
fi
fi
perl_link_duallife_scripts
}

View File

@ -0,0 +1,86 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: php-ext-pecl-r3.eclass
# @MAINTAINER:
# Gentoo PHP team <php-bugs@gentoo.org>
# @BLURB: A uniform way to install PECL extensions
# @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/
# @ECLASS-VARIABLE: PHP_EXT_PECL_PKG
# @DESCRIPTION:
# Set in ebuild before inheriting this eclass if the tarball name
# differs from ${PN/pecl-/} so that SRC_URI and HOMEPAGE get set
# correctly by the eclass.
#
# Setting this variable manually also affects PHP_EXT_NAME and ${S}
# unless you override those in ebuild. If that is not desired, please
# use PHP_EXT_PECL_FILENAME instead.
[[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}"
# @ECLASS-VARIABLE: PHP_EXT_PECL_FILENAME
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set in ebuild before inheriting this eclass if the tarball name
# differs from "${PN/pecl-/}-${PV}.tgz" so that SRC_URI gets set
# correctly by the eclass.
#
# Unlike PHP_EXT_PECL_PKG, setting this variable does not affect
# HOMEPAGE, PHP_EXT_NAME or ${S}.
# Set PHP_EXT_NAME for php-ext-source-r3.eclass.
[[ -z "${PHP_EXT_NAME}" ]] && PHP_EXT_NAME="${PHP_EXT_PECL_PKG}"
# Try to guess the upstream name of the package/version. We only use
# this variable temporarily before unsetting it.
PHP_EXT_PECL_PKG_V="${PHP_EXT_PECL_PKG}-${PV/_/}"
# It's important that we determine and set $S before we inherit below.
S="${WORKDIR}/${PHP_EXT_PECL_PKG_V}"
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"
else
SRC_URI="http://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}"
# @FUNCTION: php-ext-pecl-r3_src_install
# @DESCRIPTION:
# Install a standard PECL package. First we delegate to
# php-ext-source-r3.eclass, and then we attempt to install examples
# found in a standard location.
php-ext-pecl-r3_src_install() {
php-ext-source-r3_src_install
if in_iuse examples && use examples ; then
dodoc -r examples
fi
}
# @FUNCTION: php-ext-pecl-r3_src_test
# @DESCRIPTION:
# Run tests delivered with the PECL package. Phpize will have generated
# a run-tests.php file to be executed by `make test`. We only need to
# force the test suite to run in non-interactive mode.
php-ext-pecl-r3_src_test() {
for slot in $(php_get_slots); do
php_init_slot_env "${slot}"
NO_INTERACTION="yes" emake test
done
}

View File

@ -0,0 +1,423 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: php-ext-source-r3.eclass
# @MAINTAINER:
# Gentoo PHP team <php-bugs@gentoo.org>
# @BLURB: Compile and install standalone PHP extensions.
# @DESCRIPTION:
# A unified interface for compiling and installing standalone PHP
# extensions.
inherit autotools
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test
case ${EAPI} in
6) ;;
*)
die "${ECLASS} is not compatible with EAPI=${EAPI}"
esac
# @ECLASS-VARIABLE: PHP_EXT_NAME
# @REQUIRED
# @DESCRIPTION:
# The extension name. This must be set, otherwise the eclass dies.
# Only automagically set by php-ext-pecl-r3.eclass, so unless your ebuild
# inherits that eclass, you must set this manually before inherit.
[[ -z "${PHP_EXT_NAME}" ]] && \
die "no extension name specified for the php-ext-source-r3 eclass"
# @ECLASS-VARIABLE: PHP_EXT_INI
# @DESCRIPTION:
# Controls whether or not to add a line to php.ini for the extension.
# Defaults to "yes" and should not be changed in most cases.
[[ -z "${PHP_EXT_INI}" ]] && PHP_EXT_INI="yes"
# @ECLASS-VARIABLE: PHP_EXT_ZENDEXT
# @DESCRIPTION:
# Controls whether the extension is a ZendEngine extension or not.
# Defaults to "no". If you don't know what this is, you don't need it.
[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no"
# @ECLASS-VARIABLE: USE_PHP
# @REQUIRED
# @DESCRIPTION:
# Lists the PHP slots compatible the extension is compatible with.
# Example:
# @CODE
# USE_PHP="php5-6 php7-0"
# @CODE
[[ -z "${USE_PHP}" ]] && \
die "USE_PHP is not set for the php-ext-source-r3 eclass"
# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, all of the dependencies added by this eclass will be
# conditional on USE=${PHP_EXT_OPTIONAL_USE}. This is needed when
# ebuilds have to inherit this eclass unconditionally, but only
# actually use it when (for example) the user has USE=php.
# @ECLASS-VARIABLE: PHP_EXT_S
# @DESCRIPTION:
# The relative location of the temporary build directory for the PHP
# extension within the source package. This is useful for packages that
# bundle the PHP extension. Defaults to ${S}.
[[ -z "${PHP_EXT_S}" ]] && PHP_EXT_S="${S}"
# @ECLASS-VARIABLE: PHP_EXT_SAPIS
# @DESCRIPTION:
# A list of SAPIs for which we will install this extension. Formerly
# called PHPSAPILIST. The default includes every SAPI currently used in
# the tree.
[[ -z "${PHP_EXT_SAPIS}" ]] && PHP_EXT_SAPIS="apache2 cli cgi fpm embed phpdbg"
# Make sure at least one target is installed. First, start a USE
# conditional like "php?", but only when PHP_EXT_OPTIONAL_USE is
# non-null. The option group "|| (..." is always started here.
REQUIRED_USE="${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }|| ( "
for _php_target in ${USE_PHP}; do
# Now loop through each USE_PHP target and add the corresponding
# dev-lang/php slot to PHPDEPEND.
IUSE+=" php_targets_${_php_target}"
REQUIRED_USE+="php_targets_${_php_target} "
_php_slot=${_php_target/php}
_php_slot=${_php_slot/-/.}
PHPDEPEND+=" php_targets_${_php_target}? ( dev-lang/php:${_php_slot} )"
done
# Don't pollute the environment with our loop variables.
unset _php_slot _php_target
# Finally, end the optional group that we started before the loop. Close
# the USE-conditional if PHP_EXT_OPTIONAL_USE is non-null.
REQUIRED_USE+=") ${PHP_EXT_OPTIONAL_USE:+ )}"
RDEPEND="${RDEPEND}
${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
${PHPDEPEND}
${PHP_EXT_OPTIONAL_USE:+ )}"
DEPEND="${DEPEND}
sys-devel/m4
sys-devel/libtool
${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
${PHPDEPEND}
${PHP_EXT_OPTIONAL_USE:+ )}
"
# @ECLASS-VARIABLE: PHP_EXT_SKIP_PHPIZE
# @DEFAULT_UNSET
# @DESCRIPTION:
# By default, we run "phpize" in php-ext-source-r3_src_unpack(). Set
# PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run
# phpize (and the autoreconf that becomes necessary afterwards).
# @FUNCTION: php-ext-source-r3_src_unpack
# @DESCRIPTION:
# Runs the default src_unpack and then makes a copy for each PHP slot.
php-ext-source-r3_src_unpack() {
default
local slot orig_s="${PHP_EXT_S}"
for slot in $(php_get_slots); do
cp --recursive --preserve "${orig_s}" "${WORKDIR}/${slot}" || \
die "failed to copy sources from ${orig_s} to ${WORKDIR}/${slot}"
done
}
# @FUNCTION: php-ext-source-r3_src_prepare
# @DESCRIPTION:
# For each PHP slot, we initialize the environment, run the default
# src_prepare() for PATCHES/eapply_user support, and then call
# php-ext-source-r3_phpize.
php-ext-source-r3_src_prepare() {
for slot in $(php_get_slots); do
php_init_slot_env "${slot}"
default
php-ext-source-r3_phpize
done
}
# @FUNCTION: php-ext-source-r3_phpize
# @DESCRIPTION:
# Subject to PHP_EXT_SKIP_PHPIZE, this function runs phpize and
# autoreconf in a manner that avoids warnings.
php-ext-source-r3_phpize() {
if [[ "${PHP_EXT_SKIP_PHPIZE}" != 'yes' ]] ; then
# Create configure out of config.m4. We use autotools_run_tool
# to avoid some warnings about WANT_AUTOCONF and
# WANT_AUTOMAKE (see bugs #329071 and #549268).
autotools_run_tool "${PHPIZE}"
# Force libtoolize to run and regenerate autotools files (bug
# #220519).
rm aclocal.m4 || die "failed to remove aclocal.m4"
eautoreconf
fi
}
# @ECLASS-VARIABLE: PHP_EXT_ECONF_ARGS
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this in the ebuild to pass additional configure options to
# econf. Formerly called my_conf. Either a string or an array of
# --flag=value parameters is supported.
# @FUNCTION: php-ext-source-r3_src_configure
# @DESCRIPTION:
# Takes care of standard configure for PHP extensions (modules).
php-ext-source-r3_src_configure() {
# net-snmp creates these, bug #385403.
addpredict /usr/share/snmp/mibs/.index
addpredict /var/lib/net-snmp/mib_indexes
# Support either a string or an array for PHP_EXT_ECONF_ARGS.
local econf_args
if [[ $(declare -p PHP_EXT_ECONF_ARGS) == "declare -a"* ]]; then
econf_args=( "${PHP_EXT_ECONF_ARGS[@]}" )
else
econf_args=( ${PHP_EXT_ECONF_ARGS} )
fi
local slot
for slot in $(php_get_slots); do
php_init_slot_env "${slot}"
econf --with-php-config="${PHPCONFIG}" "${econf_args[@]}"
done
}
# @FUNCTION: php-ext-source-r3_src_compile
# @DESCRIPTION:
# Compile a standard standalone PHP extension.
php-ext-source-r3_src_compile() {
# net-snmp creates these, bug #324739.
addpredict /usr/share/snmp/mibs/.index
addpredict /var/lib/net-snmp/mib_indexes
# shm extension creates a semaphore file, bug #173574.
addpredict /session_mm_cli0.sem
local slot
for slot in $(php_get_slots); do
php_init_slot_env "${slot}"
emake
done
}
# @FUNCTION: php-ext-source-r3_src_install
# @DESCRIPTION:
# Install a standard standalone PHP extension. Uses einstalldocs()
# to support the DOCS variable/array.
php-ext-source-r3_src_install() {
local slot
for slot in $(php_get_slots); do
php_init_slot_env "${slot}"
# Strip $EPREFIX from $EXT_DIR before calling doexe (which
# handles EPREFIX itself). Shared libs are +x by convention,
# although nothing seems to depend on that.
exeinto "${EXT_DIR#$EPREFIX}"
doexe "modules/${PHP_EXT_NAME}.so"
INSTALL_ROOT="${D}" emake install-headers
done
einstalldocs
php-ext-source-r3_createinifiles
}
# @FUNCTION: php-ext-source-r3_src_test
# @DESCRIPTION:
# Run tests delivered with the standalone PHP extension. Phpize will have generated
# a run-tests.php file to be executed by `make test`. We only need to
# force the test suite to run in non-interactive mode.
php-ext-source-r3_src_test() {
local slot
for slot in $(php_get_slots); do
php_init_slot_env "${slot}"
NO_INTERACTION="yes" emake test
done
}
# @FUNCTION: php_get_slots
# @DESCRIPTION:
# Get a list of PHP slots contained in both the ebuild's USE_PHP and the
# user's PHP_TARGETS.
php_get_slots() {
local s=""
local slot
for slot in ${USE_PHP}; do
use php_targets_${slot} && s+=" ${slot/-/.}"
done
echo $s
}
# @FUNCTION: php_init_slot_env
# @USAGE: <slot>
# @DESCRIPTION:
# Takes a slot name, and initializes some global variables to values
# corresponding to that slot. For example, it sets the path to the "php"
# and "phpize" binaries, which will differ for each slot. This function
# is intended to be called while looping through a list of slots
# obtained from php_get_slots().
#
# Calling this function will change the working directory to the
# temporary build directory for the given slot.
php_init_slot_env() {
local libdir=$(get_libdir)
local slot="${1}"
PHPPREFIX="${EPREFIX}/usr/${libdir}/${slot}"
PHPIZE="${PHPPREFIX}/bin/phpize"
PHPCONFIG="${PHPPREFIX}/bin/php-config"
PHPCLI="${PHPPREFIX}/bin/php"
PHPCGI="${PHPPREFIX}/bin/php-cgi"
PHP_PKG="$(best_version =dev-lang/php-${1:3}*)"
EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
PHP_CURRENTSLOT=${1:3}
PHP_EXT_S="${WORKDIR}/${slot}"
cd "${PHP_EXT_S}" || die "failed to change directory to ${PHP_EXT_S}"
}
# @FUNCTION: php_slot_ini_files
# @USAGE: <slot>
# @INTERNAL
# @DESCRIPTION:
# Output a list of relative paths to INI files for the given
# slot. Usually there will be one INI file per SAPI.
php_slot_ini_files() {
local slot_ini_files=""
local x
for x in ${PHP_EXT_SAPIS} ; do
if [[ -f "${EPREFIX}/etc/php/${x}-${1}/php.ini" ]] ; then
slot_ini_files+=" etc/php/${x}-${1}/ext/${PHP_EXT_NAME}.ini"
fi
done
echo "${slot_ini_files}"
}
# @FUNCTION: php-ext-source-r3_createinifiles
# @DESCRIPTION:
# Builds INI files for every enabled slot and SAPI.
php-ext-source-r3_createinifiles() {
local slot
for slot in $(php_get_slots); do
php_init_slot_env "${slot}"
local file
for file in $(php_slot_ini_files "${slot}") ; do
if [[ "${PHP_EXT_INI}" = "yes" ]] ; then
# Add the needed lines to the <ext>.ini files
php-ext-source-r3_addextension "${PHP_EXT_NAME}.so" "${file}"
fi
if [[ -n "${PHP_EXT_INIFILE}" ]] ; then
cat "${FILESDIR}/${PHP_EXT_INIFILE}" >> "${ED}/${file}" \
|| die "failed to append to ${ED}/${file}"
einfo "Added contents of ${FILESDIR}/${PHP_EXT_INIFILE}" \
"to ${file}"
fi
inidir="${file/${PHP_EXT_NAME}.ini/}"
inidir="${inidir/ext/ext-active}"
dodir "/${inidir}"
dosym "/${file}" "/${file/ext/ext-active}"
done
done
# A location where PHP code for this extension can be stored,
# independent of the PHP or extension versions. This will be part of
# PHP's include_path, configured in php.ini. For example, pecl-apcu
# installs an "apc.php" file which you are supposed to load with
#
# require('apcu/apc.php');
#
PHP_EXT_SHARED_DIR="${EPREFIX}/usr/share/php/${PHP_EXT_NAME}"
}
# @FUNCTION: php-ext-source-r3_addextension
# @USAGE: <extension-path> <ini-file>
# @INTERNAL
# @DESCRIPTION:
# Add a line to an INI file that will enable the given extension. The
# first parameter is the path to the extension (.so) file, and the
# second parameter is the name of the INI file in which it should be
# loaded. This function determines the setting name (either
# "extension=..." or "zend_extension=...") and then calls
# php-ext-source-r3_addtoinifile to do the actual work.
php-ext-source-r3_addextension() {
local ext_type="extension"
local ext_file="${1}"
if [[ "${PHP_EXT_ZENDEXT}" = "yes" ]] ; then
ext_type="zend_extension"
ext_file="${EXT_DIR}/${1}" # Zend extensions need the path...
fi
php-ext-source-r3_addtoinifile "${2}" "${ext_type}" "${ext_file}"
}
# @FUNCTION: php-ext-source-r3_addtoinifile
# @USAGE: <relative-ini-path> <setting-or-section-name> [setting-value]
# @INTERNAL
# @DESCRIPTION:
# Add a setting=value to one INI file. The first argument is the
# relative path to the INI file. The second argument is the setting
# name, and the third argument is its value.
#
# You can also pass "[Section]" as the second parameter, to create a new
# section in the INI file. In that case, the third parameter (which
# would otherwise be the value of the setting) is ignored.
php-ext-source-r3_addtoinifile() {
local inifile="${WORKDIR}/${1}"
local inidir="${inifile%/*}"
mkdir -p "${inidir}" || die "failed to create INI directory ${inidir}"
# Are we adding the name of a section? Assume not by default.
local my_added="${2}=${3}"
if [[ ${2:0:1} == "[" ]] ; then
# Ok, it's a section name.
my_added="${2}"
fi
echo "${my_added}" >> "${inifile}" || die "failed to append to ${inifile}"
einfo "Added '${my_added}' to /${1}"
insinto "/${1%/*}"
doins "${inifile}"
}
# @FUNCTION: php-ext-source-r3_addtoinifiles
# @USAGE: <setting-or-section-name> [setting-value] [message]
# @DESCRIPTION:
# Add settings to every php.ini file installed by this extension.
# You can also add new [Section]s -- see the example below.
#
# @CODE
# Add some settings for the extension:
#
# php-ext-source-r3_addtoinifiles "zend_optimizer.optimization_level" "15"
# php-ext-source-r3_addtoinifiles "zend_optimizer.enable_loader" "0"
# php-ext-source-r3_addtoinifiles "zend_optimizer.disable_licensing" "0"
#
# Adding values to a section in php.ini file installed by the extension:
#
# php-ext-source-r3_addtoinifiles "[Debugger]"
# php-ext-source-r3_addtoinifiles "debugger.enabled" "on"
# php-ext-source-r3_addtoinifiles "debugger.profiler_enabled" "on"
# @CODE
php-ext-source-r3_addtoinifiles() {
local slot
for slot in $(php_get_slots); do
for file in $(php_slot_ini_files "${slot}") ; do
php-ext-source-r3_addtoinifile "${file}" "${1}" "${2}"
done
done
}

View File

@ -1,458 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# @ECLASS: phpconfutils.eclass
# @MAINTAINER:
# Gentoo PHP team <php-bugs@gentoo.org>
# @AUTHOR:
# Based on Stuart's work on the original confutils eclass
# Luca Longinotti <chtekk@gentoo.org>
# @BLURB: Provides utility functions to help with configuring PHP.
# @DESCRIPTION:
# This eclass provides utility functions to help with configuring PHP.
# It is only used by other php eclasses currently and the functions
# are not generally intended for direct use in ebuilds.
# ========================================================================
# List of USE flags that need deps that aren't yet in Portage
# or that can't be (fex. certain commercial apps)
#
# You must define PHPCONFUTILS_MISSING_DEPS if you need this
# ========================================================================
# phpconfutils_sort_flags()
#
# Sort and remove duplicates of the auto-enabled USE flags
#
phpconfutils_sort_flags() {
# Sort the list of auto-magically enabled USE flags
PHPCONFUTILS_AUTO_USE="$(echo ${PHPCONFUTILS_AUTO_USE} | tr '\040\010' '\012\012' | sort -u)"
}
# ========================================================================
# phpconfutils_init()
#
# Call this function from your src_compile() function to initialise
# this eclass first
#
phpconfutils_init() {
# Define wheter we shall support shared extensions or not
if use "sharedext" ; then
shared="=shared"
else
shared=""
fi
phpconfutils_sort_flags
}
# ========================================================================
# phpconfutils_usecheck()
#
# Check if the USE flag we want enabled is part of the auto-magical ones
#
phpconfutils_usecheck() {
local x
local use="$1"
for x in ${PHPCONFUTILS_AUTO_USE} ; do
if [[ "${use}+" == "${x}+" ]] ; then
return 0
fi
done
# If we get here, the USE is not among the auto-enabled ones
return 1
}
# ========================================================================
# phpconfutils_require_any()
#
# Use this function to ensure one or more of the specified USE flags have
# been enabled and output the results
#
# $1 - message to output everytime a flag is found
# $2 - message to output everytime a flag is not found
# $3 .. - flags to check
#
phpconfutils_require_any() {
local success_msg="$1"
shift
local fail_msg="$1"
shift
local required_flags="$@"
local default_flag="$1"
local success="0"
while [[ -n "$1" ]] ; do
if use "$1" ; then
einfo "${success_msg} $1"
success="1"
else
einfo "${fail_msg} $1"
fi
shift
done
# Did we find what we are looking for?
if [[ "${success}" == "1" ]] ; then
return
fi
# If we get here, then none of the required USE flags were enabled
eerror
eerror "You should enable one or more of the following USE flags:"
eerror " ${required_flags}"
eerror
eerror "You can do this by enabling these flags in /etc/portage/package.use:"
eerror " =${CATEGORY}/${PN}-${PVR} ${required_flags}"
eerror
eerror "The ${default_flag} USE flag was automatically enabled now."
eerror
PHPCONFUTILS_AUTO_USE="${PHPCONFUTILS_AUTO_USE} ${default_flag}"
}
# ========================================================================
# phpconfutils_use_conflict()
#
# Use this function to automatically complain to the user if USE flags
# that directly conflict have been enabled
#
# $1 - flag that conflicts with other flags
# $2 .. - flags that conflict
#
phpconfutils_use_conflict() {
phpconfutils_sort_flags
if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
return
fi
local my_flag="$1"
shift
local my_present=""
local my_remove=""
while [[ "$1+" != "+" ]] ; do
if use "$1" || phpconfutils_usecheck "$1" ; then
my_present="${my_present} $1"
my_remove="${my_remove} -$1"
fi
shift
done
if [[ -n "${my_present}" ]] ; then
eerror
eerror "USE flag '${my_flag}' conflicts with these USE flag(s):"
eerror " ${my_present}"
eerror
eerror "You must disable these conflicting flags before you can emerge this package."
eerror "You can do this by disabling these flags in /etc/portage/package.use:"
eerror " =${CATEGORY}/${PN}-${PVR} ${my_remove}"
eerror
die "Conflicting USE flags found"
fi
}
# ========================================================================
# phpconfutils_use_depend_all()
#
# Use this function to specify USE flags that depend on eachother,
# they will be automatically enabled and used for checks later
#
# $1 - flag that depends on other flags
# $2 .. - the flags that must be set for $1 to be valid
#
phpconfutils_use_depend_all() {
phpconfutils_sort_flags
if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
return
fi
local my_flag="$1"
shift
local my_missing=""
while [[ "$1+" != "+" ]] ; do
if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
my_missing="${my_missing} $1"
fi
shift
done
if [[ -n "${my_missing}" ]] ; then
PHPCONFUTILS_AUTO_USE="${PHPCONFUTILS_AUTO_USE} ${my_missing}"
ewarn
ewarn "USE flag '${my_flag}' needs these additional flag(s) set:"
ewarn " ${my_missing}"
ewarn
ewarn "'${my_missing}' was automatically enabled and the required extensions will be"
ewarn "built. In any case it is recommended to enable those flags for"
ewarn "future reference, by adding the following to /etc/portage/package.use:"
ewarn " =${CATEGORY}/${PN}-${PVR} ${my_missing}"
ewarn
fi
}
# ========================================================================
# phpconfutils_use_depend_any()
#
# Use this function to automatically complain to the user if a USE flag
# depends on another USE flag that hasn't been enabled
#
# $1 - flag that depends on other flags
# $2 - flag that is used as default if none is enabled
# $3 .. - flags that must be set for $1 to be valid
#
phpconfutils_use_depend_any() {
phpconfutils_sort_flags
if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
return
fi
local my_flag="$1"
shift
local my_default_flag="$1"
shift
local my_found=""
local my_missing=""
while [[ "$1+" != "+" ]] ; do
if use "$1" || phpconfutils_usecheck "$1" ; then
my_found="${my_found} $1"
else
my_missing="${my_missing} $1"
fi
shift
done
if [[ -z "${my_found}" ]] ; then
PHPCONFUTILS_AUTO_USE="${PHPCONFUTILS_AUTO_USE} ${my_default_flag}"
ewarn
ewarn "USE flag '${my_flag}' needs one of these additional flag(s) set:"
ewarn " ${my_missing}"
ewarn
ewarn "'${my_default_flag}' was automatically selected and enabled."
ewarn "You can change that by enabling/disabling those flags accordingly"
ewarn "in /etc/portage/package.use."
ewarn
fi
}
# ========================================================================
# phpconfutils_extension_disable()
#
# Use this function to disable an extension that is enabled by default.
# This is provided for those rare configure scripts that don't support
# a --enable for the corresponding --disable
#
# $1 - extension name
# $2 - USE flag
# $3 - optional message to einfo() to the user
#
phpconfutils_extension_disable() {
if ! use "$2" && ! phpconfutils_usecheck "$2" ; then
my_conf="${my_conf} --disable-$1"
[[ -n "$3" ]] && einfo " Disabling $1"
else
[[ -n "$3" ]] && einfo " Enabling $1"
fi
}
# ========================================================================
# phpconfutils_extension_enable()
#
# This function is like use_enable(), except that it knows about
# enabling modules as shared libraries, and it supports passing
# additional data with the switch
#
# $1 - extension name
# $2 - USE flag
# $3 - 1 = support shared, 0 = never support shared
# $4 - additional setting for configure
# $5 - additional message to einfo out to the user
#
phpconfutils_extension_enable() {
local my_shared
if [[ "$3" == "1" ]] ; then
if [[ "${shared}+" != "+" ]] ; then
my_shared="${shared}"
if [[ "$4+" != "+" ]] ; then
my_shared="${my_shared},$4"
fi
elif [[ "$4+" != "+" ]] ; then
my_shared="=$4"
fi
else
if [[ "$4+" != "+" ]] ; then
my_shared="=$4"
fi
fi
if use "$2" || phpconfutils_usecheck "$2" ; then
my_conf="${my_conf} --enable-$1${my_shared}"
einfo " Enabling $1"
else
my_conf="${my_conf} --disable-$1"
einfo " Disabling $1"
fi
}
# ========================================================================
# phpconfutils_extension_without()
#
# Use this function to disable an extension that is enabled by default
# This function is provided for those rare configure scripts that support
# --without but not the corresponding --with
#
# $1 - extension name
# $2 - USE flag
# $3 - optional message to einfo() to the user
#
phpconfutils_extension_without() {
if ! use "$2" && ! phpconfutils_usecheck "$2" ; then
my_conf="${my_conf} --without-$1"
einfo " Disabling $1"
else
einfo " Enabling $1"
fi
}
# ========================================================================
# phpconfutils_extension_with()
#
# This function is a replacement for use_with. It supports building
# extensions as shared libraries,
#
# $1 - extension name
# $2 - USE flag
# $3 - 1 = support shared, 0 = never support shared
# $4 - additional setting for configure
# $5 - optional message to einfo() out to the user
#
phpconfutils_extension_with() {
local my_shared
if [[ "$3" == "1" ]] ; then
if [[ "${shared}+" != "+" ]] ; then
my_shared="${shared}"
if [[ "$4+" != "+" ]] ; then
my_shared="${my_shared},$4"
fi
elif [[ "$4+" != "+" ]] ; then
my_shared="=$4"
fi
else
if [[ "$4+" != "+" ]] ; then
my_shared="=$4"
fi
fi
if use "$2" || phpconfutils_usecheck "$2" ; then
my_conf="${my_conf} --with-$1${my_shared}"
einfo " Enabling $1"
else
my_conf="${my_conf} --without-$1"
einfo " Disabling $1"
fi
}
# ========================================================================
# phpconfutils_warn_about_external_deps()
#
# This will output a warning to the user if he enables commercial or other
# software not currently present in Portage
#
phpconfutils_warn_about_external_deps() {
phpconfutils_sort_flags
local x
local my_found="0"
for x in ${PHPCONFUTILS_MISSING_DEPS} ; do
if use "${x}" || phpconfutils_usecheck "${x}" ; then
ewarn "USE flag ${x} enables support for software not present in Portage!"
my_found="1"
fi
done
if [[ "${my_found}" == "1" ]] ; then
ewarn
ewarn "This ebuild will continue, but if you haven't already installed the"
ewarn "software required to satisfy the list above, this package will probably"
ewarn "fail to compile later on."
ewarn "*DO NOT* file bugs about compile failures or issues you're having"
ewarn "when using one of those flags, as we aren't able to support them."
ewarn "|=|=|=|=|=|=| You are on your own if you use them! |=|=|=|=|=|=|"
ewarn
ebeep 5
fi
}
# ========================================================================
# phpconfutils_built_with_use()
#
# Sobstitute for built_with_use() to support the magically enabled USE flags
#
phpconfutils_built_with_use() {
local opt="$1"
[[ ${opt:0:1} = "-" ]] && shift || opt="-a"
local PHP_PKG=$(best_version $1)
shift
local PHP_USEFILE="${ROOT}/var/lib/php-pkg/${PHP_PKG}/PHP_USEFILE"
[[ ! -e "${PHP_USEFILE}" ]] && return 0
local PHP_USE_BUILT=$(<${PHP_USEFILE})
while [[ $# -gt 0 ]] ; do
if [[ ${opt} = "-o" ]] ; then
has $1 ${PHP_USE_BUILT} && return 0
else
has $1 ${PHP_USE_BUILT} || return 1
fi
shift
done
[[ ${opt} = "-a" ]]
}
# ========================================================================
# phpconfutils_generate_usefile()
#
# Generate the file used by phpconfutils_built_with_use() to check it's
# USE flags
#
phpconfutils_generate_usefile() {
phpconfutils_sort_flags
local PHP_USEFILE="${D}/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/PHP_USEFILE"
# Write the auto-enabled USEs into the correct file
dodir "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
echo "${PHPCONFUTILS_AUTO_USE}" > "${PHP_USEFILE}"
}

View File

@ -48,5 +48,83 @@ eprefixify() {
return 0
}
# @FUNCTION: hprefixify
# @USAGE: [ -w <line match> ] [-e <extended regex> ] <list of files>
# @DESCRIPTION:
# Tries a set of heuristics to prefixify the given files. Dies if no
# arguments are given, a file does not exist, or changing a file failed.
#
# Additional extended regular expression can be passed by -e or
# environment variable PREFIX_EXTRA_REGEX. The default heuristics can
# be constrained to lines that match a sed expression passed by -w or
# environment variable PREFIX_LINE_MATCH.
# @EXAMPLE:
# Only prefixify the 30th line,
# hprefixify -w 30 configure
# Only prefixify lines that contain "PATH",
# hprefixify -w "/PATH/" configure
# Also delete all the /opt/gnu search paths,
# hprefixify -e "/\/opt\/gnu/d" configure
hprefixify() {
use prefix || return 0
local PREFIX_EXTRA_REGEX PREFIX_LINE_MATCH xl=() x
while [[ $# -gt 0 ]]; do
case $1 in
-e)
PREFIX_EXTRA_REGEX="$2"
shift
;;
-w)
PREFIX_LINE_MATCH="$2"
shift
;;
*)
xl+=( "$1" )
;;
esac
shift
done
[[ ${#xl[@]} -lt 1 ]] && die "at least one file operand is required"
einfo "Adjusting to prefix ${EPREFIX:-/}"
for x in "${xl[@]}" ; do
if [[ -e ${x} ]] ; then
ebegin " ${x##*/}"
sed -r \
-e "${PREFIX_LINE_MATCH}s,([^[:alnum:]}\)\.])/(usr|lib(|[onx]?32|n?64)|etc|bin|sbin|var|opt|run),\1${EPREFIX}/\2,g" \
-e "${PREFIX_EXTRA_REGEX}" \
-i "${x}"
eend $? || die "failed to prefixify ${x}"
else
die "${x} does not exist"
fi
done
}
# @FUNCTION: prefixify_ro
# @USAGE: prefixify_ro <file>.
# @DESCRIPTION:
# prefixify a read-only file.
# copies the files to ${T}, prefixies it, echos the new file.
# @EXAMPLE:
# doexe "$(prefixify_ro "${FILESDIR}"/fix_libtool_files.sh)"
# epatch "$(prefixify_ro "${FILESDIR}"/${PN}-4.0.2-path.patch)"
prefixify_ro() {
if [[ -e $1 ]] ; then
local f=${1##*/}
cp "$1" "${T}" || die "failed to copy file"
local x="${T}"/${f}
# redirect to stderr because stdout is used to
# return the prefixified file.
if grep -qs @GENTOO_PORTAGE_EPREFIX@ "${x}" ; then
eprefixify "${T}"/${f} 1>&2
else
hprefixify "${T}"/${f} 1>&2
fi
echo "${x}"
else
die "$1 does not exist"
fi
}
# vim: tw=72:

View File

@ -137,7 +137,8 @@ _python_any_set_globals() {
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
python_export "${i}" PYTHON_PKG_DEP
PYTHON_DEPS="${PYTHON_PKG_DEP} ${PYTHON_DEPS}"
# note: need to strip '=' slot operator for || deps
PYTHON_DEPS="${PYTHON_PKG_DEP%=} ${PYTHON_DEPS}"
done
PYTHON_DEPS="|| ( ${PYTHON_DEPS})"
readonly PYTHON_DEPS
@ -220,7 +221,8 @@ python_gen_any_dep() {
python_export "${i}" PYTHON_PKG_DEP
local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
out="( ${PYTHON_PKG_DEP} ${i_depstr} ) ${out}"
# note: need to strip '=' slot operator for || deps
out="( ${PYTHON_PKG_DEP%=} ${i_depstr} ) ${out}"
done
echo "|| ( ${out})"
}

View File

@ -75,7 +75,7 @@ inherit multibuild python-utils-r1
#
# Example:
# @CODE
# PYTHON_COMPAT=( python2_7 python3_3 python3_4} )
# PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
# @CODE
#
# Please note that you can also use bash brace expansion if you like:

Some files were not shown because too many files have changed in this diff Show More