diff options
author | Tim Harder <radhermit@gentoo.org> | 2020-10-25 23:55:27 -0600 |
---|---|---|
committer | Tim Harder <radhermit@gentoo.org> | 2020-10-25 23:57:13 -0600 |
commit | 37127b999ef51eb5304e663abc1034ba4d4333c6 (patch) | |
tree | b646655c45c6c64a8b4edaba9901b913aef91c6a /dev-ml/lablgl | |
parent | sys-cluster/minikube: unbreak tree, switch dep to kubectl (diff) | |
download | gentoo-37127b999ef51eb5304e663abc1034ba4d4333c6.tar.gz gentoo-37127b999ef51eb5304e663abc1034ba4d4333c6.tar.bz2 gentoo-37127b999ef51eb5304e663abc1034ba4d4333c6.zip |
dev-ml/lablgl: fix lablglut binary install
Signed-off-by: Tim Harder <radhermit@gentoo.org>
Diffstat (limited to 'dev-ml/lablgl')
-rw-r--r-- | dev-ml/lablgl/files/lablgl-1.06-makefile.patch | 12 | ||||
-rw-r--r-- | dev-ml/lablgl/lablgl-1.06-r1.ebuild | 94 |
2 files changed, 106 insertions, 0 deletions
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 000000000000..36a1051a27bb --- /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 000000000000..427234ccf7b8 --- /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 +} |