culmus-0.120-r4.ebuild 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="2"
  4. inherit font
  5. # Maintainer: also check culmus.conf file in ${P}.tar.gz
  6. MY_A_P=AncientSemiticFonts-0.06-1
  7. # The Type 1 fonts are just a stripped version of TrueType fonts and they are
  8. # not updated unless there is a meaningful change and we need them for
  9. # culmus-latex, see bug #350657
  10. TYPE1_PV=0.105
  11. DESCRIPTION="Hebrew Type1 fonts"
  12. HOMEPAGE="http://culmus.sourceforge.net/"
  13. FANCY_FONTS="journal hillel anka comix gan ozrad ktav-yad dorian gladia horev"
  14. FANCY_YG_FONTS="ShmuelCLM MakabiYG"
  15. TAAMEY_FONTS="TaameyDavidCLM TaameyFrankCLM KeterAramTsova KeterYG"
  16. SRC_URI="mirror://sourceforge/culmus/${P}.tar.gz
  17. mirror://sourceforge/culmus/${PN}-type1-${TYPE1_PV}.tar.gz
  18. fontforge? ( mirror://sourceforge/culmus/${PN}-src-${PV}.tar.gz )
  19. ancient? ( !fontforge? ( mirror://sourceforge/culmus/${MY_A_P}.TTF.tgz )
  20. fontforge? ( mirror://sourceforge/culmus/${MY_A_P}.tgz ) )"
  21. SRC_URI+=" fancy? ( $(printf "http://culmus.sourceforge.net/fancy/%s.tar.gz " ${FANCY_FONTS}) )"
  22. SRC_URI+=" fancy? ( $(printf "http://culmus.sourceforge.net/fancy-yg/%s.zip " ${FANCY_YG_FONTS}) )"
  23. SRC_URI+=" taamey? ( $(printf "http://culmus.sourceforge.net/taamim/%s.zip " ${TAAMEY_FONTS}) )"
  24. # Some fonts are available in otf format too. Do we need them?
  25. # http://culmus.sourceforge.net/fancy/anka-otf.zip
  26. # http://culmus.sourceforge.net/fancy/hillel-otf.zip
  27. # http://culmus.sourceforge.net/fancy/journal-otf.zip
  28. LICENSE="|| ( GPL-2 LICENSE-BITSTREAM ) ancient? ( MIT ) fancy? ( GPL-2 )"
  29. SLOT="0"
  30. KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
  31. IUSE="ancient fancy fontforge taamey"
  32. FONT_CONF=( "${T}/65-culmus.conf" )
  33. RDEPEND="!media-fonts/culmus-ancient"
  34. # >=x11-apps/mkfontscale-1.0.9-r1 as Heavy weight support is required
  35. DEPEND="${RDEPEND}
  36. >=x11-apps/mkfontscale-1.0.9-r1
  37. fontforge? ( media-gfx/fontforge )"
  38. S=${WORKDIR}
  39. # Put all fonts, generated or not here
  40. FONT_S=${S}/FONTS
  41. src_unpack() {
  42. unpack ${P}.tar.gz # For type1 fonts...
  43. unpack ${PN}-type1-${TYPE1_PV}.tar.gz
  44. use fontforge && unpack ${PN}-src-${PV}.tar.gz
  45. use ancient && unpack ${MY_A_P}$(use fontforge || echo .TTF).tgz
  46. if use fancy; then
  47. unpack $(printf "%s.tar.gz " ${FANCY_FONTS})
  48. unpack $(printf "%s.zip " ${FANCY_YG_FONTS})
  49. mv TTF/* .
  50. fi
  51. if use taamey; then
  52. for font in ${TAAMEY_FONTS}; do
  53. mkdir ${font}
  54. pushd ${font}
  55. unpack ${font}.zip
  56. popd >/dev/null
  57. done
  58. fi
  59. }
  60. src_prepare() {
  61. cp "${P}/culmus.conf" "${T}/65-culmus.conf" || die
  62. }
  63. src_compile() {
  64. mkdir -p "${FONT_S}"
  65. if use fontforge; then
  66. pushd ${P}
  67. mv *.afm *.pfa "${FONT_S}"
  68. rm *.ttf
  69. popd >/dev/null
  70. pushd ${PN}-type1-${TYPE1_PV}
  71. mv *.afm *.pfa "${FONT_S}"
  72. popd >/dev/null
  73. pushd ${PN}-src-${PV}
  74. for f in *.sfd; do
  75. "${WORKDIR}"/${PN}-src-${PV}/GenerateTTF.pe ${f} "${FONT_S}" || die
  76. done
  77. popd >/dev/null
  78. if use ancient; then
  79. pushd ${MY_A_P}/src
  80. export FONTFORGE_LANGUAGE=ff
  81. make clean
  82. make all || die "Failed to build fonts"
  83. mv *.ttf "${FONT_S}"
  84. popd >/dev/null
  85. fi
  86. if use taamey; then
  87. for font in ${TAAMEY_FONTS}; do
  88. rm -rf ${font}/TTF
  89. pushd ${font}/SFD
  90. for f in *.sfd; do
  91. "${WORKDIR}"/${PN}-src-${PV}/GenerateTTF.pe ${f} "${FONT_S}" || die
  92. done
  93. popd >/dev/null
  94. done
  95. fi
  96. else
  97. pushd ${P}
  98. mv *.afm *.pfa *.ttf "${FONT_S}"
  99. popd >/dev/null
  100. pushd ${PN}-type1-${TYPE1_PV}
  101. mv *.afm *.pfa "${FONT_S}"
  102. popd >/dev/null
  103. if use ancient; then
  104. pushd ${MY_A_P}$(use fontforge || echo .TTF)/fonts
  105. mv *.ttf "${FONT_S}"
  106. popd >/dev/null
  107. fi
  108. if use taamey; then
  109. for font in ${TAAMEY_FONTS}; do
  110. pushd ${font}/TTF
  111. mv *.ttf "${FONT_S}"
  112. popd >/dev/null
  113. done
  114. fi
  115. fi
  116. use fancy && mv *.afm *.pfa *.ttf "${FONT_S}"
  117. }
  118. src_install() {
  119. FONT_SUFFIX="pfa afm $((use fancy || use taamey) && echo ttf)" \
  120. font_src_install
  121. rm -rf "${FONT_S}"
  122. find "${WORKDIR}" -name '*.ttf' -o -name '*.pfa' -o -name '*.pfm' |
  123. while read font; do
  124. ewarn "QA: missed font file: ${font}"
  125. done
  126. pushd ${PN}$(use fontforge && echo -src)-${PV}
  127. dodoc CHANGES || die
  128. popd >/dev/null
  129. if use ancient; then
  130. pushd "${WORKDIR}/${MY_A_P}$(use fontforge || echo .TTF)/"
  131. newdoc CHANGES{,.ancient} || die
  132. newdoc README{,.ancient} || die
  133. popd >/dev/null
  134. fi
  135. if use taamey; then
  136. for font in ${TAAMEY_FONTS}; do
  137. pushd ${font}
  138. [[ -f ChangeLog ]] && { newdoc ChangeLog{,.${font}} || die; }
  139. newdoc README{,.${font}} || die
  140. insinto /usr/share/doc/${PF}/${font}
  141. doins -r Samples
  142. popd >/dev/null
  143. done
  144. fi
  145. }