powerline-terminus-20181111.ebuild 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit font
  5. FONT_SIZES=( 18 20 22 24 28 32 )
  6. DESCRIPTION="Console Unicode Terminus font with symbols for Powerline/Airline"
  7. HOMEPAGE="https://github.com/powerline/powerline"
  8. COMMON_URI="https://raw.githubusercontent.com/powerline/fonts/master/Terminus"
  9. gen_src_uri() {
  10. for f in ${FONT_SIZES[*]}; do
  11. echo "pcf? ( ${COMMON_URI}/PCF/ter-powerline-x${f}n.pcf.gz ${COMMON_URI}/PCF/ter-powerline-x${f}b.pcf.gz )"
  12. echo "psf? ( ${COMMON_URI}/PSF/ter-powerline-v${f}n.psf.gz ${COMMON_URI}/PSF/ter-powerline-v${f}b.psf.gz )"
  13. done
  14. }
  15. SRC_URI="$(gen_src_uri)"
  16. RESTRICT="mirror strip binchecks"
  17. LICENSE="OFL-1.1 GPL-2 MIT"
  18. SLOT="0"
  19. KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
  20. IUSE="+pcf +psf"
  21. FONTDIR="${EPREFIX}/usr/share/consolefonts"
  22. REQUIRED_USE="!X"
  23. src_unpack(){
  24. mkdir -p ${S}
  25. for a in ${A}; do
  26. use pcf && ( [[ ${a%*.psf.gz}==${a} ]] && cp ${DISTDIR}/${a} ${S} || continue )
  27. use psf && ( [[ ${a%*.pcf.gz}==${a} ]] && cp ${DISTDIR}/${a} ${S} || continue )
  28. done
  29. }
  30. src_prepare(){
  31. default
  32. use pcf && FONT_SUFFIX="pcf.gz "
  33. use psf && FONT_SUFFIX+="psf.gz"
  34. }