/[gentoo-x86]/eclass/xorg-2.eclass
Gentoo

Diff of /eclass/xorg-2.eclass

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

Revision 1.9 Revision 1.10
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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/xorg-2.eclass,v 1.9 2010/08/11 09:20:09 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.10 2010/08/22 08:23:24 scarabeus Exp $
4# 4#
5# @ECLASS: xorg-2.eclass 5# @ECLASS: xorg-2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# x11@gentoo.org 7# x11@gentoo.org
8# @BLURB: Reduces code duplication in the modularized X11 ebuilds. 8# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
163# Check deps on xorg-server 163# Check deps on xorg-server
164has dri ${IUSE//+} && DEPEND+=" dri? ( >=x11-base/xorg-server-1.6.3.901-r2[-minimal] )" 164has dri ${IUSE//+} && DEPEND+=" dri? ( >=x11-base/xorg-server-1.6.3.901-r2[-minimal] )"
165[[ -n "${DRIVER}" ]] && DEPEND+=" x11-base/xorg-server[xorg]" 165[[ -n "${DRIVER}" ]] && DEPEND+=" x11-base/xorg-server[xorg]"
166 166
167# @FUNCTION: xorg-2_pkg_setup 167# @FUNCTION: xorg-2_pkg_setup
168# @USAGE:
169# @DESCRIPTION: 168# @DESCRIPTION:
170# Setup prefix compat 169# Setup prefix compat
171xorg-2_pkg_setup() { 170xorg-2_pkg_setup() {
172 [[ ${FONT} == yes ]] && font_pkg_setup 171 [[ ${FONT} == yes ]] && font_pkg_setup
173} 172}
174 173
175# @FUNCTION: xorg-2_src_unpack 174# @FUNCTION: xorg-2_src_unpack
176# @USAGE:
177# @DESCRIPTION: 175# @DESCRIPTION:
178# Simply unpack source code. 176# Simply unpack source code.
179xorg-2_src_unpack() { 177xorg-2_src_unpack() {
180 if [[ -n ${GIT_ECLASS} ]]; then 178 if [[ -n ${GIT_ECLASS} ]]; then
181 git_src_unpack 179 git_src_unpack
185 183
186 [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" 184 [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}"
187} 185}
188 186
189# @FUNCTION: xorg-2_patch_source 187# @FUNCTION: xorg-2_patch_source
190# @USAGE:
191# @DESCRIPTION: 188# @DESCRIPTION:
192# Apply all patches 189# Apply all patches
193xorg-2_patch_source() { 190xorg-2_patch_source() {
194 # Use standardized names and locations with bulk patching 191 # Use standardized names and locations with bulk patching
195 # Patch directory is ${WORKDIR}/patch 192 # Patch directory is ${WORKDIR}/patch
199 [[ -d "${EPATCH_SOURCE}" ]] && epatch 196 [[ -d "${EPATCH_SOURCE}" ]] && epatch
200 base_src_prepare 197 base_src_prepare
201} 198}
202 199
203# @FUNCTION: xorg-2_reconf_source 200# @FUNCTION: xorg-2_reconf_source
204# @USAGE:
205# @DESCRIPTION: 201# @DESCRIPTION:
206# Run eautoreconf if necessary, and run elibtoolize. 202# Run eautoreconf if necessary, and run elibtoolize.
207xorg-2_reconf_source() { 203xorg-2_reconf_source() {
208 case ${CHOST} in 204 case ${CHOST} in
209 *-interix* | *-aix* | *-winnt*) 205 *-interix* | *-aix* | *-winnt*)
216 ;; 212 ;;
217 esac 213 esac
218} 214}
219 215
220# @FUNCTION: xorg-2_src_prepare 216# @FUNCTION: xorg-2_src_prepare
221# @USAGE:
222# @DESCRIPTION: 217# @DESCRIPTION:
223# Prepare a package after unpacking, performing all X-related tasks. 218# Prepare a package after unpacking, performing all X-related tasks.
224xorg-2_src_prepare() { 219xorg-2_src_prepare() {
225 [[ -n ${GIT_ECLASS} ]] && git_src_prepare 220 [[ -n ${GIT_ECLASS} ]] && git_src_prepare
226 xorg-2_patch_source 221 xorg-2_patch_source
227 xorg-2_reconf_source 222 xorg-2_reconf_source
228} 223}
229 224
230# @FUNCTION: xorg-2_font_configure 225# @FUNCTION: xorg-2_font_configure
231# @USAGE:
232# @DESCRIPTION: 226# @DESCRIPTION:
233# If a font package, perform any necessary configuration steps 227# If a font package, perform any necessary configuration steps
234xorg-2_font_configure() { 228xorg-2_font_configure() {
235 if has nls ${IUSE//+} && ! use nls; then 229 if has nls ${IUSE//+} && ! use nls; then
236 FONT_OPTIONS+=" 230 FONT_OPTIONS+="
253 --disable-koi8-r" 247 --disable-koi8-r"
254 fi 248 fi
255} 249}
256 250
257# @FUNCTION: x-modular_flags_setup 251# @FUNCTION: x-modular_flags_setup
258# @USAGE:
259# @DESCRIPTION: 252# @DESCRIPTION:
260# Set up CFLAGS for a debug build 253# Set up CFLAGS for a debug build
261xorg-2_flags_setup() { 254xorg-2_flags_setup() {
262 # Win32 require special define 255 # Win32 require special define
263 [[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__ 256 [[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__
264 # hardened ldflags 257 # hardened ldflags
265 [[ ${PN} = xorg-server || -n ${DRIVER} ]] && append-ldflags -Wl,-z,lazy 258 [[ ${PN} = xorg-server || -n ${DRIVER} ]] && append-ldflags -Wl,-z,lazy
266} 259}
267 260
268# @FUNCTION: xorg-2_src_configure 261# @FUNCTION: xorg-2_src_configure
269# @USAGE:
270# @DESCRIPTION: 262# @DESCRIPTION:
271# Perform any necessary pre-configuration steps, then run configure 263# Perform any necessary pre-configuration steps, then run configure
272xorg-2_src_configure() { 264xorg-2_src_configure() {
273 local myopts="" 265 local myopts=""
274 266
275 xorg-2_flags_setup 267 xorg-2_flags_setup
276 [[ -n "${FONT}" ]] && xorg-2_font_configure 268 [[ -n "${FONT}" ]] && xorg-2_font_configure
277 269
278# @VARIABLE: CONFIGURE_OPTIONS 270 # @VARIABLE: CONFIGURE_OPTIONS
279# @DESCRIPTION: 271 # @DESCRIPTION:
280# Any options to pass to configure 272 # Any options to pass to configure
273 # @DEFAULT_UNSET
281 CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""} 274 CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""}
282 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then 275 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
283 if has static-libs ${IUSE//+}; then 276 if has static-libs ${IUSE//+}; then
284 myopts+=" $(use_enable static-libs static)" 277 myopts+=" $(use_enable static-libs static)"
285 fi 278 fi
289 ${myopts} 282 ${myopts}
290 fi 283 fi
291} 284}
292 285
293# @FUNCTION: xorg-2_src_compile 286# @FUNCTION: xorg-2_src_compile
294# @USAGE:
295# @DESCRIPTION: 287# @DESCRIPTION:
296# Compile a package, performing all X-related tasks. 288# Compile a package, performing all X-related tasks.
297xorg-2_src_compile() { 289xorg-2_src_compile() {
298 base_src_compile 290 base_src_compile
299} 291}
300 292
301# @FUNCTION: xorg-2_src_install 293# @FUNCTION: xorg-2_src_install
302# @USAGE:
303# @DESCRIPTION: 294# @DESCRIPTION:
304# Install a built package to ${D}, performing any necessary steps. 295# Install a built package to ${D}, performing any necessary steps.
305# Creates a ChangeLog from git if using live ebuilds. 296# Creates a ChangeLog from git if using live ebuilds.
306xorg-2_src_install() { 297xorg-2_src_install() {
307 if [[ ${CATEGORY} == x11-proto ]]; then 298 if [[ ${CATEGORY} == x11-proto ]]; then
324 fi 315 fi
325 316
326 if [[ -e "${S}"/ChangeLog ]]; then 317 if [[ -e "${S}"/ChangeLog ]]; then
327 dodoc "${S}"/ChangeLog 318 dodoc "${S}"/ChangeLog
328 fi 319 fi
329# @VARIABLE: DOCS 320 # @VARIABLE: DOCS
330# @DESCRIPTION: 321 # @DESCRIPTION:
331# Any documentation to install 322 # Any documentation to install
323 # @DEFAULT_UNSET
332 if [[ -n ${DOCS} ]]; then 324 if [[ -n ${DOCS} ]]; then
333 dodoc ${DOCS} || die "dodoc failed" 325 dodoc ${DOCS} || die "dodoc failed"
334 fi 326 fi
335 327
336 # Don't install libtool archives for server modules 328 # Don't install libtool archives for server modules
341 333
342 [[ -n ${FONT} ]] && remove_font_metadata 334 [[ -n ${FONT} ]] && remove_font_metadata
343} 335}
344 336
345# @FUNCTION: xorg-2_pkg_postinst 337# @FUNCTION: xorg-2_pkg_postinst
346# @USAGE:
347# @DESCRIPTION: 338# @DESCRIPTION:
348# Run X-specific post-installation tasks on the live filesystem. The 339# Run X-specific post-installation tasks on the live filesystem. The
349# only task right now is some setup for font packages. 340# only task right now is some setup for font packages.
350xorg-2_pkg_postinst() { 341xorg-2_pkg_postinst() {
351 [[ -n ${FONT} ]] && setup_fonts 342 [[ -n ${FONT} ]] && setup_fonts
352} 343}
353 344
354# @FUNCTION: xorg-2_pkg_postrm 345# @FUNCTION: xorg-2_pkg_postrm
355# @USAGE:
356# @DESCRIPTION: 346# @DESCRIPTION:
357# Run X-specific post-removal tasks on the live filesystem. The only 347# Run X-specific post-removal tasks on the live filesystem. The only
358# task right now is some cleanup for font packages. 348# task right now is some cleanup for font packages.
359xorg-2_pkg_postrm() { 349xorg-2_pkg_postrm() {
360 if [[ -n ${FONT} ]]; then 350 if [[ -n ${FONT} ]]; then
361 font_pkg_postrm 351 font_pkg_postrm
362 fi 352 fi
363} 353}
364 354
365# @FUNCTION: setup_fonts 355# @FUNCTION: setup_fonts
366# @USAGE:
367# @DESCRIPTION: 356# @DESCRIPTION:
368# Generates needed files for fonts and fixes font permissions 357# Generates needed files for fonts and fixes font permissions
369setup_fonts() { 358setup_fonts() {
370 create_fonts_scale 359 create_fonts_scale
371 create_fonts_dir 360 create_fonts_dir
372 font_pkg_postinst 361 font_pkg_postinst
373} 362}
374 363
375# @FUNCTION: remove_font_metadata 364# @FUNCTION: remove_font_metadata
376# @USAGE:
377# @DESCRIPTION: 365# @DESCRIPTION:
378# Don't let the package install generated font files that may overlap 366# Don't let the package install generated font files that may overlap
379# with other packages. Instead, they're generated in pkg_postinst(). 367# with other packages. Instead, they're generated in pkg_postinst().
380remove_font_metadata() { 368remove_font_metadata() {
381 if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then 369 if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
383 rm -rf "${ED}"/usr/share/fonts/${FONT_DIR}/fonts.{scale,dir,cache-1} 371 rm -rf "${ED}"/usr/share/fonts/${FONT_DIR}/fonts.{scale,dir,cache-1}
384 fi 372 fi
385} 373}
386 374
387# @FUNCTION: create_fonts_scale 375# @FUNCTION: create_fonts_scale
388# @USAGE:
389# @DESCRIPTION: 376# @DESCRIPTION:
390# Create fonts.scale file, used by the old server-side fonts subsystem. 377# Create fonts.scale file, used by the old server-side fonts subsystem.
391create_fonts_scale() { 378create_fonts_scale() {
392 if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then 379 if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
393 ebegin "Generating font.scale" 380 ebegin "Generating font.scale"
397 eend $? 384 eend $?
398 fi 385 fi
399} 386}
400 387
401# @FUNCTION: create_fonts_dir 388# @FUNCTION: create_fonts_dir
402# @USAGE:
403# @DESCRIPTION: 389# @DESCRIPTION:
404# Create fonts.dir file, used by the old server-side fonts subsystem. 390# Create fonts.dir file, used by the old server-side fonts subsystem.
405create_fonts_dir() { 391create_fonts_dir() {
406 ebegin "Generating fonts.dir" 392 ebegin "Generating fonts.dir"
407 mkfontdir \ 393 mkfontdir \

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20