qpdfview-0.4.16.ebuild 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PLOCALES="ast az be bg bs ca cs da de el en_GB eo es eu fi fr gl he hr hu id it kk ko ky lt ms my pl pt pt_BR ro ru sk sv th tr ug uk vi zh_CN"
  5. inherit l10n qmake-utils
  6. DESCRIPTION="A tabbed document viewer"
  7. HOMEPAGE="https://launchpad.net/qpdfview"
  8. SRC_URI="https://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
  9. LICENSE="GPL-2+"
  10. SLOT="0"
  11. KEYWORDS="amd64 arm x86 ~amd64-linux ~x86-linux"
  12. IUSE="cups +dbus djvu fitz +pdf postscript qt5 +sqlite +svg synctex"
  13. REQUIRED_USE="?? ( fitz pdf )"
  14. RDEPEND="
  15. cups? ( net-print/cups )
  16. djvu? ( app-text/djvu )
  17. fitz? ( >=app-text/mupdf-1.7:= )
  18. postscript? ( app-text/libspectre )
  19. !qt5? ( dev-qt/qtcore:4[iconv]
  20. dev-qt/qtgui:4
  21. sys-apps/file
  22. dbus? ( dev-qt/qtdbus:4 )
  23. pdf? ( >=app-text/poppler-0.35[qt4] )
  24. sqlite? ( dev-qt/qtsql:4[sqlite] )
  25. svg? ( dev-qt/qtsvg:4 ) )
  26. qt5? ( dev-qt/qtconcurrent:5
  27. dev-qt/qtcore:5
  28. dev-qt/qtgui:5
  29. dev-qt/qtprintsupport:5
  30. dev-qt/qtwidgets:5
  31. dbus? ( dev-qt/qtdbus:5 )
  32. pdf? ( >=app-text/poppler-0.35[qt5]
  33. dev-qt/qtxml:5 )
  34. sqlite? ( dev-qt/qtsql:5[sqlite] )
  35. svg? ( dev-qt/qtsvg:5 ) )
  36. !svg? ( virtual/freedesktop-icon-theme )
  37. synctex? ( app-text/texlive-core )"
  38. DEPEND="${RDEPEND}
  39. qt5? ( dev-qt/linguist-tools:5 )
  40. virtual/pkgconfig"
  41. DOCS=( CHANGES CONTRIBUTORS README TODO )
  42. src_prepare() {
  43. local mylrelease="$(qt4_get_bindir)"/lrelease
  44. use qt5 && mylrelease="$(qt5_get_bindir)"/lrelease
  45. prepare_locale() {
  46. "${mylrelease}" "translations/${PN}_${1}.ts" || die "preparing ${1} locale failed"
  47. }
  48. rm_help() {
  49. rm -f "help/help_${1}.html" || die "removing ${1} help file failed"
  50. }
  51. l10n_find_plocales_changes translations ${PN}_ .ts
  52. l10n_for_each_locale_do prepare_locale
  53. l10n_for_each_disabled_locale_do rm_help
  54. # adapt for prefix
  55. sed -i -e "s:/usr:${EPREFIX}/usr:g" qpdfview.pri || die
  56. default
  57. }
  58. src_configure() {
  59. local myconfig=() i=
  60. for i in cups dbus djvu pdf svg synctex; do
  61. use ${i} || myconfig+=(without_${i})
  62. done
  63. use fitz && myconfig+=(with_fitz)
  64. use postscript || myconfig+=(without_ps)
  65. use sqlite || myconfig+=(without_sql)
  66. local myqmakeargs=(
  67. qpdfview.pro
  68. CONFIG+="${myconfig[@]}"
  69. PLUGIN_INSTALL_PATH="${EPREFIX}/usr/$(get_libdir)/${PN}"
  70. )
  71. if use qt5; then
  72. eqmake5 "${myqmakeargs[@]}"
  73. else
  74. eqmake4 "${myqmakeargs[@]}"
  75. fi
  76. }
  77. src_install() {
  78. emake INSTALL_ROOT="${D}" install
  79. einstalldocs
  80. }