logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

glew-2.1.0.ebuild (2394B)


  1. # Copyright 1999-2022 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit multilib-minimal toolchain-funcs
  5. DESCRIPTION="The OpenGL Extension Wrangler Library"
  6. HOMEPAGE="http://glew.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
  8. LICENSE="BSD MIT"
  9. SLOT="$(ver_cut 1-2)"
  10. KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
  11. IUSE="doc static-libs"
  12. DEPEND="
  13. >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
  14. >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
  15. >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
  16. >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
  17. >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
  18. >=x11-libs/libXmu-1.1.1-r1[${MULTILIB_USEDEP}]
  19. "
  20. RDEPEND="${DEPEND}"
  21. src_prepare() {
  22. local PATCHES=(
  23. "${FILESDIR}"/${PN}-2.0.0-install-headers.patch
  24. )
  25. sed -i \
  26. -e '/INSTALL/s:-s::' \
  27. -e '/$(CC) $(CFLAGS) -o/s:$(CFLAGS):$(CFLAGS) $(LDFLAGS):' \
  28. -e '/^.PHONY: .*\.pc$/d' \
  29. Makefile || die
  30. if ! use static-libs ; then
  31. sed -i \
  32. -e '/glew.lib:/s|lib/$(LIB.STATIC) ||' \
  33. -e '/glew.lib.mx:/s|lib/$(LIB.STATIC.MX) ||' \
  34. -e '/INSTALL.*LIB.STATIC/d' \
  35. Makefile || die
  36. fi
  37. # don't do stupid Solaris specific stuff that won't work in Prefix
  38. cp config/Makefile.linux config/Makefile.solaris || die
  39. # and let freebsd be built as on linux too
  40. cp config/Makefile.linux config/Makefile.freebsd || die
  41. default
  42. multilib_copy_sources
  43. }
  44. glew_system() {
  45. # Set the SYSTEM variable instead of probing. #523444 #595280
  46. case ${CHOST} in
  47. *linux*) echo "linux" ;;
  48. *-freebsd*) echo "freebsd" ;;
  49. *-darwin*) echo "darwin" ;;
  50. *-solaris*) echo "solaris" ;;
  51. mingw*|*-mingw*) echo "mingw" ;;
  52. *) die "Unknown system ${CHOST}" ;;
  53. esac
  54. }
  55. set_opts() {
  56. myglewopts=(
  57. AR="$(tc-getAR)"
  58. STRIP=true
  59. CC="$(tc-getCC)"
  60. LD="$(tc-getCC) ${LDFLAGS}"
  61. SYSTEM="$(glew_system)"
  62. M_ARCH=""
  63. LDFLAGS.EXTRA=""
  64. POPT="${CFLAGS}"
  65. )
  66. }
  67. multilib_src_compile() {
  68. set_opts
  69. emake \
  70. GLEW_PREFIX="${EPREFIX}/usr" \
  71. GLEW_DEST="${EPREFIX}/usr" \
  72. LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
  73. glew.lib \
  74. "${myglewopts[@]}"
  75. }
  76. multilib_src_install() {
  77. set_opts
  78. emake \
  79. GLEW_DEST="${ED}/usr" \
  80. LIBDIR="${ED}/usr/$(get_libdir)" \
  81. PKGDIR="${ED}/usr/$(get_libdir)/pkgconfig" \
  82. "${myglewopts[@]}" \
  83. install.lib
  84. }