diff --git a/Ports/dash/package.sh b/Ports/dash/package.sh index 457eb7100e..614f7db1ee 100755 --- a/Ports/dash/package.sh +++ b/Ports/dash/package.sh @@ -5,3 +5,28 @@ useconfigure=true 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" + +configure() { + host_env + run autoupdate + run autoconf + run aclocal + run automake --add-missing + run mkdir -p host-build + run sh -c "cd host-build && ../configure $configopts CFLAGS=-I." + target_env + run mkdir -p target-build + run sh -c "cd target-build && ../configure --host="${SERENITY_ARCH}-pc-serenity" --disable-helpers $configopts CFLAGS=-I." +} + +build() { + host_env + run sh -c "cd host-build && make $makeopts" + run cp host-build/src/{mkinit,mksyntax,mknodes,mksignames} src + target_env + run sh -c "cd target-build && make $makeopts" +} + +install() { + run sh -c "cd target-build && make DESTDIR="${SERENITY_BUILD_DIR}/Root" $installopts install" +} diff --git a/Ports/dash/patches/fix-system.patch b/Ports/dash/patches/fix-system.patch deleted file mode 100644 index 8d95830d86..0000000000 --- a/Ports/dash/patches/fix-system.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- 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 - diff --git a/Ports/dash/patches/optional-helpers.patch b/Ports/dash/patches/optional-helpers.patch new file mode 100644 index 0000000000..f0a28b1b74 --- /dev/null +++ b/Ports/dash/patches/optional-helpers.patch @@ -0,0 +1,25 @@ +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