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 |
|