Ports: Return nesalizer to upstream

This makes https://github.com/SerenityPorts/nesalizer obsolete.

The patch that hardcoded the SDL2 location is removed. The the patches
to the `Makefile` are quashed. A new install function is added.
This commit is contained in:
EWouters 2022-05-07 03:19:44 +02:00 committed by Linus Groh
parent 317ca37dc6
commit 81a2f09a80
5 changed files with 108 additions and 5 deletions

View file

@ -149,7 +149,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`ncdu`](ncdu/) | Ncdu | 1.16 | https://dev.yorhel.nl/ncdu |
| [`ncurses`](ncurses/) | ncurses | 6.3 | https://invisible-island.net/ncurses/announce.html |
| [`neofetch`](neofetch/) | neofetch | 7.1.0 | https://github.com/dylanaraps/neofetch |
| [`nesalizer`](nesalizer/) | Nesalizer | | https://github.com/SerenityOS/nesalizer |
| [`nesalizer`](nesalizer/) | Nesalizer | 5bb0458 | https://github.com/ulfalizer/nesalizer |
| [`nethack`](nethack/) | nethack | 3.6.6 | https://www.nethack.org/ |
| [`ninja`](ninja/) | Ninja | 1.10.2 | https://ninja-build.org/ |
| [`nippon`](nippon/) | Nippon Safes Inc. | 1.0 | https://www.scummvm.org/games/#games-nippon |

View file

@ -1,7 +1,12 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=nesalizer
version=git
workdir=${port}-master
makeopts=("CONF=release" "EXTRA=-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2")
files="https://github.com/SerenityPorts/nesalizer/archive/master.zip nesalizer-master.zip"
version=5bb045845a5cc829a78b7384f848fdd886cd98c8
files="https://github.com/ulfalizer/nesalizer/archive/${version}.tar.gz ${port}-${version}.tar.gz 4282cb0e4af0585af4a594dfa30b2e350dd0efc39e5bc2d8312f637f50397107"
auth_type=sha256
depends=("SDL2")
makeopts+=("CONF=release")
install() {
run mkdir -p "${SERENITY_INSTALL_ROOT}/usr/local/bin/"
run cp build/nesalizer "${SERENITY_INSTALL_ROOT}/usr/local/bin/"
}

View file

@ -0,0 +1,42 @@
From 9a0103cf47963ff94d97885787993048cc5c4680 Mon Sep 17 00:00:00 2001
From: Dan MacDonald <allcoms@gmail.com>
Date: Sun, 8 Dec 2019 17:30:52 +0000
Subject: [PATCH 1/2] Add Serenity to Makefile
- Add `-lSDL2 -lgui -lipc -lgfx -lcore -lpthread -lregex`
- Disable RTTI
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 527a3d0..fa1b849 100644
--- a/Makefile
+++ b/Makefile
@@ -58,7 +58,7 @@ c_objects = $(addprefix $(BUILD_DIR)/,$(c_sources:=.o))
objects = $(c_objects) $(cpp_objects)
deps = $(addprefix $(BUILD_DIR)/,$(c_sources:=.d) $(cpp_sources:=.d))
-LDLIBS := $(shell sdl2-config --libs) -lrt
+LDLIBS := -lSDL2 -lgui -lipc -lgfx -lcore -lpthread -lregex
ifeq ($(INCLUDE_DEBUGGER),1)
LDLIBS += -lreadline
@@ -105,12 +105,12 @@ else ifneq ($(MAKECMDGOALS),clean)
endif
ifneq ($(findstring debug,$(CONF)),)
- compile_flags += -ggdb
+ compile_flags += -ggdb -fno-rtti
endif
ifneq ($(findstring release,$(CONF)),)
# Including -Ofast when linking (by including $(optimizations)) gives a
# different binary size. Might be worth investigating why.
- compile_flags += $(optimizations) -DOPTIMIZING
+ compile_flags += $(optimizations) -DOPTIMIZING -fno-rtti
link_flags += $(optimizations) -fuse-linker-plugin
endif
--
2.36.1

View file

@ -0,0 +1,42 @@
From 34b8a26412d6e0880516e881c20ec336e6a450b7 Mon Sep 17 00:00:00 2001
From: Dan MacDonald <allcoms@gmail.com>
Date: Sun, 8 Dec 2019 17:25:35 +0000
Subject: [PATCH 2/2] Disable backtracing
---
src/common.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/common.cpp b/src/common.cpp
index 33df846..4dd9e9c 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -1,6 +1,6 @@
#include "common.h"
-#include <execinfo.h>
+// #include <execinfo.h>
#include <signal.h>
//
@@ -96,7 +96,7 @@ void errno_fail(int errno_val, char const *format, ...) {
static void fatal_signal_handler(int sig) {
// Use non-async-signal-safe functions. Likely to work in practice.
- static void *backtrace_buffer[100];
+ /*static void *backtrace_buffer[100];
static char addr2line_cmd_buf[100];
fprintf(stderr, "caught fatal signal '%s'. Backtrace:\n\n", strsignal(sig));
@@ -123,7 +123,7 @@ static void fatal_signal_handler(int sig) {
fputs("failed to write address to addr2line\n", stderr);
abort();
}
-
+ */
abort();
}
--
2.36.1

View file

@ -0,0 +1,14 @@
# Patches for nesalizer on SerenityOS
## `0001-Add-Serenity-to-Makefile.patch`
Add Serenity to Makefile
- Add `-lSDL2 -lgui -lipc -lgfx -lcore -lpthread -lregex`
- Disable RTTI
## `0002-Disable-backtracing.patch`
Disable backtracing