/[gentoo-x86]/eclass/leechcraft.eclass
Gentoo

Contents of /eclass/leechcraft.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue Apr 30 07:51:24 2013 UTC (15 months, 3 weeks ago) by pinkbyte
Branch: MAIN
Changes since 1.8: +6 -2 lines
Leechcraft changed license since 0.5.95

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/leechcraft.eclass,v 1.8 2013/03/09 19:52:38 maksbotan Exp $
4 #
5 # @ECLASS: leechcraft.eclass
6 # @MAINTAINER:
7 # leechcraft@gentoo.org
8 # @AUTHOR:
9 # 0xd34df00d@gmail.com
10 # NightNord@niifaq.ru
11 # @BLURB: Common functions and setup utilities for the LeechCraft app
12 # @DESCRIPTION:
13 # The leechcraft eclass contains a common set of functions and steps
14 # needed to build LeechCraft core or its plugins.
15 #
16 # Though this eclass seems to be small at the moment, it seems like a
17 # good idea to make all plugins inherit from it, since all plugins
18 # have mostly the same configuring/build process.
19 #
20 # Thanks for original eclass to Andrian Nord <NightNord@niifaq.ru>.
21 #
22 # Only EAPI >1 supported
23
24 case ${EAPI:-0} in
25 2|3|4|5) ;;
26 0|1) die "EAPI not supported, bug ebuild mantainer" ;;
27 *) die "Unknown EAPI, bug eclass maintainers" ;;
28 esac
29
30 inherit cmake-utils toolchain-funcs versionator
31
32 if [[ ${PV} == 9999 ]]; then
33 EGIT_REPO_URI="git://github.com/0xd34df00d/leechcraft.git"
34 EGIT_PROJECT="leechcraft"
35
36 inherit git-2
37 else
38 local suffix
39 if version_is_at_least 0.4.95; then
40 DEPEND="app-arch/xz-utils"
41 suffix="xz"
42 else
43 suffix="bz2"
44 fi
45 SRC_URI="mirror://sourceforge/leechcraft/leechcraft-${PV}.tar.${suffix}"
46 S="${WORKDIR}/leechcraft-${PV}"
47 fi
48
49 HOMEPAGE="http://leechcraft.org/"
50 if version_is_at_least 0.5.95; then
51 LICENSE="Boost-1.0"
52 else
53 LICENSE="GPL-3"
54 fi
55
56 # @ECLASS-VARIABLE: LEECHCRAFT_PLUGIN_CATEGORY
57 # @DEFAULT_UNSET
58 # @DESCRIPTION:
59 # Set this to the category of the plugin, if any.
60 : ${LEECHCRAFT_PLUGIN_CATEGORY:=}
61
62 if [[ "${LEECHCRAFT_PLUGIN_CATEGORY}" ]]; then
63 CMAKE_USE_DIR="${S}"/src/plugins/${LEECHCRAFT_PLUGIN_CATEGORY}/${PN#lc-}
64 elif [[ ${PN} != lc-core ]]; then
65 CMAKE_USE_DIR="${S}"/src/plugins/${PN#lc-}
66 else
67 CMAKE_USE_DIR="${S}"/src
68 fi
69
70 EXPORT_FUNCTIONS "pkg_pretend"
71
72 # @FUNCTION: leechcraft_pkg_pretend
73 # @DESCRIPTION:
74 # Determine active compiler version and refuse to build
75 # if it is not satisfied at least to minimal version,
76 # supported by upstream developers
77 leechcraft_pkg_pretend() {
78 debug-print-function ${FUNCNAME} "$@"
79
80 if version_is_at_least 0.5.85; then
81 # 0.5.85 and later requires at least gcc 4.6
82 if [[ ${MERGE_TYPE} != binary ]]; then
83 [[ $(gcc-major-version) -lt 4 ]] || \
84 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ]] ) \
85 && die "Sorry, but gcc 4.6 or higher is required."
86 fi
87 fi
88 }

  ViewVC Help
Powered by ViewVC 1.1.20