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

Diff of /eclass/leechcraft.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.16
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2014 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.16 2014/08/03 17:08:27 maksbotan 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
24case ${EAPI:-0} in 24case ${EAPI:-0} in
25 4|3|2) ;; 25 4|5) ;;
26 0|1) die "EAPI not supported, bug ebuild mantainer" ;; 26 0|1|2|3) die "EAPI not supported, bug ebuild mantainer" ;;
27 *) die "Unknown EAPI, bug eclass maintainers" ;; 27 *) die "Unknown EAPI, bug eclass maintainers" ;;
28esac 28esac
29 29
30inherit cmake-utils versionator 30inherit cmake-utils toolchain-funcs versionator
31 31
32if [[ ${PV} == 9999 ]]; then 32if [[ ${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
37else 37else
38 local suffix 38 DEPEND="app-arch/xz-utils"
39 if version_is_at_least 0.4.95; then 39 SRC_URI="http://dist.leechcraft.org/LeechCraft/${PV}/leechcraft-${PV}.tar.xz"
40 suffix="xz"
41 else
42 suffix="bz2"
43 fi
44 SRC_URI="mirror://sourceforge/leechcraft/leechcraft-${PV}.tar.${suffix}"
45 S="${WORKDIR}/leechcraft-${PV}" 40 S="${WORKDIR}/leechcraft-${PV}"
46fi 41fi
47 42
48HOMEPAGE="http://leechcraft.org/" 43HOMEPAGE="http://leechcraft.org/"
49LICENSE="GPL-3" 44LICENSE="Boost-1.0"
50 45
51# @ECLASS-VARIABLE: LEECHCRAFT_PLUGIN_CATEGORY 46# @ECLASS-VARIABLE: LEECHCRAFT_PLUGIN_CATEGORY
52# @DEFAULT_UNSET 47# @DEFAULT_UNSET
53# @DESCRIPTION: 48# @DESCRIPTION:
54# Set this to the category of the plugin, if any. 49# Set this to the category of the plugin, if any.
55: ${LEECHCRAFT_PLUGIN_CATEGORY:=} 50: ${LEECHCRAFT_PLUGIN_CATEGORY:=}
56 51
57if [[ "${LEECHCRAFT_PLUGIN_CATEGORY}" ]]; then 52if [[ "${LEECHCRAFT_PLUGIN_CATEGORY}" ]]; then
58 CMAKE_USE_DIR="${S}"/src/plugins/${LEECHCRAFT_PLUGIN_CATEGORY}/${PN#leechcraft-} 53 CMAKE_USE_DIR="${S}"/src/plugins/${LEECHCRAFT_PLUGIN_CATEGORY}/${PN#lc-}
59elif [[ ${PN} != leechcraft-core ]]; then 54elif [[ ${PN} != lc-core ]]; then
60 CMAKE_USE_DIR="${S}"/src/plugins/${PN#leechcraft-} 55 CMAKE_USE_DIR="${S}"/src/plugins/${PN#lc-}
61else 56else
62 CMAKE_USE_DIR="${S}"/src 57 CMAKE_USE_DIR="${S}"/src
63fi 58fi
59
60EXPORT_FUNCTIONS "pkg_pretend"
61
62# @FUNCTION: leechcraft_pkg_pretend
63# @DESCRIPTION:
64# Determine active compiler version and refuse to build
65# if it is not satisfied at least to minimal version,
66# supported by upstream developers
67leechcraft_pkg_pretend() {
68 debug-print-function ${FUNCNAME} "$@"
69
70 # 0.5.85 and later requires at least gcc 4.6
71 if [[ ${MERGE_TYPE} != binary ]]; then
72 [[ $(gcc-major-version) -lt 4 ]] || \
73 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ]] ) \
74 && die "Sorry, but gcc 4.6 or higher is required."
75 fi
76 if version_is_at_least 0.6.66 || ( [[ ${PN} == lc-monocle ]] && version_is_at_least 0.6.65 ); then
77 # 0.6.65 monocle and all later plugins require at least gcc 4.8
78 if [[ ${MERGE_TYPE} != binary ]]; then
79 [[ $(gcc-major-version) -lt 4 ]] || \
80 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 8 ]] ) \
81 && die "Sorry, but gcc 4.8 or higher is required."
82 fi
83 fi
84}

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20