commit:     37127b999ef51eb5304e663abc1034ba4d4333c6
Author:     Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 26 05:55:27 2020 +0000
Commit:     Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Mon Oct 26 05:57:13 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37127b99

dev-ml/lablgl: fix lablglut binary install

Signed-off-by: Tim Harder <radhermit <AT> gentoo.org>

 dev-ml/lablgl/files/lablgl-1.06-makefile.patch | 12 ++++
 dev-ml/lablgl/lablgl-1.06-r1.ebuild            | 94 ++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)

diff --git a/dev-ml/lablgl/files/lablgl-1.06-makefile.patch 
b/dev-ml/lablgl/files/lablgl-1.06-makefile.patch
new file mode 100644
index 00000000000..36a1051a27b
--- /dev/null
+++ b/dev-ml/lablgl/files/lablgl-1.06-makefile.patch
@@ -0,0 +1,12 @@
+Make sure install dir exists before copying file to it.
+
+--- lablgl-1.06/LablGlut/src/Makefile
++++ lablgl-1.06/LablGlut/src/Makefile
+@@ -68,6 +68,7 @@
+       cd "$(INSTALLDIR)" && $(RANLIB) liblablglut$(XA)
+       @if test -f dlllablglut$(XS); then $(MAKE) installdll; \
+        else $(MAKE) installtop; fi
++      mkdir -p "$(BINDIR)"
+       cp lablglut$(XB) "$(BINDIR)"
+ 
+ real-install: preinstall

diff --git a/dev-ml/lablgl/lablgl-1.06-r1.ebuild 
b/dev-ml/lablgl/lablgl-1.06-r1.ebuild
new file mode 100644
index 00000000000..427234ccf7b
--- /dev/null
+++ b/dev-ml/lablgl/lablgl-1.06-r1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Objective CAML interface for OpenGL"
+HOMEPAGE="https://github.com/garrigue/lablgl";
+SRC_URI="https://github.com/garrigue/lablgl/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux 
~x86-linux"
+IUSE="doc glut +ocamlopt tk"
+
+RDEPEND="
+       >=dev-lang/ocaml-3.10.2:=[ocamlopt?]
+       x11-libs/libXext
+       x11-libs/libXmu
+       x11-libs/libX11
+       virtual/opengl
+       virtual/glu
+       glut? ( media-libs/freeglut )
+       tk? (
+               >=dev-lang/tcl-8.3:0=
+               >=dev-lang/tk-8.3:0=
+               dev-ml/labltk:=
+       )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}"/${P}-makefile.patch )
+
+src_configure() {
+       # make configuration file
+       echo "BINDIR=/usr/bin" > Makefile.config || die
+       echo "GLLIBS = -lGL -lGLU" >> Makefile.config || die
+       if use glut; then
+               echo "GLUTLIBS = -lglut" >> Makefile.config || die
+       else
+               echo "GLUTLIBS = " >> Makefile.config || die
+       fi
+       echo "XLIBS = -lXext -lXmu -lX11" >> Makefile.config || die
+       echo "RANLIB = $(tc-getRANLIB)" >> Makefile.config || die
+       echo 'COPTS = -c -O $(CFLAGS)' >> Makefile.config || die
+       echo 'INCLUDES = $(TKINCLUDES) $(GLINCLUDES) $(XINCLUDES)' >> 
Makefile.config || die
+}
+
+src_compile() {
+       if use tk; then
+               emake togl
+               if use ocamlopt; then
+                       emake toglopt
+               fi
+       fi
+
+       emake lib
+       if use ocamlopt; then
+               emake libopt
+       fi
+
+       if use glut; then
+               emake glut
+               if use ocamlopt; then
+                       emake glutopt
+               fi
+       fi
+}
+
+src_install() {
+       # Makefile do not use mkdir so the library is not installed
+       # but copied as a 'stublibs' file.
+       dodir /usr/$(get_libdir)/ocaml/stublibs
+
+       # Same for lablglut's toplevel
+       if use tk ; then
+               dodir /usr/bin
+       fi
+
+       BINDIR="${ED}/usr/bin"
+       BASE="${ED}/usr/$(get_libdir)/ocaml"
+       emake BINDIR="${BINDIR}" INSTALLDIR="${BASE}/lablGL" 
DLLDIR="${BASE}/stublibs" install
+
+       dodoc README CHANGES
+
+       if use doc ; then
+               mv Togl/examples{,.togl} || die
+               dodoc -r Togl/examples.togl
+
+               mv LablGlut/examples{,.glut} || die
+               dodoc -r LablGlut/examples.glut
+       fi
+}

Reply via email to