/[gentoo-x86]/eclass/qt4-r2.eclass
Gentoo

Contents of /eclass/qt4-r2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.31 - (hide annotations) (download)
Sat Nov 1 23:48:16 2014 UTC (6 weeks, 3 days ago) by pesa
Branch: MAIN
CVS Tags: HEAD
Changes since 1.30: +5 -5 lines
Fix indentation.

1 pinkbyte 1.30 # Copyright 1999-2014 Gentoo Foundation
2 ayoy 1.1 # Distributed under the terms of the GNU General Public License v2
3 pesa 1.31 # $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.30 2014/06/23 08:53:48 pinkbyte Exp $
4 ayoy 1.1
5     # @ECLASS: qt4-r2.eclass
6     # @MAINTAINER:
7 pesa 1.13 # Qt herd <qt@gentoo.org>
8     # @BLURB: Eclass for Qt4-based packages, second edition.
9 ayoy 1.1 # @DESCRIPTION:
10     # This eclass contains various functions that may be useful when
11 pesa 1.13 # dealing with packages using Qt4 libraries. Requires EAPI=2 or later.
12 ayoy 1.1
13     case ${EAPI} in
14 pesa 1.23 2|3|4|5) : ;;
15     *) die "qt4-r2.eclass: unsupported EAPI=${EAPI:-0}" ;;
16 ayoy 1.1 esac
17    
18 pinkbyte 1.30 inherit base eutils qmake-utils
19 ayoy 1.1
20     export XDG_CONFIG_HOME="${T}"
21    
22 yngwin 1.21 # @ECLASS-VARIABLE: DOCS
23     # @DEFAULT_UNSET
24     # @DESCRIPTION:
25     # Array containing documents passed to dodoc command.
26     # Paths can be absolute or relative to ${S}.
27     #
28     # Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" )
29    
30     # @ECLASS-VARIABLE: HTML_DOCS
31     # @DEFAULT_UNSET
32     # @DESCRIPTION:
33     # Array containing documents passed to dohtml command.
34     # Paths can be absolute or relative to ${S}.
35     #
36     # Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" )
37    
38 ayoy 1.1 # @ECLASS-VARIABLE: LANGS
39 pesa 1.15 # @DEFAULT_UNSET
40 ayoy 1.1 # @DESCRIPTION:
41     # In case your Qt4 application provides various translations, use this variable
42     # to specify them in order to populate "linguas_*" IUSE automatically. Make sure
43 pesa 1.15 # that you set this variable before inheriting qt4-r2 eclass.
44 pesa 1.24 #
45     # Example: LANGS="de el it ja"
46 ayoy 1.1 for x in ${LANGS}; do
47 pesa 1.19 IUSE+=" linguas_${x}"
48 ayoy 1.1 done
49    
50     # @ECLASS-VARIABLE: LANGSLONG
51 pesa 1.15 # @DEFAULT_UNSET
52 ayoy 1.1 # @DESCRIPTION:
53 pesa 1.24 # Same as LANGS, but this variable is for LINGUAS that must be in long format.
54 pesa 1.15 # Remember to set this variable before inheriting qt4-r2 eclass.
55 ayoy 1.1 # Look at ${PORTDIR}/profiles/desc/linguas.desc for details.
56 pesa 1.24 #
57     # Example: LANGSLONG="en_GB ru_RU"
58 ayoy 1.1 for x in ${LANGSLONG}; do
59 pesa 1.19 IUSE+=" linguas_${x%_*}"
60 ayoy 1.1 done
61 pesa 1.19 unset x
62 ayoy 1.1
63 yngwin 1.21 # @ECLASS-VARIABLE: PATCHES
64     # @DEFAULT_UNSET
65     # @DESCRIPTION:
66     # Array variable containing all the patches to be applied. This variable
67     # is expected to be defined in the global scope of ebuilds. Make sure to
68     # specify the full path. This variable is used in src_prepare phase.
69     #
70     # Example:
71     # @CODE
72 pesa 1.31 # PATCHES=(
73     # "${FILESDIR}/mypatch.patch"
74     # "${FILESDIR}/mypatch2.patch"
75     # )
76 yngwin 1.21 # @CODE
77    
78 ayoy 1.1 # @FUNCTION: qt4-r2_src_unpack
79     # @DESCRIPTION:
80     # Default src_unpack function for packages that depend on qt4. If you have to
81     # override src_unpack in your ebuild (probably you don't need to), call
82     # qt4-r2_src_unpack in it.
83     qt4-r2_src_unpack() {
84     debug-print-function $FUNCNAME "$@"
85 pesa 1.13
86 ayoy 1.1 base_src_unpack "$@"
87     }
88    
89     # @FUNCTION: qt4-r2_src_prepare
90     # @DESCRIPTION:
91     # Default src_prepare function for packages that depend on qt4. If you have to
92     # override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it,
93     # otherwise autopatcher will not work!
94     qt4-r2_src_prepare() {
95     debug-print-function $FUNCNAME "$@"
96    
97     base_src_prepare "$@"
98     }
99    
100     # @FUNCTION: qt4-r2_src_configure
101     # @DESCRIPTION:
102     # Default src_configure function for packages that depend on qt4. If you have to
103     # override src_configure in your ebuild, call qt4-r2_src_configure in it.
104     qt4-r2_src_configure() {
105     debug-print-function $FUNCNAME "$@"
106    
107 pesa 1.29 local project_file=$(qmake-utils_find_pro_file)
108 ayoy 1.1
109     if [[ -n ${project_file} ]]; then
110 pesa 1.19 eqmake4 "${project_file}"
111 ayoy 1.1 else
112     base_src_configure "$@"
113     fi
114     }
115    
116     # @FUNCTION: qt4-r2_src_compile
117     # @DESCRIPTION:
118     # Default src_compile function for packages that depend on qt4. If you have to
119     # override src_compile in your ebuild (probably you don't need to), call
120     # qt4-r2_src_compile in it.
121     qt4-r2_src_compile() {
122     debug-print-function $FUNCNAME "$@"
123    
124     base_src_compile "$@"
125     }
126    
127     # @FUNCTION: qt4-r2_src_install
128     # @DESCRIPTION:
129 pesa 1.24 # Default src_install function for qt4-based packages. Installs compiled code,
130 pesa 1.26 # and documentation (via DOCS and HTML_DOCS variables).
131 ayoy 1.1 qt4-r2_src_install() {
132     debug-print-function $FUNCNAME "$@"
133    
134 yngwin 1.21 base_src_install INSTALL_ROOT="${D}" "$@"
135 pinkbyte 1.30 einstalldocs
136 ayoy 1.1 }
137    
138     EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20