commit: b0c4bbcfc7d79b29678092794da745b99d72fea6 parent 42feb8ee874511f6f82a028768130fb62bc57f77 Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Date: Mon, 18 Apr 2022 01:22:56 +0200 media-libs/glew: Add compat libDiffstat:
A | media-libs/glew/Manifest | 1 | + |
A | media-libs/glew/files/glew-2.0.0-install-headers.patch | 13 | +++++++++++++ |
A | media-libs/glew/glew-2.1.0.ebuild | 98 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | media-libs/glew/metadata.xml | 8 | ++++++++ |
4 files changed, 120 insertions(+), 0 deletions(-)
diff --git a/media-libs/glew/Manifest b/media-libs/glew/Manifest @@ -0,0 +1 @@ +DIST glew-2.1.0.tgz 764073 BLAKE2B 081fb49ef286681657409f950fa03b97210dac3f90197b792d9128a2b9fa271181c9e64422a867b531683ab23010cfeb2f519adc32355839b67bf41934578fb3 SHA512 9a9b4d81482ccaac4b476c34ed537585ae754a82ebb51c3efa16d953c25cc3931be46ed2e49e79c730cd8afc6a1b78c97d52cd714044a339c3bc29734cd4d2ab diff --git a/media-libs/glew/files/glew-2.0.0-install-headers.patch b/media-libs/glew/files/glew-2.0.0-install-headers.patch @@ -0,0 +1,13 @@ +--- glew-2.0.0/Makefile ++++ glew-2.0.0/Makefile +@@ -226,9 +226,7 @@ + + install.include: + $(INSTALL) -d -m 0755 "$(DESTDIR)$(INCDIR)" +- $(INSTALL) -m 0644 include/GL/wglew.h "$(DESTDIR)$(INCDIR)/" +- $(INSTALL) -m 0644 include/GL/glew.h "$(DESTDIR)$(INCDIR)/" +- $(INSTALL) -m 0644 include/GL/glxew.h "$(DESTDIR)$(INCDIR)/" ++ $(INSTALL) -m 0644 include/GL/*.h "$(DESTDIR)$(INCDIR)/" + + install.pkgconfig: glew.pc + $(INSTALL) -d -m 0755 "$(DESTDIR)$(PKGDIR)" diff --git a/media-libs/glew/glew-2.1.0.ebuild b/media-libs/glew/glew-2.1.0.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multilib-minimal toolchain-funcs + +DESCRIPTION="The OpenGL Extension Wrangler Library" +HOMEPAGE="http://glew.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tgz" + +LICENSE="BSD MIT" +SLOT="$(ver_cut 1-2)" +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" +IUSE="doc static-libs" + +DEPEND=" + >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}] + >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] + >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}] + >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}] + >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}] + >=x11-libs/libXmu-1.1.1-r1[${MULTILIB_USEDEP}] +" +RDEPEND="${DEPEND}" + +src_prepare() { + local PATCHES=( + "${FILESDIR}"/${PN}-2.0.0-install-headers.patch + ) + + sed -i \ + -e '/INSTALL/s:-s::' \ + -e '/$(CC) $(CFLAGS) -o/s:$(CFLAGS):$(CFLAGS) $(LDFLAGS):' \ + -e '/^.PHONY: .*\.pc$/d' \ + Makefile || die + + if ! use static-libs ; then + sed -i \ + -e '/glew.lib:/s|lib/$(LIB.STATIC) ||' \ + -e '/glew.lib.mx:/s|lib/$(LIB.STATIC.MX) ||' \ + -e '/INSTALL.*LIB.STATIC/d' \ + Makefile || die + fi + + # don't do stupid Solaris specific stuff that won't work in Prefix + cp config/Makefile.linux config/Makefile.solaris || die + # and let freebsd be built as on linux too + cp config/Makefile.linux config/Makefile.freebsd || die + + default + multilib_copy_sources +} + +glew_system() { + # Set the SYSTEM variable instead of probing. #523444 #595280 + case ${CHOST} in + *linux*) echo "linux" ;; + *-freebsd*) echo "freebsd" ;; + *-darwin*) echo "darwin" ;; + *-solaris*) echo "solaris" ;; + mingw*|*-mingw*) echo "mingw" ;; + *) die "Unknown system ${CHOST}" ;; + esac +} + +set_opts() { + myglewopts=( + AR="$(tc-getAR)" + STRIP=true + CC="$(tc-getCC)" + LD="$(tc-getCC) ${LDFLAGS}" + SYSTEM="$(glew_system)" + M_ARCH="" + LDFLAGS.EXTRA="" + POPT="${CFLAGS}" + ) +} + +multilib_src_compile() { + set_opts + emake \ + GLEW_PREFIX="${EPREFIX}/usr" \ + GLEW_DEST="${EPREFIX}/usr" \ + LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ + glew.lib \ + "${myglewopts[@]}" +} + +multilib_src_install() { + set_opts + emake \ + GLEW_DEST="${ED}/usr" \ + LIBDIR="${ED}/usr/$(get_libdir)" \ + PKGDIR="${ED}/usr/$(get_libdir)/pkgconfig" \ + "${myglewopts[@]}" \ + install.lib +} diff --git a/media-libs/glew/metadata.xml b/media-libs/glew/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <upstream> + <remote-id type="github">nigels-com/glew</remote-id> + <remote-id type="sourceforge">glew</remote-id> + </upstream> +</pkgmetadata>