| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 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/x-modular.eclass,v 1.109 2009/05/14 12:40:55 remi Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.117 2009/11/28 10:25:37 scarabeus Exp $ |
| 4 | # |
4 | # |
| 5 | # @ECLASS: x-modular.eclass |
5 | # @ECLASS: x-modular.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org |
7 | # Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org |
| 8 | # @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
8 | # @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
| … | |
… | |
| 103 | fi |
103 | fi |
| 104 | |
104 | |
| 105 | SLOT="0" |
105 | SLOT="0" |
| 106 | |
106 | |
| 107 | # Set the license for the package. This can be overridden by setting |
107 | # Set the license for the package. This can be overridden by setting |
| 108 | # LICENSE after the inherit. |
108 | # LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages |
| 109 | LICENSE=${PN} |
109 | # are under the MIT license. (This is what Red Hat does in their rpms) |
|
|
110 | LICENSE="MIT" |
| 110 | |
111 | |
| 111 | # Set up shared dependencies |
112 | # Set up shared dependencies |
| 112 | if [[ -n "${SNAPSHOT}" ]]; then |
113 | if [[ -n "${SNAPSHOT}" ]]; then |
| 113 | # FIXME: What's the minimal libtool version supporting arbitrary versioning? |
114 | # FIXME: What's the minimal libtool version supporting arbitrary versioning? |
| 114 | DEPEND="${DEPEND} |
115 | DEPEND="${DEPEND} |
| … | |
… | |
| 145 | FONT_DIR=${FONT_DIR/ttf/TTF} |
146 | FONT_DIR=${FONT_DIR/ttf/TTF} |
| 146 | FONT_DIR=${FONT_DIR/otf/OTF} |
147 | FONT_DIR=${FONT_DIR/otf/OTF} |
| 147 | FONT_DIR=${FONT_DIR/type1/Type1} |
148 | FONT_DIR=${FONT_DIR/type1/Type1} |
| 148 | FONT_DIR=${FONT_DIR/speedo/Speedo} |
149 | FONT_DIR=${FONT_DIR/speedo/Speedo} |
| 149 | |
150 | |
| 150 | # Set up configure option |
151 | # Set up configure options, wrapped so ebuilds can override if need be |
|
|
152 | if [[ -z ${FONT_OPTIONS} ]]; then |
| 151 | FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\"" |
153 | FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\"" |
|
|
154 | fi |
| 152 | |
155 | |
| 153 | if [[ -n "${FONT}" ]]; then |
156 | if [[ -n "${FONT}" ]]; then |
| 154 | if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then |
157 | if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then |
| 155 | IUSE="${IUSE} nls" |
158 | IUSE="${IUSE} nls" |
| 156 | fi |
159 | fi |
| … | |
… | |
| 180 | DEPEND="${DEPEND} |
183 | DEPEND="${DEPEND} |
| 181 | >=dev-util/pkgconfig-0.18" |
184 | >=dev-util/pkgconfig-0.18" |
| 182 | |
185 | |
| 183 | if [[ "${PN/util-macros}" = "${PN}" ]]; then |
186 | if [[ "${PN/util-macros}" = "${PN}" ]]; then |
| 184 | DEPEND="${DEPEND} |
187 | DEPEND="${DEPEND} |
| 185 | >=x11-misc/util-macros-0.99.2 |
188 | >=x11-misc/util-macros-1.3.0 |
| 186 | >=sys-devel/binutils-2.16.1-r3" |
189 | sys-devel/binutils" |
| 187 | fi |
190 | fi |
| 188 | |
191 | |
| 189 | RDEPEND="${RDEPEND} |
192 | RDEPEND="${RDEPEND} |
| 190 | !<=x11-base/xorg-x11-6.9" |
193 | !<=x11-base/xorg-x11-6.9" |
| 191 | # Provides virtual/x11 for temporary use until packages are ported |
194 | # Provides virtual/x11 for temporary use until packages are ported |
| … | |
… | |
| 344 | # If a font package, perform any necessary configuration steps |
347 | # If a font package, perform any necessary configuration steps |
| 345 | x-modular_font_configure() { |
348 | x-modular_font_configure() { |
| 346 | if [[ -n "${FONT}" ]]; then |
349 | if [[ -n "${FONT}" ]]; then |
| 347 | # Might be worth adding an option to configure your desired font |
350 | # Might be worth adding an option to configure your desired font |
| 348 | # and exclude all others. Also, should this USE be nls or minimal? |
351 | # and exclude all others. Also, should this USE be nls or minimal? |
| 349 | if ! use nls; then |
352 | if has nls ${IUSE//+} && ! use nls; then |
| 350 | FONT_OPTIONS="${FONT_OPTIONS} |
353 | FONT_OPTIONS="${FONT_OPTIONS} |
| 351 | --disable-iso8859-2 |
354 | --disable-iso8859-2 |
| 352 | --disable-iso8859-3 |
355 | --disable-iso8859-3 |
| 353 | --disable-iso8859-4 |
356 | --disable-iso8859-4 |
| 354 | --disable-iso8859-5 |
357 | --disable-iso8859-5 |
| … | |
… | |
| 435 | DESTDIR="${D}" \ |
438 | DESTDIR="${D}" \ |
| 436 | install \ |
439 | install \ |
| 437 | || die |
440 | || die |
| 438 | else |
441 | else |
| 439 | make \ |
442 | make \ |
|
|
443 | docdir=/usr/share/doc/${PF} \ |
| 440 | DESTDIR="${D}" \ |
444 | DESTDIR="${D}" \ |
| 441 | install \ |
445 | install \ |
| 442 | || die |
446 | || die |
| 443 | fi |
447 | fi |
| 444 | # Shouldn't be necessary in XDIR=/usr |
448 | # Shouldn't be necessary in XDIR=/usr |
| … | |
… | |
| 510 | # @FUNCTION: cleanup_fonts |
514 | # @FUNCTION: cleanup_fonts |
| 511 | # @USAGE: |
515 | # @USAGE: |
| 512 | # @DESCRIPTION: |
516 | # @DESCRIPTION: |
| 513 | # Get rid of font directories that only contain generated files |
517 | # Get rid of font directories that only contain generated files |
| 514 | cleanup_fonts() { |
518 | cleanup_fonts() { |
| 515 | local ALLOWED_FILES="encodings.dir fonts.cache-1 fonts.dir fonts.scale" |
519 | local ALLOWED_FILES="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale" |
| 516 | for DIR in ${FONT_DIR}; do |
520 | for DIR in ${FONT_DIR}; do |
| 517 | unset KEEP_FONTDIR |
521 | unset KEEP_FONTDIR |
| 518 | REAL_DIR=${ROOT}usr/share/fonts/${DIR} |
522 | REAL_DIR=${ROOT}usr/share/fonts/${DIR} |
| 519 | |
523 | |
| 520 | ebegin "Checking ${REAL_DIR} for useless files" |
524 | ebegin "Checking ${REAL_DIR} for useless files" |
| … | |
… | |
| 557 | die "${msg}" |
561 | die "${msg}" |
| 558 | fi |
562 | fi |
| 559 | |
563 | |
| 560 | create_fonts_scale |
564 | create_fonts_scale |
| 561 | create_fonts_dir |
565 | create_fonts_dir |
| 562 | fix_font_permissions |
|
|
| 563 | create_font_cache |
566 | create_font_cache |
| 564 | } |
567 | } |
| 565 | |
568 | |
| 566 | # @FUNCTION: remove_font_metadata |
569 | # @FUNCTION: remove_font_metadata |
| 567 | # @USAGE: |
570 | # @USAGE: |
| … | |
… | |
| 650 | fi |
653 | fi |
| 651 | done |
654 | done |
| 652 | eend 0 |
655 | eend 0 |
| 653 | } |
656 | } |
| 654 | |
657 | |
| 655 | # @FUNCTION: fix_font_permissions |
|
|
| 656 | # @USAGE: |
|
|
| 657 | # @DESCRIPTION: |
|
|
| 658 | # Font files should have 644 permissions. Ensure this is the case. |
|
|
| 659 | fix_font_permissions() { |
|
|
| 660 | ebegin "Fixing permissions" |
|
|
| 661 | for DIR in ${FONT_DIR}; do |
|
|
| 662 | find "${ROOT}"/usr/share/fonts/${DIR} -type f -name 'font.*' \ |
|
|
| 663 | -exec chmod 0644 {} \; |
|
|
| 664 | done |
|
|
| 665 | eend 0 |
|
|
| 666 | } |
|
|
| 667 | |
|
|
| 668 | # @FUNCTION: create_font_cache |
658 | # @FUNCTION: create_font_cache |
| 669 | # @USAGE: |
659 | # @USAGE: |
| 670 | # @DESCRIPTION: |
660 | # @DESCRIPTION: |
| 671 | # Create fonts.cache-1 files, used by the new client-side fonts |
661 | # Create fonts.cache-1 files, used by the new client-side fonts |
| 672 | # subsystem. |
662 | # subsystem. |