| 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.10 2010/08/22 08:23:24 scarabeus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.16 2010/10/28 11:46:32 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. |
| … | |
… | |
| 42 | ${FONT_ECLASS} ${GIT_ECLASS} |
42 | ${FONT_ECLASS} ${GIT_ECLASS} |
| 43 | |
43 | |
| 44 | EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
44 | EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
| 45 | case "${EAPI:-0}" in |
45 | case "${EAPI:-0}" in |
| 46 | 3) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
46 | 3) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
| 47 | *) DEPEND="EAPI-UNSUPPORTED" ;; |
47 | *) die "EAPI-UNSUPPORTED" ;; |
| 48 | esac |
48 | esac |
| 49 | |
49 | |
| 50 | # exports must be ALWAYS after inherit |
50 | # exports must be ALWAYS after inherit |
| 51 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
51 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
| 52 | |
52 | |
| … | |
… | |
| 111 | if [[ ${FONT} == yes ]]; then |
111 | if [[ ${FONT} == yes ]]; then |
| 112 | RDEPEND+=" media-fonts/encodings |
112 | RDEPEND+=" media-fonts/encodings |
| 113 | x11-apps/mkfontscale |
113 | x11-apps/mkfontscale |
| 114 | x11-apps/mkfontdir" |
114 | x11-apps/mkfontdir" |
| 115 | PDEPEND+=" media-fonts/font-alias" |
115 | PDEPEND+=" media-fonts/font-alias" |
|
|
116 | DEPEND+=" >=media-fonts/font-util-1.1.1-r1" |
| 116 | |
117 | |
| 117 | # @ECLASS-VARIABLE: FONT_DIR |
118 | # @ECLASS-VARIABLE: FONT_DIR |
| 118 | # @DESCRIPTION: |
119 | # @DESCRIPTION: |
| 119 | # If you're creating a font package and the suffix of PN is not equal to |
120 | # If you're creating a font package and the suffix of PN is not equal to |
| 120 | # the subdirectory of /usr/share/fonts/ it should install into, set |
121 | # the subdirectory of /usr/share/fonts/ it should install into, set |
| … | |
… | |
| 246 | --disable-jisx0201 |
247 | --disable-jisx0201 |
| 247 | --disable-koi8-r" |
248 | --disable-koi8-r" |
| 248 | fi |
249 | fi |
| 249 | } |
250 | } |
| 250 | |
251 | |
| 251 | # @FUNCTION: x-modular_flags_setup |
252 | # @FUNCTION: xorg-2_flags_setup |
| 252 | # @DESCRIPTION: |
253 | # @DESCRIPTION: |
| 253 | # Set up CFLAGS for a debug build |
254 | # Set up CFLAGS for a debug build |
| 254 | xorg-2_flags_setup() { |
255 | xorg-2_flags_setup() { |
| 255 | # Win32 require special define |
256 | # Win32 require special define |
| 256 | [[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__ |
257 | [[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__ |
| 257 | # hardened ldflags |
258 | # hardened ldflags |
| 258 | [[ ${PN} = xorg-server || -n ${DRIVER} ]] && append-ldflags -Wl,-z,lazy |
259 | [[ ${PN} = xorg-server || -n ${DRIVER} ]] && append-ldflags -Wl,-z,lazy |
|
|
260 | |
|
|
261 | # Quite few libraries fail on runtime without these: |
|
|
262 | if has static-libs ${IUSE//+}; then |
|
|
263 | filter-flags -Wl,-Bdirect |
|
|
264 | filter-ldflags -Bdirect |
|
|
265 | filter-ldflags -Wl,-Bdirect |
|
|
266 | fi |
| 259 | } |
267 | } |
| 260 | |
268 | |
| 261 | # @FUNCTION: xorg-2_src_configure |
269 | # @FUNCTION: xorg-2_src_configure |
| 262 | # @DESCRIPTION: |
270 | # @DESCRIPTION: |
| 263 | # Perform any necessary pre-configuration steps, then run configure |
271 | # Perform any necessary pre-configuration steps, then run configure |
| … | |
… | |
| 308 | install || die "emake install failed" |
316 | install || die "emake install failed" |
| 309 | fi |
317 | fi |
| 310 | |
318 | |
| 311 | if [[ -n ${GIT_ECLASS} ]]; then |
319 | if [[ -n ${GIT_ECLASS} ]]; then |
| 312 | pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null |
320 | pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null |
| 313 | git log ${GIT_TREE} > "${S}"/ChangeLog |
321 | git log ${EGIT_COMMIT} > "${S}"/ChangeLog |
| 314 | popd > /dev/null |
322 | popd > /dev/null |
| 315 | fi |
323 | fi |
| 316 | |
324 | |
| 317 | if [[ -e "${S}"/ChangeLog ]]; then |
325 | if [[ -e "${S}"/ChangeLog ]]; then |
| 318 | dodoc "${S}"/ChangeLog |
326 | dodoc "${S}"/ChangeLog |