Skip to content

Commit 4b3357c

Browse files
author
Rhys Koedijk
authored
switch: add glu (#118)
1 parent e554b4e commit 4b3357c

File tree

3 files changed

+127
-0
lines changed

3 files changed

+127
-0
lines changed

switch/glu/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
2+
Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a
5+
copy of this software and associated documentation files (the "Software"),
6+
to deal in the Software without restriction, including without limitation
7+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
and/or sell copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice including the dates of first publication and
12+
either this permission notice or a reference to
13+
http://oss.sgi.com/projects/FreeB/
14+
shall be included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19+
SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
21+
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
24+
Except as contained in this notice, the name of Silicon Graphics, Inc.
25+
shall not be used in advertising or otherwise to promote the sale, use or
26+
other dealings in this Software without prior written authorization from
27+
Silicon Graphics, Inc.

switch/glu/PKGBUILD

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Maintainer: Rhys Koedijk <rhys@koedijk.co.nz>
2+
3+
pkgbasename=glu
4+
pkgname=switch-$pkgbasename
5+
pkgver=9.0.1
6+
pkgrel=1
7+
pkgdesc='SGI implementation of the OpenGL Utility library'
8+
arch=('any')
9+
url='https://mesa.freedesktop.org/archive/glu/'
10+
license=('custom')
11+
options=(!strip libtool staticlibs)
12+
source=("${url}/${pkgbasename}-${pkgver}.tar.xz")
13+
sha256sums=('fb5a4c2dd6ba6d1c21ab7c05129b0769544e1d68e1e3b0ffecb18e73c93055bc')
14+
depends=('switch-mesa')
15+
makedepends=('switch-pkg-config' 'devkitpro-pkgbuild-helpers')
16+
groups=('switch-portlibs')
17+
18+
prepare() {
19+
cd ${pkgbasename}-${pkgver}
20+
patch -Np1 -i "${startdir}/${pkgbasename}-9.0.1-configure-ac-enable-egl-arg.patch"
21+
}
22+
23+
build() {
24+
cd ${pkgbasename}-${pkgver}
25+
26+
source /opt/devkitpro/switchvars.sh
27+
28+
autoconf
29+
30+
./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \
31+
--disable-shared --enable-static --enable-egl
32+
33+
make
34+
}
35+
36+
package() {
37+
cd ${pkgbasename}-${pkgver}
38+
39+
make DESTDIR="$pkgdir" install
40+
install -Dm644 "${startdir}"/LICENSE "$pkgdir"/opt/devkitpro/portlibs/switch/licenses/$pkgname/LICENSE
41+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index 6d9b04b..e35d8bd 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -61,6 +61,12 @@ AC_ARG_ENABLE(osmesa,
6+
[OSMESA="$enableval"],
7+
[OSMESA=no])
8+
9+
+AC_ARG_ENABLE(egl,
10+
+ AS_HELP_STRING([--enable-egl],
11+
+ [Enable use of libEGL instead of libGL]),
12+
+ [EGL="$enableval"],
13+
+ [EGL=no])
14+
+
15+
dnl Get the pkg-config definitions for libGL/OSMesa. We include a fallback
16+
dnl path for implementations that don't provide a .pc file
17+
if test "x$OSMESA" = "xyes"; then
18+
@@ -71,17 +77,30 @@ if test "x$OSMESA" = "xyes"; then
19+
[OSMESA_LIBS=-lOSMesa],
20+
AC_MSG_ERROR([OSMesa required]))
21+
])
22+
-else
23+
- GLU_REQUIRES="gl"
24+
- PKG_CHECK_MODULES(GL, [gl], [], [
25+
- AC_CHECK_HEADER([GL/gl.h],
26+
- [],
27+
- AC_MSG_ERROR([GL not found]))
28+
- AC_CHECK_LIB([GL],
29+
- [glBegin],
30+
- [GL_LIBS=-lGL],
31+
- AC_MSG_ERROR([GL required]))
32+
- ])
33+
+else
34+
+ if test "x$EGL" = "xyes"; then
35+
+ GLU_REQUIRES="egl"
36+
+ PKG_CHECK_MODULES(EGL, [egl], [], [
37+
+ AC_CHECK_HEADER([GL/gl.h],
38+
+ [],
39+
+ AC_MSG_ERROR([EGL not found]))
40+
+ AC_CHECK_LIB([EGL],
41+
+ [glBegin],
42+
+ [GL_LIBS=-lEGL],
43+
+ AC_MSG_ERROR([EGL required]))
44+
+ ])
45+
+ else
46+
+ GLU_REQUIRES="gl"
47+
+ PKG_CHECK_MODULES(GL, [gl], [], [
48+
+ AC_CHECK_HEADER([GL/gl.h],
49+
+ [],
50+
+ AC_MSG_ERROR([GL not found]))
51+
+ AC_CHECK_LIB([GL],
52+
+ [glBegin],
53+
+ [GL_LIBS=-lGL],
54+
+ AC_MSG_ERROR([GL required]))
55+
+ ])
56+
+ fi
57+
fi
58+
AC_SUBST([GLU_REQUIRES])
59+

0 commit comments

Comments
 (0)