diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 624ecc2f02..7cd474cf18 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -100,7 +100,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`glib`](glib/) | GLib | 2.79.1 | https://wiki.gnome.org/Projects/GLib | | [`glm`](glm/) | OpenGL Mathematics (GLM) | 0.9.9.8 | https://github.com/g-truc/glm | | [`gltron`](gltron/) | GLTron | 0.70 | http://gltron.org | -| [`glu`](glu/) | Mesa GLU | 9.0.2 | https://gitlab.freedesktop.org/mesa/glu | +| [`glu`](glu/) | Mesa GLU | 9.0.3 | https://gitlab.freedesktop.org/mesa/glu | | [`gmp`](gmp/) | GNU Multiple Precision Arithmetic Library (GMP) | 6.3.0 | https://gmplib.org/ | | [`gn`](gn/) | GN Meta Build System | 2023.07.12 | https://gn.googlesource.com/gn/ | | [`gnuapl`](gnuapl/) | GNU APL | 1.8 | https://www.gnu.org/software/apl/ | diff --git a/Ports/glu/package.sh b/Ports/glu/package.sh index 02eddd1342..06290db7c6 100755 --- a/Ports/glu/package.sh +++ b/Ports/glu/package.sh @@ -1,12 +1,26 @@ #!/usr/bin/env -S bash ../.port_include.sh -port=glu -useconfigure="true" -version="9.0.2" +port='glu' +version='9.0.3' files=( - "https://archive.mesa3d.org/glu/glu-${version}.tar.gz#24effdfb952453cc00e275e1c82ca9787506aba0282145fff054498e60e19a65" + "https://archive.mesa3d.org/glu/glu-${version}.tar.xz#bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f" +) +useconfigure='true' +configopts=( + "--cross-file=${SERENITY_BUILD_DIR}/meson-cross-file.txt" + "--prefix=${SERENITY_INSTALL_ROOT}/usr/local" + '-Dbuildtype=release' ) -depends=("pkgconf") -use_fresh_config_sub=true -export GL_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/include/LibGL" -export GL_LIBS="-lgl" +export CPPFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/include/LibGL" + +configure() { + run meson setup "${configopts[@]}" build +} + +build() { + run ninja -C build +} + +install() { + run ninja -C build install +} diff --git a/Ports/glu/patches/0001-Build-Manually-find-LibGL.patch b/Ports/glu/patches/0001-Build-Manually-find-LibGL.patch new file mode 100644 index 0000000000..76e88b4902 --- /dev/null +++ b/Ports/glu/patches/0001-Build-Manually-find-LibGL.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers +Date: Sun, 11 Feb 2024 22:25:59 +0100 +Subject: [PATCH] Build: Manually find LibGL + +We don't have a working pkgconfig to find it, so get rid of it and +manually find the library using the C compiler. +--- + meson.build | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/meson.build b/meson.build +index 7949e300ac60e0ff6955dedfd9a050cfa3010f4a..18dd4f497e7a43be3e36915bb5430e8891a3a9fb 100644 +--- a/meson.build ++++ b/meson.build +@@ -18,7 +18,8 @@ gl_provider = get_option('gl_provider') + if gl_provider == 'glvnd' + gl_provider = 'opengl' + endif +-dep_gl = dependency(gl_provider) ++cc = meson.get_compiler('c') ++dep_gl = cc.find_library('gl', has_headers : 'GL/gl.h') + + inc_include = include_directories('include') + +@@ -28,11 +29,3 @@ install_headers( + 'include/GL/glu.h', + subdir : 'GL', + ) +- +-pkgconf = import('pkgconfig') +-pkgconf.generate( +- libglu, +- name : 'glu', +- description : 'Mesa OpenGL Utility Library', +- requires: dep_gl +-) diff --git a/Ports/glu/patches/0002-Build-Do-not-hide-symbols-by-default.patch b/Ports/glu/patches/0002-Build-Do-not-hide-symbols-by-default.patch new file mode 100644 index 0000000000..e87e44900d --- /dev/null +++ b/Ports/glu/patches/0002-Build-Do-not-hide-symbols-by-default.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers +Date: Sun, 11 Feb 2024 23:47:48 +0100 +Subject: [PATCH] Build: Do not hide symbols by default + +For some reason, the functions glu exports end up as LOCAL entries in +the shared library. Remove this default visibility to set them to +GLOBAL. +--- + src/meson.build | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/meson.build b/src/meson.build +index 57d3b4a6163828445872f73ca4a92f2d202ac768..9ee969636950760354fb8990cc0bb7ea789098b5 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -103,7 +103,6 @@ libglu = library( + 'libnurbs/nurbtess', + inc_include, + ], +- gnu_symbol_visibility : 'hidden', + dependencies : [dep_gl], + version : '1.3.1', + darwin_versions : [ '5.0.0', '5.1.0' ], diff --git a/Ports/glu/patches/ReadMe.md b/Ports/glu/patches/ReadMe.md new file mode 100644 index 0000000000..2ffe8753d5 --- /dev/null +++ b/Ports/glu/patches/ReadMe.md @@ -0,0 +1,17 @@ +# Patches for glu on SerenityOS + +## `0001-Build-Manually-find-LibGL.patch` + +Build: Manually find LibGL + +We don't have a working pkgconfig to find it, so get rid of it and +manually find the library using the C compiler. + +## `0002-Build-Do-not-hide-symbols-by-default.patch` + +Build: Do not hide symbols by default + +For some reason, the functions glu exports end up as LOCAL entries in +the shared library. Remove this default visibility to set them to +GLOBAL. +