From d4413bc26b4663b05e0f4a32a601355ad5fb67c0 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 16 May 2022 19:21:37 +0430 Subject: [PATCH] Ports: Update gettext's patches to use git patches --- ...001-Teach-config.sub-about-serenity.patch} | 31 ++++++--- ...b-out-the-getprogname-implementation.patch | 67 +++++++++++++++++++ .../0003-Stub-out-some-wctype-functions.patch | 35 ++++++++++ Ports/gettext/patches/ReadMe.md | 17 +++++ Ports/gettext/patches/getprogname.patch | 48 ------------- Ports/gettext/patches/wctype.patch | 22 ------ 6 files changed, 142 insertions(+), 78 deletions(-) rename Ports/gettext/patches/{configure.patch => 0001-Teach-config.sub-about-serenity.patch} (56%) create mode 100644 Ports/gettext/patches/0002-Stub-out-the-getprogname-implementation.patch create mode 100644 Ports/gettext/patches/0003-Stub-out-some-wctype-functions.patch create mode 100644 Ports/gettext/patches/ReadMe.md delete mode 100644 Ports/gettext/patches/getprogname.patch delete mode 100644 Ports/gettext/patches/wctype.patch diff --git a/Ports/gettext/patches/configure.patch b/Ports/gettext/patches/0001-Teach-config.sub-about-serenity.patch similarity index 56% rename from Ports/gettext/patches/configure.patch rename to Ports/gettext/patches/0001-Teach-config.sub-about-serenity.patch index 479813d638c..0554d53ae9d 100644 --- a/Ports/gettext/patches/configure.patch +++ b/Ports/gettext/patches/0001-Teach-config.sub-about-serenity.patch @@ -1,7 +1,18 @@ -diff -Naur gettext-0.21/build-aux/config.sub gettext-0.21.serenity/build-aux/config.sub ---- gettext-0.21/build-aux/config.sub 2020-07-17 22:25:52.000000000 +0200 -+++ gettext-0.21.serenity/build-aux/config.sub 2021-05-08 04:40:29.446280648 +0200 -@@ -1692,7 +1692,7 @@ +From 849a14feac4220857d03ed5b4c35b03e418c6eb8 Mon Sep 17 00:00:00 2001 +From: Ali Mohammad Pur +Date: Mon, 16 May 2022 15:44:34 +0430 +Subject: [PATCH 1/3] Teach config.sub about serenity + +--- + build-aux/config.sub | 2 +- + libtextstyle/build-aux/config.sub | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/build-aux/config.sub b/build-aux/config.sub +index 3d9a8dc..94c9729 100755 +--- a/build-aux/config.sub ++++ b/build-aux/config.sub +@@ -1692,7 +1692,7 @@ case $os in # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. @@ -10,10 +21,11 @@ diff -Naur gettext-0.21/build-aux/config.sub gettext-0.21.serenity/build-aux/con | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ -diff -Naur gettext-0.21/libtextstyle/build-aux/config.sub gettext-0.21.serenity/libtextstyle/build-aux/config.sub ---- gettext-0.21/libtextstyle/build-aux/config.sub 2020-07-17 22:26:48.000000000 +0200 -+++ gettext-0.21.serenity/libtextstyle/build-aux/config.sub 2021-05-08 04:40:43.673225314 +0200 -@@ -1692,7 +1692,7 @@ +diff --git a/libtextstyle/build-aux/config.sub b/libtextstyle/build-aux/config.sub +index 3d9a8dc..94c9729 100755 +--- a/libtextstyle/build-aux/config.sub ++++ b/libtextstyle/build-aux/config.sub +@@ -1692,7 +1692,7 @@ case $os in # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. @@ -22,3 +34,6 @@ diff -Naur gettext-0.21/libtextstyle/build-aux/config.sub gettext-0.21.serenity/ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ +-- +2.36.1 + diff --git a/Ports/gettext/patches/0002-Stub-out-the-getprogname-implementation.patch b/Ports/gettext/patches/0002-Stub-out-the-getprogname-implementation.patch new file mode 100644 index 00000000000..0a7f5601008 --- /dev/null +++ b/Ports/gettext/patches/0002-Stub-out-the-getprogname-implementation.patch @@ -0,0 +1,67 @@ +From 5eb27ed6f09fb3387c23fb6cd4c39204d4592787 Mon Sep 17 00:00:00 2001 +From: Ali Mohammad Pur +Date: Mon, 16 May 2022 15:44:53 +0430 +Subject: [PATCH 2/3] Stub out the getprogname() implementation + +--- + gettext-runtime/gnulib-lib/getprogname.c | 2 ++ + gettext-tools/gnulib-lib/getprogname.c | 2 ++ + gettext-tools/libgettextpo/getprogname.c | 2 ++ + libtextstyle/lib/getprogname.c | 2 ++ + 4 files changed, 8 insertions(+) + +diff --git a/gettext-runtime/gnulib-lib/getprogname.c b/gettext-runtime/gnulib-lib/getprogname.c +index 5e6f764..e800b89 100644 +--- a/gettext-runtime/gnulib-lib/getprogname.c ++++ b/gettext-runtime/gnulib-lib/getprogname.c +@@ -245,6 +245,8 @@ getprogname (void) + } + } + return NULL; ++# elif defined(__serenity__) ++ return NULL; + # else + # error "getprogname module not ported to this OS" + # endif +diff --git a/gettext-tools/gnulib-lib/getprogname.c b/gettext-tools/gnulib-lib/getprogname.c +index 5e6f764..e800b89 100644 +--- a/gettext-tools/gnulib-lib/getprogname.c ++++ b/gettext-tools/gnulib-lib/getprogname.c +@@ -245,6 +245,8 @@ getprogname (void) + } + } + return NULL; ++# elif defined(__serenity__) ++ return NULL; + # else + # error "getprogname module not ported to this OS" + # endif +diff --git a/gettext-tools/libgettextpo/getprogname.c b/gettext-tools/libgettextpo/getprogname.c +index 5e6f764..e800b89 100644 +--- a/gettext-tools/libgettextpo/getprogname.c ++++ b/gettext-tools/libgettextpo/getprogname.c +@@ -245,6 +245,8 @@ getprogname (void) + } + } + return NULL; ++# elif defined(__serenity__) ++ return NULL; + # else + # error "getprogname module not ported to this OS" + # endif +diff --git a/libtextstyle/lib/getprogname.c b/libtextstyle/lib/getprogname.c +index 5e6f764..e800b89 100644 +--- a/libtextstyle/lib/getprogname.c ++++ b/libtextstyle/lib/getprogname.c +@@ -245,6 +245,8 @@ getprogname (void) + } + } + return NULL; ++# elif defined(__serenity__) ++ return NULL; + # else + # error "getprogname module not ported to this OS" + # endif +-- +2.36.1 + diff --git a/Ports/gettext/patches/0003-Stub-out-some-wctype-functions.patch b/Ports/gettext/patches/0003-Stub-out-some-wctype-functions.patch new file mode 100644 index 00000000000..74331026e20 --- /dev/null +++ b/Ports/gettext/patches/0003-Stub-out-some-wctype-functions.patch @@ -0,0 +1,35 @@ +From 83aa314598238bfcbd9d55aa96a3fbe937c45a81 Mon Sep 17 00:00:00 2001 +From: Ali Mohammad Pur +Date: Mon, 16 May 2022 15:45:32 +0430 +Subject: [PATCH 3/3] Stub out some wctype functions + +--- + gettext-tools/gnulib-lib/fnmatch.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/gettext-tools/gnulib-lib/fnmatch.c b/gettext-tools/gnulib-lib/fnmatch.c +index 3937ce3..84aa6e6 100644 +--- a/gettext-tools/gnulib-lib/fnmatch.c ++++ b/gettext-tools/gnulib-lib/fnmatch.c +@@ -106,6 +106,18 @@ extern int fnmatch (const char *pattern, const char *string, int flags); + # define CHAR_CLASS_MAX_LENGTH 256 + #endif + ++#ifdef __serenity__ ++wctype_t wctype(const char*) ++{ ++ asm("int3"); ++} ++ ++int iswctype(wint_t, wctype_t) ++{ ++ asm("int3"); ++} ++#endif ++ + #define IS_CHAR_CLASS(string) wctype (string) + + /* Avoid depending on library functions or files +-- +2.36.1 + diff --git a/Ports/gettext/patches/ReadMe.md b/Ports/gettext/patches/ReadMe.md new file mode 100644 index 00000000000..46813fabd1d --- /dev/null +++ b/Ports/gettext/patches/ReadMe.md @@ -0,0 +1,17 @@ +# Patches for gettext on SerenityOS + +## `0001-Teach-config.sub-about-serenity.patch` + +Teach config.sub about serenity + + +## `0002-Stub-out-the-getprogname-implementation.patch` + +Stub out the getprogname() implementation + + +## `0003-Stub-out-some-wctype-functions.patch` + +Stub out some wctype functions + + diff --git a/Ports/gettext/patches/getprogname.patch b/Ports/gettext/patches/getprogname.patch deleted file mode 100644 index 7bb4ca519ec..00000000000 --- a/Ports/gettext/patches/getprogname.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -Naur gettext-0.21/gettext-runtime/gnulib-lib/getprogname.c gettext-0.21.serenity/gettext-runtime/gnulib-lib/getprogname.c ---- gettext-0.21/gettext-runtime/gnulib-lib/getprogname.c 2020-07-05 22:09:26.000000000 +0200 -+++ gettext-0.21.serenity/gettext-runtime/gnulib-lib/getprogname.c 2021-05-08 05:04:37.755260750 +0200 -@@ -245,6 +245,8 @@ - } - } - return NULL; -+# elif defined(__serenity__) -+ return NULL; - # else - # error "getprogname module not ported to this OS" - # endif -diff -Naur gettext-0.21/gettext-tools/gnulib-lib/getprogname.c gettext-0.21.serenity/gettext-tools/gnulib-lib/getprogname.c ---- gettext-0.21/gettext-tools/gnulib-lib/getprogname.c 2020-07-05 22:10:31.000000000 +0200 -+++ gettext-0.21.serenity/gettext-tools/gnulib-lib/getprogname.c 2021-05-08 05:04:30.225111896 +0200 -@@ -245,6 +245,8 @@ - } - } - return NULL; -+# elif defined(__serenity__) -+ return NULL; - # else - # error "getprogname module not ported to this OS" - # endif -diff -Naur gettext-0.21/gettext-tools/libgettextpo/getprogname.c gettext-0.21.serenity/gettext-tools/libgettextpo/getprogname.c ---- gettext-0.21/gettext-tools/libgettextpo/getprogname.c 2020-07-05 22:11:43.000000000 +0200 -+++ gettext-0.21.serenity/gettext-tools/libgettextpo/getprogname.c 2021-05-08 05:04:16.591509028 +0200 -@@ -245,6 +245,8 @@ - } - } - return NULL; -+# elif defined(__serenity__) -+ return NULL; - # else - # error "getprogname module not ported to this OS" - # endif -diff -Naur gettext-0.21/libtextstyle/lib/getprogname.c gettext-0.21.serenity/libtextstyle/lib/getprogname.c ---- gettext-0.21/libtextstyle/lib/getprogname.c 2020-07-05 22:12:31.000000000 +0200 -+++ gettext-0.21.serenity/libtextstyle/lib/getprogname.c 2021-05-08 05:04:34.065187807 +0200 -@@ -245,6 +245,8 @@ - } - } - return NULL; -+# elif defined(__serenity__) -+ return NULL; - # else - # error "getprogname module not ported to this OS" - # endif diff --git a/Ports/gettext/patches/wctype.patch b/Ports/gettext/patches/wctype.patch deleted file mode 100644 index 7e191b3786a..00000000000 --- a/Ports/gettext/patches/wctype.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Naur gettext-0.21/gettext-tools/gnulib-lib/fnmatch.c gettext-0.21.serenity/gettext-tools/gnulib-lib/fnmatch.c ---- gettext-0.21/gettext-tools/gnulib-lib/fnmatch.c 2020-06-26 21:52:53.000000000 +0200 -+++ gettext-0.21.serenity/gettext-tools/gnulib-lib/fnmatch.c 2021-05-08 05:14:25.420192898 +0200 -@@ -106,6 +106,18 @@ - # define CHAR_CLASS_MAX_LENGTH 256 - #endif - -+#ifdef __serenity__ -+wctype_t wctype(const char*) -+{ -+ asm("int3"); -+} -+ -+int iswctype(wint_t, wctype_t) -+{ -+ asm("int3"); -+} -+#endif -+ - #define IS_CHAR_CLASS(string) wctype (string) - - /* Avoid depending on library functions or files