djview-4.10.6.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit autotools gnome2-utils fdo-mime flag-o-matic versionator toolchain-funcs multilib nsplugins
  5. DESCRIPTION="Portable DjVu viewer using Qt4"
  6. HOMEPAGE="http://djvu.sourceforge.net/djview4.html"
  7. SRC_URI="mirror://sourceforge/djvu/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~x86"
  11. IUSE="debug nsplugin"
  12. RDEPEND="
  13. >=app-text/djvu-3.5.22-r1
  14. dev-qt/qtdbus:4
  15. dev-qt/qtopengl:4
  16. dev-qt/qtgui:4"
  17. DEPEND="${RDEPEND}
  18. >=sys-devel/autoconf-2.67
  19. virtual/pkgconfig
  20. nsplugin? ( dev-libs/glib:2 )"
  21. src_prepare() {
  22. # Force XEmbed instead of Xt-based mainloop (disable Xt autodep)
  23. sed -e 's:\(ac_xt=\)yes:\1no:' -i configure* || die
  24. sed 's/AC_CXX_OPTIMIZE/OPTS=;AC_SUBST(OPTS)/' -i configure.ac || die #263688
  25. rm aclocal.m4 config/{libtool.m4,install-sh,ltmain.sh,lt*.m4}
  26. AT_M4DIR="config" eautoreconf
  27. }
  28. src_configure() {
  29. # See config/acinclude.m4
  30. use debug || append-cppflags "-DNDEBUG"
  31. # QTDIR is needed because of kde3
  32. QTDIR=/usr \
  33. econf \
  34. --with-x \
  35. $(use_enable nsplugin nsdejavu) \
  36. --disable-desktopfiles
  37. }
  38. src_compile() {
  39. emake CC="$(tc-getCC)" CXX="$(tc-getCXX)"
  40. }
  41. src_install() {
  42. emake DESTDIR="${D}" \
  43. plugindir=/usr/$(get_libdir)/${PLUGINS_DIR} \
  44. install
  45. dodoc README NEWS
  46. cd desktopfiles
  47. insinto /usr/share/icons/hicolor/32x32/apps
  48. newins prebuilt-hi32-djview4.png djvulibre-djview4.png
  49. insinto /usr/share/icons/hicolor/64x64/apps
  50. newins prebuilt-hi64-djview4.png djvulibre-djview4.png
  51. insinto /usr/share/icons/hicolor/scalable/apps
  52. newins djview.svg djvulibre-djview4.svg
  53. sed -i -e 's/Exec=djview4/Exec=djview/' djvulibre-djview4.desktop
  54. domenu djvulibre-djview4.desktop
  55. }
  56. pkg_preinst() {
  57. gnome2_icon_savelist
  58. }
  59. pkg_postinst() {
  60. fdo-mime_desktop_database_update
  61. gnome2_icon_cache_update
  62. }
  63. pkg_postrm() {
  64. fdo-mime_desktop_database_update
  65. gnome2_icon_cache_update
  66. }