summaryrefslogtreecommitdiff
path: root/Ports/bash
diff options
context:
space:
mode:
authorRobin Burchell <robin+git@viroteck.net>2019-05-28 02:58:36 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-28 03:07:18 +0200
commit9a284ad3f75629dc3d5b5a026a9a2b3c76704bca (patch)
tree567b6ece51e6f1c0b1d5caacd56d3de9b2768c84 /Ports/bash
parentb12a09643762b934adefd2ecbe537ff05663400a (diff)
downloadserenity-9a284ad3f75629dc3d5b5a026a9a2b3c76704bca.zip
Move everything to a subdirectory
Also don't run cd for the initial git clone (DERP!), and other bash port fixes.
Diffstat (limited to 'Ports/bash')
-rwxr-xr-xPorts/bash/bash.sh30
-rw-r--r--Ports/bash/configure-system.patch13
-rw-r--r--Ports/bash/disable-locale.patch18
-rw-r--r--Ports/bash/include-stdio.patch13
4 files changed, 74 insertions, 0 deletions
diff --git a/Ports/bash/bash.sh b/Ports/bash/bash.sh
new file mode 100755
index 0000000000..802f94ed02
--- /dev/null
+++ b/Ports/bash/bash.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+MAKEOPTS=" " # bash will die weirdly if you try build with multiple jobs.
+INSTALLOPTS=" "
+PORT_DIR=bash
+function fetch() {
+ run_fetch_git "https://git.savannah.gnu.org/git/bash.git"
+
+ # Add serenity as a system for configure
+ run_patch configure-system.patch -p1
+
+ # For some reason, the build fails due to FILE* being undefined without this.
+ # This is probably a LibC bug, but work around it for now.
+ run_patch include-stdio.patch -p1
+
+ # Locale calls crash right now. LibC bug, probably.
+ run_patch disable-locale.patch -p1
+}
+function configure() {
+ run_configure_autotools --disable-nls --without-bash-malloc
+}
+function build() {
+ # Avoid some broken cross compile tests...
+ run_command perl -p -i -e "s/define GETCWD_BROKEN 1/undef GETCWD_BROKEN/" config.h
+ run_command perl -p -i -e "s/define CAN_REDEFINE_GETENV 1/undef CAN_REDEFINE_GETENV/" config.h
+ run_make
+}
+function install() {
+ run_make_install DESTDIR="$SERENITY_ROOT"/Root
+}
+source ../.port_include.sh
diff --git a/Ports/bash/configure-system.patch b/Ports/bash/configure-system.patch
new file mode 100644
index 0000000000..5a642d7816
--- /dev/null
+++ b/Ports/bash/configure-system.patch
@@ -0,0 +1,13 @@
+diff --git a/support/config.sub b/support/config.sub
+index f208558e..fb8fa19e 100755
+--- a/support/config.sub
++++ b/support/config.sub
+@@ -1360,7 +1360,7 @@ case $os in
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+- | midnightbsd*)
++ | midnightbsd* | serenity*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ qnx*)
diff --git a/Ports/bash/disable-locale.patch b/Ports/bash/disable-locale.patch
new file mode 100644
index 0000000000..c231fc5936
--- /dev/null
+++ b/Ports/bash/disable-locale.patch
@@ -0,0 +1,18 @@
+diff -Nru pristine/bash-5.0/locale.c bash-5.0/locale.c
++++ bash-5.0/locale.c 2019-05-21 02:18:05.843104487 +0200
+@@ -76,6 +76,7 @@
+ void
+ set_default_locale ()
+ {
++ return;
+ #if defined (HAVE_SETLOCALE)
+ default_locale = setlocale (LC_ALL, "");
+ if (default_locale)
+@@ -95,6 +96,7 @@
+ void
+ set_default_locale_vars ()
+ {
++ return;
+ char *val;
+
+#if defined (HAVE_SETLOCALE)
diff --git a/Ports/bash/include-stdio.patch b/Ports/bash/include-stdio.patch
new file mode 100644
index 0000000000..bd06d4b6f8
--- /dev/null
+++ b/Ports/bash/include-stdio.patch
@@ -0,0 +1,13 @@
+diff --git a/include/stdc.h b/include/stdc.h
+index c66492f0..5991f4bd 100644
+--- a/include/stdc.h
++++ b/include/stdc.h
+@@ -22,6 +22,8 @@
+ #if !defined (_STDC_H_)
+ #define _STDC_H_
+
++#include <stdio.h>
++
+ /* Adapted from BSD /usr/include/sys/cdefs.h. */
+
+ /* A function can be defined using prototypes and compile on both ANSI C