Commits

Barry Schwartz committed 0fae4e6

pmccabe-2.6

  • Participants
  • Parent commits 85edbd7

Comments (0)

Files changed (3)

File exlibs/toolchain-funcs.exlib

+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.69 2007/03/27 01:46:50 vapier Exp $
+#
+# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
+#
+# This eclass contains (or should) functions to get common info
+# about the toolchain (libc/compiler/binutils/etc...)
+
+# A simple way to see if we're using a cross-compiler ...
+tc-is-cross-compiler() {
+    illegal_in_global_scope
+
+    return $([[ ${CBUILD:-${CHOST}} != ${CHOST} ]])
+}
+
+# Returns the version as by `$CC -dumpversion`
+gcc-fullversion() {
+    illegal_in_global_scope
+
+    "${CC}" "$@" -dumpversion
+}
+# Returns the version, but only the <major>.<minor>
+gcc-version() {
+    illegal_in_global_scope
+
+    gcc-fullversion "$@" | cut -f1,2 -d.
+}
+# Returns the Major version
+gcc-major-version() {
+    illegal_in_global_scope
+
+    gcc-version "$@" | cut -f1 -d.
+}
+# Returns the Minor version
+gcc-minor-version() {
+    illegal_in_global_scope
+
+    gcc-version "$@" | cut -f2 -d.
+}
+# Returns the Micro version
+gcc-micro-version() {
+    illegal_in_global_scope
+
+    gcc-fullversion "$@" | cut -f3 -d. | cut -f1 -d-
+}
+
+# Returns the version as by `$CXX -dumpversion`
+gxx-fullversion() {
+    illegal_in_global_scope
+
+    "${CXX}" "$@" -dumpversion
+}
+# Returns the version, but only the <major>.<minor>
+gxx-version() {
+    illegal_in_global_scope
+
+    gxx-fullversion "$@" | cut -f1,2 -d.
+}
+# Returns the Major version
+gxx-major-version() {
+    illegal_in_global_scope
+
+    gxx-version "$@" | cut -f1 -d.
+}
+# Returns the Minor version
+gxx-minor-version() {
+    illegal_in_global_scope
+
+    gxx-version "$@" | cut -f2 -d.
+}
+# Returns the Micro version
+gxx-micro-version() {
+    illegal_in_global_scope
+
+    gxx-fullversion "$@" | cut -f3 -d. | cut -f1 -d-
+}
+
+# Check whether our selected compiler supports visibility
+has_visibility() {
+    illegal_in_global_scope
+
+    # We need >=sys-devel/gcc-4.1
+    [[ "${CC}" == *gcc* && $(gcc-major-version)$(gcc-minor-version) -ge 41 ]] || return 1
+}
+

File packages/debian/pmccabe/pmccabe-2.6.exheres-0

+# Copyright 2012 Barry Schwartz
+# Distributed under the terms of the GNU General Public License v2
+
+require pmccabe
+
+SLOT="0"
+PLATFORMS="~amd64"
+

File packages/debian/pmccabe/pmccabe.exlib

+# Copyright 2012 Barry Schwartz
+# Distributed under the terms of the GNU General Public License v2
+
+require debian-upstream
+
+SUMMARY="pmccabe: McCabe-style function complexity and line counting for C and C++"
+LICENCES="GPL-2"
+
+MYOPTIONS=""
+
+DEPENDENCIES=""
+
+WORK="${WORKBASE}/${PN}"
+
+export_exlib_phases src_prepare src_install
+
+pmccabe_src_prepare() {
+    edo sed -i -e 's/ -o pmccabe / $(LDFLAGS) -o pmccabe /' Makefile
+}
+
+pmccabe_src_install() {
+    dobin codechanges pmccabe decomment vifn
+    doman codechanges.1 pmccabe.1 vifn.1 decomment.1
+    emagicdocs
+}
+