Ports: Update joe's patches to use git patches

This commit is contained in:
Ali Mohammad Pur 2022-05-16 19:21:41 +04:30 committed by Ali Mohammad Pur
parent ab83c669ea
commit 8a610b1bb9
Notes: sideshowbarker 2024-07-17 10:50:07 +09:00
6 changed files with 126 additions and 56 deletions

View file

@ -0,0 +1,27 @@
From becc61b31858199a1cff4278bb2239d05ff9d38f Mon Sep 17 00:00:00 2001
From: Snow <i@xkun.me>
Date: Sun, 15 May 2022 11:41:03 +0800
Subject: [PATCH 1/4] Define __USE_MISC in checkwidths.c
Define `__USE_MISC` manually in `checkwidths.c` for `ECHOCTL` and `ECHOKE`,
see `Kernel/API/POSIX/termios.h`.
---
joe/util/checkwidths.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/joe/util/checkwidths.c b/joe/util/checkwidths.c
index 509447d..944faef 100644
--- a/joe/util/checkwidths.c
+++ b/joe/util/checkwidths.c
@@ -5,6 +5,8 @@
*/
+#define __USE_MISC // for ECHOCTL and ECHOKE
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
--
2.36.1

View file

@ -0,0 +1,26 @@
From 7136012c016c40b890ae4db5b3e4da4bf9b57caf Mon Sep 17 00:00:00 2001
From: Snow <i@xkun.me>
Date: Sun, 15 May 2022 11:41:03 +0800
Subject: [PATCH 2/4] Remove the sys/ prefix for the fcntl include
Serenity does not have the header `fcntl.h` in `/usr/include/sys`.
---
joe/util/checkwidths.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/joe/util/checkwidths.c b/joe/util/checkwidths.c
index 944faef..e8e3441 100644
--- a/joe/util/checkwidths.c
+++ b/joe/util/checkwidths.c
@@ -14,7 +14,7 @@
#include <arpa/inet.h>
#include <stddef.h>
#include <poll.h>
-#include <sys/fcntl.h>
+#include <fcntl.h> // the prefix "sys/" is not needed on serenity
#include <termios.h>
#define TO_CHAR_OK(c) ((char)(c))
--
2.36.1

View file

@ -0,0 +1,25 @@
From 0a0fd1875d7a58753e1c3da90e767e04ed06ef7f Mon Sep 17 00:00:00 2001
From: Snow <i@xkun.me>
Date: Sun, 15 May 2022 11:41:03 +0800
Subject: [PATCH 3/4] Teach config.sub about serenity
---
config.sub | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.sub b/config.sub
index 9633db7..fe9a63e 100755
--- a/config.sub
+++ b/config.sub
@@ -1374,7 +1374,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -serenity*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
--
2.36.1

View file

@ -0,0 +1,26 @@
From 07d7111359facb2e8ce95ca28743f3b38d991b25 Mon Sep 17 00:00:00 2001
From: Snow <i@xkun.me>
Date: Sun, 15 May 2022 11:41:03 +0800
Subject: [PATCH 4/4] Undefine TERMINFO in termcap.c
Leaving it defined will lead to a crash.
---
joe/termcap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/joe/termcap.c b/joe/termcap.c
index 7f4a459..b6fb6f8 100644
--- a/joe/termcap.c
+++ b/joe/termcap.c
@@ -7,6 +7,8 @@
*/
#include "types.h"
+#undef TERMINFO // undefine this manually, or it will lead crash
+
#ifdef TERMINFO
#ifdef __CYGWIN__
--
2.36.1

View file

@ -1,14 +1,26 @@
# Patches for joe's own editor
# Patches for joe on SerenityOS
## `joe.patch`
## `0001-Define-__USE_MISC-in-checkwidths.c.patch`
Build a curseless joe's own editor, its only dependency is LibC.
Define __USE_MISC in checkwidths.c
- Add serenity to `config.sub`.
- Some hacks in joe source code to make it work.
- Undefine the macro `TERMINFO` in `termcap.c`, or it will lead crash.
- Define `__USE_MISC` manually in `checkwidths.c` for `ECHOCTL` and `ECHOKE`,
see `Kernel/API/POSIX/termios.h`.
- Remove the prefix `sys/`, because serenity does not have the header `fcntl.h`
in `/usr/include/sys`.
Define `__USE_MISC` manually in `checkwidths.c` for `ECHOCTL` and `ECHOKE`,
see `Kernel/API/POSIX/termios.h`.
## `0002-Remove-the-sys-prefix-for-the-fcntl-include.patch`
Remove the sys/ prefix for the fcntl include
Serenity does not have the header `fcntl.h` in `/usr/include/sys`.
## `0003-Teach-config.sub-about-serenity.patch`
Teach config.sub about serenity
## `0004-Undefine-TERMINFO-in-termcap.c.patch`
Undefine TERMINFO in termcap.c
Leaving it defined will lead to a crash.

View file

@ -1,46 +0,0 @@
diff -u -r joe-4.6/config.sub joe-4.6-patched/config.sub
--- joe-4.6/config.sub 2018-01-11 00:29:29.000000000 +0800
+++ joe-4.6-patched/config.sub 2022-05-15 11:01:52.017408784 +0800
@@ -1374,7 +1374,7 @@
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -serenity*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
diff -u -r joe-4.6/joe/termcap.c joe-4.6-patched/joe/termcap.c
--- joe-4.6/joe/termcap.c 2018-01-11 00:28:34.000000000 +0800
+++ joe-4.6-patched/joe/termcap.c 2022-05-15 11:02:58.185406191 +0800
@@ -7,6 +7,8 @@
*/
#include "types.h"
+#undef TERMINFO // undefine this manually, or it will lead crash
+
#ifdef TERMINFO
#ifdef __CYGWIN__
diff -u -r joe-4.6/joe/util/checkwidths.c joe-4.6-patched/joe/util/checkwidths.c
--- joe-4.6/joe/util/checkwidths.c 2018-01-11 00:28:34.000000000 +0800
+++ joe-4.6-patched/joe/util/checkwidths.c 2022-05-15 11:04:04.225403604 +0800
@@ -5,6 +5,8 @@
*/
+#define __USE_MISC // for ECHOCTL and ECHOKE
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -12,7 +14,7 @@
#include <arpa/inet.h>
#include <stddef.h>
#include <poll.h>
-#include <sys/fcntl.h>
+#include <fcntl.h> // the prefix "sys/" is not needed on serenity
#include <termios.h>
#define TO_CHAR_OK(c) ((char)(c))