diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-02 12:24:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-02 12:30:01 +0000 |
commit | 8ba70a1c28a4e0ee73db5308b38abc923b0be44d (patch) | |
tree | 0ed9bff8e4bd70766c81dbb559d32781bdd93ce8 /recipes-extended/bash | |
download | meta-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')
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 @@ | |||
1 | Add 'ptest' target to Makefile, to run tests without checking dependencies. | ||
2 | |||
3 | Signed-off-by: Anders Roxell <anders.roxell@enea.com> | ||
4 | Upstream-Status: Pending | ||
5 | --- | ||
6 | diff -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 @@ | |||
1 | From 933bd886af49667e88e2385409449ab598813dab Mon Sep 17 00:00:00 2001 | ||
2 | From: Andre McCurdy <armccurdy@gmail.com> | ||
3 | Date: Wed, 15 Jul 2015 00:54:33 -0700 | ||
4 | Subject: [PATCH] dont include target CFLAGS in host LDFLAGS | ||
5 | |||
6 | Building the host tool 'mkbuiltins' will fail if the target CFLAGS | ||
7 | contains an option which isn't supported by the host's gcc. To prevent | ||
8 | the issue, define LDFLAGS_FOR_BUILD based on CFLAGS_FOR_BUILD instead | ||
9 | of CFLAGS. | ||
10 | |||
11 | Upstream-Status: Inappropriate [required for bash 3.2.57 (GPLv2) recipe only] | ||
12 | |||
13 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> | ||
14 | --- | ||
15 | builtins/Makefile.in | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/builtins/Makefile.in b/builtins/Makefile.in | ||
19 | index 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 | -- | ||
32 | 1.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 @@ | |||
1 | On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by | ||
2 | the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers | ||
3 | use the STRING() macro from unistd.h. A header in the bash sources overrides | ||
4 | the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the | ||
5 | wrappers to generate calls to 'xread' and 'xopen', which do not exist, | ||
6 | resulting in a failure to link. | ||
7 | |||
8 | Assume we have stringize support when cross-compiling, which works around the | ||
9 | issue. | ||
10 | |||
11 | It may be best for upstream to either give up on supporting compilers without | ||
12 | stringize support, or to not define STRING() at all when FORTIFY_SOURCES is | ||
13 | defined, letting the unistd.h one be used, instead. | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | |||
17 | Signed-off-by: Christopher Larson <chris_larson@mentor.com> | ||
18 | Signed-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 | ||
2 | make -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 @@ | |||
1 | Fix 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 | |||
6 | Upstream-Status: Backport | ||
7 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
8 | |||
9 | diff --git a/print_cmd.c b/print_cmd.c | ||
10 | index 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 @@ | |||
1 | Add FAIL/PASS output to test output. | ||
2 | |||
3 | Signed-off-by: Björn Stenberg <bjst@enea.com> | ||
4 | Upstream-Status: Pending | ||
5 | --- | ||
6 | diff -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 @@ | |||
1 | SUMMARY = "An sh-compatible command language interpreter" | ||
2 | HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html" | ||
3 | SECTION = "base/shell" | ||
4 | |||
5 | DEPENDS = "ncurses bison-native virtual/libiconv" | ||
6 | |||
7 | inherit autotools gettext texinfo update-alternatives ptest | ||
8 | |||
9 | EXTRA_AUTORECONF += "--exclude=autoheader" | ||
10 | EXTRA_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. | ||
15 | CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS" | ||
16 | |||
17 | ALTERNATIVE_${PN} = "bash sh" | ||
18 | ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash" | ||
19 | ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash" | ||
20 | ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh" | ||
21 | ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}" | ||
22 | ALTERNATIVE_PRIORITY = "100" | ||
23 | |||
24 | RDEPENDS_${PN} += "base-files" | ||
25 | RDEPENDS_${PN}_class-nativesdk = "" | ||
26 | RDEPENDS_${PN}-ptest += "make" | ||
27 | |||
28 | USERADD_PACKAGES = "${PN}-ptest" | ||
29 | USERADD_PARAM_${PN}-ptest = "--create-home --user-group test" | ||
30 | |||
31 | do_configure_prepend () { | ||
32 | if [ ! -e ${S}/acinclude.m4 ]; then | ||
33 | cat ${S}/aclocal.m4 > ${S}/acinclude.m4 | ||
34 | fi | ||
35 | } | ||
36 | |||
37 | do_compile_ptest () { | ||
38 | oe_runmake buildtest | ||
39 | } | ||
40 | |||
41 | do_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 | } | ||
48 | do_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 | |||
54 | do_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 | |||
61 | pkg_postinst_${PN} () { | ||
62 | grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells | ||
63 | } | ||
64 | |||
65 | pkg_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 @@ | |||
1 | require bash.inc | ||
2 | |||
3 | LICENSE = "GPLv2+" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=fd5d9bcabd8ed5a54a01ce8d183d592a" | ||
5 | |||
6 | SRC_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 | |||
15 | SRC_URI[md5sum] = "237a8767c990b43ae2c89895c2dbc062" | ||
16 | SRC_URI[sha256sum] = "3fa9daf85ebf35068f090ce51283ddeeb3c75eb5bc70b1a4a7cb05868bfe06a4" | ||
17 | |||
18 | PARALLEL_MAKE = "" | ||