djview-4.9.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 1999-2014 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. MY_P=${PN}-$(replace_version_separator 2 '-')
  6. DESCRIPTION="Portable DjVu viewer using Qt4"
  7. HOMEPAGE="http://djvu.sourceforge.net/djview4.html"
  8. SRC_URI="mirror://sourceforge/djvu/${MY_P}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~alpha amd64 hppa ~ia64 ppc ppc64 x86"
  12. IUSE="debug nsplugin"
  13. RDEPEND="
  14. >=app-text/djvu-3.5.22-r1
  15. dev-qt/qtdbus: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. S=${WORKDIR}/${PN}4-${PV}
  22. src_prepare() {
  23. # Force XEmbed instead of Xt-based mainloop (disable Xt autodep)
  24. sed -e 's:\(ac_xt=\)yes:\1no:' -i configure* || die
  25. sed 's/AC_CXX_OPTIMIZE/OPTS=;AC_SUBST(OPTS)/' -i configure.ac || die #263688
  26. rm aclocal.m4 config/{libtool.m4,install-sh,ltmain.sh,lt*.m4}
  27. AT_M4DIR="config" eautoreconf
  28. }
  29. src_configure() {
  30. # See config/acinclude.m4
  31. use debug || append-cppflags "-DNDEBUG"
  32. # QTDIR is needed because of kde3
  33. QTDIR=/usr \
  34. econf \
  35. --with-x \
  36. $(use_enable nsplugin nsdejavu) \
  37. --disable-desktopfiles
  38. }
  39. src_compile() {
  40. emake CC="$(tc-getCC)" CXX="$(tc-getCXX)"
  41. }
  42. src_install() {
  43. emake DESTDIR="${D}" \
  44. plugindir=/usr/$(get_libdir)/${PLUGINS_DIR} \
  45. install
  46. dodoc README NEWS
  47. cd desktopfiles
  48. insinto /usr/share/icons/hicolor/32x32/apps
  49. newins hi32-djview4.png djvulibre-djview4.png
  50. insinto /usr/share/icons/hicolor/64x64/apps
  51. newins hi64-djview4.png djvulibre-djview4.png
  52. insinto /usr/share/icons/hicolor/scalable/apps
  53. newins djview.svg djvulibre-djview4.svg
  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. }