mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
Ports: Remove LibGL workarounds
Now that ports can find our OpenGL headers and shared library, remove all configuration and patches that was previously needed to make ports compile with LibGL.
This commit is contained in:
parent
857ab2e06d
commit
b2eaed43e9
24 changed files with 48 additions and 157 deletions
|
@ -25,7 +25,7 @@ launcher_category='&Games'
|
|||
launcher_command=/usr/local/bin/retroarch
|
||||
icon_file=media/retroarch.ico
|
||||
|
||||
export CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/include/LibGL -I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2"
|
||||
export CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2"
|
||||
|
||||
post_install() {
|
||||
echo "==== Post installation instructions ===="
|
||||
|
|
|
@ -8,7 +8,7 @@ Subject: [PATCH] Add SerenityOS platform
|
|||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/qb/qb.system.sh b/qb/qb.system.sh
|
||||
index c7ac141..f7f198d 100644
|
||||
index c7ac14110bafc0c1715a5b02fc933dc7c45dc449..f7f198dc9c290d5c46079cedd13c5cbb42bb678b 100644
|
||||
--- a/qb/qb.system.sh
|
||||
+++ b/qb/qb.system.sh
|
||||
@@ -1,5 +1,5 @@
|
||||
|
|
|
@ -8,7 +8,7 @@ Subject: [PATCH] Add strlcat()
|
|||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/Makefile.common b/Makefile.common
|
||||
index 580beba..dbfbd39 100644
|
||||
index 40c3ad2d5a077dc8f84932506d4253c7d98e326f..f2d6bcf526a1c7d3aba90bdd4ef6cd1ebc3ca91c 100644
|
||||
--- a/Makefile.common
|
||||
+++ b/Makefile.common
|
||||
@@ -186,6 +186,10 @@ ifneq ($(findstring Linux,$(OS)),)
|
|
@ -1,22 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: gouchi <gouchi@free.fr>
|
||||
Date: Sat, 7 May 2022 18:20:09 +0200
|
||||
Subject: [PATCH] Find libgl
|
||||
|
||||
---
|
||||
qb/config.libs.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/qb/config.libs.sh b/qb/config.libs.sh
|
||||
index 19cd2a6..672fb02 100644
|
||||
--- a/qb/config.libs.sh
|
||||
+++ b/qb/config.libs.sh
|
||||
@@ -402,7 +402,7 @@ if [ "$HAVE_OPENGL" != 'no' ] && [ "$HAVE_OPENGLES" != 'yes' ]; then
|
||||
check_lib '' OPENGL -lopengl32
|
||||
else
|
||||
check_header '' OPENGL "GL/gl.h"
|
||||
- check_lib '' OPENGL -lGL
|
||||
+ check_lib '' OPENGL -lgl
|
||||
fi
|
||||
|
||||
if [ "$HAVE_OPENGL" = 'yes' ]; then
|
|
@ -8,7 +8,7 @@ Subject: [PATCH] Disable pthread_attr_setschedpolicy()
|
|||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libretro-common/rthreads/rthreads.c b/libretro-common/rthreads/rthreads.c
|
||||
index 30ec6ff..08c8a96 100644
|
||||
index b611a3e443148f1471d3de7aa6f11b4a62e9ba4a..76800cbdaedf31fcc409456b69ae366a58026163 100644
|
||||
--- a/libretro-common/rthreads/rthreads.c
|
||||
+++ b/libretro-common/rthreads/rthreads.c
|
||||
@@ -161,7 +161,7 @@ sthread_t *sthread_create(void (*thread_func)(void*), void *userdata)
|
|
@ -8,7 +8,7 @@ Subject: [PATCH] Use SDL software instead of hardware rendering
|
|||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c
|
||||
index 4dbe33f..dd67b4a 100644
|
||||
index 4dbe33f446815aa212daf0dbb58c3d2e183e88ec..dd67b4aaec550cf375ea3da088363e266dc5aa31 100644
|
||||
--- a/gfx/drivers/sdl2_gfx.c
|
||||
+++ b/gfx/drivers/sdl2_gfx.c
|
||||
@@ -182,7 +182,7 @@ static void sdl2_render_msg(sdl2_video_t *vid, const char *msg)
|
|
@ -16,7 +16,7 @@ Set some config paths to home directory
|
|||
create mode 100644 pkg/serenityos/retroarch.cfg
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 63c7eda..2aed29f 100644
|
||||
index 63c7eda4aa9ac2acf7ec7dfe9c04fcd5d8919a74..2aed29f89cf3709186fcd7c13400e34f1c90c299 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -235,7 +235,7 @@ install: $(TARGET)
|
||||
|
@ -30,7 +30,7 @@ index 63c7eda..2aed29f 100644
|
|||
cp docs/retroarch.6 $(DESTDIR)$(MAN_DIR)/man6
|
||||
diff --git a/pkg/serenityos/retroarch.cfg b/pkg/serenityos/retroarch.cfg
|
||||
new file mode 100644
|
||||
index 0000000..088e883
|
||||
index 0000000000000000000000000000000000000000..3fc7d7ac0fbb3330e5a359593ae3acfc88112540
|
||||
--- /dev/null
|
||||
+++ b/pkg/serenityos/retroarch.cfg
|
||||
@@ -0,0 +1,1021 @@
|
|
@ -5,27 +5,22 @@
|
|||
Add SerenityOS platform
|
||||
|
||||
|
||||
## `0002-Find-libgl.patch`
|
||||
|
||||
Find libgl
|
||||
|
||||
|
||||
## `0003-Add-strlcat.patch`
|
||||
## `0002-Add-strlcat.patch`
|
||||
|
||||
Add strlcat()
|
||||
|
||||
|
||||
## `0004-Disable-pthread_attr_setschedpolicy.patch`
|
||||
## `0003-Disable-pthread_attr_setschedpolicy.patch`
|
||||
|
||||
Disable pthread_attr_setschedpolicy()
|
||||
|
||||
|
||||
## `0005-Use-SDL-software-instead-of-hardware-rendering.patch`
|
||||
## `0004-Use-SDL-software-instead-of-hardware-rendering.patch`
|
||||
|
||||
Use SDL software instead of hardware rendering
|
||||
|
||||
|
||||
## `0006-Set-default-options-for-SerenityOS.patch`
|
||||
## `0005-Set-default-options-for-SerenityOS.patch`
|
||||
|
||||
Set default options for SerenityOS
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@ configopts=(
|
|||
'-DUSE_DNS_C=ON'
|
||||
'-Bbuild'
|
||||
'-GNinja'
|
||||
"-DCMAKE_C_FLAGS=-I${SERENITY_INSTALL_ROOT}/usr/include/LibGL -I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2 -I${SERENITY_INSTALL_ROOT}/usr/local/include -lcurl -lharfbuzz -lfreetype"
|
||||
"-DCMAKE_CXX_FLAGS=-I${SERENITY_INSTALL_ROOT}/usr/include/LibGL -I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2 -I${SERENITY_INSTALL_ROOT}/usr/local/include -lcurl -lharfbuzz -lfreetype"
|
||||
"-DCMAKE_C_FLAGS=-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2 -I${SERENITY_INSTALL_ROOT}/usr/local/include -lcurl -lharfbuzz -lfreetype"
|
||||
"-DCMAKE_CXX_FLAGS=-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2 -I${SERENITY_INSTALL_ROOT}/usr/local/include -lcurl -lharfbuzz -lfreetype"
|
||||
'-DUSE_IPV6=OFF'
|
||||
'-DUSE_SYSTEM_ENET=OFF'
|
||||
)
|
||||
|
|
|
@ -10,7 +10,6 @@ depends=("libpng" "glu" "SDL_sound" "sdl12-compat" "zlib")
|
|||
configopts=(
|
||||
"--disable-warn"
|
||||
"--with-sdl-prefix=${SERENITY_INSTALL_ROOT}/usr/local"
|
||||
"CPPFLAGS=-I${SERENITY_INSTALL_ROOT}/usr/include/LibGL"
|
||||
"LIBS=-lm -lSDL_sound"
|
||||
)
|
||||
launcher_name='GLTron'
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jelle Raaijmakers <jelle@gmta.nl>
|
||||
Date: Mon, 9 May 2022 00:30:04 +0200
|
||||
Subject: [PATCH] Build: Replace `-lGL` with `-lgl` to reference our LibGL
|
||||
|
||||
---
|
||||
configure | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 226d00eb04f048a51cfbc742ccfe62cfb7ad6750..086139a0e045fe6ad914fc641625fc281ca630e7 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -3130,7 +3130,7 @@ if test "${ac_cv_lib_GL_main+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
-LIBS="-lGL $LIBS"
|
||||
+LIBS="-lgl $LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
#line 3135 "configure"
|
||||
#include "confdefs.h"
|
||||
@@ -3171,7 +3171,7 @@ if test $ac_cv_lib_GL_main = yes; then
|
||||
#define HAVE_LIBGL 1
|
||||
EOF
|
||||
|
||||
- LIBS="-lGL $LIBS"
|
||||
+ LIBS="-lgl $LIBS"
|
||||
|
||||
else
|
||||
{ { echo "$as_me:3177: error: OpenGL is not installed" >&5
|
|
@ -1,23 +1,18 @@
|
|||
# Patches for gltron on SerenityOS
|
||||
|
||||
## `0001-Build-Replace-lGL-with-lgl-to-reference-our-LibGL.patch`
|
||||
|
||||
Build: Replace `-lGL` with `-lgl` to reference our LibGL
|
||||
|
||||
|
||||
## `0002-Build-Remove-ansi-build-argument.patch`
|
||||
## `0001-Build-Remove-ansi-build-argument.patch`
|
||||
|
||||
Build: Remove `-ansi` build argument
|
||||
|
||||
|
||||
## `0003-Build-Fix-char-vs.-const-char-arguments.patch`
|
||||
## `0002-Build-Fix-char-vs.-const-char-arguments.patch`
|
||||
|
||||
Build: Fix `char*` vs. `const char*` arguments
|
||||
|
||||
These arguments are of the wrong constness, which will trip our
|
||||
compiler.
|
||||
|
||||
## `0004-System-Make-sure-to-exit-the-loop-on-receiving-SDL_Q.patch`
|
||||
## `0003-System-Make-sure-to-exit-the-loop-on-receiving-SDL_Q.patch`
|
||||
|
||||
System: Make sure to exit the loop on receiving SDL_QUIT
|
||||
|
||||
|
|
|
@ -9,10 +9,9 @@ configopts=(
|
|||
"--cross-file=${SERENITY_BUILD_DIR}/meson-cross-file.txt"
|
||||
"--prefix=${SERENITY_INSTALL_ROOT}/usr/local"
|
||||
'-Dbuildtype=release'
|
||||
'-Dgl_provider=gl'
|
||||
)
|
||||
|
||||
export CPPFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/include/LibGL"
|
||||
|
||||
configure() {
|
||||
run meson setup "${configopts[@]}" build
|
||||
}
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jelle Raaijmakers <jelle@gmta.nl>
|
||||
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
|
||||
-)
|
27
Ports/glu/patches/0001-Build-Remove-pkgconfig.patch
Normal file
27
Ports/glu/patches/0001-Build-Remove-pkgconfig.patch
Normal file
|
@ -0,0 +1,27 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jelle Raaijmakers <jelle@gmta.nl>
|
||||
Date: Sun, 11 Feb 2024 22:25:59 +0100
|
||||
Subject: [PATCH] Build: Remove pkgconfig
|
||||
|
||||
We can't use pkgconfig here since the OpenGL dependency we find is
|
||||
incompatible with it as an argument.
|
||||
---
|
||||
meson.build | 8 --------
|
||||
1 file changed, 8 deletions(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 7949e300ac60e0ff6955dedfd9a050cfa3010f4a..eed52aea0419aa4efa7ae6d4e71cac4bc28a7b79 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -28,11 +28,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
|
||||
-)
|
|
@ -1,11 +1,11 @@
|
|||
# Patches for glu on SerenityOS
|
||||
|
||||
## `0001-Build-Manually-find-LibGL.patch`
|
||||
## `0001-Build-Remove-pkgconfig.patch`
|
||||
|
||||
Build: Manually find LibGL
|
||||
Build: Remove pkgconfig
|
||||
|
||||
We don't have a working pkgconfig to find it, so get rid of it and
|
||||
manually find the library using the C compiler.
|
||||
We can't use pkgconfig here since the OpenGL dependency we find is
|
||||
incompatible with it as an argument.
|
||||
|
||||
## `0002-Build-Do-not-hide-symbols-by-default.patch`
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ workdir="quake2sdl-${commit_hash}"
|
|||
makeopts=()
|
||||
configopts=(
|
||||
"-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
|
||||
"-DOPENGL_INCLUDE_DIR=${SERENITY_INSTALL_ROOT}/usr/include/LibGL"
|
||||
)
|
||||
depends=('SDL2')
|
||||
launcher_name='Quake II'
|
||||
|
|
|
@ -27,7 +27,6 @@ icon_file='icons/scummvm.ico'
|
|||
|
||||
export CPPFLAGS='-fvisibility=hidden'
|
||||
export FREETYPE2_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/freetype2"
|
||||
export OPENGL_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/include/LibGL"
|
||||
export SDL_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2"
|
||||
|
||||
function post_install() {
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jelle Raaijmakers <jelle@gmta.nl>
|
||||
Date: Sun, 9 Jan 2022 23:01:32 +0100
|
||||
Subject: [PATCH] Teach configure about serenity
|
||||
|
||||
---
|
||||
configure | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 5c28f7e35038236debbdeb3c396ce65f1189b13d..5bbf819fe31d24ac215d59f730bd64eac69c0bfd 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5843,6 +5843,9 @@ EOF
|
||||
mingw*)
|
||||
OPENGL_LIBS="-lopengl32"
|
||||
;;
|
||||
+ serenity*)
|
||||
+ OPENGL_LIBS="-lgl"
|
||||
+ ;;
|
||||
*)
|
||||
OPENGL_LIBS="-lGL"
|
||||
;;
|
|
@ -1,7 +0,0 @@
|
|||
# Patches for scummvm on SerenityOS
|
||||
|
||||
## `0001-Teach-configure-about-serenity.patch`
|
||||
|
||||
Teach configure about serenity
|
||||
|
||||
|
|
@ -8,8 +8,6 @@ files=(
|
|||
)
|
||||
depends=("glu" "SDL_mixer" "sdl12-compat" "tcl")
|
||||
configopts=(
|
||||
"--with-gl-inc=${SERENITY_INSTALL_ROOT}/usr/include/LibGL"
|
||||
"--with-gl-lib-name=gl"
|
||||
"--with-sdl-prefix=${SERENITY_INSTALL_ROOT}/usr/local"
|
||||
"--with-tcl-lib-name=tcl8.6"
|
||||
"--without-x"
|
||||
|
|
Loading…
Reference in a new issue