kicad-doc-4.0.5.ebuild 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit cmake-utils
  5. DESCRIPTION="Electronic Schematic and PCB design tools manuals"
  6. HOMEPAGE="http://www.kicad-pcb.org/"
  7. SRC_URI="https://github.com/KiCad/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="|| ( GPL-3+ CC-BY-3.0 ) GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="html +pdf"
  12. LANGS="en fr it ja nl pl"
  13. for lang in ${LANGS}; do
  14. LUSE+=" l10n_${lang}"
  15. done
  16. IUSE+=${LUSE}
  17. REQUIRED_USE="|| ( html pdf ) ^^ ( ${LUSE} )"
  18. unset lang
  19. unset LUSE
  20. DEPEND=">=app-text/asciidoc-8.6.9
  21. app-text/dblatex
  22. app-text/texlive:=[l10n_en?,l10n_fr?,l10n_it?,l10n_ja?,l10n_nl?,l10n_pl?]
  23. >=app-text/po4a-0.45
  24. >=sys-devel/gettext-0.18
  25. dev-util/source-highlight
  26. dev-perl/Unicode-LineBreak
  27. l10n_ja? ( media-fonts/vlgothic )"
  28. RDEPEND=""
  29. src_prepare() {
  30. DOCPATH="KICAD_DOC_INSTALL_PATH share/doc/kicad"
  31. sed "s|${DOCPATH}|${DOCPATH}-${PV}|g" -i CMakeLists.txt || die "sed failed"
  32. cmake-utils_src_prepare
  33. }
  34. src_configure() {
  35. local formats=""
  36. local doclang=""
  37. local format lang
  38. # construct format string
  39. for format in html pdf; do
  40. use ${format} && formats+="${format};"
  41. done
  42. # find out which language is requested
  43. for lang in ${LANGS}; do
  44. if use l10n_${lang}; then
  45. if [[ -z ${doclang} ]]; then
  46. doclang="${lang}"
  47. else
  48. ewarn "Only one single language can be enabled." \
  49. "Using \"${doclang}\", ignoring \"${lang}\"."
  50. fi
  51. fi
  52. done
  53. local mycmakeargs=(
  54. -DBUILD_FORMATS="${formats}"
  55. -DSINGLE_LANGUAGE="${doclang}"
  56. )
  57. cmake-utils_src_configure
  58. }