Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 209626 | Differences between
and this patch

Collapse All | Expand All

(-)qt4-build.eclass.orig (-7 / +56 lines)
Lines 5-12 Link Here
5
# @ECLASS: qt4-build.eclass
5
# @ECLASS: qt4-build.eclass
6
# @MAINTAINER:
6
# @MAINTAINER:
7
# Caleb Tennis <caleb@gentoo.org>
7
# Caleb Tennis <caleb@gentoo.org>
8
# @BLURB:
8
# @BLURB: Eclass for Qt4 
9
# Eclass for Qt4 
10
# @DESCRIPTION:
9
# @DESCRIPTION:
11
# This eclass contains various functions that are used when building Qt4
10
# This eclass contains various functions that are used when building Qt4
12
11
Lines 37-42 Link Here
37
	LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}"
36
	LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}"
38
}
37
}
39
38
39
# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES
40
# @DESCRIPTION:
41
# Arguments for build_target_directories. Takes the directories, in which the
42
# code should be compiled. This is a space separated list
43
44
45
# @FUNCTION: qt4-build_src_unpack
46
# @DESCRIPTION:
47
# Unpacks the sources, and replaces some flags (e. g. replaces -O3 w/ -O2)
40
qt4-build_src_unpack() {
48
qt4-build_src_unpack() {
41
	unpack ${A}
49
	unpack ${A}
42
	cd "${S}"
50
	cd "${S}"
Lines 52-62 Link Here
52
	fi
60
	fi
53
}
61
}
54
62
63
# @FUNCTION: qt4-build_src_install
64
# @DESCRIPTION:
65
# standard src_install function
55
qt4-build_src_install() {
66
qt4-build_src_install() {
56
	install_directories "${QT4_TARGET_DIRECTORIES}"
67
	install_directories "${QT4_TARGET_DIRECTORIES}"
57
	fix_library_files
68
	fix_library_files
58
}
69
}
59
70
71
# @FUNCTION: standard_configure_options
72
# @DESCRIPTION:
73
# Sets up some standard configure options, like libdir (if necessary), wether
74
# debug info is wanted or not, and much standard things more
60
standard_configure_options() {
75
standard_configure_options() {
61
	local myconf=""
76
	local myconf=""
62
77
Lines 80-85 Link Here
80
	echo "${myconf}"
95
	echo "${myconf}"
81
}
96
}
82
97
98
# @FUNCTION: build_target_directories
99
# @DESCRIPTION:
100
# Compiles the code in $QT4_TARGET_DIRECTORIES
83
build_target_directories() {
101
build_target_directories() {
84
	build_directories "${QT4_TARGET_DIRECTORIES}"
102
	build_directories "${QT4_TARGET_DIRECTORIES}"
85
}
103
}
Lines 91-97 Link Here
91
		"${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" && emake || die
109
		"${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" && emake || die
92
	done
110
	done
93
}
111
}
94
112
# @FUNCTION: install_directories
113
# @USAGE: < directories >
114
# @DESCRIPTION:
115
# run emake install in the given directories, which are separeted by spaces
95
install_directories() {
116
install_directories() {
96
	local dirs="$@"
117
	local dirs="$@"
97
	for x in ${dirs}; do
118
	for x in ${dirs}; do
Lines 99-126 Link Here
99
		emake INSTALL_ROOT="${D}" install || die
120
		emake INSTALL_ROOT="${D}" install || die
100
	done
121
	done
101
}
122
}
102
123
# @FUNCTION: qconfig_add_option
124
# @USAGE: < option >
125
# @DESCRIPTION:
126
# Adds the <option> to /usr/share/qt4/mkspecs/qconfig.pri
103
qconfig_add_option() {
127
qconfig_add_option() {
104
	local option=$1
128
	local option=$1
105
	qconfig_remove_option $1
129
	qconfig_remove_option $1
106
	sed -i -e "s:QT_CONFIG +=:QT_CONFIG += ${option}:g" /usr/share/qt4/mkspecs/qconfig.pri
130
	sed -i -e "s:QT_CONFIG +=:QT_CONFIG += ${option}:g" /usr/share/qt4/mkspecs/qconfig.pri
107
}
131
}
108
132
133
# @FUNCTION: qconfig_remove_option
134
# @USAGE: < option >
135
# @DESCRIPTION:
136
# Removes the <option> from /usr/share/qt4/mkspecs/qconfig.pri
109
qconfig_remove_option() {
137
qconfig_remove_option() {
110
	local option=$1
138
	local option=$1
111
	sed -i -e "s: ${option}::g" /usr/share/qt4/mkspecs/qconfig.pri
139
	sed -i -e "s: ${option}::g" /usr/share/qt4/mkspecs/qconfig.pri
112
}
140
}
113
141
142
# @FUNCTION: skip_qmake_build_patch
143
# @DESCRIPTION:
144
# Don't need to build qmake, as it's already installed from qmake-core
114
skip_qmake_build_patch() {
145
skip_qmake_build_patch() {
115
	# Don't need to build qmake, as it's already installed from qmake-core
116
	sed -i -e "s:if true:if false:g" "${S}"/configure
146
	sed -i -e "s:if true:if false:g" "${S}"/configure
117
}
147
}
118
148
149
# @FUNCTION: skip_project_genereation_patch
150
# @DESCRIPTION:
151
# Exit the script early by throwing in an exit before all of the .pro files are scanned
119
skip_project_generation_patch() {
152
skip_project_generation_patch() {
120
	# Exit the script early by throwing in an exit before all of the .pro files are scanned
121
	sed -i -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" "${S}"/configure
153
	sed -i -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" "${S}"/configure
122
}
154
}
123
155
156
# @FUNCTION: install_binaries_to_buildtree
157
# @DESCRIPTION:
158
# Installs the binaries to the buildtree
124
install_binaries_to_buildtree()
159
install_binaries_to_buildtree()
125
{
160
{
126
	cp ${QTBINDIR}/qmake ${S}/bin
161
	cp ${QTBINDIR}/qmake ${S}/bin
Lines 129-134 Link Here
129
	cp ${QTBINDIR}/rcc ${S}/bin
164
	cp ${QTBINDIR}/rcc ${S}/bin
130
}
165
}
131
166
167
# @FUNCTION: fix_library_files
168
# @DESCRIPTION:
169
# Fixes the pathes in *.la, *.prl, *.pc, as they are wrong due to sandbox and
170
# moves the *.pc-files into the pkgconfig directory
132
fix_library_files() {
171
fix_library_files() {
133
	sed -i -e "s:${S}/lib:${QTLIBDIR}:g" "${D}"/${QTLIBDIR}/*.la
172
	sed -i -e "s:${S}/lib:${QTLIBDIR}:g" "${D}"/${QTLIBDIR}/*.la
134
	sed -i -e "s:${S}/lib:${QTLIBDIR}:g" "${D}"/${QTLIBDIR}/*.prl
173
	sed -i -e "s:${S}/lib:${QTLIBDIR}:g" "${D}"/${QTLIBDIR}/*.prl
Lines 142-147 Link Here
142
	mv "${D}"/${QTLIBDIR}/pkgconfig/*.pc "${D}"/${QTPCDIR}
181
	mv "${D}"/${QTLIBDIR}/pkgconfig/*.pc "${D}"/${QTPCDIR}
143
}
182
}
144
183
184
# @FUNCTION: qt_use
185
# @USAGE: < flag > [ feature ] [ enableval ]
186
# @DESCRIPTION:	
187
# This will echo "${enableval}-${feature}" if <flag> is enabled, or
188
# "-no-${feature} if the flag is disabled. If [feature] is not specified <flag>
189
# will be used for that. If [enableval] is not specified, it omits the
190
# assignment-part
145
qt_use() {
191
qt_use() {
146
	local flag="$1"
192
	local flag="$1"
147
	local feature="$1"
193
	local feature="$1"
Lines 154-161 Link Here
154
	return 0
200
	return 0
155
}
201
}
156
202
203
# @FUNCTION: qt_mkspecs_dir
204
# @RETURN: the specs-directory w/o path
205
# @DESCRIPTION:	
206
# Allows us to define which mkspecs dir we want to use.
157
qt_mkspecs_dir() {
207
qt_mkspecs_dir() {
158
	# Allows us to define which mkspecs dir we want to use.
159
	local spec
208
	local spec
160
209
161
	case ${CHOST} in
210
	case ${CHOST} in

Return to bug 209626