From 9a284ad3f75629dc3d5b5a026a9a2b3c76704bca Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 28 May 2019 02:58:36 +0200 Subject: Move everything to a subdirectory Also don't run cd for the initial git clone (DERP!), and other bash port fixes. --- Ports/.bash-serenity-disable-locale.patch | 18 ------------------ Ports/.bash-serenity-include-stdio.patch | 13 ------------- Ports/.bash-serenity-system.patch | 13 ------------- Ports/.port_include.sh | 8 +++++++- Ports/SDL2.sh | 15 --------------- Ports/SDL2/SDL2.sh | 15 +++++++++++++++ Ports/bash.sh | 30 ------------------------------ Ports/bash/bash.sh | 30 ++++++++++++++++++++++++++++++ Ports/bash/configure-system.patch | 13 +++++++++++++ Ports/bash/disable-locale.patch | 18 ++++++++++++++++++ Ports/bash/include-stdio.patch | 13 +++++++++++++ 11 files changed, 96 insertions(+), 90 deletions(-) delete mode 100644 Ports/.bash-serenity-disable-locale.patch delete mode 100644 Ports/.bash-serenity-include-stdio.patch delete mode 100644 Ports/.bash-serenity-system.patch delete mode 100755 Ports/SDL2.sh create mode 100755 Ports/SDL2/SDL2.sh delete mode 100755 Ports/bash.sh create mode 100755 Ports/bash/bash.sh create mode 100644 Ports/bash/configure-system.patch create mode 100644 Ports/bash/disable-locale.patch create mode 100644 Ports/bash/include-stdio.patch (limited to 'Ports') diff --git a/Ports/.bash-serenity-disable-locale.patch b/Ports/.bash-serenity-disable-locale.patch deleted file mode 100644 index c231fc5936..0000000000 --- a/Ports/.bash-serenity-disable-locale.patch +++ /dev/null @@ -1,18 +0,0 @@ -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-serenity-include-stdio.patch b/Ports/.bash-serenity-include-stdio.patch deleted file mode 100644 index bd06d4b6f8..0000000000 --- a/Ports/.bash-serenity-include-stdio.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 -+ - /* Adapted from BSD /usr/include/sys/cdefs.h. */ - - /* A function can be defined using prototypes and compile on both ANSI C diff --git a/Ports/.bash-serenity-system.patch b/Ports/.bash-serenity-system.patch deleted file mode 100644 index 5a642d7816..0000000000 --- a/Ports/.bash-serenity-system.patch +++ /dev/null @@ -1,13 +0,0 @@ -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/.port_include.sh b/Ports/.port_include.sh index c197bcd651..b96f045d60 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -25,12 +25,18 @@ function run_command() { echo "+ FINISHED: $@" } +function run_command_nocd() { + echo "+ $@ (nocd)" + ("$@") + echo "+ FINISHED (nocd): $@" +} + function run_fetch_git() { if [ -d "$PORT_DIR/.git" ]; then run_command git fetch run_command git reset --hard FETCH_HEAD else - run_command git clone "$1" "$PORT_DIR" + run_command_nocd git clone "$1" "$PORT_DIR" fi } diff --git a/Ports/SDL2.sh b/Ports/SDL2.sh deleted file mode 100755 index 0e6b0a1c2e..0000000000 --- a/Ports/SDL2.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -PORT_DIR=SDL -function fetch() { - run_fetch_git "https://github.com/SerenityOS/SDL" -} -function configure() { - run_configure_cmake -} -function build() { - run_make -} -function install() { - run_make_install -} -source ./.port_include.sh diff --git a/Ports/SDL2/SDL2.sh b/Ports/SDL2/SDL2.sh new file mode 100755 index 0000000000..239e44d58b --- /dev/null +++ b/Ports/SDL2/SDL2.sh @@ -0,0 +1,15 @@ +#!/bin/sh +PORT_DIR=SDL +function fetch() { + run_fetch_git "https://github.com/SerenityOS/SDL" +} +function configure() { + run_configure_cmake +} +function build() { + run_make +} +function install() { + run_make_install +} +source ../.port_include.sh diff --git a/Ports/bash.sh b/Ports/bash.sh deleted file mode 100755 index e978d23f75..0000000000 --- a/Ports/bash.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/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 .bash-serenity-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 .bash-serenity-include-stdio.patch -p1 - - # Locale calls crash right now. LibC bug, probably. - run_patch .bash-serenity-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/GETCWD_BROKEN 1/GETCWD_BROKEN 0/" config.h - run_command perl -p -i -e "s/CAN_REDEFINE_GETENV 1/CAN_REDEFINE_GETENV 0/" config.h - run_make -} -function install() { - run_make_install -} -source ./.port_include.sh 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 ++ + /* Adapted from BSD /usr/include/sys/cdefs.h. */ + + /* A function can be defined using prototypes and compile on both ANSI C -- cgit v1.2.3