glbsp-2.24.ebuild 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs versionator
  5. MY_PV=$(delete_version_separator 1)
  6. DESCRIPTION="A node builder specially designed for OpenGL ports of the DOOM game engine"
  7. HOMEPAGE="http://glbsp.sourceforge.net/"
  8. SRC_URI="mirror://sourceforge/glbsp/${PN}_src_${MY_PV}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="amd64 ~ppc x86"
  12. IUSE="fltk"
  13. DEPEND="fltk? ( x11-libs/fltk:1 )"
  14. RDEPEND=${DEPEND}
  15. S=${WORKDIR}/${P}-source
  16. src_prepare() {
  17. epatch "${FILESDIR}"/${P}-ldflags.patch
  18. sed -i \
  19. -e "/^CC=/s:=.*:=$(tc-getCC):" \
  20. -e "/^CXX=/s:=.*:=$(tc-getCXX):" \
  21. -e "/^AR=/s:ar:$(tc-getAR):" \
  22. -e "/^RANLIB=/s:=.*:=$(tc-getRANLIB):" \
  23. -e "s:-O2:${CFLAGS}:" \
  24. -e "s:-O -g3:${CFLAGS}:" \
  25. Makefile.unx \
  26. nodeview/Makefile.unx || die
  27. }
  28. src_compile() {
  29. emake -f Makefile.unx
  30. if use fltk ; then
  31. emake -f Makefile.unx glBSPX \
  32. FLTK_FLAGS="$(fltk-config --cflags)" \
  33. FLTK_LIBS="$(fltk-config --use-images --ldflags)"
  34. emake -f Makefile.unx -C nodeview \
  35. FLTK_CFLAGS="$(fltk-config --cflags)" \
  36. FLTK_LIBS="$(fltk-config --use-images --ldflags)"
  37. fi
  38. }
  39. src_install() {
  40. dobin glbsp
  41. dolib.a libglbsp.a
  42. doman glbsp.1
  43. dodoc AUTHORS.txt glbsp.txt
  44. insinto "/usr/include"
  45. doins "src/glbsp.h"
  46. if use fltk ; then
  47. newbin glBSPX glbspx
  48. newicon gui/icon.xpm glbspx.xpm
  49. make_desktop_entry glbspx glBSPX glbspx
  50. dobin nodeview/nodeview
  51. docinto nodeview
  52. dodoc nodeview/{README,TODO}.txt
  53. fi
  54. }