From f15b467b5dc93e6253625c794296dde8156b8dcf Mon Sep 17 00:00:00 2001 From: Brian Callahan Date: Sun, 10 May 2020 11:50:31 -0400 Subject: [PATCH] Ports: Add dash shell --- Ports/dash/package.sh | 8 +++ Ports/dash/patches/fix-jobs.patch | 11 ++++ Ports/dash/patches/fix-shell.patch | 17 +++++++ Ports/dash/patches/fix-system.patch | 79 +++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100755 Ports/dash/package.sh create mode 100644 Ports/dash/patches/fix-jobs.patch create mode 100644 Ports/dash/patches/fix-shell.patch create mode 100644 Ports/dash/patches/fix-system.patch diff --git a/Ports/dash/package.sh b/Ports/dash/package.sh new file mode 100755 index 0000000000..6b1c934226 --- /dev/null +++ b/Ports/dash/package.sh @@ -0,0 +1,8 @@ +#!/bin/bash ../.port_include.sh +port=dash +version=0.5.10.2 +useconfigure=true +configopts="--enable-static" +files="http://gondor.apana.org.au/~herbert/dash/files/dash-${version}.tar.gz dash-${version}.tar.gz +http://gondor.apana.org.au/~herbert/dash/files/dash-${version}.tar.gz.sha256sum dash-${version}.tar.gz.sha256sum" +auth_type="sha256" diff --git a/Ports/dash/patches/fix-jobs.patch b/Ports/dash/patches/fix-jobs.patch new file mode 100644 index 0000000000..776dbc0d88 --- /dev/null +++ b/Ports/dash/patches/fix-jobs.patch @@ -0,0 +1,11 @@ +--- 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; + diff --git a/Ports/dash/patches/fix-shell.patch b/Ports/dash/patches/fix-shell.patch new file mode 100644 index 0000000000..5b6c0e2dee --- /dev/null +++ b/Ports/dash/patches/fix-shell.patch @@ -0,0 +1,17 @@ +--- dash-0.5.10.2/src/shell.h.orig Sun Sep 28 04:19:32 2014 ++++ dash-0.5.10.2/src/shell.h Fri Apr 24 18:25:38 2020 +@@ -51,6 +51,14 @@ + + #include + ++#ifndef PATH_MAX ++#define PATH_MAX 4096 ++#endif ++ ++#ifndef NAME_MAX ++#define NAME_MAX 1024 ++#endif ++ + #ifndef JOBS + #define JOBS 1 + #endif diff --git a/Ports/dash/patches/fix-system.patch b/Ports/dash/patches/fix-system.patch new file mode 100644 index 0000000000..8d95830d86 --- /dev/null +++ b/Ports/dash/patches/fix-system.patch @@ -0,0 +1,79 @@ +--- dash-0.5.10.2/src/system.c.orig Sun May 10 01:45:02 2020 ++++ dash-0.5.10.2/src/system.c Sun May 10 01:50:52 2020 +@@ -131,64 +131,64 @@ + + #ifndef HAVE_ISALPHA + int isalnum(int c) { +- return _isalnum(c); ++ return (_ctype_[(int)(c)] & (_U | _L | _N)); + } + + + int iscntrl(int c) { +- return _iscntrl(c); ++ return (_ctype_[(int)(c)] & (_C)); + } + + + int islower(int c) { +- return _islower(c); ++ return ((_ctype_[(int)(c)] & (_U | _L)) == _L); + } + + + int isspace(int c) { +- return _isspace(c); ++ return (_ctype_[(int)(c)] & (_S)); + } + + + int isalpha(int c) { +- return _isalpha(c); ++ return (_ctype_[(int)(c)] & (_U | _L)); + } + + + int isdigit(int c) { +- return _isdigit(c); ++ return (_ctype_[(int)(c)] & (_N)); + } + + + int isprint(int c) { +- return _isprint(c); ++ return (_ctype_[(int)(c)] & (_P | _U | _L | _N | _B)); + } + + + int isupper(int c) { +- return _isupper(c); ++ return ((_ctype_[(int)(c)] & (_U | _L)) == _U); + } + + + #if HAVE_DECL_ISBLANK + int isblank(int c) { +- return _isblank(c); ++ return (c == ' ' || c == '\t'); + } + #endif + + + int isgraph(int c) { +- return _isgraph(c); ++ return (_ctype_[(int)(c)] & (_P | _U | _L | _N)); + } + + + int ispunct(int c) { +- return _ispunct(c); ++ return (_ctype_[(int)(c)] & (_P)); + } + + + int isxdigit(int c) { +- return _isxdigit(c); ++ return (_ctype_[(int)(c)] & (_N | _X)); + } + #endif +