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

Diff of /eclass/leechcraft.eclass

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

Revision 1.2 Revision 1.13
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.2 2011/08/22 18:20:34 maksbotan Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/leechcraft.eclass,v 1.13 2014/04/14 15:45:16 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 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 DEPEND="app-arch/xz-utils"
38 SRC_URI="mirror://sourceforge/leechcraft/leechcraft-${PV}.tar.bz2" 39 SRC_URI="mirror://sourceforge/leechcraft/leechcraft-${PV}.tar.xz
40 http://dist.leechcraft.org/LeechCraft/${PV}/leechcraft-${PV}.tar.xz"
39 S="${WORKDIR}/leechcraft-${PV}" 41 S="${WORKDIR}/leechcraft-${PV}"
40fi 42fi
41 43
42HOMEPAGE="http://leechcraft.org/" 44HOMEPAGE="http://leechcraft.org/"
45if version_is_at_least 0.5.95; then
46 LICENSE="Boost-1.0"
47else
43LICENSE="GPL-3" 48 LICENSE="GPL-3"
49fi
44 50
45# @ECLASS-VARIABLE: LEECHCRAFT_PLUGIN_CATEGORY 51# @ECLASS-VARIABLE: LEECHCRAFT_PLUGIN_CATEGORY
46# @DEFAULT_UNSET 52# @DEFAULT_UNSET
47# @DESCRIPTION: 53# @DESCRIPTION:
48# Set this to the category of the plugin, if any. 54# Set this to the category of the plugin, if any.
49: ${LEECHCRAFT_PLUGIN_CATEGORY:=} 55: ${LEECHCRAFT_PLUGIN_CATEGORY:=}
50 56
51if [[ "${LEECHCRAFT_PLUGIN_CATEGORY}" ]]; then 57if [[ "${LEECHCRAFT_PLUGIN_CATEGORY}" ]]; then
52 CMAKE_USE_DIR="${S}"/src/plugins/${LEECHCRAFT_PLUGIN_CATEGORY}/${PN#leechcraft-} 58 CMAKE_USE_DIR="${S}"/src/plugins/${LEECHCRAFT_PLUGIN_CATEGORY}/${PN#lc-}
53elif [[ ${PN} != leechcraft-core ]]; then 59elif [[ ${PN} != lc-core ]]; then
54 CMAKE_USE_DIR="${S}"/src/plugins/${PN#leechcraft-} 60 CMAKE_USE_DIR="${S}"/src/plugins/${PN#lc-}
55else 61else
56 CMAKE_USE_DIR="${S}"/src 62 CMAKE_USE_DIR="${S}"/src
57fi 63fi
64
65EXPORT_FUNCTIONS "pkg_pretend"
66
67# @FUNCTION: leechcraft_pkg_pretend
68# @DESCRIPTION:
69# Determine active compiler version and refuse to build
70# if it is not satisfied at least to minimal version,
71# supported by upstream developers
72leechcraft_pkg_pretend() {
73 debug-print-function ${FUNCNAME} "$@"
74
75 if version_is_at_least 0.5.85; then
76 # 0.5.85 and later requires at least gcc 4.6
77 if [[ ${MERGE_TYPE} != binary ]]; then
78 [[ $(gcc-major-version) -lt 4 ]] || \
79 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ]] ) \
80 && die "Sorry, but gcc 4.6 or higher is required."
81 fi
82 fi
83 if version_is_at_least 0.6.66 || ( [[ ${PN} == lc-monocle ]] && version_is_at_least 0.6.65 ); then
84 echo "lalalalala"
85 # 0.6.65 monocle and all later plugins require at least gcc 4.8
86 if [[ ${MERGE_TYPE} != binary ]]; then
87 [[ $(gcc-major-version) -lt 4 ]] || \
88 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 8 ]] ) \
89 && die "Sorry, but gcc 4.8 or higher is required."
90 fi
91 fi
92}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20