diff --git a/switch/glu/LICENSE b/switch/glu/LICENSE new file mode 100644 index 00000000..f7e08f4a --- /dev/null +++ b/switch/glu/LICENSE @@ -0,0 +1,27 @@ +SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) +Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice including the dates of first publication and +either this permission notice or a reference to +http://oss.sgi.com/projects/FreeB/ +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Except as contained in this notice, the name of Silicon Graphics, Inc. +shall not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization from +Silicon Graphics, Inc. \ No newline at end of file diff --git a/switch/glu/PKGBUILD b/switch/glu/PKGBUILD new file mode 100644 index 00000000..3c849204 --- /dev/null +++ b/switch/glu/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: Rhys Koedijk + +pkgbasename=glu +pkgname=switch-$pkgbasename +pkgver=9.0.1 +pkgrel=1 +pkgdesc='SGI implementation of the OpenGL Utility library' +arch=('any') +url='https://mesa.freedesktop.org/archive/glu/' +license=('custom') +options=(!strip libtool staticlibs) +source=("${url}/${pkgbasename}-${pkgver}.tar.xz") +sha256sums=('fb5a4c2dd6ba6d1c21ab7c05129b0769544e1d68e1e3b0ffecb18e73c93055bc') +depends=('switch-mesa') +makedepends=('switch-pkg-config' 'devkitpro-pkgbuild-helpers') +groups=('switch-portlibs') + +prepare() { + cd ${pkgbasename}-${pkgver} + patch -Np1 -i "${startdir}/${pkgbasename}-9.0.1-configure-ac-enable-egl-arg.patch" +} + +build() { + cd ${pkgbasename}-${pkgver} + + source /opt/devkitpro/switchvars.sh + + autoconf + + ./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \ + --disable-shared --enable-static --enable-egl + + make +} + +package() { + cd ${pkgbasename}-${pkgver} + + make DESTDIR="$pkgdir" install + install -Dm644 "${startdir}"/LICENSE "$pkgdir"/opt/devkitpro/portlibs/switch/licenses/$pkgname/LICENSE +} \ No newline at end of file diff --git a/switch/glu/glu-9.0.1-configure-ac-enable-egl-arg.patch b/switch/glu/glu-9.0.1-configure-ac-enable-egl-arg.patch new file mode 100644 index 00000000..5060acb1 --- /dev/null +++ b/switch/glu/glu-9.0.1-configure-ac-enable-egl-arg.patch @@ -0,0 +1,59 @@ +diff --git a/configure.ac b/configure.ac +index 6d9b04b..e35d8bd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -61,6 +61,12 @@ AC_ARG_ENABLE(osmesa, + [OSMESA="$enableval"], + [OSMESA=no]) + ++AC_ARG_ENABLE(egl, ++ AS_HELP_STRING([--enable-egl], ++ [Enable use of libEGL instead of libGL]), ++ [EGL="$enableval"], ++ [EGL=no]) ++ + dnl Get the pkg-config definitions for libGL/OSMesa. We include a fallback + dnl path for implementations that don't provide a .pc file + if test "x$OSMESA" = "xyes"; then +@@ -71,17 +77,30 @@ if test "x$OSMESA" = "xyes"; then + [OSMESA_LIBS=-lOSMesa], + AC_MSG_ERROR([OSMesa required])) + ]) +-else +- GLU_REQUIRES="gl" +- PKG_CHECK_MODULES(GL, [gl], [], [ +- AC_CHECK_HEADER([GL/gl.h], +- [], +- AC_MSG_ERROR([GL not found])) +- AC_CHECK_LIB([GL], +- [glBegin], +- [GL_LIBS=-lGL], +- AC_MSG_ERROR([GL required])) +- ]) ++else ++ if test "x$EGL" = "xyes"; then ++ GLU_REQUIRES="egl" ++ PKG_CHECK_MODULES(EGL, [egl], [], [ ++ AC_CHECK_HEADER([GL/gl.h], ++ [], ++ AC_MSG_ERROR([EGL not found])) ++ AC_CHECK_LIB([EGL], ++ [glBegin], ++ [GL_LIBS=-lEGL], ++ AC_MSG_ERROR([EGL required])) ++ ]) ++ else ++ GLU_REQUIRES="gl" ++ PKG_CHECK_MODULES(GL, [gl], [], [ ++ AC_CHECK_HEADER([GL/gl.h], ++ [], ++ AC_MSG_ERROR([GL not found])) ++ AC_CHECK_LIB([GL], ++ [glBegin], ++ [GL_LIBS=-lGL], ++ AC_MSG_ERROR([GL required])) ++ ]) ++ fi + fi + AC_SUBST([GLU_REQUIRES]) +