font-ebdftopcf.eclass 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # Author: Robin H. Johnson <robbat2@gentoo.org>
  4. # font-ebdftopcf.eclass
  5. # Eclass to make PCF font generator from BDF uniform and optimal
  6. # The manpage for this eclass is in media-gfx/ebdftopcf.
  7. # inherit this eclass after font.eclass
  8. # if USE="-X", this eclass is basically a no-op, since bdftopcf requires Xorg.
  9. IUSE="X"
  10. # Variable declarations
  11. DEPEND="X? ( media-gfx/ebdftopcf )"
  12. RDEPEND=""
  13. #
  14. # Public functions
  15. #
  16. ebdftopcf() {
  17. local bdffiles
  18. bdffiles="$@"
  19. [ -z "$bdffiles" ] && die "No BDF files specified."
  20. emake -f "${EPREFIX}"/usr/share/ebdftopcf/Makefile.ebdftopcf \
  21. BDFFILES="${bdffiles}" \
  22. BDFTOPCF_PARAMS="${BDFTOPCF_PARAMS}" \
  23. || die "Failed to build PCF files"
  24. }
  25. #
  26. # Public inheritable functions
  27. #
  28. font-ebdftopcf_src_compile() {
  29. use X && FONT_SUFFIX="pcf.gz"
  30. use X || FONT_SUFFIX="bdf"
  31. if use X; then
  32. [ -z "${BDFFILES}" ] && BDFFILES="$(find . -name '*.bdf')"
  33. ebdftopcf ${BDFFILES}
  34. fi
  35. }
  36. EXPORT_FUNCTIONS src_compile