Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 206975
Collapse All | Expand All

(-)a/eclass/qt4-build.eclass (-9 / +66 lines)
Lines 84-89 qt4-build_src_compile() { Link Here
84
84
85
qt4-build_src_install() {
85
qt4-build_src_install() {
86
	install_directories "${QT4_TARGET_DIRECTORIES}"
86
	install_directories "${QT4_TARGET_DIRECTORIES}"
87
	install_qconfig
87
	fix_library_files
88
	fix_library_files
88
}
89
}
89
90
Lines 136-151 install_directories() { Link Here
136
	done
137
	done
137
}
138
}
138
139
139
qconfig_add_option() {
140
# @ECLASS-VARIABLE: QCONFIG_ADD
140
	local option=${1}
141
# @DESCRIPTION:
141
	qconfig_remove_option ${1}
142
# List options that need to be added to QT_CONFIG in qconfig.pri
142
	sed -e "s:QT_CONFIG +=:& ${option}:g" \
143
QCONFIG_ADD="${QCONFIG_ADD:-}"
143
		-i /usr/share/qt4/mkspecs/qconfig.pri || die "Sed failed"
144
145
# @ECLASS-VARIABLE: QCONFIG_REMOVE
146
# @DESCRIPTION:
147
# List options that need to be removed from QT_CONFIG in qconfig.pri
148
QCONFIG_REMOVE="${QCONFIG_REMOVE:-}"
149
150
install_qconfig() {
151
	if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} ]]; then
152
		local x
153
		for x in QCONFIG_ADD QCONFIG_REMOVE; do
154
			[[ -n ${!x} ]] && echo ${x}=${!x} >> "${T}"/${PN}-qconfig.pri
155
		done
156
157
		insinto ${QTDATADIR}/mkspecs/gentoo
158
		doins "${T}"/${PN}-qconfig.pri || die "installing ${PN}-qconfig.pri failed"
159
	fi
160
}
161
162
write_qconfig() {
163
	if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} || ${CATEGORY}/${PN} == x11-libs/qt-core ]]; then
164
		local x qconfig_add qconfig_remove
165
		for x in "${ROOT}${QTDATADIR}"/mkspecs/gentoo/*-qconfig.pri; do
166
			[[ -f ${x} ]] || continue
167
			qconfig_add="${qconfig_add} $(sed -n 's/^QCONFIG_ADD=//p' "${x}")"
168
			qconfig_remove="${qconfig_remove} $(sed -n 's/^QCONFIG_REMOVE=//p' "${x}")"
169
		done
170
171
		# these error checks don't use die because dying in pkg_post{inst,rm}
172
		# just makes things worse.
173
		if [[ -e "${ROOT}${QTDATADIR}"/mkspecs/gentoo/qconfig.pri ]]; then
174
			if ! cp "${ROOT}${QTDATADIR}"/mkspecs/gentoo/qconfig.pri \
175
				"${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri; then
176
				eerror "cp qconfig failed."
177
				return 1
178
			fi
179
180
			for x in ${qconfig_remove}; do
181
				if ! sed -i -e "/^QT_CONFIG/s/\([ \t=]\)${x}/\1/g" \
182
					"${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri; then
183
					eerror "Sed failed for ${x}"
184
					return 1
185
				fi
186
			done
187
188
			if ! sed -i -e "/^QT_CONFIG/s/$/ ${qconfig_add}/" \
189
				"${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri; then
190
				eerror "Sed failed for qconfig_add"
191
				return 1
192
			fi
193
		else
194
			rm -f "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri
195
			rmdir "${ROOT}${QTDATADIR}"/mkspecs "${ROOT}${QTDATADIR}" 2>/dev/null
196
		fi
197
	fi
198
}
199
200
qt4-build_pkg_postrm() {
201
	write_qconfig
144
}
202
}
145
203
146
qconfig_remove_option() {
204
qt4-build_pkg_postinst() {
147
	local option=${1}
205
	write_qconfig
148
	sed -i -e "s: ${option}::g" /usr/share/qt4/mkspecs/qconfig.pri || die "Sed failed"
149
}
206
}
150
207
151
skip_qmake_build_patch() {
208
skip_qmake_build_patch() {
Lines 295-299 qt_mkspecs_dir() { Link Here
295
	echo "${spec}"
352
	echo "${spec}"
296
}
353
}
297
354
298
EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install
355
EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postrm pkg_postinst
299
356
(-)a/x11-libs/qt-core/qt-core-4.4.0_rc1_p20080220.ebuild (-6 / +3 lines)
Lines 101-107 src_install() { Link Here
101
101
102
	install_directories src/{corelib,xml,network,plugins/codecs}
102
	install_directories src/{corelib,xml,network,plugins/codecs}
103
103
104
	# FIXME: don't override qconfig.pri when a new fresh set of options if there are some already installed on the system
105
	emake INSTALL_ROOT="${D}" install_mkspecs || die "emake install_mkspecs failed"
104
	emake INSTALL_ROOT="${D}" install_mkspecs || die "emake install_mkspecs failed"
106
105
107
	if use doc; then
106
	if use doc; then
Lines 123-133 src_install() { Link Here
123
	EOF
122
	EOF
124
	doenvd "${T}/44qt4"
123
	doenvd "${T}/44qt4"
125
124
126
	# If we already have a qconfig.pri installed on the system, don't overwrite it with a new one.
125
	dodir /${QTDATADIR}/mkspecs/gentoo
127
	if [[ -a ${QTDATADIR}/mkspecs/qconfig.pri ]]; then
126
	mv "${D}"/${QTDATADIR}/mkspecs/qconfig.pri "${D}"/${QTDATADIR}/mkspecs/gentoo || \
128
		rm "${D}"/${QTDATADIR}/mkspecs/qconfig.pri || die "Couldn't remove rm ${D}/${QTDATADIR}/mkspecs/qconfig.pri"
127
		die "Failed to move qconfig.pri"
129
	fi
130
128
131
	keepdir "${QTSYSCONFDIR}"
129
	keepdir "${QTSYSCONFDIR}"
132
}
130
}
133
(-)a/x11-libs/qt-dbus/qt-dbus-4.4.0_rc1_p20080220.ebuild (-8 / +1 lines)
Lines 27-32 src/dbus Link Here
27
tools/qdbus/qdbus
27
tools/qdbus/qdbus
28
tools/qdbus/qdbusxml2cpp
28
tools/qdbus/qdbusxml2cpp
29
tools/qdbus/qdbuscpp2xml"
29
tools/qdbus/qdbuscpp2xml"
30
QCONFIG_ADD="qdbus"
30
31
31
src_compile() {
32
src_compile() {
32
	local myconf
33
	local myconf
Lines 34-44 src_compile() { Link Here
34
35
35
	qt4-build_src_compile
36
	qt4-build_src_compile
36
}
37
}
37
38
pkg_postinst() {
39
	qconfig_add_option qdbus
40
}
41
42
pkg_postrm() {
43
	qconfig_remove_option qdbus
44
}
(-)a/x11-libs/qt-gui/qt-gui-4.4.0_rc1_p20080220.ebuild (-34 / +4 lines)
Lines 101-142 src_compile() { Link Here
101
}
101
}
102
102
103
src_install() {
103
src_install() {
104
	QCONFIG_ADD="x11sm xshape xcursor xfixes xrandr xrender xkb fontconfig
105
		$(use input_devices_wacom && echo tablet) $(usev accessibility)
106
		$(usev xinerama) $(usev cups) $(usev nas) gif png system-png"
107
	QCONFIG_REMOVE="no-gif no-png"
104
	qt4-build_src_install
108
	qt4-build_src_install
105
109
106
	insinto /usr/share/applications
110
	insinto /usr/share/applications
107
	doins "${FILESDIR}"/{Designer,Linguist}.desktop
111
	doins "${FILESDIR}"/{Designer,Linguist}.desktop
108
}
112
}
109
110
pkg_postinst() {
111
	for _option in x11sm xshape xcursor xfixes xrandr xrender xkb fontconfig; do
112
		qconfig_add_option ${_option}
113
	done
114
	use input_devices_wacom && qconfig_add_option tablet
115
	use accessibility && qconfig_add_option accessibility
116
	use xinerama && qconfig_add_option xinerama
117
	use cups && qconfig_add_option cups
118
	use nas && qconfig_add_option nas
119
120
	qconfig_remove_option no-gif
121
	qconfig_add_option gif
122
123
	qconfig_remove_option no-png
124
	qconfig_add_option png
125
	qconfig_add_option system-png
126
127
	# FIXME Need to do the same for tiff and mng
128
}
129
130
pkg_postrm() {
131
	for _option in x11sm xshape xcursor xfixes xrandr xrender xkb fontconfig \
132
		tablet accessibility xinerama cups nas png system-png gif
133
	do
134
		qconfig_remove_option ${_option}
135
	done
136
137
	for _option in no-png no-gif; do
138
		qconfig_add_option ${_option}
139
	done
140
141
	# FIXME Need to do the same for tiff and mng
142
}
(-)a/x11-libs/qt-opengl/qt-opengl-4.4.0_rc1_p20080220.ebuild (-8 / +1 lines)
Lines 23-28 DEPEND="~x11-libs/qt-gui-${PV} Link Here
23
RDEPEND="${DEPEND}"
23
RDEPEND="${DEPEND}"
24
24
25
QT4_TARGET_DIRECTORIES="src/opengl"
25
QT4_TARGET_DIRECTORIES="src/opengl"
26
QCONFIG_ADD="opengl"
26
27
27
pkg_setup() {
28
pkg_setup() {
28
	use qt3support && QT4_BUILT_WITH_USE="${QT4_BUILT_WITH_USE}
29
	use qt3support && QT4_BUILT_WITH_USE="${QT4_BUILT_WITH_USE}
Lines 38-48 src_compile() { Link Here
38
	# Not building tools/designer/src/plugins/tools/view3d as it's commented out of the build in the source
39
	# Not building tools/designer/src/plugins/tools/view3d as it's commented out of the build in the source
39
	qt4-build_src_compile
40
	qt4-build_src_compile
40
}
41
}
41
42
pkg_postinst() {
43
	qconfig_add_option opengl
44
}
45
46
pkg_postrm() {
47
	qconfig_remove_option opengl
48
}
(-)a/x11-libs/qt-phonon/qt-phonon-4.4.0_rc1_p20080220.ebuild (-8 / +1 lines)
Lines 25-30 RDEPEND="${DEPEND}" Link Here
25
QT4_TARGET_DIRECTORIES="
25
QT4_TARGET_DIRECTORIES="
26
src/phonon
26
src/phonon
27
src/plugins/phonon"
27
src/plugins/phonon"
28
QCONFIG_ADD="phonon"
28
29
29
src_compile() {
30
src_compile() {
30
	local myconf
31
	local myconf
Lines 33-43 src_compile() { Link Here
33
34
34
	qt4-build_src_compile
35
	qt4-build_src_compile
35
}
36
}
36
37
pkg_postinst() {
38
	qconfig_add_option phonon
39
}
40
41
pkg_postrm() {
42
	qconfig_remove_option phonon
43
}
(-)a/x11-libs/qt-webkit/qt-webkit-4.4.0_rc1_p20080220.ebuild (-8 / +1 lines)
Lines 19-24 DEPEND="~x11-libs/qt-gui-${PV}" Link Here
19
RDEPEND="${DEPEND}"
19
RDEPEND="${DEPEND}"
20
20
21
QT4_TARGET_DIRECTORIES="src/3rdparty/webkit/WebCore tools/designer/src/plugins/qwebview"
21
QT4_TARGET_DIRECTORIES="src/3rdparty/webkit/WebCore tools/designer/src/plugins/qwebview"
22
QCONFIG_ADD="webkit"
22
23
23
src_compile() {
24
src_compile() {
24
	local myconf
25
	local myconf
Lines 26-36 src_compile() { Link Here
26
27
27
	qt4-build_src_compile
28
	qt4-build_src_compile
28
}
29
}
29
30
pkg_postinst() {
31
	qconfig_add_option webkit
32
}
33
34
pkg_postrm() {
35
	qconfig_remove_option webkit
36
}
(-)a/x11-libs/qt-xmlpatterns/qt-xmlpatterns-4.4.0_rc1_p20080220.ebuild (-8 / +1 lines)
Lines 19-24 DEPEND="~x11-libs/qt-core-${PV}" Link Here
19
RDEPEND="${DEPEND}"
19
RDEPEND="${DEPEND}"
20
20
21
QT4_TARGET_DIRECTORIES="src/xmlpatterns tools/xmlpatterns"
21
QT4_TARGET_DIRECTORIES="src/xmlpatterns tools/xmlpatterns"
22
QCONFIG_ADD="xmlpatterns"
22
23
23
src_compile() {
24
src_compile() {
24
	local myconf
25
	local myconf
Lines 26-36 src_compile() { Link Here
26
27
27
	qt4-build_src_compile
28
	qt4-build_src_compile
28
}
29
}
29
30
pkg_postinst() {
31
	qconfig_add_option xmlpatterns
32
}
33
34
pkg_postrm() {
35
	qconfig_remove_option xmlpatterns
36
}

Return to bug 206975