1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

Ports: Update ed's patches to use git patches

This commit is contained in:
Ali Mohammad Pur 2022-05-17 21:09:44 +04:30 committed by Ali Mohammad Pur
parent 25dc066af6
commit f5a4d529c2
9 changed files with 133 additions and 51 deletions

View file

@ -0,0 +1,32 @@
From d29259d2ea80767820f69b9b58f9377166440938 Mon Sep 17 00:00:00 2001
From: EWouters <6179932+EWouters@users.noreply.github.com>
Date: Fri, 1 Apr 2022 02:54:00 +0200
Subject: [PATCH 1/4] Make CC and friends overridable from the env
Co-Authored-By: roytam1 <roytam@gmail.com>
---
configure | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 3531bcd..a225c14 100755
--- a/configure
+++ b/configure
@@ -21,10 +21,10 @@ datarootdir='$(prefix)/share'
infodir='$(datarootdir)/info'
mandir='$(datarootdir)/man'
program_prefix=
-CC=gcc
-CPPFLAGS=
-CFLAGS='-Wall -W -O2'
-LDFLAGS=
+CC?=gcc
+CPPFLAGS?=
+CFLAGS?='-Wall -W -O2'
+LDFLAGS?=
# checking whether we are using GNU C.
/bin/sh -c "${CC} --version" > /dev/null 2>&1 || { CC=cc ; CFLAGS=-O2 ; }
--
2.36.1

View file

@ -0,0 +1,26 @@
From a61996a48d800229a267d9fef1548b08450997ab Mon Sep 17 00:00:00 2001
From: Brian Callahan <ibara@users.noreply.github.com>
Date: Sat, 1 Feb 2020 14:54:04 -0500
Subject: [PATCH 2/4] Use stdbool instead of rolling a manual Bool
---
ed.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ed.h b/ed.h
index db0b4a6..ef0c134 100644
--- a/ed.h
+++ b/ed.h
@@ -18,8 +18,7 @@
*/
#ifndef __cplusplus
-enum Bool { false = 0, true = 1 };
-typedef enum Bool bool;
+#include <stdbool.h>
#endif
enum Pflags /* print suffixes */
--
2.36.1

View file

@ -0,0 +1,26 @@
From 492088ee0565b8d947d129125ab3518a4da6a7c9 Mon Sep 17 00:00:00 2001
From: Brian Callahan <ibara@users.noreply.github.com>
Date: Fri, 1 Apr 2022 02:54:00 +0200
Subject: [PATCH 3/4] Manually link with pcre2
Co-Authored-By: EWouters <6179932+EWouters@users.noreply.github.com>
---
Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index f716df4..c1a7880 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -20,7 +20,7 @@ objs = buffer.o carg_parser.o global.o io.o main.o main_loop.o regex.o signal.o
all : $(progname) r$(progname)
$(progname) : $(objs)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs) -lpcre2-posix -lpcre2-8
r$(progname) : r$(progname).in
cat $(VPATH)/r$(progname).in > $@
--
2.36.1

View file

@ -0,0 +1,25 @@
From 5d79ba1193bb0f9813c9650ee36ec416af525a1e Mon Sep 17 00:00:00 2001
From: Brian Callahan <ibara@users.noreply.github.com>
Date: Sat, 1 Feb 2020 14:54:04 -0500
Subject: [PATCH 4/4] Use pcre2 for regex instead of libc's regex.h
---
regex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/regex.c b/regex.c
index 9b38120..325b2f6 100644
--- a/regex.c
+++ b/regex.c
@@ -19,7 +19,7 @@
#include <stddef.h>
#include <errno.h>
-#include <regex.h>
+#include <pcre2posix.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
--
2.36.1

View file

@ -0,0 +1,24 @@
# Patches for ed on SerenityOS
## `0001-Make-CC-and-friends-overridable-from-the-env.patch`
Make CC and friends overridable from the env
## `0002-Use-stdbool-instead-of-rolling-a-manual-Bool.patch`
Use stdbool instead of rolling a manual Bool
## `0003-Manually-link-with-pcre2.patch`
Manually link with pcre2
## `0004-Use-pcre2-for-regex-instead-of-libc-s-regex.h.patch`
Use pcre2 for regex instead of libc's regex.h

View file

@ -1,11 +0,0 @@
--- ed-1.18/Makefile.in.og 2022-03-31 22:53:17.000000000 +0200
+++ ed-1.18/Makefile.in 2022-03-31 22:54:31.000000000 +0200
@@ -20,7 +20,7 @@
all : $(progname) r$(progname)
$(progname) : $(objs)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(objs) -lpcre2-posix -lpcre2-8
r$(progname) : r$(progname).in
cat $(VPATH)/r$(progname).in > $@

View file

@ -1,17 +0,0 @@
--- ed-1.18/configure.og 2022-03-31 22:58:11.000000000 +0200
+++ ed-1.18/configure 2022-03-31 23:01:31.000000000 +0200
@@ -21,10 +21,10 @@
infodir='$(datarootdir)/info'
mandir='$(datarootdir)/man'
program_prefix=
-CC=gcc
-CPPFLAGS=
-CFLAGS='-Wall -W -O2'
-LDFLAGS=
+CC?=gcc
+CPPFLAGS?=
+CFLAGS?='-Wall -W -O2'
+LDFLAGS?=
# checking whether we are using GNU C.
/bin/sh -c "${CC} --version" > /dev/null 2>&1 || { CC=cc ; CFLAGS=-O2 ; }

View file

@ -1,12 +0,0 @@
--- ed-1.15/ed.h.orig Sat Feb 1 14:19:01 2020
+++ ed-1.15/ed.h Sat Feb 1 14:19:17 2020
@@ -18,8 +18,7 @@
*/
#ifndef __cplusplus
-enum Bool { false = 0, true = 1 };
-typedef enum Bool bool;
+#include <stdbool.h>
#endif
enum Pflags /* print suffixes */

View file

@ -1,11 +0,0 @@
--- ed-1.15/regex.c.orig Sat Feb 1 14:17:22 2020
+++ ed-1.15/regex.c Sat Feb 1 14:17:34 2020
@@ -19,7 +19,7 @@
#include <stddef.h>
#include <errno.h>
-#include <regex.h>
+#include <pcre2posix.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>