summaryrefslogtreecommitdiff
path: root/Ports/joe
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-05-16 19:21:41 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-05-19 20:17:10 +0430
commit8a610b1bb9f906510f01f6fd2dcbe9fcc41f3990 (patch)
tree06112993ecb8726eccc528f04d02bf13527dacb3 /Ports/joe
parentab83c669ea7a4b59d4044a8a29ff7f09340035c1 (diff)
downloadserenity-8a610b1bb9f906510f01f6fd2dcbe9fcc41f3990.zip
Ports: Update joe's patches to use git patches
Diffstat (limited to 'Ports/joe')
-rw-r--r--Ports/joe/patches/0001-Define-__USE_MISC-in-checkwidths.c.patch27
-rw-r--r--Ports/joe/patches/0002-Remove-the-sys-prefix-for-the-fcntl-include.patch26
-rw-r--r--Ports/joe/patches/0003-Teach-config.sub-about-serenity.patch25
-rw-r--r--Ports/joe/patches/0004-Undefine-TERMINFO-in-termcap.c.patch26
-rw-r--r--Ports/joe/patches/ReadMe.md32
-rw-r--r--Ports/joe/patches/joe.patch46
6 files changed, 126 insertions, 56 deletions
diff --git a/Ports/joe/patches/0001-Define-__USE_MISC-in-checkwidths.c.patch b/Ports/joe/patches/0001-Define-__USE_MISC-in-checkwidths.c.patch
new file mode 100644
index 0000000000..13448e252b
--- /dev/null
+++ b/Ports/joe/patches/0001-Define-__USE_MISC-in-checkwidths.c.patch
@@ -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
+
diff --git a/Ports/joe/patches/0002-Remove-the-sys-prefix-for-the-fcntl-include.patch b/Ports/joe/patches/0002-Remove-the-sys-prefix-for-the-fcntl-include.patch
new file mode 100644
index 0000000000..b957751856
--- /dev/null
+++ b/Ports/joe/patches/0002-Remove-the-sys-prefix-for-the-fcntl-include.patch
@@ -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
+
diff --git a/Ports/joe/patches/0003-Teach-config.sub-about-serenity.patch b/Ports/joe/patches/0003-Teach-config.sub-about-serenity.patch
new file mode 100644
index 0000000000..56c57d5a78
--- /dev/null
+++ b/Ports/joe/patches/0003-Teach-config.sub-about-serenity.patch
@@ -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
+
diff --git a/Ports/joe/patches/0004-Undefine-TERMINFO-in-termcap.c.patch b/Ports/joe/patches/0004-Undefine-TERMINFO-in-termcap.c.patch
new file mode 100644
index 0000000000..137b6532cc
--- /dev/null
+++ b/Ports/joe/patches/0004-Undefine-TERMINFO-in-termcap.c.patch
@@ -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
+
diff --git a/Ports/joe/patches/ReadMe.md b/Ports/joe/patches/ReadMe.md
index 1d2ec3688d..5332bf9235 100644
--- a/Ports/joe/patches/ReadMe.md
+++ b/Ports/joe/patches/ReadMe.md
@@ -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.
diff --git a/Ports/joe/patches/joe.patch b/Ports/joe/patches/joe.patch
deleted file mode 100644
index ef8c3d0b20..0000000000
--- a/Ports/joe/patches/joe.patch
+++ /dev/null
@@ -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))
-