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