fontconfig-ultimate-2015.08.01.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit readme.gentoo versionator
  5. MY_PV=$(replace_all_version_separators "-")
  6. DESCRIPTION="A set of font rendering and replacement rules for fontconfig-infinality"
  7. HOMEPAGE="http://bohoomil.com/"
  8. SRC_URI="https://github.com/bohoomil/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
  9. LICENSE="MIT"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. DEPEND="app-eselect/eselect-infinality
  13. app-eselect/eselect-lcdfilter
  14. media-libs/fontconfig-infinality
  15. media-libs/freetype:2[infinality]"
  16. RDEPEND="${DEPEND}"
  17. S=${WORKDIR}/${PN}-${MY_PV}
  18. DISABLE_AUTOFORMATTING="1"
  19. DOC_CONTENTS="1. Disable all rules but 52-infinality.conf using eselect fontconfig
  20. 2. Enable one of the \"ultimate\" presets using eselect infinality
  21. 3. Select ultimate lcdfilter settings using eselect lcdfilter"
  22. BLACKLIST="43-wqy-zenhei-sharp.conf"
  23. src_prepare() {
  24. pushd fontconfig_patches/fonts-settings || die
  25. rm ${BLACKLIST} || die
  26. popd
  27. # Generate lcdfilter config
  28. echo -e "################# FONTCONFIG ULTIMATE STYLE #################\n" \
  29. > "${T}"/ultimate || die
  30. local infinality_style
  31. infinality_style=$(sed --quiet \
  32. -e 's/^USE_STYLE="*\([1-9]\)"*/\1/p' \
  33. freetype/infinality-settings.sh) || die
  34. if ! [ -n "$infinality_style" ]; then
  35. ewarn "Missing USE_STYLE variable in package source."
  36. infinality_style=1
  37. fi
  38. sed --quiet \
  39. -e '/INFINALITY_FT_FILTER_PARAMS=/p' \
  40. freetype/infinality-settings.sh \
  41. | sed --quiet \
  42. -e "${infinality_style} s/[ \t]*export[ \t]*//p" \
  43. >> "${T}"/ultimate
  44. assert
  45. sed --quiet \
  46. -e '/INFINALITY_FT_FILTER_PARAMS/ d' \
  47. -e 's/^[ \t]*export[ \t]*INFINALITY_FT/INFINALITY_FT/p' \
  48. freetype/infinality-settings.sh \
  49. >> "${T}"/ultimate || die
  50. }
  51. src_install() {
  52. insinto /etc/fonts/infinality/conf.src.ultimate
  53. doins conf.d.infinality/*.conf
  54. doins fontconfig_patches/{ms,free,combi}/*.conf
  55. # Cut a list of default .conf files out of Makefile.am
  56. local default_configs config fonts_settings
  57. default_configs=$(sed --quiet \
  58. -e ':again' \
  59. -e '/\\$/ N' \
  60. -e 's/\\\n/ /' \
  61. -e 't again' \
  62. -e 's/^CONF_LINKS =//p' \
  63. conf.d.infinality/Makefile.am) || die
  64. # Install per-font settings
  65. pushd fontconfig_patches/fonts-settings || die
  66. doins *.conf
  67. fonts_settings=$(echo *.conf)
  68. popd
  69. # Install font presets
  70. pushd fontconfig_patches/ms || die
  71. for config in ${default_configs} ${fonts_settings} *.conf; do
  72. dosym ../../conf.src.ultimate/"${config}" \
  73. /etc/fonts/infinality/styles.conf.avail/ultimate-ms/"${config}"
  74. done
  75. popd
  76. pushd fontconfig_patches/free || die
  77. for config in ${default_configs} ${fonts_settings} *.conf; do
  78. dosym ../../conf.src.ultimate/"${config}" \
  79. /etc/fonts/infinality/styles.conf.avail/ultimate-free/"${config}"
  80. done
  81. popd
  82. pushd fontconfig_patches/combi || die
  83. for config in ${default_configs} ${fonts_settings} *.conf; do
  84. dosym ../../conf.src.ultimate/"${config}" \
  85. /etc/fonts/infinality/styles.conf.avail/ultimate-combi/"${config}"
  86. done
  87. popd
  88. insinto /usr/share/eselect-lcdfilter/env.d
  89. doins "${T}"/ultimate
  90. readme.gentoo_create_doc
  91. }