fltk-1.3.3-r3.ebuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils fdo-mime flag-o-matic
  5. DESCRIPTION="C++ user interface toolkit for X and OpenGL"
  6. HOMEPAGE="http://www.fltk.org/"
  7. SRC_URI="http://fltk.org/pub/${PN}/${PV}/${P}-source.tar.gz"
  8. SLOT="1"
  9. LICENSE="FLTK LGPL-2"
  10. KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
  11. IUSE="cairo debug doc examples games +opengl static-libs +threads +xft +xinerama"
  12. RDEPEND="
  13. >=media-libs/libpng-1.2:0
  14. sys-libs/zlib
  15. virtual/jpeg:0
  16. x11-libs/libICE
  17. x11-libs/libSM
  18. x11-libs/libXext
  19. x11-libs/libXt
  20. cairo? ( x11-libs/cairo[X] )
  21. opengl? ( virtual/glu virtual/opengl )
  22. xft? ( x11-libs/libXft )
  23. xinerama? ( x11-libs/libXinerama )
  24. "
  25. DEPEND="
  26. ${RDEPEND}
  27. x11-proto/xextproto
  28. doc? ( app-doc/doxygen )
  29. xinerama? ( x11-proto/xineramaproto )
  30. "
  31. src_prepare() {
  32. rm -rf zlib jpeg png || die
  33. epatch \
  34. "${FILESDIR}"/${PN}-1.3.2-desktop.patch \
  35. "${FILESDIR}"/${PN}-1.3.0-share.patch \
  36. "${FILESDIR}"/${PN}-1.3.2-conf-tests.patch \
  37. "${FILESDIR}"/${PN}-1.3.2-jpeg-9a.patch \
  38. "${FILESDIR}"/${PN}-1.3.3-visibility.patch \
  39. "${FILESDIR}"/${PN}-1.3.3-fl_open_display.patch \
  40. "${FILESDIR}"/${PN}-1.3.3-fltk-config.patch \
  41. "${FILESDIR}"/${PN}-1.3.3-xutf8-visibility.patch
  42. sed -i \
  43. -e 's:@HLINKS@::g' FL/Makefile.in || die
  44. # some fixes introduced because slotting
  45. sed -i \
  46. -e '/RANLIB/s:$(libdir)/\(.*LIBNAME)\):$(libdir)/`basename \1`:g' \
  47. src/Makefile || die
  48. # docs in proper docdir
  49. sed -i \
  50. -e "/^docdir/s:fltk:${PF}/html:" \
  51. -e "/SILENT:/d" \
  52. makeinclude.in || die
  53. sed -e "s/7/${PV}/" \
  54. < "${FILESDIR}"/FLTKConfig.cmake \
  55. > CMake/FLTKConfig.cmake || die
  56. sed -e 's:-Os::g' -i configure.in || die
  57. use prefix && append-ldflags -Wl,-rpath -Wl,"${FLTK_LIBDIR}"
  58. # also in Makefile:config.guess config.sub:
  59. cp misc/config.{guess,sub} . || die
  60. eautoconf
  61. }
  62. src_configure() {
  63. FLTK_INCDIR=${EPREFIX}/usr/include/fltk
  64. FLTK_LIBDIR=${EPREFIX}/usr/$(get_libdir)/fltk
  65. econf \
  66. $(use_enable cairo) \
  67. $(use_enable debug) \
  68. $(use_enable opengl gl) \
  69. $(use_enable threads) \
  70. $(use_enable xft) \
  71. $(use_enable xinerama) \
  72. --disable-localjpeg \
  73. --disable-localpng \
  74. --disable-localzlib \
  75. --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
  76. --enable-largefile \
  77. --enable-shared \
  78. --enable-xdbe \
  79. --includedir=${FLTK_INCDIR} \
  80. --libdir=${FLTK_LIBDIR}
  81. }
  82. src_compile() {
  83. default
  84. if use doc; then
  85. emake -C documentation html
  86. fi
  87. if use games; then
  88. emake -C test blocks checkers sudoku
  89. fi
  90. }
  91. src_test() {
  92. emake -C test
  93. }
  94. src_install() {
  95. default
  96. emake -C fluid \
  97. DESTDIR="${D}" install-linux
  98. if use doc; then
  99. emake -C documentation \
  100. DESTDIR="${D}" install
  101. fi
  102. local apps="fluid"
  103. if use games; then
  104. emake -C test \
  105. DESTDIR="${D}" install-linux
  106. emake -C documentation \
  107. DESTDIR="${D}" install-linux
  108. apps+=" sudoku blocks checkers"
  109. fi
  110. for app in ${apps}; do
  111. dosym /usr/share/icons/hicolor/32x32/apps/${app}.png \
  112. /usr/share/pixmaps/${app}.png
  113. done
  114. dodoc CHANGES README CREDITS ANNOUNCEMENT
  115. if use examples; then
  116. insinto /usr/share/doc/${PF}/examples
  117. doins test/*.{h,cxx,fl} test/demo.menu
  118. fi
  119. insinto /usr/share/cmake/Modules
  120. doins CMake/FLTK*.cmake
  121. echo "LDPATH=${FLTK_LIBDIR}" > 99fltk
  122. echo "FLTK_DOCDIR=${EPREFIX}/usr/share/doc/${PF}/html" >> 99fltk
  123. doenvd 99fltk
  124. # FIXME: This is bad, but building only shared libraries is hardly supported
  125. # FIXME: The executables in test/ are linking statically against libfltk
  126. if ! use static-libs; then
  127. rm "${ED}"/usr/lib*/fltk/*.a || die
  128. fi
  129. prune_libtool_files
  130. }
  131. pkg_postinst() {
  132. fdo-mime_desktop_database_update
  133. }
  134. pkg_postrm() {
  135. fdo-mime_desktop_database_update
  136. }