* [gentoo-commits] proj/sci:pkg-config commit in: eclass/
@ 2012-11-29 7:11 Justin Lecher
0 siblings, 0 replies; 2+ messages in thread
From: Justin Lecher @ 2012-11-29 7:11 UTC (permalink / raw
To: gentoo-commits
commit: 1217b9add9d88d9174efa5f3f4a5d0c944607915
Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 28 20:41:46 2012 +0000
Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Wed Nov 28 20:41:46 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=1217b9ad
full featured
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
---
eclass/pkgconfig.eclass | 161 +++++++++++++++++++++++++++++------------------
1 files changed, 100 insertions(+), 61 deletions(-)
diff --git a/eclass/pkgconfig.eclass b/eclass/pkgconfig.eclass
index e56e54e..cd401de 100644
--- a/eclass/pkgconfig.eclass
+++ b/eclass/pkgconfig.eclass
@@ -15,41 +15,43 @@ inherit multilib
# @REQUIRED
# @DESCRIPTION:
# Offset for current package
-:{PC_PREFIX:-"${EPREFIX}/usr"}
+: ${PC_PREFIX:="${EPREFIX}/usr"}
# @ECLASS-VARIABLE: PC_EXEC_PREFIX
# @REQUIRED
# @DESCRIPTION:
# Offset for current package
-:{PC_EXEC_PREFIX:-"${PC_PREFIX}"}
+: ${PC_EXEC_PREFIX:="${PC_PREFIX}"}
# @ECLASS-VARIABLE: PC_LIBDIR
# @DESCRIPTION:
-# libdir to use, defaults to standard system libdir aka /usr/lib*
+# libdir to use
+: ${PC_LIBDIR:="${EPREFIX}/usr/$(get_libdir)"}
# @ECLASS-VARIABLE: PC_INCLUDEDIR
# @DESCRIPTION:
-# include dir to use, defaults to standard system libdir aka /usr/include
-:{PC_INCLUDEDIR:-"${PC_PREFIX}/include"}
+# include dir to use
+: ${PC_INCLUDEDIR:="${PC_PREFIX}/include"}
-# A human-readable name for the library or package, defaults to PN
-: {PC_NAME:-${PN}}
+# @ECLASS-VARIABLE: PC_NAME
+# @DESCRIPTION:
+# A human-readable name for the library or package
+: ${PC_NAME:=${PN}}
# @ECLASS-VARIABLE: PC_DESCRIPTION
# @DESCRIPTION:
-# A brief description of the package, defaults to DESCRIPTION
-:{PC_DESCRIPTION:-DESCRIPTION}
+# A brief description of the package
+: ${PC_DESCRIPTION:=${DESCRIPTION}}
# @ECLASS-VARIABLE: PC_URL
# @DESCRIPTION:
-# An URL where people can get more information about and download the package,
-# defaults to HOMEPAGE
-:{PC_URL:-HOMEPAGE}
+# An URL where people can get more information about and download the package
+: ${PC_URL:=${HOMEPAGE}}
# @ECLASS-VARIABLE: PC_VERSION
# @DESCRIPTION:
-# A string specifically defining the version of the package, defaults to ${PV}
-:{PC_VERSION:-PV}
+# A string specifically defining the version of the package
+: ${PC_VERSION:=${PV}}
# @ECLASS-VARIABLE: PC_REQUIRES
# @DEFAULT_UNSET
@@ -64,7 +66,7 @@ inherit multilib
# applications. The version specific rules from the PC_REQUIRES field also
# apply here.
-# @ECLASS-VARIABLE: PC_CONFLICT
+# @ECLASS-VARIABLE: PC_CONFLICTS
# @DEFAULT_UNSET
# @DESCRIPTION:
# An optional field describing packages that this one conflicts with.
@@ -72,13 +74,6 @@ inherit multilib
# This field also takes multiple instances of the same package. E.g.,
# Conflicts: bar < 1.2.3, bar >= 1.3.0.
-# @ECLASS-VARIABLE: PC_CFLAGS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# The compiler flags specific to this package and any required libraries
-# that don't support pkg-config. If the required libraries support
-# pkg-config, they should be added to PC_REQUIRES or PC_REQUIRES_PRIVATE.
-
# @ECLASS-VARIABLE: PC_LIBS
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -91,46 +86,90 @@ inherit multilib
# The link flags for private libraries required by this package but not
# exposed to applications. The same rule as PC_CFLAGS applies here.
+# @ECLASS-VARIABLE: PC_CFLAGS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The compiler flags specific to this package and any required libraries
+# that don't support pkg-config. If the required libraries support
+# pkg-config, they should be added to PC_REQUIRES or PC_REQUIRES_PRIVATE.
+
# @FUNCTION: create_pkgconfig
+# @USAGE: [-p | --prefix PC_PREFIX] [-e | --exec-prefix PC_EXEC_PREFIX] [-L | --libdir PC_LIBDIR ] [-I | --includedir PC_INCLUDEDIR ] [-n | --name PC_NAME] [-d | --description PC_DESCRIPTION] [-V | --version PC_VERSION] [-u | --url PC_URL] [-r | --requires PC_REQUIRES] [--requires-private PC_REQUIRES_PRIVATE] [--conflicts PC_CONFLICTS] [-l | --libs PC_LIBS] [--libs-private PC_LIBS_PRIVATE] [-c | --cflags PC_CFLAGS] <filename>
# @DESCRIPTION:
+# Creates and installs .pc file. Function arguments overrule the global set
+# eclass variables. The function should only be executed in src_install().
create_pkgconfig() {
- local name
- case ${1} in
- -i | --includedir )
- shift
- PC_INCLUDEDIR=${1}
- ;;
- -l | --libdir )
- shift
- PC_LIBDIR=${1}
- ;;
- -* )
- die "Unknown option ${1}"
- * )
- name=${1}
- ;;
- esac
-
- [[ -z ${name} ]] && die "Missing name for pkg-config file"
- [[ -z ${PC_LIBDIR]] || PC_LIBDIR="${EPREFIX}/usr/$(get_libdir)"
-
- cat > ${T}/${pcname}.pc <<- EOF
- prefix="${EPREFIX}/usr"
-exec_prefix=\${prefix}
-libdir=\${prefix}/$(get_libdir)
-includedir=\${prefix}/include
-
-Name: ${pcname}
-Description: ${PN} ${pcname}
-Version: ${PV}
-URL: ${HOMEPAGE}
-Requires:
-Requires.private:
-Conflicts:
-Libs.private:
-Libs: -L\${libdir} -l${libname} $@
-Cflags: -I\${includedir}/${PN}
-${PCREQ}
-EOF
-
+ local pcname
+
+ [[ "${EBUILD_PHASE}" != "install" ]] && \
+ die "create_pkgconfig should only be used in src_install()"
+
+ while (($#)); do
+ case ${1} in
+ -p | --prefix )
+ shift; PC_PREFIX=${1} ;;
+ -e | --exec-prefix )
+ shift; PC_EXEC_PREFIX=${1} ;;
+ -L | --libdir )
+ shift; PC_LIBDIR=${1} ;;
+ -I | --includedir )
+ shift; PC_INCLUDEDIR=${1} ;;
+ -n | --name )
+ shift; PC_NAME=${1} ;;
+ -d | --description )
+ shift; PC_DESCRIPTION=${1} ;;
+ -V | --version )
+ shift; PC_VERSION=${1} ;;
+ -u | --url )
+ shift; PC_URL=${1} ;;
+ -r | --requires )
+ shift; PC_REQUIRES=${1} ;;
+ --requires-private )
+ shift; PC_REQUIRES_PRIVATE=${1} ;;
+ --conflicts )
+ shift; PC_CONFLICTS=${1};;
+ -l | --libs )
+ shift; PC_LIBS=${1} ;;
+ --libs-private )
+ shift; PC_LIBS_PRIVATE=${1} ;;
+ -c | --cflags )
+ shift; PC_CFLAGS=${1} ;;
+ -* )
+ ewarn "Unknown option ${1}" ;;
+ * )
+ pcname=${1} ;;
+ esac
+ shift
+ done
+
+ [[ -z ${pcname} ]] && die "Missing name for pkg-config file"
+ : ${PC_PREFIX:="${EPREFIX}/usr"}
+ : ${PC_EXEC_PREFIX:="${PC_PREFIX}"}
+ : ${PC_LIBDIR:="${EPREFIX}/usr/$(get_libdir)"}
+ : ${PC_INCLUDEDIR:="${PC_PREFIX}/include"}
+ : ${PC_NAME:=${PN}}
+ : ${PC_DESCRIPTION:=${DESCRIPTION}}
+ : ${PC_URL:=${HOMEPAGE}}
+ : ${PC_VERSION:=${PV}}
+
+ cat > "${T}"/${pcname}.pc <<- EOF
+ prefix="${PC_PREFIX}"
+ exec_prefix="${PC_EXEC_PREFIX}"
+ libdir="${PC_LIBDIR}"
+ includedir="${PC_INCLUDEDIR}"
+
+ Name: ${PC_NAME}
+ Description: ${PC_DESCRIPTION}
+ Version: ${PC_VERSION}
+ URL: ${PC_URL}
+ Requires: ${PC_REQUIRES}
+ Requires.private: ${PC_REQUIRES_PRIVATE}
+ Conflicts: ${PC_CONFLICTS}
+ Cflags: ${PC_CFLAGS}
+ Libs: ${PC_LIBS}
+ Libs.private: ${PC_LIBS_PRIVATE}
+ EOF
+
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins "${T}"/${pcname}.pc
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/sci:pkg-config commit in: eclass/
@ 2012-11-29 7:11 Justin Lecher
0 siblings, 0 replies; 2+ messages in thread
From: Justin Lecher @ 2012-11-29 7:11 UTC (permalink / raw
To: gentoo-commits
commit: 40fca611523c9846f0576a1bf5865cafa0a3ab96
Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 28 21:44:30 2012 +0000
Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Wed Nov 28 21:44:30 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=40fca611
Keep order in pc file
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
---
eclass/pkgconfig.eclass | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/eclass/pkgconfig.eclass b/eclass/pkgconfig.eclass
index cd401de..f706a82 100644
--- a/eclass/pkgconfig.eclass
+++ b/eclass/pkgconfig.eclass
@@ -165,9 +165,9 @@ create_pkgconfig() {
Requires: ${PC_REQUIRES}
Requires.private: ${PC_REQUIRES_PRIVATE}
Conflicts: ${PC_CONFLICTS}
- Cflags: ${PC_CFLAGS}
Libs: ${PC_LIBS}
Libs.private: ${PC_LIBS_PRIVATE}
+ Cflags: ${PC_CFLAGS}
EOF
insinto /usr/$(get_libdir)/pkgconfig
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-29 7:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29 7:11 [gentoo-commits] proj/sci:pkg-config commit in: eclass/ Justin Lecher
-- strict thread matches above, loose matches on Subject: below --
2012-11-29 7:11 Justin Lecher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox