summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/bash
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2014-06-26 14:36:22 +0200
committerAdrian Dudau <adrian.dudau@enea.com>2014-06-26 15:32:53 +0200
commitf4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch)
tree487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-extended/bash
downloadpoky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-extended/bash')
-rw-r--r--meta/recipes-extended/bash/bash-3.2.48/build-tests.patch44
-rw-r--r--meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch29
-rw-r--r--meta/recipes-extended/bash/bash-3.2.48/run-ptest2
-rw-r--r--meta/recipes-extended/bash/bash-3.2.48/test-output.patch25
-rw-r--r--meta/recipes-extended/bash/bash.inc54
-rw-r--r--meta/recipes-extended/bash/bash/build-tests.patch55
-rw-r--r--meta/recipes-extended/bash/bash/execute_cmd.patch17
-rw-r--r--meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch26
-rw-r--r--meta/recipes-extended/bash/bash/run-ptest2
-rw-r--r--meta/recipes-extended/bash/bash/test-output.patch25
-rw-r--r--meta/recipes-extended/bash/bash_3.2.48.bb28
-rw-r--r--meta/recipes-extended/bash/bash_4.3.bb18
12 files changed, 325 insertions, 0 deletions
diff --git a/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch b/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch
new file mode 100644
index 0000000000..91341ee696
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/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) -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) -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) -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/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch b/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch
new file mode 100644
index 0000000000..c4229a7ed9
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/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/meta/recipes-extended/bash/bash-3.2.48/run-ptest b/meta/recipes-extended/bash/bash-3.2.48/run-ptest
new file mode 100644
index 0000000000..8dd3b9981d
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/run-ptest
@@ -0,0 +1,2 @@
1#!/bin/sh
2make -k THIS_SH=/bin/bash BUILD_DIR=. runtest
diff --git a/meta/recipes-extended/bash/bash-3.2.48/test-output.patch b/meta/recipes-extended/bash/bash-3.2.48/test-output.patch
new file mode 100644
index 0000000000..2b09b7d977
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/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/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
new file mode 100644
index 0000000000..2bb2df9584
--- /dev/null
+++ b/meta/recipes-extended/bash/bash.inc
@@ -0,0 +1,54 @@
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"
6
7inherit autotools-brokensep gettext update-alternatives ptest
8
9PARALLEL_MAKE = ""
10
11EXTRA_OECONF = "--enable-job-control"
12
13ALTERNATIVE_${PN} = "sh"
14ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
15ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash"
16ALTERNATIVE_PRIORITY = "100"
17
18export AUTOHEADER = "true"
19
20RDEPENDS_${PN} += "base-files"
21RDEPENDS_${PN}_class-nativesdk = ""
22RDEPENDS_${PN}-ptest += "make"
23
24do_configure_prepend () {
25 if [ ! -e ${S}/acinclude.m4 ]; then
26 cat ${S}/aclocal.m4 > ${S}/acinclude.m4
27 fi
28}
29
30do_compile_ptest () {
31 oe_runmake buildtest
32}
33
34do_install_append () {
35 # Move /usr/bin/bash to /bin/bash, if need
36 if [ "${base_bindir}" != "${bindir}" ]; then
37 mkdir -p ${D}${base_bindir}
38 mv ${D}${bindir}/bash ${D}${base_bindir}
39 fi
40}
41
42do_install_ptest () {
43 make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
44 cp ${B}/Makefile ${D}${PTEST_PATH}
45 sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
46}
47
48pkg_postinst_${PN} () {
49 grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
50}
51
52pkg_postrm_${PN} () {
53 printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
54}
diff --git a/meta/recipes-extended/bash/bash/build-tests.patch b/meta/recipes-extended/bash/bash/build-tests.patch
new file mode 100644
index 0000000000..73a81b60da
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/build-tests.patch
@@ -0,0 +1,55 @@
1Add 'ptest' target to Makefile, to run tests without checking dependencies.
2
3Upstream-Status: Pending
4Signed-off-by: Anders Roxell <anders.roxell@enea.com>
5Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
6---
7 Makefile.in | 24 +++++++++++++++++++-----
8 1 file changed, 19 insertions(+), 5 deletions(-)
9
10diff --git a/Makefile.in b/Makefile.in
11--- a/Makefile.in
12+++ b/Makefile.in
13@@ -848,20 +848,34 @@ maybe-clean:
14 fi
15
16 recho$(EXEEXT): $(SUPPORT_SRC)recho.c
17- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
18+ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
19
20 zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
21- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
22+ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
23
24 printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
25- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
26+ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
27
28 xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c
29- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
30+ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
31
32-test tests check: force $(Program) $(TESTS_SUPPORT)
33+test tests check:
34+ @$(MAKE) install-test
35+ @$(MAKE) runtest
36+
37+install-test: buildtest
38+ifeq ($(origin INSTALL_TEST_DIR), undefined)
39 @-test -d tests || mkdir tests
40 @cp $(TESTS_SUPPORT) tests
41+else
42+ @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
43+ @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
44+ @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
45+endif
46+
47+buildtest: force $(Program) $(TESTS_SUPPORT)
48+
49+runtest:
50 @( cd $(srcdir)/tests && \
51 PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
52
53--
541.8.1.2
55
diff --git a/meta/recipes-extended/bash/bash/execute_cmd.patch b/meta/recipes-extended/bash/bash/execute_cmd.patch
new file mode 100644
index 0000000000..81f8f0a9cd
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/execute_cmd.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3--- execute_cmd.c.orig Fri Jun 3 13:34:42 2011
4+++ execute_cmd.c Fri Jun 3 13:36:41 2011
5@@ -2202,7 +2202,11 @@
6 /* If the `lastpipe' option is set with shopt, and job control is not
7 enabled, execute the last element of non-async pipelines in the
8 current shell environment. */
9- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
10+ if (lastpipe_opt &&
11+#if defined(JOB_CONTROL)
12+ job_control == 0 &&
13+#endif
14+ asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
15 {
16 lstdin = move_to_high_fd (0, 0, 255);
17 if (lstdin > 0)
diff --git a/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch b/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
new file mode 100644
index 0000000000..a9391d6cac
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
@@ -0,0 +1,26 @@
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
17--- bash-4.2.orig/builtins/mkbuiltins.c
18+++ bash-4.2/builtins/mkbuiltins.c
19@@ -28,6 +28,7 @@
20 # define HAVE_STDLIB_H
21
22 # define HAVE_RENAME
23+# define HAVE_STRINGIZE
24 #endif /* CROSS_COMPILING */
25
26 #if defined (HAVE_UNISTD_H)
diff --git a/meta/recipes-extended/bash/bash/run-ptest b/meta/recipes-extended/bash/bash/run-ptest
new file mode 100644
index 0000000000..8dd3b9981d
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/run-ptest
@@ -0,0 +1,2 @@
1#!/bin/sh
2make -k THIS_SH=/bin/bash BUILD_DIR=. runtest
diff --git a/meta/recipes-extended/bash/bash/test-output.patch b/meta/recipes-extended/bash/bash/test-output.patch
new file mode 100644
index 0000000000..2b09b7d977
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/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/meta/recipes-extended/bash/bash_3.2.48.bb b/meta/recipes-extended/bash/bash_3.2.48.bb
new file mode 100644
index 0000000000..fe04b28e7c
--- /dev/null
+++ b/meta/recipes-extended/bash/bash_3.2.48.bb
@@ -0,0 +1,28 @@
1require bash.inc
2
3LICENSE = "GPLv2+"
4LIC_FILES_CHKSUM = "file://COPYING;md5=fd5d9bcabd8ed5a54a01ce8d183d592a"
5
6PR = "r11"
7
8SRC_URI = "${GNU_MIRROR}/bash/bash-${PV}.tar.gz;name=tarball \
9 ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-049;apply=yes;striplevel=0;name=patch001 \
10 ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-050;apply=yes;striplevel=0;name=patch002 \
11 ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-051;apply=yes;striplevel=0;name=patch003 \
12 file://mkbuiltins_have_stringize.patch \
13 file://build-tests.patch \
14 file://test-output.patch \
15 file://run-ptest \
16 "
17
18SRC_URI[tarball.md5sum] = "338dcf975a93640bb3eaa843ca42e3f8"
19SRC_URI[tarball.sha256sum] = "128d281bd5682ba5f6953122915da71976357d7a76490d266c9173b1d0426348"
20SRC_URI[patch001.md5sum] = "af571a2d164d5abdcae4499e94e8892c"
21SRC_URI[patch001.sha256sum] = "b1217ed94bdb95dc878fa5cabbf8a164435eb0d9da23a392198f48566ee34a2f"
22SRC_URI[patch002.md5sum] = "8443d4385d73ec835abe401d90591377"
23SRC_URI[patch002.sha256sum] = "081bb03c580ecee63ba03b40beb3caf509eca29515b2e8dd3c078503609a1642"
24SRC_URI[patch003.md5sum] = "15c6653042e9814aa87120098fc7a849"
25SRC_URI[patch003.sha256sum] = "354886097cd95b4def77028f32ee01e2e088d58a98184fede9d3ce9320e218ef"
26
27SRC_URI[md5sum] = "338dcf975a93640bb3eaa843ca42e3f8"
28SRC_URI[sha256sum] = "128d281bd5682ba5f6953122915da71976357d7a76490d266c9173b1d0426348"
diff --git a/meta/recipes-extended/bash/bash_4.3.bb b/meta/recipes-extended/bash/bash_4.3.bb
new file mode 100644
index 0000000000..25b7410c52
--- /dev/null
+++ b/meta/recipes-extended/bash/bash_4.3.bb
@@ -0,0 +1,18 @@
1require bash.inc
2
3# GPLv2+ (< 4.0), GPLv3+ (>= 4.0)
4LICENSE = "GPLv3+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
6
7SRC_URI = "${GNU_MIRROR}/bash/${BPN}-${PV}.tar.gz;name=tarball \
8 file://execute_cmd.patch;striplevel=0 \
9 file://mkbuiltins_have_stringize.patch \
10 file://build-tests.patch \
11 file://test-output.patch \
12 file://run-ptest \
13 "
14
15SRC_URI[tarball.md5sum] = "81348932d5da294953e15d4814c74dd1"
16SRC_URI[tarball.sha256sum] = "afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4"
17
18BBCLASSEXTEND = "nativesdk"