From d943b379628ba03aa55162d80c1e39bd618cfa2f Mon Sep 17 00:00:00 2001 From: fosslinux Date: Tue, 13 Apr 2021 18:05:34 +1000 Subject: [PATCH] Add bison 2.3 This is required for perl 5.10.1. --- SHA256SUMS.sources | 2 + parts.rst | 7 +++ sysa.py | 7 +++ sysa/bison-2.3/bison-2.3.sh | 32 +++++++++++ sysa/bison-2.3/checksums | 1 + sysa/bison-2.3/import-gnulib.sh | 55 +++++++++++++++++++ sysa/bison-2.3/patches/autover-mismatch.patch | 17 ++++++ sysa/bison-2.3/patches/fopen-safer.patch | 18 ++++++ sysa/bison-2.3/patches/gnulib-fix.patch | 17 ++++++ sysa/bison-2.3/patches/our-bison.patch | 20 +++++++ sysa/run2.sh | 2 + 11 files changed, 178 insertions(+) create mode 100755 sysa/bison-2.3/bison-2.3.sh create mode 100644 sysa/bison-2.3/checksums create mode 100755 sysa/bison-2.3/import-gnulib.sh create mode 100644 sysa/bison-2.3/patches/autover-mismatch.patch create mode 100644 sysa/bison-2.3/patches/fopen-safer.patch create mode 100644 sysa/bison-2.3/patches/gnulib-fix.patch create mode 100644 sysa/bison-2.3/patches/our-bison.patch diff --git a/SHA256SUMS.sources b/SHA256SUMS.sources index c969760..c100004 100644 --- a/SHA256SUMS.sources +++ b/SHA256SUMS.sources @@ -64,3 +64,5 @@ de23af78fca90ce32dff2dd45b3432b2334740bb9bb7b05bf60fdbfc396ceb9c tcc-0.9.27.tar 1b700d375e253e88bdf79caa244284a899b80f59fd64fdd3aaa6408b7bd715ae untar.c 166c48d2842519bc4f96333bff9e265f8cdda44d38e40594ef3f9bbb52890490 xz-5.0.5.tar.bz2 c40385e142989c91989413f3c5a31282b2ffdca16b69cd3ecfde537b8a474921 flex-2.5.33.tar.gz +b10d7e9e354be72aee4e4911cf19dd27b5c527d4e7200857365b5fcdeea0dffb bison-2.3.tar.bz2 +0190f28cb155fedd22bf8558c3e8705eed9eacfb7ae29e7508d025a68eb90899 gnulib-b28236b.tar.gz diff --git a/parts.rst b/parts.rst index 85386ee..520c4a6 100644 --- a/parts.rst +++ b/parts.rst @@ -638,3 +638,10 @@ flex 2.5.33 An older version of flex is required for bison 2.3. We cannot use 2.5.11 that was compiled much earlier, as it does not produce reproducible output when building bison 2.3. + +bison 2.3 +========= + +This is an older version of bison required for the bison files in perl 5.10.1. +We backwards-bootstrap this from 3.4.1, using 3.4.1 to compile the bison files +in 2.3. This parser works sufficiently well for perl 5.10.5. diff --git a/sysa.py b/sysa.py index 510a9a5..59a85a4 100755 --- a/sysa.py +++ b/sysa.py @@ -446,6 +446,9 @@ class SysA: self.get_file(["https://mirrors.kernel.org/gnu/tar/tar-1.34.tar.xz", "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-30820c.tar.gz"]) + # make 4.2.1 + self.get_file("https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz") + # gmp 6.2.1 self.get_file("https://mirrors.kernel.org/gnu/gmp/gmp-6.2.1.tar.xz") @@ -460,3 +463,7 @@ class SysA: # flex 2.5.33 self.get_file("http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.33.tar.gz") + + # bison 2.3 + self.get_file(["https://mirrors.kernel.org/gnu/bison/bison-2.3.tar.bz2", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b28236b.tar.gz"]) diff --git a/sysa/bison-2.3/bison-2.3.sh b/sysa/bison-2.3/bison-2.3.sh new file mode 100755 index 0000000..6d0c455 --- /dev/null +++ b/sysa/bison-2.3/bison-2.3.sh @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2021 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + default + + ../../import-gnulib.sh + + AUTOPOINT=true autoreconf-2.65 -fi + + # Remove pregenerated files + rm src/parse-gram.c src/parse-gram.h src/scan-skel.c src/scan-gram.c + + # Remove pregenerated .info + rm doc/bison.info +} + +src_configure() { + LEX=flex-2.5.33 ./configure \ + --prefix="${PREFIX}" \ + --program-suffix=-2.3 \ + --datarootdir="${PREFIX}/share/bison-2.3" +} + +src_compile() { + make MAKEINFO=true +} + +src_install() { + make MAKEINFO=true DESTDIR="${DESTDIR}" install +} diff --git a/sysa/bison-2.3/checksums b/sysa/bison-2.3/checksums new file mode 100644 index 0000000..d8384ce --- /dev/null +++ b/sysa/bison-2.3/checksums @@ -0,0 +1 @@ +1064ce45a402e6dcadf2a01e4aa55743ee45a7124ce4ba580d80e75f49af1ff8 /after/bin/bison-2.3 diff --git a/sysa/bison-2.3/import-gnulib.sh b/sysa/bison-2.3/import-gnulib.sh new file mode 100755 index 0000000..d535e5a --- /dev/null +++ b/sysa/bison-2.3/import-gnulib.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: 2021 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +set -e + +gnulib_modules=' +argmatch +dirname +error +exitfail +extensions +getopt +gettext +hard-locale +hash +malloc +mbswidth +obstack +quote +quotearg +stdbool +stdio-safer +strerror +strtoul +strverscmp +unistd-safer +unlocked-io +verify +xalloc +xalloc-die +xstrndup +' + +# Copy over needed files +for i in ${gnulib_modules}; do + for f in $(../gnulib-b28236b/gnulib-tool --extract-filelist "${i}") \ + lib/wcwidth.h; do + cp -pf "../gnulib-b28236b/${f}" "./${f}" + done +done + +# Generate the things +(echo '# This file is generated automatically by "bootstrap".' && + echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' && + ../gnulib-b28236b/gnulib-tool --extract-autoconf-snippet $gnulib_modules && + echo '])' +) > m4/gnulib.m4 + +(echo '# This file is generated automatically by "bootstrap".' && + ../gnulib-b28236b/gnulib-tool --extract-automake-snippet $gnulib_modules | + sed 's/^[ ]*AM_CPPFLAGS[ ]*+=/# (commented out by bootstrap) &/' +) > lib/gnulib.mk diff --git a/sysa/bison-2.3/patches/autover-mismatch.patch b/sysa/bison-2.3/patches/autover-mismatch.patch new file mode 100644 index 0000000..77ed96e --- /dev/null +++ b/sysa/bison-2.3/patches/autover-mismatch.patch @@ -0,0 +1,17 @@ +SPDX-FileCopyrightText: 2021 fosslinux + +SPDX-License-Identifier: GPL-2.0-or-later + +This macro does not exist in newer versions of autoconf and is unrequired. +There is no verion of autoconf supporting this project + gnulib + this macro. + +--- m4/po_gl.m4 2021-04-11 18:39:53.353069610 +1000 ++++ m4/po_gl.m4 2021-04-11 18:40:20.422242498 +1000 +@@ -24,7 +24,6 @@ + [ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +- AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Perform the following tests also if --disable-nls has been given, diff --git a/sysa/bison-2.3/patches/fopen-safer.patch b/sysa/bison-2.3/patches/fopen-safer.patch new file mode 100644 index 0000000..088eeeb --- /dev/null +++ b/sysa/bison-2.3/patches/fopen-safer.patch @@ -0,0 +1,18 @@ +SPDX-FileCopyrightText: 2021 fosslinux + +SPDX-License-Identifier: GPL-2.0-or-later + +fopen-safer.c for whatever reason does not exist when added by gnulib. + +--- lib/Makefile.am 2021-04-11 19:01:01.265993928 +1000 ++++ lib/Makefile.am 2021-04-11 19:01:40.413232722 +1000 +@@ -32,7 +32,8 @@ + lib_SOURCES = \ + get-errno.h get-errno.c \ + subpipe.h subpipe.c \ +- $(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources) ++ $(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources) \ ++ fopen-safer.c + + # Implementation of bitsets + bitsets_sources = \ diff --git a/sysa/bison-2.3/patches/gnulib-fix.patch b/sysa/bison-2.3/patches/gnulib-fix.patch new file mode 100644 index 0000000..b336fe0 --- /dev/null +++ b/sysa/bison-2.3/patches/gnulib-fix.patch @@ -0,0 +1,17 @@ +SPDX-FileCopyrightText: 2021 fosslinux + +SPDX-License-Identifier: GPL-2.0-or-later + +This should be declared for gnulib, but for some reason is not, most likely +use of a different version (but CVS history no longer exists). + +--- lib/Makefile.am 2021-04-11 13:49:09.414805465 +1000 ++++ lib/Makefile.am 2021-04-11 13:49:26.418916036 +1000 +@@ -19,6 +19,7 @@ + + BUILT_SOURCES = + EXTRA_DIST = ++EXTRA_lib_SOURCES = + MOSTLYCLEANFILES = + + lib_LIBRARIES = $(YACC_LIBRARY) diff --git a/sysa/bison-2.3/patches/our-bison.patch b/sysa/bison-2.3/patches/our-bison.patch new file mode 100644 index 0000000..b3bdc09 --- /dev/null +++ b/sysa/bison-2.3/patches/our-bison.patch @@ -0,0 +1,20 @@ +SPDX-FileCopyrightText: 2021 fosslinux + +SPDX-License-Identifier: GPL-2.0-or-later + +This doesn't actually make sense, you can't use the built bison to bootstrap +itself. Make it use our bison instead. + +--- src/Makefile.am 2021-04-10 21:37:11.570390316 +1000 ++++ src/Makefile.am 2021-04-10 21:38:01.805804332 +1000 +@@ -23,10 +23,6 @@ + + LDADD = ../lib/libbison.a $(LIBINTL) + +-# Use our own Bison to build the parser. Of course, you ought to +-# keep a sane version of Bison nearby... +-YACC = ../tests/bison -y +- + bin_PROGRAMS = bison + bin_SCRIPTS = $(YACC_SCRIPT) + EXTRA_SCRIPTS = yacc diff --git a/sysa/run2.sh b/sysa/run2.sh index 4b2a434..4965f78 100755 --- a/sysa/run2.sh +++ b/sysa/run2.sh @@ -36,6 +36,8 @@ build mpc-1.2.1 build flex-2.5.33 +build bison-2.3 + if [ "$FORCE_TIMESTAMPS" = True ] ; then echo 'Forcing all files timestamps to be 0 unix time.' canonicalise_all_files_timestamp