Ports: Update dash's patches to use git patches

This commit is contained in:
Ali Mohammad Pur 2022-05-16 19:21:31 +04:30 committed by Ali Mohammad Pur
parent b7975b33b3
commit 03e9253d37
Notes: sideshowbarker 2024-07-17 10:51:54 +09:00
5 changed files with 80 additions and 36 deletions

View file

@ -0,0 +1,27 @@
From d6d5890a9938ce5bfb6e9a1ee98fb2d692a6efa3 Mon Sep 17 00:00:00 2001
From: Brian Callahan <bcallah@openbsd.org>
Date: Sun, 10 May 2020 11:50:31 -0400
Subject: [PATCH 1/2] Replace a use of wait3() with waitpid() in the job
control
wait3() does not exist on serenity.
---
src/jobs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/jobs.c b/src/jobs.c
index 606d603..92ac84d 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -1147,7 +1147,7 @@ waitproc(int block, int *status)
do {
gotsigchld = 0;
- err = wait3(status, flags, NULL);
+ err = waitpid(-1, status, flags);
if (err || !block)
break;
--
2.36.1

View file

@ -0,0 +1,40 @@
From 481993ee4f0908cefcbddb0cca4e6811751d809c Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gbeutner@serenityos.org>
Date: Mon, 12 Apr 2021 09:18:56 +0200
Subject: [PATCH 2/2] Skip building helpers by default
---
configure.ac | 3 +++
src/Makefile.am | 2 ++
2 files changed, 5 insertions(+)
diff --git a/configure.ac b/configure.ac
index 4829288..9f9a155 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,5 +181,8 @@ AC_ARG_ENABLE(lineno, AS_HELP_STRING(--disable-lineno, \
if test "$enable_lineno" != "no"; then
AC_DEFINE([WITH_LINENO], 1, [Define if you build with -DWITH_LINENO])
fi
+AC_ARG_ENABLE(helpers, AS_HELP_STRING(--enable-helpers, \
+ [Build helpers]))
+AM_CONDITIONAL([BUILD_HELPERS], [test x$enable_helpers = xyes])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index 139355e..e95491a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,7 +66,9 @@ syntax.c syntax.h: mksyntax
signames.c: mksignames
./$^
+if BUILD_HELPERS
mksyntax: token.h
$(HELPERS): %: %.c
$(COMPILE_FOR_BUILD) -o $@ $<
+endif
--
2.36.1

View file

@ -0,0 +1,13 @@
# Patches for dash on SerenityOS
## `0001-Replace-a-use-of-wait3-with-waitpid-in-the-job-contr.patch`
Replace a use of wait3() with waitpid() in the job control
wait3() does not exist on serenity.
## `0002-Skip-building-helpers-by-default.patch`
Skip building helpers by default

View file

@ -1,11 +0,0 @@
--- dash-0.5.10.2/src/jobs.c.orig Sun May 10 01:20:24 2020
+++ dash-0.5.10.2/src/jobs.c Sun May 10 01:20:58 2020
@@ -1147,7 +1147,7 @@
do {
gotsigchld = 0;
- err = wait3(status, flags, NULL);
+ err = waitpid(-1, status, flags);
if (err || !block)
break;

View file

@ -1,25 +0,0 @@
diff -Naur dash-0.5.10.2/configure.ac dash-0.5.10.2.serenity/configure.ac
--- dash-0.5.10.2/configure.ac 2021-04-12 09:02:46.066529775 +0200
+++ dash-0.5.10.2.serenity/configure.ac 2021-04-12 09:01:46.232094315 +0200
@@ -181,5 +181,8 @@
if test "$enable_lineno" != "no"; then
AC_DEFINE([WITH_LINENO], 1, [Define if you build with -DWITH_LINENO])
fi
+AC_ARG_ENABLE(helpers, AS_HELP_STRING(--enable-helpers, \
+ [Build helpers]))
+AM_CONDITIONAL([BUILD_HELPERS], [test x$enable_helpers = xyes])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
diff -Naur dash-0.5.10.2/src/Makefile.am dash-0.5.10.2.serenity/src/Makefile.am
--- dash-0.5.10.2/src/Makefile.am 2021-04-12 09:14:04.178912517 +0200
+++ dash-0.5.10.2.serenity/src/Makefile.am 2021-04-12 09:13:28.768298013 +0200
@@ -66,7 +66,9 @@
signames.c: mksignames
./$^
+if BUILD_HELPERS
mksyntax: token.h
$(HELPERS): %: %.c
$(COMPILE_FOR_BUILD) -o $@ $<
+endif