summaryrefslogtreecommitdiffstats
path: root/recipes-extended/bash
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-02 12:24:31 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-02 12:30:01 +0000
commit8ba70a1c28a4e0ee73db5308b38abc923b0be44d (patch)
tree0ed9bff8e4bd70766c81dbb559d32781bdd93ce8 /recipes-extended/bash
downloadmeta-gplv2-8ba70a1c28a4e0ee73db5308b38abc923b0be44d.tar.gz
Create meta-gplv2 from files from OE-Core
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'recipes-extended/bash')
-rw-r--r--recipes-extended/bash/bash-3.2.57/build-tests.patch44
-rw-r--r--recipes-extended/bash/bash-3.2.57/dont-include-target-CFLAGS-in-host-LDFLAGS.patch33
-rw-r--r--recipes-extended/bash/bash-3.2.57/mkbuiltins_have_stringize.patch29
-rw-r--r--recipes-extended/bash/bash-3.2.57/run-ptest2
-rw-r--r--recipes-extended/bash/bash-3.2.57/string-format.patch21
-rw-r--r--recipes-extended/bash/bash-3.2.57/test-output.patch25
-rw-r--r--recipes-extended/bash/bash.inc67
-rw-r--r--recipes-extended/bash/bash_3.2.57.bb18
8 files changed, 239 insertions, 0 deletions
diff --git a/recipes-extended/bash/bash-3.2.57/build-tests.patch b/recipes-extended/bash/bash-3.2.57/build-tests.patch
new file mode 100644
index 0000000..e63457c
--- /dev/null
+++ b/recipes-extended/bash/bash-3.2.57/build-tests.patch
@@ -0,0 +1,44 @@
1Add 'ptest' target to Makefile, to run tests without checking dependencies.
2
3Signed-off-by: Anders Roxell <anders.roxell@enea.com>
4Upstream-Status: Pending
5---
6diff -dNaur bash-3.2.48/Makefile.in.orig bash-3.2.48/Makefile.in
7--- bash-3.2.48/Makefile.in.orig 2006-08-17 23:03:35.000000000 +0500
8+++ bash-3.2.48/Makefile.in 2013-07-02 20:20:07.512709327 +0500
9@@ -803,17 +803,31 @@
10 fi
11
12 recho$(EXEEXT): $(SUPPORT_SRC)recho.c
13- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
14+ @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $<
15
16 zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
17- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
18+ @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $<
19
20 printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
21- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
22+ @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $<
23
24-test tests check: force $(Program) $(TESTS_SUPPORT)
25+test tests check:
26+ @$(MAKE) install-test
27+ @$(MAKE) runtest
28+
29+install-test: buildtest
30+ifeq ($(origin INSTALL_TEST_DIR), undefined)
31 @-test -d tests || mkdir tests
32 @cp $(TESTS_SUPPORT) tests
33+else
34+ @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
35+ @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
36+ @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
37+endif
38+
39+buildtest: force $(Program) $(TESTS_SUPPORT)
40+
41+runtest:
42 @( cd $(srcdir)/tests && \
43 PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
44
diff --git a/recipes-extended/bash/bash-3.2.57/dont-include-target-CFLAGS-in-host-LDFLAGS.patch b/recipes-extended/bash/bash-3.2.57/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
new file mode 100644
index 0000000..ee756dc
--- /dev/null
+++ b/recipes-extended/bash/bash-3.2.57/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
@@ -0,0 +1,33 @@
1From 933bd886af49667e88e2385409449ab598813dab Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Wed, 15 Jul 2015 00:54:33 -0700
4Subject: [PATCH] dont include target CFLAGS in host LDFLAGS
5
6Building the host tool 'mkbuiltins' will fail if the target CFLAGS
7contains an option which isn't supported by the host's gcc. To prevent
8the issue, define LDFLAGS_FOR_BUILD based on CFLAGS_FOR_BUILD instead
9of CFLAGS.
10
11Upstream-Status: Inappropriate [required for bash 3.2.57 (GPLv2) recipe only]
12
13Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
14---
15 builtins/Makefile.in | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/builtins/Makefile.in b/builtins/Makefile.in
19index e027f7a..ebfddf3 100644
20--- a/builtins/Makefile.in
21+++ b/builtins/Makefile.in
22@@ -63,7 +63,7 @@ LOCAL_DEFS = @LOCAL_DEFS@
23
24 LIBS = @LIBS@
25 LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS)
26-LDFLAGS_FOR_BUILD = $(LDFLAGS)
27+LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD)
28 LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
29 #LIBS_FOR_BUILD = @LIBS_FOR_BUILD@
30 LIBS_FOR_BUILD = $(LIBS)
31--
321.9.1
33
diff --git a/recipes-extended/bash/bash-3.2.57/mkbuiltins_have_stringize.patch b/recipes-extended/bash/bash-3.2.57/mkbuiltins_have_stringize.patch
new file mode 100644
index 0000000..c4229a7
--- /dev/null
+++ b/recipes-extended/bash/bash-3.2.57/mkbuiltins_have_stringize.patch
@@ -0,0 +1,29 @@
1On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
2the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
3use the STRING() macro from unistd.h. A header in the bash sources overrides
4the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
5wrappers to generate calls to 'xread' and 'xopen', which do not exist,
6resulting in a failure to link.
7
8Assume we have stringize support when cross-compiling, which works around the
9issue.
10
11It may be best for upstream to either give up on supporting compilers without
12stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
13defined, letting the unistd.h one be used, instead.
14
15Upstream-Status: Pending
16
17Signed-off-by: Christopher Larson <chris_larson@mentor.com>
18Signed-off-by: Saul Wold <sgw@linux.intel.com>
19
20--- bash-4.2.orig/builtins/mkbuiltins.c
21+++ bash-4.2/builtins/mkbuiltins.c
22@@ -28,6 +28,7 @@
23 # define HAVE_STDLIB_H
24
25 # define HAVE_RENAME
26+# define HAVE_STRINGIZE
27 #endif /* CROSS_COMPILING */
28
29 #if defined (HAVE_UNISTD_H)
diff --git a/recipes-extended/bash/bash-3.2.57/run-ptest b/recipes-extended/bash/bash-3.2.57/run-ptest
new file mode 100644
index 0000000..8dd3b99
--- /dev/null
+++ b/recipes-extended/bash/bash-3.2.57/run-ptest
@@ -0,0 +1,2 @@
1#!/bin/sh
2make -k THIS_SH=/bin/bash BUILD_DIR=. runtest
diff --git a/recipes-extended/bash/bash-3.2.57/string-format.patch b/recipes-extended/bash/bash-3.2.57/string-format.patch
new file mode 100644
index 0000000..eda3964
--- /dev/null
+++ b/recipes-extended/bash/bash-3.2.57/string-format.patch
@@ -0,0 +1,21 @@
1Fix a string format warning when using security flags:
2
3| ../bash-3.2.48/print_cmd.c:1152:3: error: format not a string literal and no format arguments [-Werror=format-security]
4| cprintf (indentation_string);
5
6Upstream-Status: Backport
7Signed-off-by: Ross Burton <ross.burton@intel.com>
8
9diff --git a/print_cmd.c b/print_cmd.c
10index d1dfd1a..956db53 100644
11--- a/print_cmd.c
12+++ b/print_cmd.c
13@@ -1149,7 +1149,7 @@ indent (amount)
14 for (i = 0; amount > 0; amount--)
15 indentation_string[i++] = ' ';
16 indentation_string[i] = '\0';
17- cprintf (indentation_string);
18+ cprintf ("%s", indentation_string);
19 }
20
21 static void
diff --git a/recipes-extended/bash/bash-3.2.57/test-output.patch b/recipes-extended/bash/bash-3.2.57/test-output.patch
new file mode 100644
index 0000000..2b09b7d
--- /dev/null
+++ b/recipes-extended/bash/bash-3.2.57/test-output.patch
@@ -0,0 +1,25 @@
1Add FAIL/PASS output to test output.
2
3Signed-off-by: Björn Stenberg <bjst@enea.com>
4Upstream-Status: Pending
5---
6diff -uNr a/tests/run-all b/tests/run-all
7--- a/tests/run-all 1999-10-08 17:07:46.000000000 +0200
8+++ b/tests/run-all 2012-10-27 21:04:18.663331887 +0200
9@@ -22,7 +22,15 @@
10 case $x in
11 $0|run-minimal|run-gprof) ;;
12 *.orig|*~) ;;
13- *) echo $x ; sh $x ;;
14+ *) echo $x
15+ output=`sh $x`
16+ if [ -n "$output" ]; then
17+ echo "$output"
18+ echo "FAIL: $x"
19+ else
20+ echo "PASS: $x"
21+ fi
22+ ;;
23 esac
24 done
25
diff --git a/recipes-extended/bash/bash.inc b/recipes-extended/bash/bash.inc
new file mode 100644
index 0000000..a05b987
--- /dev/null
+++ b/recipes-extended/bash/bash.inc
@@ -0,0 +1,67 @@
1SUMMARY = "An sh-compatible command language interpreter"
2HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
3SECTION = "base/shell"
4
5DEPENDS = "ncurses bison-native virtual/libiconv"
6
7inherit autotools gettext texinfo update-alternatives ptest
8
9EXTRA_AUTORECONF += "--exclude=autoheader"
10EXTRA_OECONF = "--enable-job-control --without-bash-malloc"
11
12# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
13# startup files, even if they are not interactive.
14# This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137.
15CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS"
16
17ALTERNATIVE_${PN} = "bash sh"
18ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash"
19ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash"
20ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
21ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}"
22ALTERNATIVE_PRIORITY = "100"
23
24RDEPENDS_${PN} += "base-files"
25RDEPENDS_${PN}_class-nativesdk = ""
26RDEPENDS_${PN}-ptest += "make"
27
28USERADD_PACKAGES = "${PN}-ptest"
29USERADD_PARAM_${PN}-ptest = "--create-home --user-group test"
30
31do_configure_prepend () {
32 if [ ! -e ${S}/acinclude.m4 ]; then
33 cat ${S}/aclocal.m4 > ${S}/acinclude.m4
34 fi
35}
36
37do_compile_ptest () {
38 oe_runmake buildtest
39}
40
41do_install_append () {
42 # Move /usr/bin/bash to /bin/bash, if need
43 if [ "${base_bindir}" != "${bindir}" ]; then
44 mkdir -p ${D}${base_bindir}
45 mv ${D}${bindir}/bash ${D}${base_bindir}
46 fi
47}
48do_install_append_class-target () {
49 # Clean host path in bashbug
50 sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
51 -e "s,-I${WORKDIR}/\S* ,,g" ${D}${bindir}/bashbug
52}
53
54do_install_ptest () {
55 make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
56 cp ${B}/Makefile ${D}${PTEST_PATH}
57 sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
58 -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" ${D}${PTEST_PATH}/Makefile
59}
60
61pkg_postinst_${PN} () {
62 grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
63}
64
65pkg_postrm_${PN} () {
66 printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
67}
diff --git a/recipes-extended/bash/bash_3.2.57.bb b/recipes-extended/bash/bash_3.2.57.bb
new file mode 100644
index 0000000..5c288b3
--- /dev/null
+++ b/recipes-extended/bash/bash_3.2.57.bb
@@ -0,0 +1,18 @@
1require bash.inc
2
3LICENSE = "GPLv2+"
4LIC_FILES_CHKSUM = "file://COPYING;md5=fd5d9bcabd8ed5a54a01ce8d183d592a"
5
6SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
7 file://mkbuiltins_have_stringize.patch \
8 file://build-tests.patch \
9 file://test-output.patch \
10 file://run-ptest \
11 file://dont-include-target-CFLAGS-in-host-LDFLAGS.patch \
12 file://string-format.patch \
13 "
14
15SRC_URI[md5sum] = "237a8767c990b43ae2c89895c2dbc062"
16SRC_URI[sha256sum] = "3fa9daf85ebf35068f090ce51283ddeeb3c75eb5bc70b1a4a7cb05868bfe06a4"
17
18PARALLEL_MAKE = ""