1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit multilib-minimal toolchain-funcs versionator
7 DESCRIPTION="The OpenGL Extension Wrangler Library"
8 HOMEPAGE="http://glew.sourceforge.net/"
9 SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
12 SLOT="$(get_version_component_range 1-2)"
13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
15 RDEPEND=">=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
16 !=media-libs/glew-1.10*:0"
28 -e '/$(CC) $(CFLAGS) -o/s:$(CFLAGS):$(CFLAGS) $(LDFLAGS):' \
29 -e '/glew.lib:/s|lib/$(LIB.STATIC) ||' \
30 -e '/glew.lib.mx:/s|lib/$(LIB.STATIC.MX) ||' \
33 # don't do stupid Solaris specific stuff that won't work in Prefix
34 cp config/Makefile.linux config/Makefile.solaris || die
35 # and let freebsd be built as on linux too
36 cp config/Makefile.linux config/Makefile.freebsd || die
42 # Set the SYSTEM variable instead of probing. #523444 #595280
44 *linux*) echo "linux" ;;
45 *-freebsd*) echo "freebsd" ;;
46 *-darwin*) echo "darwin" ;;
47 *-solaris*) echo "solaris" ;;
48 mingw*|*-mingw*) echo "mingw" ;;
49 *) die "Unknown system ${CHOST}" ;;
58 LD="$(tc-getCC) ${LDFLAGS}"
59 SYSTEM="$(glew_system)"
62 LDFLAGS.GL="-lGL" # Don't need X libs!
67 multilib_src_compile() {
69 emake glew.lib{,.mx} "${myglewopts[@]}"
72 multilib_src_install() {
73 newlib.so lib/libGLEW.so.${SLOT}.* libGLEW.so.${SLOT}
74 newlib.so lib/libGLEWmx.so.${SLOT}.* libGLEWmx.so.${SLOT}