summaryrefslogtreecommitdiff
path: root/Ports/emu2
diff options
context:
space:
mode:
Diffstat (limited to 'Ports/emu2')
-rw-r--r--Ports/emu2/patches/0001-Include-strings.h.patch24
-rw-r--r--Ports/emu2/patches/0002-Replace-a-use-of-rindex-with-strrchr.patch34
-rw-r--r--Ports/emu2/patches/0003-Install-into-usr-local.patch25
-rw-r--r--Ports/emu2/patches/0004-Don-t-use-setitimer.patch (renamed from Ports/emu2/patches/main.patch)22
-rw-r--r--Ports/emu2/patches/ReadMe.md24
-rw-r--r--Ports/emu2/patches/codepage.patch9
-rw-r--r--Ports/emu2/patches/dosnames.patch18
-rw-r--r--Ports/emu2/patches/install-prefix.patch12
8 files changed, 125 insertions, 43 deletions
diff --git a/Ports/emu2/patches/0001-Include-strings.h.patch b/Ports/emu2/patches/0001-Include-strings.h.patch
new file mode 100644
index 0000000000..7a0bf64294
--- /dev/null
+++ b/Ports/emu2/patches/0001-Include-strings.h.patch
@@ -0,0 +1,24 @@
+From 0e8dbc3e4e44760da5817053eb2a9f6f2f55245b Mon Sep 17 00:00:00 2001
+From: Brendan Coles <bcoles@gmail.com>
+Date: Wed, 14 Apr 2021 17:24:58 +0000
+Subject: [PATCH 1/4] Include <strings.h>
+
+---
+ src/codepage.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/codepage.c b/src/codepage.c
+index 3916b61..9df0bd8 100644
+--- a/src/codepage.c
++++ b/src/codepage.c
+@@ -3,6 +3,7 @@
+ #include "env.h"
+ #include <stdlib.h>
+ #include <string.h>
++#include <strings.h>
+
+ /* List of code-pages */
+ struct cp_data
+--
+2.36.1
+
diff --git a/Ports/emu2/patches/0002-Replace-a-use-of-rindex-with-strrchr.patch b/Ports/emu2/patches/0002-Replace-a-use-of-rindex-with-strrchr.patch
new file mode 100644
index 0000000000..72001c0843
--- /dev/null
+++ b/Ports/emu2/patches/0002-Replace-a-use-of-rindex-with-strrchr.patch
@@ -0,0 +1,34 @@
+From 35566f37112c812ab3695e4843ff653792b1d532 Mon Sep 17 00:00:00 2001
+From: Brendan Coles <bcoles@gmail.com>
+Date: Thu, 23 Dec 2021 10:26:29 +0100
+Subject: [PATCH 2/4] Replace a use of rindex() with strrchr()
+
+Co-Authored-By: Daniel Bertalan <dani@danielbertalan.dev>
+---
+ src/dosnames.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/dosnames.c b/src/dosnames.c
+index b6122a9..582a0e2 100644
+--- a/src/dosnames.c
++++ b/src/dosnames.c
+@@ -9,6 +9,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <strings.h>
+ #include <sys/stat.h>
+
+ // DOS directory entries.
+@@ -589,7 +590,7 @@ char *dos_unix_path_fcb(int addr, int force)
+ static struct dos_file_list *find_first_file(char *fspec)
+ {
+ // Now, separate the path to the spec
+- char *glob, *unixpath, *p = rindex(fspec, '/');
++ char *glob, *unixpath, *p = strrchr(fspec, '/');
+ if(!p)
+ {
+ glob = fspec;
+--
+2.36.1
+
diff --git a/Ports/emu2/patches/0003-Install-into-usr-local.patch b/Ports/emu2/patches/0003-Install-into-usr-local.patch
new file mode 100644
index 0000000000..1fd6018cb9
--- /dev/null
+++ b/Ports/emu2/patches/0003-Install-into-usr-local.patch
@@ -0,0 +1,25 @@
+From 83c869b96b9651ff4fc16989cffb9a27d21329b2 Mon Sep 17 00:00:00 2001
+From: Gunnar Beutner <gbeutner@serenityos.org>
+Date: Thu, 15 Apr 2021 15:43:18 +0200
+Subject: [PATCH 3/4] Install into /usr/local
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 80dd6ec..7026600 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,7 +2,7 @@ CC=gcc
+ CFLAGS=-O3 -flto -Wall -g -Werror=implicit-function-declaration -Werror=int-conversion
+ LDLIBS=-lm
+ INSTALL=install
+-PREFIX=/usr
++PREFIX=/usr/local
+
+ OBJS=\
+ cpu.o\
+--
+2.36.1
+
diff --git a/Ports/emu2/patches/main.patch b/Ports/emu2/patches/0004-Don-t-use-setitimer.patch
index 52082fccd4..97f2daae14 100644
--- a/Ports/emu2/patches/main.patch
+++ b/Ports/emu2/patches/0004-Don-t-use-setitimer.patch
@@ -1,6 +1,17 @@
-diff -ur a/src/main.c b/src/main.c
---- a/src/main.c 2022-01-07 14:27:34.882469924 +0100
-+++ b/src/main.c 2022-01-07 17:25:14.828001662 +0100
+From 9dec9f5ffc1a75ab15d4ecec19cb03fa4792b31d Mon Sep 17 00:00:00 2001
+From: Brendan Coles <bcoles@gmail.com>
+Date: Fri, 7 Jan 2022 17:26:40 +0100
+Subject: [PATCH 4/4] Don't use setitimer()
+
+Co-Authored-By: Tim Schumacher <timschumi@gmx.de>
+---
+ src/main.c | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index d0c0d2f..7e313a0 100644
+--- a/src/main.c
++++ b/src/main.c
@@ -12,6 +12,7 @@
#include <errno.h>
#include <fcntl.h>
@@ -9,7 +20,7 @@ diff -ur a/src/main.c b/src/main.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-@@ -304,12 +304,6 @@
+@@ -304,12 +305,6 @@ int main(int argc, char **argv)
signal(SIGQUIT, exit_handler);
signal(SIGPIPE, exit_handler);
signal(SIGTERM, exit_handler);
@@ -22,3 +33,6 @@ diff -ur a/src/main.c b/src/main.c
init_bios_mem();
while(1)
{
+--
+2.36.1
+
diff --git a/Ports/emu2/patches/ReadMe.md b/Ports/emu2/patches/ReadMe.md
new file mode 100644
index 0000000000..7999701b28
--- /dev/null
+++ b/Ports/emu2/patches/ReadMe.md
@@ -0,0 +1,24 @@
+# Patches for emu2 on SerenityOS
+
+## `0001-Include-strings.h.patch`
+
+Include <strings.h>
+
+
+## `0002-Replace-a-use-of-rindex-with-strrchr.patch`
+
+Replace a use of rindex() with strrchr()
+
+
+
+## `0003-Install-into-usr-local.patch`
+
+Install into /usr/local
+
+
+## `0004-Don-t-use-setitimer.patch`
+
+Don't use setitimer()
+
+
+
diff --git a/Ports/emu2/patches/codepage.patch b/Ports/emu2/patches/codepage.patch
deleted file mode 100644
index daba393bb1..0000000000
--- a/Ports/emu2/patches/codepage.patch
+++ /dev/null
@@ -1,9 +0,0 @@
-+++ emu2-master/src/codepage.c 2021-04-14 07:13:48.165698165 -0700
-@@ -3,6 +3,7 @@
- #include "env.h"
- #include <stdlib.h>
- #include <string.h>
-+#include <strings.h>
-
- /* List of code-pages */
- struct cp_data
diff --git a/Ports/emu2/patches/dosnames.patch b/Ports/emu2/patches/dosnames.patch
deleted file mode 100644
index e4b0860738..0000000000
--- a/Ports/emu2/patches/dosnames.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-+++ emu2-master/src/dosnames.c 2021-04-14 07:15:44.036839086 -0700
-@@ -9,6 +9,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <strings.h>
- #include <sys/stat.h>
-
- // DOS directory entries.
-@@ -589,7 +590,7 @@
- static struct dos_file_list *find_first_file(char *fspec)
- {
- // Now, separate the path to the spec
-- char *glob, *unixpath, *p = rindex(fspec, '/');
-+ char *glob, *unixpath, *p = strrchr(fspec, '/');
- if(!p)
- {
- glob = fspec;
diff --git a/Ports/emu2/patches/install-prefix.patch b/Ports/emu2/patches/install-prefix.patch
deleted file mode 100644
index 320892d739..0000000000
--- a/Ports/emu2/patches/install-prefix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur emu2-ff276eb0a755a3e784f73da00b5db6c1b25c1f83/Makefile emu2-ff276eb0a755a3e784f73da00b5db6c1b25c1f83.serenity/Makefile
---- emu2-ff276eb0a755a3e784f73da00b5db6c1b25c1f83/Makefile 2021-04-14 15:58:46.000000000 +0200
-+++ emu2-ff276eb0a755a3e784f73da00b5db6c1b25c1f83.serenity/Makefile 2021-04-16 00:42:15.680769941 +0200
-@@ -2,7 +2,7 @@
- CFLAGS=-O3 -flto -Wall -g -Werror=implicit-function-declaration -Werror=int-conversion
- LDLIBS=-lm
- INSTALL=install
--PREFIX=/usr
-+PREFIX=/usr/local
-
- OBJS=\
- cpu.o\