diff options
author | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2023-05-02 14:42:47 +0200 |
---|---|---|
committer | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2023-05-02 14:42:47 +0200 |
commit | 678613b1c2d615231929424e5852cda6233c6b3e (patch) | |
tree | a0c0c5ec02840ffe4b6ea48f70dad36fa8664762 /eclass | |
parent | dev-python/neo: treeclean (diff) | |
download | sci-678613b1c2d615231929424e5852cda6233c6b3e.tar.gz sci-678613b1c2d615231929424e5852cda6233c6b3e.tar.bz2 sci-678613b1c2d615231929424e5852cda6233c6b3e.zip |
sci-libs/xblas: treeclean
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/alternatives-2.eclass | 142 | ||||
-rw-r--r-- | eclass/numeric-int64-multibuild.eclass | 414 | ||||
-rw-r--r-- | eclass/numeric.eclass | 138 |
3 files changed, 0 insertions, 694 deletions
diff --git a/eclass/alternatives-2.eclass b/eclass/alternatives-2.eclass deleted file mode 100644 index 7237f0db3..000000000 --- a/eclass/alternatives-2.eclass +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright 2010-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# Based in part upon 'alternatives.exlib' from Exherbo, which is: -# Copyright 2008, 2009 Bo Ørsted Andresen -# Copyright 2008, 2009 Mike Kelly -# Copyright 2009 David Leverton - -# @ECLASS: alternatives-2.eclass -# @MAINTAINER: -# Gentoo Science Project <sci@gentoo.org> -# @BLURB: Manage alternative implementations. -# @DESCRIPTION: -# Autogenerate eselect modules for alternatives and ensure that valid provider -# is set. -# -# Remove eselect modules when last provider is unmerged. -# -# If your package provides pkg_postinst or pkg_prerm phases, you need to be -# sure you explicitly run alternatives-2_pkg_{postinst,prerm} where appropriate. - -case "${EAPI:-0}" in - 0|1|2|3|4) - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" - ;; - 5|6|7) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; -esac - -DEPEND=">=app-admin/eselect-1.4.13-r101" -RDEPEND="${DEPEND} - !app-eselect/eselect-blas - !app-eselect/eselect-cblas - !app-eselect/eselect-lapack" - -# @ECLASS-VARIABLE: ALTERNATIVES_DIR -# @INTERNAL -# @DESCRIPTION: -# Alternatives directory with symlinks managed by eselect. -ALTERNATIVES_DIR="/etc/env.d/alternatives" - -# @FUNCTION: alternatives_for -# @USAGE: <alternative> <provider> <importance> <source> <target> [<source> <target> [...]] -# @DESCRIPTION: -# Set up alternative provider. -# -# EXAMPLE: -# @CODE -# alternatives_for sh bash 0 \ -# /usr/bin/sh bash -# @CODE -alternatives_for() { - debug-print-function ${FUNCNAME} "${@}" - - dodir /etc/env.d/alternatives - - ALTERNATIVESDIR_ROOT="${D%/}" \ - eselect alternatives add ${@} || die - - ALTERNATIVES_CREATED+=( ${1} ) -} - -# @FUNCTION: cleanup_old_alternatives_module -# @USAGE: <alternative> -# @DESCRIPTION: -# Remove old alternatives module. -cleanup_old_alternatives_module() { - debug-print-function ${FUNCNAME} "${@}" - - local alt=${1} old_module="${EROOT%/}/usr/share/eselect/modules/${alt}.eselect" - - if [[ -f "${old_module}" && $(grep 'ALTERNATIVE=' "${old_module}" | cut -d '=' -f 2) == "${alt}" ]]; then - local version="$(grep 'VERSION=' "${old_module}" | grep -o '[0-9.]\+')" - if [[ "${version}" == "0.1" || "${version}" == "20080924" ]]; then - einfo "rm ${old_module}" - rm "${old_module}" || eerror "rm ${old_module} failed" - fi - fi -} - -# @FUNCTION: alternatives-2_pkg_postinst -# @DESCRIPTION: -# Create eselect modules for all provided alternatives if necessary and ensure -# that valid provider is set. -# -# Also remove old eselect modules for provided alternatives. -# -# Provided alternatives are set up using alternatives_for(). -alternatives-2_pkg_postinst() { - debug-print-function ${FUNCNAME} "${@}" - - local alt - - for alt in ${ALTERNATIVES_CREATED[@]}; do - if ! eselect ${alt} show > /dev/null; then - einfo "Creating Alternative for ${alt}" - eselect alternatives create ${alt} - fi - - # Set alternative provider if there is no valid provider selected - eselect alternatives update "${alt}" - - cleanup_old_alternatives_module ${alt} - done -} - -# @FUNCTION: alternatives-2_pkg_prerm -# @DESCRIPTION: -# Ensure a valid provider is set in case the package is unmerged and -# remove autogenerated eselect modules for alternative when last -# provider is unmerged. -# -# Provided alternatives are set up using alternatives_for(). -alternatives-2_pkg_prerm() { - debug-print-function ${FUNCNAME} "${@}" - - local alt ret - - # If we are uninstalling, update alternatives to valid provider - [[ -n ${REPLACED_BY_VERSION} ]] || ignore="--ignore" - for alt in ${ALTERNATIVES_CREATED[@]}; do - eselect alternatives update "${alt}" - ret=$? - - case ${ret} in - 0) : ;; - 2) - # This was last provider for the alternative, remove eselect module - einfo "Cleaning up unused alternatives module for ${alt}" - eselect alternatives delete "${alt}" || eerror "Failed to remove ${alt}" - ;; - *) - eerror "eselect alternatives update returned \"${ret}\"" - ;; - esac - done -} - -EXPORT_FUNCTIONS pkg_postinst pkg_prerm diff --git a/eclass/numeric-int64-multibuild.eclass b/eclass/numeric-int64-multibuild.eclass deleted file mode 100644 index 9dd23cebf..000000000 --- a/eclass/numeric-int64-multibuild.eclass +++ /dev/null @@ -1,414 +0,0 @@ -# Copyright 1999-2021 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: numeric-int64-multibuild.eclass -# @MAINTAINER: -# sci team <sci@gentoo.org> -# @AUTHOR: -# Author: Mark Wright <gienah@gentoo.org> -# Author: Justin Lecher <jlec@gentoo.org> -# @BLURB: Build functions for Fortran multilib int64 multibuild packages -# @DESCRIPTION: -# The numeric-int64-multibuild.eclass exports USE flags and utility functions -# necessary to build packages for multilib int64 multibuild in a clean -# and uniform manner. - -if [[ ! ${_NUMERIC_INT64_MULTILIB_ECLASS} ]]; then - -# EAPI=5 is required for meaningful MULTILIB_USEDEP. -case ${EAPI:-0} in - 5) - inherit multilib ;; - 6|7) ;; - *) die "EAPI=${EAPI} is not supported" ;; -esac - -inherit alternatives-2 eutils fortran-2 multilib-build numeric toolchain-funcs - -IUSE="int64" - -# @ECLASS-VARIABLE: NUMERIC_INT32_SUFFIX -# @INTERNAL -# @DESCRIPTION: -# MULTIBUILD_ID suffix for int32 build -NUMERIC_INT32_SUFFIX="int32" - -# @ECLASS-VARIABLE: NUMERIC_INT64_SUFFIX -# @INTERNAL -# @DESCRIPTION: -# MULTIBUILD_ID suffix for int64 build -NUMERIC_INT64_SUFFIX="int64" - -# @ECLASS-VARIABLE: NUMERIC_STATIC_SUFFIX -# @INTERNAL -# @DESCRIPTION: -# MULTIBUILD_ID suffix for static build -NUMERIC_STATIC_SUFFIX="static" - -# @FUNCTION: numeric-int64_is_int64_build -# @DESCRIPTION: -# Returns shell true if the current multibuild is a int64 build, -# else returns shell false. -# -# Example: -# -# @CODE -# $(numeric-int64_is_int64_build) && \ -# openblas_abi_cflags+=" -DOPENBLAS_USE64BITINT" -# @CODE -numeric-int64_is_int64_build() { - debug-print-function ${FUNCNAME} "${@}" - if [[ "${MULTIBUILD_ID}" =~ "${NUMERIC_INT64_SUFFIX}" ]]; then - return 0 - else - return 1 - fi -} - -# @FUNCTION: numeric-int64_is_static_build -# @DESCRIPTION: -# Returns shell true if current multibuild is a static build, -# else returns shell false. -# -# Example: -# -# @CODE -# if $(numeric-int64_is_static_build); then -# dolib.a lib*a -# fi -# @CODE -numeric-int64_is_static_build() { - debug-print-function ${FUNCNAME} "${@}" - if [[ "${MULTIBUILD_ID}" =~ "${NUMERIC_STATIC_SUFFIX}" ]]; then - return 0 - else - return 1 - fi -} - -# @FUNCTION: numeric-int64_get_module_name -# @USAGE: [<module_name>] -# @DESCRIPTION: -# Return the numeric module name, without the .pc extension, -# for the current fortran int64 build. If the current build is not an int64 -# build, and the ebuild does not have dynamic, threads or openmp USE flags or -# they are disabled, then the module_name is ${NUMERIC_MODULE_NAME} or -# <module_name> if <module_name> is specified. -# -# Takes an optional <module_name> parameter. If no <module_name> is specified, -# uses ${NUMERIC_MODULE_NAME} as the base to calculate the module_name for the -# current build. -# -# Example: -# -# @CODE -# NUMERIC_MODULE_NAME=blas -# profname=$(numeric-int64_get_module_name) -# -# int32 build: -# -> profname == blas -# -# int64 build: -# -> profname == blas-int64 -# @CODE -numeric-int64_get_module_name() { - debug-print-function ${FUNCNAME} "${@}" - local module_name="${1:-${NUMERIC_MODULE_NAME}}" - if has dynamic ${IUSE} && use dynamic; then - module_name+="-dynamic" - fi - if $(numeric-int64_is_int64_build); then - module_name+="-${NUMERIC_INT64_SUFFIX}" - fi - # choose posix threads over openmp when the two are set - # yet to see the need of having the two profiles simultaneously - if in_iuse threads && use threads; then - module_name+="-threads" - elif in_iuse openmp && use openmp; then - module_name+="-openmp" - fi - echo "${module_name}" -} - -# @FUNCTION: _numeric-int64_get_numeric_alternative -# @INTERNAL -_numeric-int64_get_numeric_alternative() { - debug-print-function ${FUNCNAME} "${@}" - local alternative_name="${1}" - if $(numeric-int64_is_int64_build); then - alternative_name+="-${NUMERIC_INT64_SUFFIX}" - fi - echo "${alternative_name}" -} - -# @FUNCTION: numeric-int64_get_blas_alternative -# @DESCRIPTION: -# Returns the eselect blas alternative for the current -# int build type. Which is blas-int64 if called from an int64 build, -# or blas otherwise. -numeric-int64_get_blas_alternative() { - debug-print-function ${FUNCNAME} "${@}" - _numeric-int64_get_numeric_alternative blas -} - -# @FUNCTION: numeric-int64_get_cblas_alternative -# @DESCRIPTION: -# Returns the eselect cblas alternative for the current -# int build type. Which is cblas-int64 if called from an int64 build, -# or cblas otherwise. -numeric-int64_get_cblas_alternative() { - debug-print-function ${FUNCNAME} "${@}" - _numeric-int64_get_numeric_alternative cblas -} - -# @FUNCTION: numeric-int64_get_xblas_alternative -# @DESCRIPTION: -# Returns the eselect xblas alternative for the current -# int build type. Which is xblas-int64 if called from an int64 build, -# or xblas otherwise. -numeric-int64_get_xblas_alternative() { - debug-print-function ${FUNCNAME} "${@}" - _numeric-int64_get_numeric_alternative xblas -} - -# @FUNCTION: numeric-int64_get_lapack_alternative -# @DESCRIPTION: -# Returns the eselect lapack alternative for the current -# int build type. Which is lapack-int64 if called from an int64 build, -# or lapack otherwise. -numeric-int64_get_lapack_alternative() { - debug-print-function ${FUNCNAME} "${@}" - _numeric-int64_get_numeric_alternative lapack -} - -# @FUNCTION: numeric-int64_get_blas_module_name -# @DESCRIPTION: -# Returns the pkg-config file name, without the .pc extension, -# for the currently selected blas-int64 module if we are performing an int64 -# build, or the currently selected blas module otherwise. -numeric-int64_get_blas_module_name() { - debug-print-function ${FUNCNAME} "${@}" - local blas_alternative=$(numeric-int64_get_blas_alternative) - local blas_symlinks=( $(eselect "${blas_alternative}" files) ) - local blas_prof_symlink="$(readlink -f ${blas_symlinks[0]})" - local blas_prof_file="${blas_prof_symlink##*/}" - echo "${blas_prof_file%.pc}" -} - -# @FUNCTION: numeric-int64_get_xblas_module_name -# @DESCRIPTION: -# Returns the xblas pkg-config file name, -# without the .pc extension, for the current build. Which is xblas-int64 if -# we are performing an int64 build, or xblas otherwise. -numeric-int64_get_xblas_module_name() { - debug-print-function ${FUNCNAME} "${@}" - local xblas_provider="xblas" - if $(numeric-int64_is_int64_build); then - xblas_provider+="-${INT64_SUFFIX}" - fi - echo "${xblas_provider}" -} - -# @FUNCTION: numeric-int64_get_fortran_int64_abi_fflags -# @DESCRIPTION: -# Return the Fortran compiler flag to enable 64 bit integers for -# array indices if we are performing an int64 build, or the empty string -# otherwise. -# -# Example: -# -# @CODE -# src_configure() { -# my_configure() { -# export FCFLAGS="${FCFLAGS} $(get_abi_CFLAGS) $(numeric-int64_get_fortran_int64_abi_fflags)" -# econf $(use_enable fortran) -# } -# numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_configure -# } -# @CODE -numeric-int64_get_fortran_int64_abi_fflags() { - debug-print-function ${FUNCNAME} "${@}" - $(numeric-int64_is_int64_build) && echo "$(fortran_int64_abi_fflags)" -} - -# @FUNCTION: numeric-int64_get_multibuild_int_variants -# @DESCRIPTION: -# Returns the array of int64 and int32 -# multibuild combinations. -numeric-int64_get_multibuild_int_variants() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( int32 ) variant - - in_iuse int64 && use int64 && MULTIBUILD_VARIANTS+=( int64 ) - - echo "${MULTIBUILD_VARIANTS[@]}" -} - -# @FUNCTION: numeric-int64_get_multibuild_variants -# @DESCRIPTION: -# Returns the array of int64, int32 and static -# multibuild combinations. -numeric-int64_get_multibuild_variants() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=$(numeric-int64_get_multibuild_int_variants) - if in_iuse static-libs && use static-libs; then - for variant in ${MULTIBUILD_VARIANTS[@]}; do - MULTIBUILD_VARIANTS+=( static_${variant} ) - done - fi - echo "${MULTIBUILD_VARIANTS[@]}" -} - -# @FUNCTION: numeric-int64_get_all_abi_variants -# @DESCRIPTION: -# Returns the array of int64, int32 and static build combinations -# combined with all multilib ABI variants. -numeric-int64_get_all_abi_variants() { - debug-print-function ${FUNCNAME} "${@}" - local abi ret=() variant - - for abi in $(multilib_get_enabled_abi_pairs); do - for variant in $(numeric-int64_get_multibuild_variants); do - if [[ ${variant} =~ int64 ]]; then - [[ ${abi} =~ amd64 ]] && ret+=( ${abi}_${variant} ) - else - ret+=( ${abi}_${variant} ) - fi - done - done - echo "${ret[@]}" -} - -# @FUNCTION: numeric-int64_ensure_blas_int_support -# @DESCRIPTION: -# Check the blas supports the necessary int types in the currently -# selected blas module. -# -# Example: -# -# @CODE -# src_prepare() { -# numeric-int64_ensure_blas_int_support -# ... -# @CODE -numeric-int64_ensure_blas_int_support() { - local MULTILIB_INT64_VARIANTS=( $(numeric-int64_get_multibuild_variants) ) - local MULTIBUILD_ID - for MULTIBUILD_ID in "${MULTILIB_INT64_VARIANTS[@]}"; do - local blas_module_name=$(numeric-int64_get_blas_module_name) - $(tc-getPKG_CONFIG) --exists "${blas_module_name}" \ - || die "${PN} requires the pkgbuild module ${blas_module_name}" - done -} - -# @FUNCTION: numeric-int64-multibuild_install_alternative -# @USAGE: <alternative name> <provider name> [extra files sources] [extra files dest] -# @DESCRIPTION: -# Install alternatives pc file and extra files for all providers for all multilib ABIs. -numeric-int64-multibuild_install_alternative() { - debug-print-function ${FUNCNAME} "${@}" - [[ $# -lt 2 ]] && die "${FUNCNAME} needs at least two arguments" - pc_file() { - debug-print-function ${FUNCNAME} "${@}" - numeric-int64_is_static_build && return - local alternative=$(_numeric-int64_get_numeric_alternative "$1") - local module_name=$(numeric-int64_get_module_name) - printf \ - "/usr/$(get_libdir)/pkgconfig/${alternative}.pc ${module_name}.pc " \ - >> "${T}"/alternative-${alternative}.sh || die - } - pc_install() { - debug-print-function ${FUNCNAME} "${@}" - numeric-int64_is_static_build && return - local alternative=$(_numeric-int64_get_numeric_alternative "$1") - local module_name=$(numeric-int64_get_module_name $2) - shift 2 - alternatives_for \ - ${alternative} ${module_name} 0 \ - $(cat "${T}"/alternative-${alternative}.sh) ${@} - rm "${T}"/alternative-${alternative}.sh || die - } - numeric-int64-multibuild_foreach_all_abi_variants pc_file ${@} - numeric-int64-multibuild_foreach_int_abi pc_install ${@} -} - -# @FUNCTION: numeric-int64-multibuild_multilib_wrapper -# @USAGE: <argv>... -# @DESCRIPTION: -# Initialize the environment for ABI selected for multibuild. -# -# Example: -# -# @CODE -# multibuild_foreach_variant run_in_build_dir \ -# numeric-int64-multibuild_multilib_wrapper my_src_install -# @CODE -numeric-int64-multibuild_multilib_wrapper() { - debug-print-function ${FUNCNAME} "${@}" - - local v="${MULTIBUILD_VARIANT%_*}" - # MULTIBUILD_VARIANT could be abi_x86_64.amd64_static_int32 - v=${v%_${NUMERIC_STATIC_SUFFIX}} - local ABI="${v#*.}" - # hack: our int64 and int32 ABIs can correspond to the same ABI - # in multilib, resulting in multiple sed replacements of headers - # and thus error like "Flag not listed in wrapper template." - # Using MULTILIB_ABI_FLAG="${ABI}", the corresponding header - # is ignored. - local MULTILIB_ABI_FLAG - case ${MULTIBUILD_VARIANT} in - *_${NUMERIC_STATIC_SUFFIX}*|*_${NUMERIC_INT64_SUFFIX}) - MULTILIB_ABI_FLAG="${ABI}" - ;; - *_${NUMERIC_INT32_SUFFIX}) - MULTILIB_ABI_FLAG="${v%.*}" - ;; - esac - - multilib_toolchain_setup "${ABI}" - readonly ABI - "${@}" || die -} - -# @FUNCTION: numeric-int64-multibuild_foreach_int_abi -# @USAGE: <argv> ... -# @DESCRIPTION: -# Run command for each enabled numeric variant (e.g. int32, int64) -numeric-int64-multibuild_foreach_int_abi() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( $(numeric-int64_get_multibuild_int_variants) ) - multibuild_foreach_variant numeric-int64-multibuild_multilib_wrapper "${@}" -} - -# @FUNCTION: numeric-int64-multibuild_foreach_variant -# @USAGE: <argv> ... -# @DESCRIPTION: -# Run command for each enabled numeric abi and static-libs (e.g. int32, int64, static) -numeric-int64-multibuild_foreach_variant() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( $(numeric-int64_get_multibuild_variants) ) - multibuild_foreach_variant numeric-int64-multibuild_multilib_wrapper "${@}" -} - -# @FUNCTION: numeric-int64-multibuild_foreach_all_abi_variants -# @USAGE: <argv> ... -# @DESCRIPTION: -# Run command for each enabled numeric variant (e.g. int32, int64, static) _AND_ -# enabled multilib ABI -numeric-int64-multibuild_foreach_all_abi_variants() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( $(numeric-int64_get_all_abi_variants) ) - multibuild_foreach_variant numeric-int64-multibuild_multilib_wrapper "${@}" -} - -# @FUNCTION: numeric-int64-multibuild_copy_sources -# @DESCRIPTION: -# Thin wrapper around multibuild_copy_sources() -numeric-int64-multibuild_copy_sources() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( $(numeric-int64_get_all_abi_variants) ) - multibuild_copy_sources -} - -_NUMERIC_INT64_MULTILIB_ECLASS=1 -fi diff --git a/eclass/numeric.eclass b/eclass/numeric.eclass deleted file mode 100644 index 431b7afec..000000000 --- a/eclass/numeric.eclass +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: numeric.eclass -# @MAINTAINER: -# jlec@gentoo.org -# @BLURB: Maintance bits needed for *lapack* and *blas* packages -# @DESCRIPTION: -# Various functions which make the maintenance numerical algebra packages -# easier. - -if [[ ! ${_NUMERIC_ECLASS} ]]; then - -case ${EAPI:-0} in - 0|1|2|3|4|5) - inherit multilib ;; - 6|7) ;; - *) die "EAPI=${EAPI} is not supported" ;; -esac - -# @VARIABLE: NUMERIC_MODULE_NAME -# @DESCRIPTION: -# The base pkg-config module name of the package being built. -# NUMERIC_MODULE_NAME is used by the numeric-int64_get_module_name to -# determine the pkg-config module name based on whether the package -# has dynamic, threads or openmp USE flags and if so, if the user has -# turned them or, and if the current multibuild is a int64 build or not. -# -# @CODE -# NUMERIC_MODULE_NAME="openblas" -# inherit ... numeric-int64-multibuild -# @CODE -: ${NUMERIC_MODULE_NAME:=blas} - -# @FUNCTION: create_pkgconfig -# @USAGE: [ additional arguments ] -# @DESCRIPTION: -# Creates and installs pkg-config file. The function should only be executed in -# src_install(). For further information about optional arguments please consult -# http://people.freedesktop.org/~dbn/pkg-config-guide.html -# -# @CODE -# Optional arguments are: -# -# -p | --prefix Offset for current package (${EPREFIX}/usr) -# -e | --exec-prefix Offset for current package (${prefix}) -# -L | --libdir Libdir to use (${prefix}/$(get_libdir)) -# -I | --includedir Includedir to use (${prefix}/include) -# -n | --name A human-readable name (PN} -# -d | --description A brief description (DESCRIPTION) -# -V | --version Version of the package (PV) -# -u | --url Web presents (HOMEPAGE) -# -r | --requires Packages required by this package (unset) -# -l | --libs Link flags specific to this package (unset) -# -c | --cflags Compiler flags specific to this package (unset) -# --requires-private Like --requires, but not exposed (unset) -# --conflicts Packages that this one conflicts with (unset) -# --libs-private Like --libs, but not exposed (unset) -# @CODE -create_pkgconfig() { - debug-print-function ${FUNCNAME} "${@}" - local pcfilename pcrequires pcrequirespriv pcconflicts pclibs pclibspriv pccflags - local pcprefix="${EPREFIX}/usr" - local pcexecprefix="${pcprefix}" - local pclibdir="${EPREFIX}/usr/$(get_libdir)" - local pcincldir="${pcprefix}/include" - local pcname=${PN} - local pcdescription="${DESCRIPTION}" - local pcurl=${HOMEPAGE} - local pcversion=${PV} - - [[ "${EBUILD_PHASE}" != "install" ]] && \ - die "create_pkgconfig should only be used in src_install()" - - while (($#)); do - case ${1} in - -p | --prefix ) - shift; pcprefix=${1} ;; - -e | --exec-prefix ) - shift; pcexecprefix=${1} ;; - -L | --libdir ) - shift; pclibdir=${1} ;; - -I | --includedir ) - shift; pcincldir=${1} ;; - -n | --name ) - shift; pcname=${1} ;; - -d | --description ) - shift; pcdescription=${1} ;; - -V | --version ) - shift; pcversion=${1} ;; - -u | --url ) - shift; pcurl=${1} ;; - -r | --requires ) - shift; pcrequires=${1} ;; - --requires-private ) - shift; pcrequirespriv=${1} ;; - --conflicts ) - shift; pcconflicts=${1};; - -l | --libs ) - shift; pclibs=${1} ;; - --libs-private ) - shift; pclibspriv=${1} ;; - -c | --cflags ) - shift; pccflags=${1} ;; - -* ) - ewarn "Unknown option ${1}" ;; - * ) - pcfilename=${1} ;; - esac - shift - done - - [[ -z ${pcfilename} ]] && die "Missing name for pkg-config file" - - cat > "${T}"/${pcfilename}.pc <<- EOF - prefix="${pcprefix}" - exec_prefix="${pcexecprefix}" - libdir="${pclibdir}" - includedir="${pcincldir}" - - Name: ${pcname} - Description: ${pcdescription} - Version: ${pcversion} - URL: ${pcurl} - Requires: ${pcrequires} - Requires.private: ${pcrequirespriv} - Conflicts: ${pcconflicts} - Libs: -L\${libdir} ${pclibs} - Libs.private: ${pclibspriv} - Cflags: -I\${includedir} ${pccflags} - EOF - - insinto /usr/$(get_libdir)/pkgconfig - doins "${T}"/${pcfilename}.pc -} - -_NUMERIC_ECLASS=1 -fi |