Remove the notion of "sys*"

- This idea originates from very early in the project and was, at the
  time, a very easy way to categorise things.
- Now, it doesn't really make much sense - it is fairly arbitary, often
  occuring when there is a change in kernel, but not from builder-hex0
  to fiwix, and sysb is in reality completely unnecessary.
- In short, the sys* stuff is a bit of a mess that makes the project
  more difficult to understand.
- This puts everything down into one folder and has a manifest file that
  is used to generate the build scripts on the fly rather than using
  coded scripts.
- This is created in the "seed" stage.

stage0-posix -- (calls) --> seed -- (generates) --> main steps

Alongside this change there are a variety of other smaller fixups to the
general structure of the live-bootstrap rootfs.

- Creating a rootfs has become much simpler and is defined as code in
  go.sh. The new structure, for an about-to-be booted system, is

/
-- /steps (direct copy of steps/)
-- /distfiles (direct copy of distfiles/)
-- all files from seed/*
-- all files from seed/stage0-posix/*

- There is no longer such a thing as /usr/include/musl, this didn't
  really make any sense, as musl is the final libc used. Rather, to
  separate musl and mes, we have /usr/include/mes, which is much easier
  to work with.
- This also makes mes easier to blow away later.
- A few things that weren't properly in packages have been changed;
  checksum-transcriber, simple-patch, kexec-fiwix have all been given
  fully qualified package names.
- Highly breaking change, scripts now exist in their package directory
  but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh,
  etc. This avoids manual definition of passes.
  - Ditto with patches; default directory is patches, but then any patch
    series specific to a pass are named patches-passX.
This commit is contained in:
fosslinux 2023-11-07 10:51:23 +11:00
parent 0907cfd073
commit 6ed2e09f3a
546 changed files with 700 additions and 1299 deletions

118
steps/SHA256SUMS.pkgs Normal file
View file

@ -0,0 +1,118 @@
2dac610769286171ca81e736d729f5227938596cf44a0a8a764009715c55d23b autoconf-2.52_0.tar.bz2
7345a49227ed69774e01097c514f1ebd3abaeed0b2b9136b7f5ee1b0fe573390 autoconf-2.53_0.tar.bz2
6acc512d0a0ea3a860f708893a157609b93947c257df25ae324230c5aeca405e autoconf-2.54_0.tar.bz2
234e67c19653777fed7779c0c88c7592ca21d916b3e08eb366f85ed0f3ad6a9a autoconf-2.55_0.tar.bz2
8881440a9d105ca313eaa2149e7eb89263284bd5cef7bbdd953da9ca79997879 autoconf-2.57_0.tar.bz2
35925617e155087cc34bd71bd609d49098dedf7c051cac5c231eac19852d247f autoconf-2.59_0.tar.bz2
8912ae2a24ea40a7cd3ccab5e97dd109db7be4a86f40458ac836568aa7437b6a autoconf-2.61_0.tar.bz2
d5fcce4baea5e11f983a7e4b7148545ab6720bb4e010898c73387f6711be67f4 autoconf-2.64_0.tar.bz2
298dcf17a439adb306237b308e3c4ed3d376cb863ae0f0f08bfdf1f3199a548b autoconf-2.69_0.tar.bz2
8c2401edf1c68910005bbcb8b8e84727a46f7d9643d2ad1267bd0259078dadc4 autoconf-2.71_0.tar.bz2
6ff691e3ddd4f3d1796d28b07a2a96691dbd9801844c99ccbe660da59dabd74b autoconf-archive-2021.02.19_0.tar.bz2
6a5cc1eb9ebc7e0ace8365e4c4aad5607ad1878ec9a90b384b55f8399cdbcb14 autogen-5.18.16_0.tar.bz2
02a426e82a52d4a2cd7e73fe3dc5a2c58b3ed100f24a92c57e42511fd86e247c automake-1.10.3_0.tar.bz2
34925adeaa2876a5e068adeb17b71fe7c7105244c3cb5439d33f7406310674da automake-1.11.2_0.tar.bz2
a7bd12bd0c639783ce1c0e9f640cf004a87460bbda8154bc550c5e6884457b48 automake-1.15.1_0.tar.bz2
57100612d902537b72ee2fd3dfecc903f2ea3959f1a480af87c6a1ef9a9d7c03 automake-1.16.3_0.tar.bz2
1c7e09ac08f156960420fca1f6e8560c1855bf01b001a0648b56153d6ceb9c28 automake-1.6.3_0.tar.bz2
444131776779d1f27628088a817bfb8c9aa85f4b036b934794a71e484ec9bd70 automake-1.6.3_1.tar.bz2
e8ff13753943e43972a8cf1672819f001718ed38e5497cf7b554c21a507ba22b automake-1.7.8_0.tar.bz2
ef08694bf8e78ffcf56f9c8a63b0f189e301c06f02ab240e15e4c7fe354c2a0d automake-1.7_0.tar.bz2
9922651b64ad2e29b944082f26db223008220155048f25d64df1f6d82071ff1c automake-1.8.5_0.tar.bz2
c5807850a377e4bb9aa4121d9781d145bdd80327626a9419630a75ce2c8d9c71 automake-1.9.6_0.tar.bz2
5078d40dbdf5910cf9e89853765342366c19d9f2638e103b8158facd5655b6f6 bash-5.2.15_0.tar.bz2
f6e0a6d1a10c399101d2178063918750d271dab4da3db56955acf77ce11b6ba4 bc-1.07.1_0.tar.bz2
7b8ea17311f22e987a39b814658c72b46201650c4dfbc707e8fd9eb42bf1ed28 binutils-2.30_0.tar.bz2
abc76e210e1cae4a02b56686ed555ef6e5167deccdb96c021718e93fdb420ec4 binutils-2.38_0.tar.bz2
d7aac3185d1b19193f535e2c5377e2e41be872d55a6ae9a3c3d14b488df88277 binutils-2.38_1.tar.bz2
f0bb18831983493b82fde53917e8d16c6a380761ac5e71e14769a82193fee788 bison-2.3_0.tar.bz2
df9539b52384757d927bca5a27b1b58325b6024b23b0470e557f135eb69bae30 bison-3.4.1_0.tar.bz2
fed9e13409f6378f97e8cef61e6faac992f3b767dfdac22f32453ff57cf29e7b bison-3.4.1_1.tar.bz2
44d143d9dcb4098138a8b8eee0e29de1c7e282b9582df153f75ae301336c0927 bison-3.4.1_2.tar.bz2
6d5e4debdec03aee096dbcefcad878fb5c6a069f895ee7ade878d9eeb97fb83e bison-3.4.2_0.tar.bz2
80e541fc4d3dfce4451318f26c31ccfe580848139672bd437131cdfd5e3664b2 bzip2-1.0.8_0.tar.bz2
c511d571d24675a141258e0e198c5ed1bcfd4889ddd736ff8e25c0d97b44e2cf ca-certificates-3.88.1_0.tar.bz2
acd3ba50a33ea0172c3ca59e341a48e4233be48ded26fa031fd2e9417a2dfb31 coreutils-5.0_0.tar.bz2
09092e187588c5d33c023ac41671b367aef9f7ee967d2c7c03430b33cc03f251 coreutils-6.10_0.tar.bz2
b19f9c44fa7711b93f62a6e7d7696219a819b7331c16662264acc43f7bd61251 coreutils-8.32_0.tar.bz2
d65348e9abcb961b6d060acb875b6ca3d75c14b1519426075d4644c6196b0ef2 curl-7.88.1_0.tar.bz2
93d5319fc83ea992f1db0fd163b4106b8bbb164475af40ce496244fed2a17422 curl-7.88.1_1.tar.bz2
0a11416b8d49f4fdf81e05ba81cc43fa3f33504f2c493935a3a7e9dbcb10a035 dhcpcd-10.0.1_0.tar.bz2
c4008ae6b168aee4120b0f3624a1875f9e413d8f0c637708b8b04a1fb5be173c diffutils-2.7_0.tar.bz2
bda6afcd3a390a34a57443269a4857ccc470129f7a557981778c145fd841cbd1 dist-3.5-236_0.tar.bz2
1219dc5ffb33251b3b8e5ee2d605f5a648acccbc593ad766004441e9904e350f e2fsprogs-1.45.7_0.tar.bz2
dd2bc9708213816b752ea40cd7ff4d5b89336be47b3c76b2aff683708f9dcbbc ed-1.4_0.tar.bz2
9a680b6aaabd7c301438579389c500cce72472af3d78d8ba8f88c99feb9cc721 file-5.44_0.tar.bz2
5984d3f2d5513dd04dc97619e2809d634fc7e3692f36f770e0202a61b6b2921d findutils-4.2.33_0.tar.bz2
41902ec0383ea977a8d008dee37150e022e0714cd99f54c37f29c153464b758a flex-2.5.11_0.tar.bz2
b3a8d59229289ca5a1de6a24c9c828d2847144f6662e0d5b7f41e7ff6e57abaa flex-2.5.33_0.tar.bz2
408131b1c033a5f8a6845997b049784be0b466cec107a71270e5a04dae2c1e6c flex-2.6.4_0.tar.bz2
5ff7fbe16b55563719b108260bd6a34ebabab0465d758ca98cba522932532e45 gawk-3.0.4_0.tar.bz2
6de1c1380026ef9948387e665610185b6014f47a80453177a6c81898c95cbbd3 gc-8.0.4_0.tar.bz2
374b54f568d7c67eb91f68a95b09322c9f6dc9c55cc6d49803ca3f5a8a3f6dbc gcc-10.4.0_0.tar.bz2
e2af44250ca4a29d505ddd7182db7f9c702d7dedcc0604d6f8ddac3872a0c057 gcc-13.1.0_0.tar.bz2
b09580c3972ff4e5f6e624bdc83d5328ce017422e0b92a7c170b51b6f04a47d2 gcc-4.0.4_0.tar.bz2
c16e9eaab6ac62df3a2a880f35c8da413be150fa00b66f992e37a1b411f32bcf gcc-4.0.4_1.tar.bz2
ed1eadc2b40eb3716801eaeaff0dbbc28c79101cf7880753d150bc8f2a4439c6 gcc-4.7.4_0.tar.bz2
dc67fc1b132fa3945349efe74c5b2197bd0b6babf4d29d2deddd04f09d9af680 gettext-0.21_0.tar.bz2
309282ba840f80b5e10897b1221f3ff3329b9e05b982c788d03652f411974524 gmp-6.2.1_0.tar.bz2
f5917ffad5dd282d5ea17e791b470455c328ea0ebc845ed5ec80937a8d0eb933 gperf-3.1_0.tar.bz2
67d706423e079a9cd764fd9607027d296c0ff2380c1104006a2230a299eb2c1d grep-2.4_0.tar.bz2
0939a34d58ff31e2c234f6f47f964633ceae4839de49ce368ad027c016850d58 grep-3.7_0.tar.bz2
d4c6b39136bbdb4a213a4229c5c460a6abefcda76285e4019d63e61382fbb8e8 guile-3.0.9_0.tar.bz2
8d2015b87337abbf287f7a39ee4cf53514120b5d3e90a93fe7d533dcc43f14fa help2man-1.36.4_0.tar.bz2
72a0f7b561b6ef5dd29f9ddb1f4fd61a60230e41c6f18967afa8af40bfdf5473 kbd-1.15_0.tar.bz2
fd35fc5e14e7cb3c018964c43bf24dec2b3575d8fea38da3a2ea93349806a33c kexec-linux-1.0.0_0.tar.bz2
ca33ded1a8769dca42d6a1f9c05395e8da856fd9eecbb747cccb57d20b84459c kexec-tools-2.0.22_0.tar.bz2
a3f47ec4d26387952b22791d4d7d6837b90d81515d0a5ffe2804cf492fb090e1 libarchive-3.5.2_0.tar.bz2
36550df491767bb24d2ccab304ce70a3b4956e7c0c0e0c343d922fd57cdafbdd libatomic_ops-7.6.10_0.tar.bz2
b39826742e236890f3562cdf19492e7ef4224b271f3e75ddeab1f07982b03ebe libffi-3.3_0.tar.bz2
daae709e98d2df2190d1d13b4e86f7f3fe90fa7a975282fe0bb03289b6539f29 libtool-2.2.4_0.tar.bz2
c1577cee0b82534699dc4385ecea9f521516303f773216d00bc30e4bf0053758 libtool-2.4.7_0.tar.bz2
503007bbcddcf4e49d26514c59b4c9501f8b42f0c994a59dfdc388b1ae6b7900 libunistring-0.9.10_0.tar.bz2
1d07aaf7049be45853fd409340cdb52bb3a1b6dfa4dbc8b69358c1ee966cd67f linux-4.9.10_0.tar.bz2
2fd5bec0c086cb89596f14894cbf078b3d1e990d297ba02b6cc4135e7d64996b linux-headers-5.10.41_0.tar.bz2
3864f2c66516fc4f5086f626f4da2b2a7635e21babca86ba478f866920868e2b m4-1.4.7_0.tar.bz2
cc203f338771ed1a99df17310bbe3e4885638d42141af8d0b3e8ed987e0fccca make-3.82_0.tar.bz2
6d24960d6a987f68a7e0e3abf6edb52d2e0fe4c86f6ba45327e9634dbf7d40b4 make-4.2.1_0.tar.bz2
17cd976bc0f6e897c6fffe43dd7c55d93ce0adadf1b4dc72925b80e2d266519f mpc-1.2.1_0.tar.bz2
98a9f55c01ed375fae21913284e7fa07ff434c0810f34d791f3fbaa1df221302 mpfr-4.1.0_0.tar.bz2
a724c91a43e282c3d338a977e4eeac3b970df241db7872f9d5cf27984b609814 musl-1.1.24_0.tar.bz2
2a03a3707593997a0e03ce3aa6b2ee647cf2e5bfe1deb028357a2dfab56e33e2 musl-1.1.24_1.tar.bz2
b79e0f8a39ba8880d43aa27551b72915655c62af39125e1f4ac8f8e69e71aaca musl-1.1.24_2.tar.bz2
81f79a0faf58e105c5f12d9f538d3ea7578a3b361e633ab8f47324ec23ec9de6 musl-1.2.4_0.tar.bz2
6dc5e763b747b66f72692c6820d7f46b7f4cf2e2fe05229a1d01c03919c1c936 musl-1.2.4_1.tar.bz2
538a65e8a55d476099f403ef4b3d13265022efb34d365124663f320262e04f3a musl-1.2.4_2.tar.bz2
97351f0df3d08ffdbe728a4b7fb36f91b1d83396be13ef6005ce62b9b62a9e07 openssl-1.1.1l_0.tar.bz2
61eedd6037ed342d069c48cf81792f9bd131ae2e9b937cd5c5e799f62d88c15c patch-2.7.6_0.tar.bz2
914a7abf36a64723b6e9f9b0b6ccd19c8e544fa798896a2bb1151dc341890c22 perl-5.000_0.tar.bz2
887d835562d471653bcda60e652fceb4b3ef58a83321a4eb5af0431dc182781b perl-5.003_0.tar.bz2
74d64a8af080022432fa94dba449090419d25b103d247710dc0b6102a4ad86a6 perl-5.10.1_0.tar.bz2
71ad3cadba5801cb19d4520825d4b3606713807b1eaa5eb3c49b3149bc2675ad perl-5.32.1_0.tar.bz2
9fa8850897248d77d554caa2b3d52e7890308cbf28750ffc24c09f498aee563c perl-5.6.2_0.tar.bz2
b86fc586d72a6d204d0b9017afe17aa2439529e13f43befc56648b78de17c8f8 perl5.004-05_0.tar.bz2
451ae6bb6e996a1c857fe92ec379654413fadec180c6477cf5fd4b5d7a079e26 perl5.005-03_0.tar.bz2
1b9d4260edf7b2241d10e4c4ad17d0f90047bd4bf42f2487a7133902529e9dfe pkg-config-0.29.2_0.tar.bz2
5c4d4ff26c44b92caf08350f0e24f97b343961c4fd73f511f6bcef6a5e645b3f python-2.0.1_0.tar.bz2
f0c7bb60faae8eaf6960dfaad43acc7e30d5487ae114e44ec3c184c946adbc6f python-2.0.1_1.tar.bz2
5163e798e204b0e4ea1ab5d513ad618e11fb6dd01414991f7c7408dc74d54400 python-2.3.7_0.tar.bz2
ce21de104f50a65012f42df46b53beaf1dc2d8c5bf8f09ad20f80f64a2eb4d68 python-2.3.7_1.tar.bz2
2788ab6ae1c411898de035aadfdbed9b77812c73d9c68a79813390d6f1e3f87f python-2.5.6_0.tar.bz2
eba41b855f378e004648b1b3453485d2d4401cd72cf7b993c1be06b7cebf71a2 python-3.1.5_0.tar.bz2
e10a0eceb1fcb9ca80dfcaf53bfa0d311adbaccdaf6846a6c5abfbea1e7db879 python-3.1.5_1.tar.bz2
bc87d4b8b0d2f26ed7d632c73ef9cd937bc9b6cb3bdcb57fdea78d29e38722bc python-3.11.1_0.tar.bz2
be89de80f75679c07e59f72b8d3ee4f14edcaa306dccd9d8a2c8adbb83245a43 python-3.3.7_0.tar.bz2
e4a6dd6ff78b4f46e17e2b867e1562e1fa3a6c75db890c136818382d31619b78 python-3.4.10_0.tar.bz2
1e0c73270bec02c323981d75ce4c731677672719ea34abf06ba145b56aae178e python-3.8.16_0.tar.bz2
6081832f1fc258df7dd927986821991b49fa78a71b76f4b37b5c34a8ebc9bc86 sed-4.0.9_0.tar.bz2
e58d8ec46c5b31175de9598bf0da214b88ccbd4cca7a787f3d048c44edaf3ceb sed-4.8_0.tar.bz2
912d8f344104f1322255d6210c7c7e1371413ab530b2c6796e6aa565c74bf647 tar-1.34_0.tar.bz2
a297b20252833d5c7b95ca343c85e84f9e5262e71beab9176ccf542833b75b4e tcc-0.9.27_0.tar.bz2
41a4b0fbf461dd26ecd31d77b300c979a4decae185c9e2d50c0470bc49d0b893 tcc-0.9.27_1.tar.bz2
cbfc578c709f677ec3e9792a8620e4e2a88d13d93969fd54aac93e4a29c2604d tcc-0.9.27_2.tar.bz2
2b503cd31d3326ac1ed0eb9f506ac93c93770da51164e152a812cd248961069c tcc-0.9.27_3.tar.bz2
50ebaa1d8fcc4a03a43d431eb71e2f435cc8712ae47d400564df3716037d553a texinfo-6.7_0.tar.bz2
a8e53f863b2ab7aa027ed5522702b451afd524b2c09d2f3d0daba1f460b26c91 util-linux-2.19.1_0.tar.bz2
5a1fdd2b42080f3b4808ceb1bf80a95873e614a25524545e6803b7d9f1fd5605 which-2.21_0.tar.bz2
17aa8a94450f3bb9fe6f2c6f59dde8aa6194f951bf3ab58249cb75ad472e864d xz-5.4.1_0.tar.bz2
ca8ec9876a7334f5f87e1159e0efe343b8b497ffb0dea8b548223035ecd67f9e zlib-1.2.13_0.tar.bz2

21
steps/autoconf-2.52/pass1.sh Executable file
View file

@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_compile() {
rm doc/standards.info doc/autoconf.info
cp autoconf.in autoconf
sed -i -e "s# @SHELL@#/bin/sh#" -e 's/@M4@/m4/' -e 's/@AWK@/awk/' \
-e 's/@PACKAGE_NAME@/Autoconf/' -e 's/@VERSION@/2.52/' \
-e "s#@datadir@#${PREFIX}/share/autoconf-2.52#" autoconf
chmod +x autoconf
m4 autoconf.m4 --freeze-state=autoconf.m4f
}
src_install() {
install -D autoconf "${DESTDIR}${PREFIX}/bin/autoconf-2.52"
mkdir -p "${DESTDIR}${PREFIX}/share/autoconf-2.52"
cp -r -- *.m4* "${DESTDIR}${PREFIX}/share/autoconf-2.52/"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.52.tar.bz2 4681bcbb9c9298c506f6405a7deb62c54fc3b339d3239a8f36a5df83daaec94f

39
steps/autoconf-2.53/pass1.sh Executable file
View file

@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2021-2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
rm -- Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
rm doc/standards.info doc/autoconf.info
# Do not use pregenerated manpages
sed -i '/SUBDIRS/s/ man//' Makefile.am
aclocal-1.6
cat config/m4.m4 >> aclocal.m4
autoconf-2.52
automake-1.6
# Not supported by autoconf-2.52
sed -i "s#@abs_top_builddir@#$PWD#" tests/wrappl.in
sed -i "s#@abs_top_srcdir@#$PWD#" tests/wrappl.in
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.53
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true DESTDIR="${DESTDIR}"
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1,42 @@
SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
SPDX-License-Identifier: GPL-3.0-or-later
Disable features unsupported by Autoconf 2.52
--- configure.ac Wed Mar 17 19:53:06 2021
+++ configure.ac.new Wed Mar 17 19:52:53 2021
@@ -19,8 +19,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-# We need AC_CONFIG_TESTDIR.
-AC_PREREQ([2.53])
+AC_PREREQ([2.52])
AC_INIT([GNU Autoconf], [2.53], [bug-autoconf@gnu.org])
AC_SUBST([PACKAGE_NAME])dnl
@@ -32,7 +31,6 @@
AM_INIT_AUTOMAKE
# Initialize the test suite and build position independent wrappers.
-AC_CONFIG_TESTDIR([tests])
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
AC_CONFIG_FILES([tests/autoconf:tests/wrapsh.in],
[chmod +x tests/autoconf])
@@ -85,16 +73,4 @@
bin/Makefile])
AC_OUTPUT
-# Report the state of this version of Autoconf if this is a beta.
-m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[a-z]],
-[ cat <<EOF
-
-You are about to use an experimental version of Autoconf. Be sure to
-read the relevant mailing lists, most importantly <autoconf@gnu.org>.
-
-Below you will find information on the status of this version of Autoconf.
-
-EOF
- sed -n '/^\* Status/,$p' $srcdir/BUGS
-])

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.53.tar.bz2 6b217a064c6d06603d50a3ad05129aef9435367810c10894210b8dad965d2306

41
steps/autoconf-2.54/pass1.sh Executable file
View file

@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: 2021-2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm bin/autoconf.in
rm -- Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
rm doc/standards.info doc/autoconf.info
# Do not use pregenerated manpages
sed -i '/SUBDIRS/s/ man//' Makefile.am
aclocal-1.7
sed -i 's/2.54/2.53/' aclocal.m4
cat config/m4.m4 >> aclocal.m4
autoconf-2.53
# Otherwise automake-1.7 fails to find autoconf
ln -s "${PREFIX}"/bin/autoconf-2.53 "${PREFIX}"/bin/autoconf
automake-1.7
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.54
}
src_compile() {
# Workaround for racy make dependencies
make -C bin autom4te
make -C lib
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.54.tar.bz2 a74aea954f36c7beeb6cc47b96a408c3e04e7ad635f614e65250dbcd8ec0bd28

35
steps/autoconf-2.55/pass1.sh Executable file
View file

@ -0,0 +1,35 @@
# SPDX-FileCopyrightText: 2021-2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm bin/autoconf.in
rm -- Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
rm doc/standards.info doc/autoconf.info
# Do not use pregenerated manpages
sed -i '/SUBDIRS/s/ man//' Makefile.am
AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 AUTOCONF=autoconf-2.54 autoreconf-2.54
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.55
}
src_compile() {
# Workaround for racy make dependencies
make -C bin autom4te
make -C lib
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.55.tar.bz2 f757158a04889b265203eecd8ca92568e2a67c3b9062fa6bff7a0a6efd2244ac

33
steps/autoconf-2.57/pass1.sh Executable file
View file

@ -0,0 +1,33 @@
# SPDX-FileCopyrightText: 2021-2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm bin/autoconf.in
rm doc/standards.info
# Do not use pregenerated manpages
sed -i '/SUBDIRS/s/ man//' Makefile.am
AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 AUTOCONF=autoconf-2.55 autoreconf-2.55 -f
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.57
}
src_compile() {
# Workaround for racy make dependencies
make -C bin autom4te
make -C lib
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.57.tar.bz2 e1035aa2c21fae2a934d1ab56c774ce9d22717881dab8a1a5b16d294fb793489

33
steps/autoconf-2.59/pass1.sh Executable file
View file

@ -0,0 +1,33 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm bin/autoconf.in
rm doc/standards.info
# Do not use pregenerated manpages
sed -i '/SUBDIRS/s/ man//' Makefile.am
AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 AUTOCONF=autoconf-2.57 autoreconf-2.57 -f
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.59
}
src_compile() {
# Workaround for racy make dependencies
make -C bin autom4te
make -C lib
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.59.tar.bz2 f0cde70a8f135098a6a3e85869f2e1cc3f141beea766fa3d6636e086cd8b90a7

27
steps/autoconf-2.61/pass1.sh Executable file
View file

@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm doc/standards.info man/*.1
sed -i -e '/AC_PROG_GREP/d' -e '/AC_PROG_SED/d' configure.ac
AUTOMAKE=automake-1.8 ACLOCAL=aclocal-1.8 AUTOM4TE=autom4te-2.59 AUTOCONF=autoconf-2.59 autoreconf-2.59 -f
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.61
}
src_compile() {
make -j1 MAKEINFO=true PREFIX="${PREFIX}"
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.61.tar.bz2 93a2ceab963618b021db153f0c881a2de82455c1dc7422be436fcd5c554085a1

26
steps/autoconf-2.64/pass1.sh Executable file
View file

@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm doc/standards.info man/*.1
AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 AUTOM4TE=autom4te-2.61 AUTOCONF=autoconf-2.61 autoreconf-2.61 -f
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.64
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.64.tar.bz2 872f4cadf12e7e7c8a2414e047fdff26b517c7f1a977d72433c124d0d3acaa85

26
steps/autoconf-2.69/pass1.sh Executable file
View file

@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm doc/standards.info man/*.1
AUTOMAKE=automake-1.11 ACLOCAL=aclocal-1.11 autoreconf-2.64 -f
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.69
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.gz 954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969

28
steps/autoconf-2.71/pass1.sh Executable file
View file

@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm doc/standards.info
autoreconf-2.69 -fi
# Install autoconf data files into versioned directory
sed -i '/^pkgdatadir/s:$:-@VERSION@:' Makefile.in
}
src_configure() {
./configure --prefix="${PREFIX}" --program-suffix=-2.71
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
ln -sf "${PREFIX}/bin/autoconf-2.71" "${DESTDIR}${PREFIX}/bin/autoconf"
ln -sf "${PREFIX}/bin/autoheader-2.71" "${DESTDIR}${PREFIX}/bin/autoheader"
ln -sf "${PREFIX}/bin/autom4te-2.71" "${DESTDIR}${PREFIX}/bin/autom4te"
ln -sf "${PREFIX}/bin/autoreconf-2.71" "${DESTDIR}${PREFIX}/bin/autoreconf"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/autoconf/autoconf-2.71.tar.xz f14c83cfebcc9427f2c3cea7258bd90df972d92eb26752da4ddad81c87a0faa4

View file

@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
}
src_configure() {
./configure --prefix="${PREFIX}"
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true DESTDIR="${DESTDIR}"
}
src_install() {
make MAKEINFO=true DESTDIR="${DESTDIR}" install
}

View file

@ -0,0 +1 @@
http://mirrors.kernel.org/gnu/autoconf-archive/autoconf-archive-2021.02.19.tar.xz e8a6eb9d28ddcba8ffef3fa211653239e9bf239aba6a01a6b7cfc7ceaec69cbd

68
steps/autogen-5.18.16/pass1.sh Executable file
View file

@ -0,0 +1,68 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
noextract="autogen-5.18.16.tar.xz"
src_prepare() {
mkdir build
mv ../autogen-5.18.16 build/src
mv ../autogen-5.18.16.tar.xz build/
rm -f build/src/add-on/char-mapper/cm.tar
}
src_compile() {
(
set -e
declare -x PKG_CONFIG_PATH="${LIBDIR}/pkgconfig"
sed -i "s/make install/make install DESTDIR=\${DESTDIR}/" bootstrap_tarball.sh
sed -i "/make check/d" bootstrap_tarball.sh
declare -x FINALPREFIX="${PREFIX}"
declare -x GUILE_STATIC="--static"
declare -x GNULIBDIR="${PWD}"/../gnulib-8f4538a5
declare -x MAN_PAGE_DATE=1970-01-01
SKIP_MAIN=1 . ./bootstrap_tarball.sh
prepare_tarball
bootstrap_columns
bootstrap_getdefs
bootstrap_autogen
bootstrap_tpl_config
# Build stage2 autogen (stage1 autogen is not easy to install into /usr)
rm -R build/tarball
cp -ar build/autogen-5.18.16 build/tarball
cd build/tarball
# These files does not respect MAN_PAGE_DATE
sed -i "s/+%Y/+1970/; s/%m/01/; s/%d'/01'/; s/%Y/2018/" autoopts/aoconf.tpl
sed -i 's/%Y/2018/' autoopts/options_h.tpl
SOURCE_DIR="$PWD" ./config/bootstrap
# Specify timeout to avoid non-reproducibility
CPPFLAGS=-D_LARGEFILE64_SOURCE=1 ./configure \
--prefix="${FINALPREFIX}" \
--libdir="${FINALPREFIX}/lib/i386-unknown-linux-musl" \
--disable-shared \
--enable-timeout=15
touch doc/agdoc.texi # build later
make -j1 CFLAGS=-Wno-error
# Fix non-reproducible man-page
awk '{gsub("\\(/tmp/.*", "", $7); print}' agen5/autogen.1 > autogen.1
mv autogen.1 agen5/autogen.1
cd ../..
)
}
src_install() {
cd build/tarball
make DESTDIR="${DESTDIR}" install MAN_PAGE_DATE=1970-01-01
# Some reproducibility issues and generally not useful for bootstrapping
rm "${DESTDIR}${PREFIX}/share/autogen/libopts-"*.tar.gz
cd ../..
}

View file

@ -0,0 +1,4 @@
https://github.com/schierlm/gnu-autogen-bootstrapping/archive/refs/tags/autogen-5.18.16-v1.0.tar.gz 98ff63400dff5282017c33e4ec3c93da8a92a5260340da253e59bd6eef18d116
https://mirrors.kernel.org/gnu/autogen/rel5.18.16/autogen-5.18.16.tar.xz f8a13466b48faa3ba99fe17a069e71c9ab006d9b1cfabe699f8c60a47d5bb49a
https://git.savannah.gnu.org/cgit/autogen.git/snapshot/autogen-5.18.16.tar.gz 0c04ab2f7ce13c4a1c06c4abc7dfe75312aad89b8b0a1068e5e563787eb56632
http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-8f4538a5.tar.gz e207c0bb72093c3a72dde302fcfaa1dbda12a62172d47b73565883a92209ebab

28
steps/automake-1.10.3/pass1.sh Executable file
View file

@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
rm doc/amhello-1.0.tar.gz doc/automake.info*
awk '/SUBDIRS/{sub("doc ", "", $0)} {print}' Makefile.am > Makefile.am.tmp
mv Makefile.am.tmp Makefile.am
AUTOM4TE=autom4te-2.61 AUTOCONF=autoconf-2.61 AUTOHEADER=autoheader-2.61 AUTORECONF=autoreconf-2.61 ./bootstrap
}
src_configure() {
AUTORECONF=autoreconf-2.61 AUTOHEADER=autoheader-2.61 AUTOCONF=autoconf-2.61 AUTOM4TE=autom4te-2.61 ./configure CC=tcc --prefix="${PREFIX}"
}
src_compile() {
AUTOM4TE=autom4te-2.61 make "${MAKEJOBS}" MAKEINFO=true CC=tcc
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
rm "${DESTDIR}/usr/bin/automake" "${DESTDIR}/usr/bin/aclocal"
}

View file

@ -0,0 +1,16 @@
SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
SPDX-License-Identifier: GPL-2.0-or-later
Fixes aclocal-1.10 to work with our Perl
--- aclocal.in 2021-03-25 19:18:10.489134059 +0000
+++ aclocal.in 2021-03-25 19:18:20.159389339 +0000
@@ -45,6 +45,7 @@
use Automake::FileUtils;
use File::Basename;
use File::stat;
+use File::Glob;
use Cwd;
# Some globals.

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.10.3.tar.bz2 e98ab43bb839c31696a4202e5b6ff388b391659ef2387cf9365019fad17e1adc

29
steps/automake-1.11.2/pass1.sh Executable file
View file

@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
rm -f doc/amhello-1.0.tar.gz doc/automake.info* doc/aclocal-1.11.1 doc/automake-1.11.1
# Building doc often causes race conditions, skip it
awk '/SUBDIRS/{sub("doc ", "", $0)} {print}' Makefile.am > Makefile.am.tmp
mv Makefile.am.tmp Makefile.am
AUTOCONF=autoconf-2.64 AUTOM4TE=autom4te-2.64 ./bootstrap
}
src_configure() {
AUTORECONF=autoreconf-2.64 AUTOM4TE=autom4te-2.64 AUTOHEADER=autoheader-2.64 AUTOCONF=autoconf-2.64 ./configure --prefix="${PREFIX}"
}
src_compile() {
AUTORECONF=autoreconf-2.64 AUTOM4TE=autom4te-2.64 AUTOHEADER=autoheader-2.64 AUTOCONF=autoconf-2.64 make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
rm "${DESTDIR}/usr/bin/automake"
}

View file

@ -0,0 +1,16 @@
SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
SPDX-License-Identifier: GPL-2.0-or-later
Fixes aclocal-1.10 to work with our Perl
--- aclocal.in 2021-03-25 19:18:10.489134059 +0000
+++ aclocal.in 2021-03-25 19:18:20.159389339 +0000
@@ -44,6 +44,7 @@
use Automake::FileUtils;
use File::Basename;
use File::stat;
+use File::Glob;
use Cwd;
# Some globals.

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.11.2.tar.bz2 4f46d1f9380c8a3506280750f630e9fc915cb1a435b724be56b499d016368718

31
steps/automake-1.15.1/pass1.sh Executable file
View file

@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
rm doc/amhello-1.0.tar.gz
# Building doc often causes race conditions, skip it
sed -i '/doc\/Makefile.inc/d' Makefile.am
sed -i '/t\/Makefile.inc/d' Makefile.am
AUTOCONF=autoconf-2.69 AUTOM4TE=autom4te-2.69 ./bootstrap
rm doc/automake-history.info doc/automake.info*
}
src_configure() {
AUTORECONF=autoreconf-2.69 AUTOM4TE=autom4te-2.69 AUTOHEADER=autoheader-2.69 AUTOCONF=autoconf-2.69 ./configure --prefix="${PREFIX}"
}
src_compile() {
AUTORECONF=autoreconf-2.69 AUTOM4TE=autom4te-2.69 AUTOHEADER=autoheader-2.69 AUTOCONF=autoconf-2.69 make -j1 MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
rm "${DESTDIR}/usr/bin/automake" "${DESTDIR}/usr/bin/aclocal"
}

View file

@ -0,0 +1,16 @@
SPDX-FileCopyrightText: © 2021 Andrius Štikonas <andrius@stikonas.eu>
SPDX-License-Identifier: GPL-2.0-or-later
Fixes aclocal to work with our Perl
--- bin/aclocal.in 2021-03-31 18:19:50.665806225 +0100
+++ bin/aclocal.in 2021-03-31 18:20:02.836132739 +0100
@@ -42,6 +42,7 @@
use Automake::XFile;
use Automake::FileUtils;
use File::Basename;
+use File::Glob;
use File::Path ();
# Some globals.

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
SPDX-License-Identifier: GPL-2.0-or-later
Fixes dependency of bootstrapping script
--- gen-testsuite-part 2017-06-16 21:46:16.000000000 +0100
+++ gen-testsuite-part 2021-04-01 00:02:46.801098617 +0100
@@ -64,8 +64,6 @@
$func->($fh);
close $fh
or die "$me: closing '$tmpfile': $!\n";
- chmod ($perms & ~umask, $tmpfile)
- or die "$me: cannot change perms for '$tmpfile': $!\n";
rename ($tmpfile, $outfile)
or die "$me: renaming '$tmpfile' -> '$outfile: $!\n'";
}

View file

@ -0,0 +1,35 @@
SPDX-FileCopyrightText: © 2023 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
Fixes configure script to work with older bash
--- configure.ac.bak 2023-03-08 14:34:57.009268432 +1100
+++ configure.ac 2023-03-08 14:35:27.947964581 +1100
@@ -272,14 +272,6 @@
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
- [supports \${@%:@var}],
- [zero='' one='x' twelve=' foobar baz!' \
- && test ${@%:@zero} -eq 0 \
- && test ${@%:@one} -eq 1 \
- && test ${@%:@twelve} -eq 12],
- [], [am_score=1; break])
-
- _AM_CHECK_SHELL_FEATURE([$1],
[supports \${var@%:@glob} and \${var%glob}],
[v=a/b/c \
&& test ${v@%:@*/} = b/c \
@@ -313,11 +305,6 @@
echo 'alias false=echo' > conftest-alias.sh
echo 'false && test "$(false 97)" = 97' >> conftest-alias.sh
- _AM_CHECK_SHELL_FEATURE([$1],
- [supports alias named like shell builtins],
- [. ./conftest-alias.sh],
- [rm -f conftest-alias.sh],
- [rm -f conftest-alias.sh; am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
[supports "test -e"],

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.15.1.tar.gz 988e32527abe052307d21c8ca000aa238b914df363a617e38f4fb89f5abf6260

23
steps/automake-1.16.3/pass1.sh Executable file
View file

@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 AUTOCONF=autoconf-2.69 AUTOM4TE=autom4te-2.69 ./bootstrap
rm doc/automake-history.info doc/automake.info*
cp "${PREFIX}/bin/help2man" doc/
}
src_configure() {
AUTOCONF=autoconf-2.69 ./configure --prefix="${PREFIX}"
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.16.3.tar.xz ff2bf7656c4d1c6fdda3b8bebb21f09153a736bcba169aaf65eab25fa113bf3a

27
steps/automake-1.6.3/pass1.sh Executable file
View file

@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
cp aclocal.in aclocal
cp m4/amversion.in m4/amversion.m4
}
src_compile() {
sed -i -e 's/@VERSION@/1.6.3/' -e 's/@APIVERSION@/1.6/' m4/amversion.m4
sed -i -e "s#@PERL@#${PREFIX}/bin/perl#" -e 's/@PACKAGE@/automake/' \
-e 's/@APIVERSION@/1.6/' -e 's/@VERSION@/1.6.3/' \
-e "s#@prefix@#${PREFIX}#" -e "s#@datadir@#${PREFIX}/share#" aclocal
}
src_install() {
mkdir -p "${DESTDIR}${PREFIX}"/share/automake-1.6/Automake
cp lib/Automake/*.pm "${DESTDIR}${PREFIX}"/share/automake-1.6/Automake/
install -D aclocal "${DESTDIR}${PREFIX}"/bin/aclocal-1.6
mkdir -p "${DESTDIR}${PREFIX}"/share/aclocal-1.6
cp -r m4/*.m4 "${DESTDIR}${PREFIX}"/share/aclocal-1.6/
}

34
steps/automake-1.6.3/pass2.sh Executable file
View file

@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
sed -i '/Makefile/d' configure.in
rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
aclocal-1.6
autoconf-2.52
}
src_configure() {
./configure --prefix="${PREFIX}"
}
src_compile() {
cp m4/amversion.in m4/amversion.m4
sed -i 's/@VERSION@/1.6.3/' m4/amversion.m4
sed -i 's/@APIVERSION@/1.6/' m4/amversion.m4
}
src_install() {
install -D automake "${DESTDIR}${PREFIX}"/bin/automake-1.6
mkdir -p "${DESTDIR}${PREFIX}"/share/automake-1.6/am
mkdir -p "${DESTDIR}${PREFIX}"/share/automake-1.6/Automake
cp lib/Automake/*.pm "${DESTDIR}${PREFIX}"/share/automake-1.6/Automake/
cp -r lib/am/*.am "${DESTDIR}${PREFIX}"/share/automake-1.6/am/
install -D aclocal "${DESTDIR}${PREFIX}"/bin/aclocal-1.6
mkdir -p "${DESTDIR}${PREFIX}"/share/aclocal-1.6/
cp -r m4/*.m4 "${DESTDIR}${PREFIX}"/share/aclocal-1.6/
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.6.3.tar.bz2 0dbafacaf21e135cab35d357a14bdcd981d2f2d00e1387801be8091a31b7bb81

22
steps/automake-1.7.8/pass1.sh Executable file
View file

@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 AUTOCONF=autoconf-2.55 autoreconf-2.55
}
src_configure() {
AUTOCONF=autoconf-2.55 ./configure --prefix="${PREFIX}"
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
rm "${DESTDIR}/usr/bin/automake" "${DESTDIR}/usr/bin/aclocal"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.7.8.tar.bz2 2dddc3b51506e702647ccc6757e15c05323fa67245d2d53e81ed36a832f9be42

24
steps/automake-1.7/pass1.sh Executable file
View file

@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
sed -i -e 's/2.54/2.53/' -e '/AC_PROG_EGREP/d' -e '/AC_PROG_FGREP/d' configure.in
aclocal-1.6
autoconf-2.53
automake-1.6
}
src_configure() {
./configure --prefix="${PREFIX}"
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
rm "${DESTDIR}/usr/bin/automake" "${DESTDIR}/usr/bin/aclocal"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.7.tar.bz2 6633ee1202375e3c8798a92e1b7f46894f78d541aeea7f49654503fdc0b28835

22
steps/automake-1.8.5/pass1.sh Executable file
View file

@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm doc/automake.info*
AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 AUTOCONF=autoconf-2.59 autoreconf-2.59 -f
}
src_configure() {
AUTOCONF=autoconf-2.59 ./configure --prefix="${PREFIX}"
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
rm "${DESTDIR}/usr/bin/automake" "${DESTDIR}/usr/bin/aclocal"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.8.5.tar.bz2 84c93aaa3c3651a9e7474b721b0e6788318592509e7de604bafe4ea8049dc410

23
steps/automake-1.9.6/pass1.sh Executable file
View file

@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
rm doc/automake.info*
sed -i 's/1.8a/1.8.5/; s/ filename-length-max=99//' configure.ac
AUTOMAKE=automake-1.8 ACLOCAL=aclocal-1.8 AUTOM4TE=autom4te-2.61 AUTOCONF=autoconf-2.61 autoreconf-2.61 -f
}
src_configure() {
AUTOCONF=autoconf-2.61 ./configure --prefix="${PREFIX}"
}
src_compile() {
make "${MAKEJOBS}" MAKEINFO=true
}
src_install() {
make install MAKEINFO=true DESTDIR="${DESTDIR}"
rm "${DESTDIR}/usr/bin/automake" "${DESTDIR}/usr/bin/aclocal"
}

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/automake/automake-1.9.6.tar.bz2 8eccaa98e1863d10e4a5f861d8e2ec349a23e88cb12ad10f6b6f79022ad2bb8d

View file

@ -0,0 +1 @@
79d7f5e9f4f735575a6a163023150017587a97c5f911d81fc91380cea8bb4362 /usr/bin/bash

View file

@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
.SUFFIXES = .def
include ../common.mk
CFLAGS = \
-I. \
-I.. \
-I../include \
-I../lib \
$(COMMON_CFLAGS)
BUILTINS_DEFS = $(addsuffix .def, $(BUILTINS_DEF_FILES))
BUILTINS_DEF_OBJS = $(addsuffix .o, $(BUILTINS_DEF_FILES))
BUILTINS_STATIC_FILES = common evalstring evalfile getopt bashgetopt
BUILTINS_STATIC_OBJS = $(addsuffix .o, $(BUILTINS_STATIC_FILES))
BUILTINS_OBJS = $(BUILTINS_DEF_OBJS) $(BUILTINS_STATIC_OBJS)
%.o: %.def
../mkbuiltins $<
$(CC) -c $(CFLAGS) -o $@ $*.c
libbuiltins.a: $(BUILTINS_OBJS) builtins.o
$(AR) cr $@ $^

View file

@ -0,0 +1,59 @@
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
CC = tcc
LD = tcc
AR = tcc -ar
COMMON_CFLAGS = \
-DHAVE_DIRENT_H \
-DSTRUCT_DIRENT_HAS_D_INO \
-DHAVE_STDINT_H \
-DHAVE_LIMITS_H \
-DHAVE_STRING_H \
-DHAVE_INTTYPES_H \
-DRETSIGTYPE=void \
-DHUGE_VAL=10000000000.0 \
-DTERMIO_TTY_DRIVER \
-DPREFER_STDARG \
-DHAVE_DECL_STRTOL \
-DHAVE_DECL_STRTOLL \
-DHAVE_DECL_STRTOUL \
-DHAVE_DECL_STRTOULL \
-DHAVE_TZNAME \
-DPIPESIZE=4096 \
-DDEFAULT_PATH_VALUE=\"$(prefix)/bin\" \
-DSTANDARD_UTILS_PATH=\"$(prefix)/bin\" \
-DPPROMPT=\"$ \" \
-DSPROMPT=\"$ \" \
-DCONF_MACHTYPE=\"bootstrap\" \
-DGETGROUPS_T=int \
-DCOND_COMMAND \
-DCONF_HOSTTYPE=\"i386\" \
-DCONF_OSTYPE=\"linux\" \
-DDEFAULT_MAIL_DIRECTORY=\"/fake-mail\" \
-DVOID_SIGHANDLER \
-DDISTVERSION=\"2.05b\" \
-DBUILDVERSION=\"0\" \
-DSCCSVERSION=\"2.05b\" \
-DLC_ALL=\"C\" \
-DHAVE_STRERROR \
-DHAVE_MEMSET \
-DHAVE_DUP2 \
-DHAVE_STRTOUL \
-DHAVE_STRTOULL \
-DHAVE_STRCHR \
-DHAVE_BCOPY \
-DHAVE_BZERO \
-DHAVE_POSIX_SIGNALS \
-DHAVE_GETCWD \
-DHAVE_SYS_SIGLIST \
-Dendpwent\(x\)=0 \
-Denable_hostname_completion\(on_or_off\)=0
BUILTINS_DEF_FILES = alias bind break builtin cd colon command complete declare \
echo enable eval exec exit fc fg_bg hash history jobs kill let read return \
set setattr shift source suspend test times trap type ulimit umask wait \
getopts pushd shopt printf

View file

@ -0,0 +1,92 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
include common.mk
CFLAGS = \
-I. \
-Iinclude \
-Ilib \
-Ilib/sh \
-Ibuiltins \
$(COMMON_CFLAGS)
LDFLAGS = -L. -Lbuiltins -static
LIBRARIES = libsh.a builtins/libbuiltins.a libglob.a libtilde.a
SHLIB_FILES = clktck getcwd getenv oslib setlinebuf strcasecmp strerror strtod \
vprint itos rename zread zwrite shtty inet_aton netopen \
strpbrk timeval clock makepath pathcanon pathphys stringlist stringvec \
tmpfile spell strtrans strindex shquote snprintf mailstat fmtulong \
fmtullong strtoll strtoull strtoimax strtoumax fmtumax netconn mktime \
strftime xstrchr zcatfd
# FIXME: for some reason these don't get picked up correctly in the
# final linking cmd
SHLIB_ODD_FILES = zcatfd strtoumax spell pathphys
SHLIB_OBJS = $(addprefix lib/sh/, $(addsuffix .o, $(SHLIB_FILES)))
SHLIB_ODD_OBJS = $(addprefix lib/sh/, $(addsuffix .o, $(SHLIB_ODD_FILES)))
MKBUILTINS_OBJS = builtins/mkbuiltins.o
BUILTINS_DEFS = $(addprefix builtins/, $(addsuffix .def, $(BUILTINS_DEF_FILES)))
GLOB_FILES = glob strmatch smatch xmbsrtowcs
GLOB_OBJS = $(addprefix lib/glob/, $(addsuffix .o, $(GLOB_FILES)))
TILDE_OBJS = lib/tilde/tilde.o
MKSYNTAX_OBJS = mksyntax.o
MKSIGNAMES_OBJS = support/mksignames.o
FILES = shell eval y.tab general make_cmd print_cmd dispose_cmd execute_cmd \
variables copy_cmd error expr flags nojobs subst hashcmd hashlib mailcheck \
trap input unwind_prot pathexp sig test version alias array arrayfunc \
braces bracecomp bashhist bashline list stringlib locale findcmd redir \
pcomplete pcomplib syntax xmalloc siglist
OBJS = $(addsuffix .o, $(FILES))
all: bash
# Builtins
mkbuiltins: $(MKBUILTINS_OBJS)
$(CC) $(CFLAGS) $(MKBUILTINS_OBJS) $(LDFLAGS) -o $@
./mkbuiltins -externfile builtins/builtext.h -structfile builtins/builtins.c -noproduction $(BUILTINS_DEFS)
# libsh
libsh.a: $(SHLIB_OBJS)
$(AR) cr $@ $^
# libglob
libglob.a: $(GLOB_OBJS)
$(AR) cr $@ $^
# libtilde
libtilde.a: $(TILDE_OBJS)
$(AR) cr $@ $^
# The actual program
mksyntax: $(MKSYNTAX_OBJS)
$(CC) $^ $(LDFLAGS) -o $@ -lgetopt
syntax.c: mksyntax
./mksyntax -o $@
mksignames: $(MKSIGNAMES_OBJS)
$(CC) $^ $(LDFLAGS) -o $@ -lgetopt
signames.h: mksignames
./mksignames $@
y.tab.c: parse.y
yacc -d $^
trap.c: signames.h
bash: libsh.a libglob.a libtilde.a $(OBJS)
$(CC) -o bash $(LIBRARIES) $(OBJS) $(SHLIB_ODD_OBJS) $(LDFLAGS) -lsh -lbuiltins -lglob -ltilde

65
steps/bash-2.05b/pass1.kaem Executable file
View file

@ -0,0 +1,65 @@
#!/bin/sh
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -ex
# Check tarball checksums
checksum-transcriber sources
sha256sum -c sources.SHA256SUM
mkdir build src
cd build
# Extract
cp ${DISTFILES}/${pkg}.tar.gz ../src/
gzip -d -f ../src/${pkg}.tar.gz
tar xf ../src/${pkg}.tar
rm -r ../src/
cd ${pkg}
cp ../../mk/main.mk Makefile
cp ../../mk/builtins.mk builtins/Makefile
cp ../../mk/common.mk common.mk
# Create various .h files
touch config.h
touch include/version.h
touch include/pipesize.h
rm y.tab.c y.tab.h
# Patch
patch -Np0 -i ../../patches/mes-libc.patch
patch -Np0 -i ../../patches/tinycc.patch
patch -Np0 -i ../../patches/missing-defines.patch
patch -Np0 -i ../../patches/locale.patch
patch -Np0 -i ../../patches/dev-tty.patch
# Compile
make mkbuiltins
cd builtins
make libbuiltins.a
cd ..
make
# Install
install bash ${PREFIX}/bin/
mkdir /bin/
ln -s ${PREFIX}/bin/bash /bin/bash
ln -s ${PREFIX}/bin/bash /bin/sh
ln -s ${PREFIX}/bin/bash ${PREFIX}/bin/sh
cd ../..
# Checksums
if match x${UPDATE_CHECKSUMS} xTrue; then
sha256sum -o ${pkg}.checksums \
/usr/bin/bash
install ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.checksums
fi

53
steps/bash-2.05b/pass2.sh Executable file
View file

@ -0,0 +1,53 @@
# SPDX-FileCopyrightText: © 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
# Remove bison generated files
rm y.tab.c y.tab.h
# Skip documentation
mv doc/Makefile.in Makefile.in.doc
rm doc/*
mv Makefile.in.doc doc/Makefile.in
# Rebuild configure script
rm configure
autoconf-2.69
# avoid non-deterministic build:
printf '%s\n%s\n' \
'#!/bin/sh' \
'echo "#define PIPESIZE 65536"' >builtins/psize.sh
}
src_configure() {
# --build argument needed for reproducibility
# bash_cv_dev_stdin and bash_cv_dev_fd are also used to
# improve reproducibility because they make configure
# skip checking for /dev/{fd,stdin,stdout,stderr} (build
# output is affected by their availability otherwise).
# size is part of binutils and is not yet available.
CC=tcc LD=tcc AR="tcc -ar" SIZE=true ./configure --prefix="${PREFIX}" \
--without-bash-malloc \
--disable-nls \
--build=i386-linux-gnu \
--enable-static-link \
bash_cv_dev_stdin=absent \
bash_cv_dev_fd=whacky
}
src_compile() {
make -j1
}
src_install() {
install -D bash "${DESTDIR}${PREFIX}/bin/bash"
# Work around weird symlink bug
install bash "${DESTDIR}${PREFIX}/bin/sh"
# Needs special handling b/c is currently running - tar doesn't like this
rm -f "${PREFIX}/bin/bash" "${PREFIX}/bin/sh"
}

View file

@ -0,0 +1,19 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
We do not have /dev at this stage of the bootstrap, including /dev/tty. For
some reason, bash has a fixation on /dev/tty, even though we are not
interactive. Removing this check entirely fixes this issue.
diff --color -ru shell.c
--- shell.c 2002-07-02 01:27:11.000000000 +1000
+++ shell.c 2021-01-16 11:23:36.407287955 +1100
@@ -342,8 +342,6 @@
# endif
#endif
- check_dev_tty ();
-
#ifdef __CYGWIN__
_cygwin32_check_tmp ();

View file

@ -0,0 +1,18 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
tinycc's extern support is bad. i.e. these externs don't propagate through.
--- builtins/common.c 2021-01-15 21:32:56.938683418 +1100
+++ builtins/common.c 2021-01-15 21:34:09.102153806 +1100
@@ -46,6 +46,9 @@
#include "../flags.h"
#include "../jobs.h"
#include "../builtins.h"
+int num_shell_builtins;
+struct builtin *shell_builtins;
+struct builtin *current_builtin;
#include "../input.h"
#include "../execute_cmd.h"
#include "../trap.h"

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
mes libc + setting locale = not worky.
--- locale.c 2021-01-15 09:38:55.729307629 +1100
+++ locale.c 2021-01-15 11:19:01.929391346 +1100
@@ -190,7 +190,7 @@
set_lang (var, value)
char *var, *value;
{
- return ((lc_all == 0 || *lc_all == 0) ? setlocale (LC_ALL, value?value:"") != NULL : 0);
+ return 0;
}
/* Get the value of one of the locale variables (LC_MESSAGES, LC_CTYPE) */

View file

@ -0,0 +1,19 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
mes libc does not have locale support...
diff --git lib/sh/snprintf.c lib/sh/snprintf.c
index 7669576..747aeba 100644
--- lib/sh/snprintf.c
+++ lib/sh/snprintf.c
@@ -376,7 +376,7 @@ static void xfree __P((void *));
if ((p)->flags & PF_STAR_P) \
(p)->precision = GETARG (int)
-#if defined (HAVE_LOCALE_H)
+#if 0
# define GETLOCALEDATA(d, t, g) \
do \
{ \

View file

@ -0,0 +1,29 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
We don't actually want any of these things, which should really be hidden
behind the ifdefs given here to disable them when they are not being
used (as we do).
--- execute_cmd.c 2021-01-15 09:38:55.730307635 +1100
+++ execute_cmd.c 2021-01-15 09:43:41.046896754 +1100
@@ -286,12 +286,18 @@
{
if (currently_executing_command->type == cm_simple)
return currently_executing_command->value.Simple->line;
+#ifdef COND_COMMAND
else if (currently_executing_command->type == cm_cond)
return currently_executing_command->value.Cond->line;
+#endif
+#ifdef DPAREN_ARITHMETIC
else if (currently_executing_command->type == cm_arith)
return currently_executing_command->value.Arith->line;
+#endif
+#ifdef ARITH_FOR_COMMAND
else if (currently_executing_command->type == cm_arith_for)
return currently_executing_command->value.ArithFor->line;
+#endif
else
return line_number;
}

View file

@ -0,0 +1,24 @@
SPDX-FileCopyrightText: © 2023 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
We don't yet have the size command.
--- Makefile.in 2023-03-11 15:41:13.297307977 +1100
+++ Makefile.in 2023-03-11 15:43:51.677298993 +1100
@@ -471,7 +471,6 @@
$(RM) $@
$(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS)
ls -l $(Program)
- size $(Program)
.build: $(SOURCES) config.h Makefile version.h $(VERSPROG)
@echo
@@ -493,7 +492,6 @@
strip: $(Program) .made
strip $(Program)
ls -l $(Program)
- size $(Program)
lint:
${MAKE} ${MFLAGS} CFLAGS='${GCC_LINT_FLAGS}' .made

View file

@ -0,0 +1,30 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
int name, namelen; is wrong for mes libc, it is char* name, so we modify tinycc
to reflect this.
diff --git lib/sh/oslib.c lib/sh/oslib.c
index 90d7be9..37fdf2a 100644
--- lib/sh/oslib.c
+++ lib/sh/oslib.c
@@ -192,8 +192,7 @@ bzero (s, n)
# include <sys/utsname.h>
int
gethostname (name, namelen)
- char *name;
- int namelen;
+ char *name; int namelen;
{
int i;
struct utsname ut;
@@ -209,7 +208,7 @@ gethostname (name, namelen)
# else /* !HAVE_UNAME */
int
gethostname (name, namelen)
- int name, namelen;
+ char* name; int namelen;
{
strncpy (name, "unknown", namelen);
name[namelen] = '\0';

1
steps/bash-2.05b/sources Normal file
View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/bash/bash-2.05b.tar.gz ba03d412998cc54bd0b0f2d6c32100967d3137098affdc2d32e6e7c11b163fe4

61
steps/bash-5.2.15/pass1.sh Executable file
View file

@ -0,0 +1,61 @@
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Bastian Bittorf <bb@npl.de>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
# Remove bison generated files
rm y.tab.c y.tab.h
# Remove prebuilt translation catalogs
rm po/*.gmo
# Skip documentation
mv doc/Makefile.in Makefile.in.doc
rm doc/*
mv Makefile.in.doc doc/Makefile.in
# Erroneously included file (configure checks do not work)
rm lib/sh/strtoimax.c
touch lib/sh/strtoimax.c
# Rebuild configure script
rm configure
autoconf-2.69
# avoid non-deterministic build:
printf '%s\n%s\n' \
'#!/bin/sh' \
'echo "#define PIPESIZE 65536"' >builtins/psize.sh
}
src_configure() {
# --build argument needed for reproducibility
# bash_cv_dev_stdin and bash_cv_dev_fd are also used to
# improve reproducibility because they make configure
# skip checking for /dev/{fd,stdin,stdout,stderr} (build
# output is affected by their availability otherwise).
# size is part of binutils and is not yet available.
./configure --prefix="${PREFIX}" \
--without-bash-malloc \
--disable-nls \
--build=i386-unknown-linux-musl \
--enable-static-link \
bash_cv_dev_stdin=absent \
bash_cv_dev_fd=whacky
}
src_compile() {
make -j1 PREFIX="${PREFIX}"
}
src_install() {
install -D bash "${DESTDIR}${PREFIX}/bin/bash"
# Work around weird symlink bug
install bash "${DESTDIR}${PREFIX}/bin/sh"
# Needs special handling b/c is currently running - tar doesn't like this
rm -f "${PREFIX}/bin/bash" "${PREFIX}/bin/sh"
}

View file

@ -0,0 +1 @@
http://mirrors.kernel.org/gnu/bash/bash-5.2.15.tar.gz 13720965b5f4fc3a0d4b61dd37e7565c741da9a5be24edc2ae00182fc1b3588c

20
steps/bc-1.07.1/pass1.sh Executable file
View file

@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: © 2023 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
# Remove bison generated files
rm bc/bc.c bc/bc.h
rm bc/scan.c
# Skip documentation
sed -i 's/ doc//' Makefile.am
# Rebuild configure script
AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
}
src_configure() {
./configure --prefix="${PREFIX}" \
--build=i386-unknown-linux-musl
}

1
steps/bc-1.07.1/sources Normal file
View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/bc/bc-1.07.1.tar.gz 62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a

107
steps/binutils-2.30/pass1.sh Executable file
View file

@ -0,0 +1,107 @@
# SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
# Remove unused generated files
rm etc/Makefile.in etc/configure
# Regenerate files
for dir in bfd binutils gas gprof intl ld libiberty opcodes zlib; do
(
cd $dir
AUTOPOINT=true ACLOCAL=aclocal-1.11 AUTOMAKE=automake-1.11 autoreconf-2.64 -fi
)
done
ACLOCAL=aclocal-1.11 autoreconf-2.64 -fi
# Rebuild bison files
touch -- */*.y
rm binutils/arparse.c binutils/arparse.h
rm binutils/defparse.c binutils/defparse.h
rm binutils/mcparse.c binutils/mcparse.h
rm binutils/rcparse.c binutils/rcparse.h
rm binutils/sysinfo.c binutils/sysinfo.h
rm gas/bfin-parse.c gas/bfin-parse.h
rm gas/m68k-parse.c gas/rl78-parse.c
rm gas/rl78-parse.h gas/rx-parse.c
rm gas/rx-parse.h gas/itbl-parse.c
rm gas/itbl-parse.h gold/yyscript.c
rm gold/yyscript.h intl/plural.c
rm ld/deffilep.c ld/deffilep.h
rm ld/ldgram.c ld/ldgram.h
# Rebuild flex generated files
touch -- */*.l */*/*.l
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c
rm gas/bfin-lex.c gas/itbl-lex.c
rm ld/ldlex.c
# Remove prebuilt texinfo files
rm bfd/doc/bfd.info binutils/doc/binutils.info
rm gas/doc/as.info gprof/gprof.info ld/ld.info
# Remove pregenerated opcodes files
rm opcodes/i386-init.h opcodes/i386-tbl.h
rm opcodes/ia64-asmtab.c
rm opcodes/z8k-opc.h
rm opcodes/aarch64-asm-2.c opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c
rm $(grep -l 'MACHINE GENERATED' opcodes/*.c opcodes/*.h)
# Regenerate MeP sections
./bfd/mep-relocs.pl
# Manpages
rm */*.1 */*/*.1 */*/*.man
}
src_configure() {
for dir in intl libiberty opcodes bfd binutils gas gprof ld zlib; do
(
cd $dir
LD="true" AR="tcc -ar" CC="tcc" ./configure \
--disable-nls \
--enable-deterministic-archives \
--enable-64-bit-bfd \
--build=i386-unknown-linux-gnu \
--host=i386-unknown-linux-gnu \
--target=i386-unknown-linux-gnu \
--program-prefix="" \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--with-sysroot= \
--srcdir=. \
--enable-compressed-debug-sections=all \
lt_cv_sys_max_cmd_len=32768
)
done
}
src_compile() {
make -C bfd headers
for dir in libiberty zlib bfd opcodes binutils gas gprof ld; do
make "${MAKEJOBS}" -C $dir tooldir=${PREFIX} CPPFLAGS="-DPLUGIN_LITTLE_ENDIAN" MAKEINFO=true
done
}
src_install() {
for dir in libiberty zlib bfd opcodes binutils gas gprof ld; do
make -C $dir tooldir=${PREFIX} DESTDIR="${DESTDIR}" install MAKEINFO=true
done
# Create triplet symlinks
(
cd "${DESTDIR}${PREFIX}/bin"
for f in *; do
ln -s "${PREFIX}/bin/${f}" "i386-unknown-linux-musl-${f}"
done
)
}

View file

@ -0,0 +1,18 @@
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
SPDX-License-Identifier: GPL-3.0-or-later
Add missing AC_CONFIG_MACRO_DIR.
Required by autoreconf to create aclocal.m4 correctly.
--- /libiberty/configure.ac 2022-01-22 14:14:09.000000000 +0200
+++ libiberty/configure.ac 2022-09-04 00:01:02.941738129 +0300
@@ -2,6 +2,7 @@
AC_INIT
AC_CONFIG_SRCDIR([xmalloc.c])
+AC_CONFIG_MACRO_DIR(../config)
# This works around the fact that libtool configuration may change LD
# for this particular configuration, but some shells, instead of

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-3.0-or-later
In new gettext external is required for AM_GNU_GETTEXT.
--- intl/configure.ac 2023-02-07 18:57:56.350832016 +1100
+++ intl/configure.ac 2023-02-07 18:58:07.310054484 +1100
@@ -4,7 +4,7 @@
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR(../config)
AM_GNU_GETTEXT_VERSION(0.12.1)
-AM_GNU_GETTEXT([], [need-ngettext])
+AM_GNU_GETTEXT([external], [need-ngettext])
# This replaces the extensive use of DEFS in the original Makefile.in.
AC_DEFINE(IN_LIBINTL, 1, [Define because this is libintl.])

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
SPDX-License-Identifier: GPL-3.0-or-later
Ensure i386-init.h dependencies are satisfied.
--- opcodes/Makefile.am 2022-01-22 14:14:09.000000000 +0200
+++ opcodes/Makefile.am 2022-09-13 21:09:04.353324699 +0300
@@ -575,7 +575,7 @@ i386-gen.o: i386-gen.c i386-opc.h $(srcd
$(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h
@echo $@
-$(srcdir)/i386-init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl
+$(srcdir)/i386-init.h: i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl
./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
i386-opc.lo: $(srcdir)/i386-tbl.h

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/binutils/binutils-2.30.tar.bz2 efeade848067e9a03f1918b1da0d37aaffa0b0127a06b5e9236229851d9d0c09

117
steps/binutils-2.38/pass1.sh Executable file
View file

@ -0,0 +1,117 @@
# SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
# Remove unused generated files
rm etc/Makefile.in etc/configure
rm zlib/aclocal.m4 zlib/configure
# Regenerate autoconf
for dir in bfd binutils gas gold gprof intl ld libctf libiberty opcodes; do
cd $dir
AUTOPOINT=true ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
cd ..
done
ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
# Regenerate directories with Makefile.am only
pushd gold
automake-1.15 -fai testsuite/Makefile
popd
pushd bfd
automake-1.15 -fai doc/Makefile
popd
# Rebuild bison files
touch -- */*.y
rm binutils/arparse.c binutils/arparse.h
rm binutils/defparse.c binutils/defparse.h
rm binutils/mcparse.c binutils/mcparse.h
rm binutils/rcparse.c binutils/rcparse.h
rm binutils/sysinfo.c binutils/sysinfo.h
rm gas/config/bfin-parse.c gas/config/bfin-parse.h
rm gas/config/loongarch-parse.c gas/config/loongarch-parse.h
rm gas/config/m68k-parse.c gas/config/rl78-parse.c
rm gas/config/rl78-parse.h gas/config/rx-parse.c
rm gas/config/rx-parse.h gas/itbl-parse.c
rm gas/itbl-parse.h gold/yyscript.c
rm gold/yyscript.h intl/plural.c
rm ld/deffilep.c ld/deffilep.h
rm ld/ldgram.c ld/ldgram.h
# Rebuild flex generated files
touch -- */*.l */*/*.l
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c
rm gas/config/bfin-lex.c gas/config/loongarch-lex.c gas/itbl-lex.c
rm ld/ldlex.c
# Remove prebuilt texinfo files
find . -type f -name '*.info*' \
-not -wholename './binutils/sysroff.info' \
-delete
# Remove pregenerated opcodes files
rm opcodes/i386-init.h opcodes/i386-tbl.h
rm opcodes/ia64-asmtab.c
rm opcodes/z8k-opc.h
rm opcodes/aarch64-asm-2.c opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c
rm $(grep -l 'MACHINE GENERATED' opcodes/*.c opcodes/*.h)
# Regenerate MeP sections
./bfd/mep-relocs.pl
# Manpages
find . -type f \( -name '*.1' -or -name '*.man' \) -delete
}
src_configure() {
for dir in intl libctf libiberty opcodes bfd binutils gas gprof ld; do
cd $dir
./configure \
--disable-nls \
--enable-install-libiberty \
--enable-deterministic-archives \
--with-system-zlib \
--build=i386-unknown-linux-musl \
--host=i386-unknown-linux-musl \
--target=i386-unknown-linux-musl \
--program-prefix="" \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--with-sysroot= \
--srcdir=.
cd ..
done
}
src_compile() {
make -C bfd headers
for dir in libiberty bfd opcodes libctf binutils gas gprof ld; do
make "${MAKEJOBS}" -C $dir tooldir=${PREFIX} CFLAGS="-std=c99"
done
}
src_install() {
for dir in libiberty bfd opcodes libctf binutils gas gprof ld; do
make -C $dir tooldir=${PREFIX} DESTDIR="${DESTDIR}" install
done
# Create triplet symlinks
pushd "${DESTDIR}${PREFIX}/bin"
for f in *; do
ln -s "${PREFIX}/bin/${f}" "i386-unknown-linux-musl-${f}"
done
popd
# FIXME: Binutils' manpages dates are not reproducible
rm -r "${DESTDIR}${PREFIX}/share/man"
}

122
steps/binutils-2.38/pass2.sh Executable file
View file

@ -0,0 +1,122 @@
# SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
# Remove unused generated files
rm etc/Makefile.in etc/configure
rm zlib/aclocal.m4 zlib/configure
# Regenerate top-level (autogen + autotools)
autogen Makefile.def
ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
# Regenerate autoconf
for dir in bfd binutils gas gold gprof intl ld libctf libiberty opcodes; do
cd $dir
ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
cd ..
done
# Regenerate directories with Makefile.am only
pushd gold
automake-1.15 -fai testsuite/Makefile
popd
pushd bfd
automake-1.15 -fai doc/Makefile
popd
# intl/ Makefile is a bit broken because of new gettext
sed -i 's/@USE_INCLUDED_LIBINTL@/no/' intl/Makefile.in
# There is no way to add -all-static to libtool LDFLAGS (such a thing doesn't exist)
# -all-static is required for static binaries with libtool
sed -i 's:\(--mode=link $(CCLD)\):\1 -all-static:' {bfd,binutils,opcodes,ld,libctf,gas,gprof}/Makefile.in
# Rebuild bison files
touch -- */*.y
rm binutils/arparse.c binutils/arparse.h
rm binutils/defparse.c binutils/defparse.h
rm binutils/mcparse.c binutils/mcparse.h
rm binutils/rcparse.c binutils/rcparse.h
rm binutils/sysinfo.c binutils/sysinfo.h
rm gas/config/bfin-parse.c gas/config/bfin-parse.h
rm gas/config/loongarch-parse.c gas/config/loongarch-parse.h
rm gas/config/m68k-parse.c gas/config/rl78-parse.c
rm gas/config/rl78-parse.h gas/config/rx-parse.c
rm gas/config/rx-parse.h gas/itbl-parse.c
rm gas/itbl-parse.h gold/yyscript.c
rm gold/yyscript.h intl/plural.c
rm ld/deffilep.c ld/deffilep.h
rm ld/ldgram.c ld/ldgram.h
# Rebuild flex generated files
touch -- */*.l */*/*.l
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c
rm gas/config/bfin-lex.c gas/config/loongarch-lex.c gas/itbl-lex.c
rm ld/ldlex.c
# Remove prebuilt texinfo files
find . -type f -name '*.info*' \
-not -wholename './binutils/sysroff.info' \
-delete
# Remove pregenerated opcodes files
rm opcodes/i386-init.h opcodes/i386-tbl.h
rm opcodes/ia64-asmtab.c
rm opcodes/z8k-opc.h
rm opcodes/aarch64-asm-2.c opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c
rm $(grep -l 'MACHINE GENERATED' opcodes/*.c opcodes/*.h)
# Regenerate MeP sections
./bfd/mep-relocs.pl
# Manpages
find . -type f \( -name '*.1' -or -name '*.man' \) -delete
}
src_configure() {
mkdir build
cd build
LDFLAGS="-static" \
../configure \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--build=i386-unknown-linux-musl \
--host=i386-unknown-linux-musl \
--target=i386-unknown-linux-musl \
--enable-static \
--disable-nls \
--disable-multilib \
--disable-plugins \
--enable-threads \
--enable-64-bit-bfd \
--enable-gold \
--enable-ld=default \
--enable-install-libiberty \
--enable-deterministic-archives \
--with-system-zlib \
--program-prefix="" \
--with-sysroot= \
--srcdir=..
}
src_install() {
default
# Create triplet symlinks
pushd "${DESTDIR}${PREFIX}/bin"
for f in *; do
ln -s "${PREFIX}/bin/${f}" "i386-unknown-linux-musl-${f}"
done
popd
# FIXME: Binutils' manpages dates are not reproducible
rm -r "${DESTDIR}${PREFIX}/share/man"
}

View file

@ -0,0 +1,18 @@
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
SPDX-License-Identifier: GPL-3.0-or-later
Add missing AC_CONFIG_MACRO_DIR.
Required by autoreconf to create aclocal.m4 correctly.
--- /libiberty/configure.ac 2022-01-22 14:14:09.000000000 +0200
+++ libiberty/configure.ac 2022-09-04 00:01:02.941738129 +0300
@@ -2,6 +2,7 @@
AC_INIT
AC_CONFIG_SRCDIR([xmalloc.c])
+AC_CONFIG_MACRO_DIR(../config)
# This works around the fact that libtool configuration may change LD
# for this particular configuration, but some shells, instead of

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-3.0-or-later
In new gettext external is required for AM_GNU_GETTEXT.
--- intl/configure.ac 2023-02-07 18:57:56.350832016 +1100
+++ intl/configure.ac 2023-02-07 18:58:07.310054484 +1100
@@ -4,7 +4,7 @@
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR(../config)
AM_GNU_GETTEXT_VERSION(0.12.1)
-AM_GNU_GETTEXT([], [need-ngettext])
+AM_GNU_GETTEXT([external], [need-ngettext])
# This replaces the extensive use of DEFS in the original Makefile.in.
AC_DEFINE(IN_LIBINTL, 1, [Define because this is libintl.])

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
SPDX-License-Identifier: GPL-3.0-or-later
Ensure i386-init.h dependencies are satisfied.
--- opcodes/Makefile.am 2022-01-22 14:14:09.000000000 +0200
+++ opcodes/Makefile.am 2022-09-13 21:09:04.353324699 +0300
@@ -575,7 +575,7 @@ i386-gen.o: i386-gen.c i386-opc.h $(srcd
$(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h
@echo $@
-$(srcdir)/i386-init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
+$(srcdir)/i386-init.h: i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
$(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
< $(srcdir)/i386-opc.tbl \
| ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/binutils/binutils-2.38.tar.xz e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024

View file

@ -0,0 +1,55 @@
#!/bin/sh
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# 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

34
steps/bison-2.3/pass1.sh Executable file
View file

@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
../../import-gnulib.sh
AUTOPOINT=true AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 autoreconf-2.69 -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}" \
--libdir="${LIBDIR}" \
--program-suffix=-2.3 \
--datarootdir="${PREFIX}/share/bison-2.3"
}
src_compile() {
make -j1 MAKEINFO=true
}
src_install() {
make MAKEINFO=true DESTDIR="${DESTDIR}" install
}

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
This macro does not exist in newer versions of autoconf and is unrequired.
There is no version 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,

View file

@ -0,0 +1,18 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
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
@@ -31,7 +31,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 = \

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
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)

View file

@ -0,0 +1,20 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
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

2
steps/bison-2.3/sources Normal file
View file

@ -0,0 +1,2 @@
http://mirrors.kernel.org/gnu/bison/bison-2.3.tar.bz2 b10d7e9e354be72aee4e4911cf19dd27b5c527d4e7200857365b5fcdeea0dffb
http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b28236b.tar.gz 0190f28cb155fedd22bf8558c3e8705eed9eacfb7ae29e7508d025a68eb90899

View file

@ -0,0 +1,40 @@
// SPDX-FileCopyrightText: 2020 Andrius Štikonas <andrius@stikonas.eu>
// SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
// SPDX-License-Identifier: GPL-3.0-or-later
#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1
#define HAVE_DECL_STRERROR_R 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_PIPE 1
#define HAVE_SNPRINTF 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define M4 "/usr/bin/m4"
#define M4_GNU_OPTION ""
#define PACKAGE "bison"
#define PACKAGE_BUGREPORT "bug-bison@gnu.org"
#define PACKAGE_COPYRIGHT_YEAR 2019
#define PACKAGE_NAME "GNU Bison"
#define PACKAGE_STRING "GNU Bison 3.4.1"
#define PACKAGE_URL "http://www.gnu.org/software/bison/"
#define PACKAGE_VERSION "3.4.1"
#define VERSION "3.4.1"
#define PROMOTED_MODE_T mode_t
#define BOURNE_SHELL "/bin/sh"
#define _GNU_SOURCE 1
#define _Noreturn
#define _GL_ASYNC_SAFE
#define _GL_EXTERN_INLINE extern inline
#define _GL_INLINE_HEADER_BEGIN
#define _GL_INLINE_HEADER_END
#define _GL_UNUSED
#define _GL_UNUSED_LABEL
#define _GL_ATTRIBUTE_PURE
#define _GL_ATTRIBUTE_CONST
#define _GL_ATTRIBUTE_MALLOC
#define _GL_ATTRIBUTE_FORMAT_PRINTF(x, y)
#define _GL_ARG_NONNULL(x)
#ifndef _GL_INLINE
#define _GL_INLINE static inline
#endif

View file

@ -0,0 +1,7 @@
// SPDX-FileCopyrightText: 2020 Andrius Štikonas <andrius@stikonas.eu>
// SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
// SPDX-License-Identifier: GPL-3.0-or-later
#define LOCALEDIR "/usr/share/locale"
#define PKGDATADIR "/usr/share/bison"

View file

@ -0,0 +1,972 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
* This file is based on parse-gram.y from GNU Bison 3.4.1. It
* implements a subset of the grammar described by parse-gram.y, just
* enough to provide a bootstrapping path for Bison.
*
* Copyright (c) 2020, Giovanni Mascellani <gio@debian.org>
*
* The copyright notice of the original file follows. This file is
* distributed under the same license and with the same conditions.
*/
/* Bison Grammar Parser -*- C -*-
Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/*
* Since this code is intended to provide a bootstrapping path for GNU
* Bison, it is important that it is as easy to understand as
* possible. Fortunately Bison's grammar is rather simple. I believe
* that if you know how Bison works, you should not find it hard to
* follow the logic in this file and compare it with the original
* grammar.
*
* Apart from the code literally copied from the grammar file
* (prologues and epilogue), this file basically contains a few
* wrappers over the lexer interface (the functions gram_*), basically
* adding the feature to give back one lexeme and a lot of functions
* parse_* or maybe_parse_*, parsing the corresponding grammar
* rule. Functions maybe_parse_* are allowed to fail, and return
* accordingly.
*
* Error checking is very simple and just made of assertions. This is
* just boostrapping code, not meant for end users, so it should not
* be a problem.
*/
/* %code top */
/* On column 0 to please syntax-check. */
#include <config.h>
#include <assert.h>
#define YYLTYPE GRAM_LTYPE
#include "parse-gram.h"
/* %code */
#include "system.h"
#include <errno.h>
#include "c-ctype.h"
#include "complain.h"
#include "conflicts.h"
#include "files.h"
#include "getargs.h"
#include "gram.h"
#include "named-ref.h"
#include "quotearg.h"
#include "reader.h"
#include "scan-code.h"
#include "scan-gram.h"
#include "vasnprintf.h"
#include "xmemdup0.h"
static int current_prec = 0;
static location current_lhs_loc;
static named_ref *current_lhs_named_ref;
static symbol *current_lhs_symbol;
static symbol_class current_class = unknown_sym;
/** Set the new current left-hand side symbol, possibly common
* to several right-hand side parts of rule.
*/
static void current_lhs (symbol *sym, location loc, named_ref *ref);
#define YYLLOC_DEFAULT(Current, Rhs, N) \
(Current) = lloc_default (Rhs, N)
static YYLTYPE lloc_default (YYLTYPE const *, int);
#define YY_LOCATION_PRINT(File, Loc) \
location_print (Loc, File)
/* Strip initial '{' and final '}' (must be first and last characters).
Return the result. */
static char *strip_braces (char *code);
/* Convert CODE by calling code_props_plain_init if PLAIN, otherwise
code_props_symbol_action_init. Call
gram_scanner_last_string_free to release the latest string from
the scanner (should be CODE). */
static char const *translate_code (char *code, location loc, bool plain);
/* Convert CODE by calling code_props_plain_init after having
stripped the first and last characters (expected to be '{', and
'}'). Call gram_scanner_last_string_free to release the latest
string from the scanner (should be CODE). */
static char const *translate_code_braceless (char *code, location loc);
/* Handle a %error-verbose directive. */
static void handle_error_verbose (location const *loc, char const *directive);
/* Handle a %file-prefix directive. */
static void handle_file_prefix (location const *loc,
location const *dir_loc,
char const *directive, char const *value);
/* Handle a %name-prefix directive. */
static void handle_name_prefix (location const *loc,
char const *directive, char const *value);
/* Handle a %pure-parser directive. */
static void handle_pure_parser (location const *loc, char const *directive);
/* Handle a %require directive. */
static void handle_require (location const *loc, char const *version);
/* Handle a %skeleton directive. */
static void handle_skeleton (location const *loc, char const *skel);
/* Handle a %yacc directive. */
static void handle_yacc (location const *loc, char const *directive);
static void gram_error (location const *, char const *);
/* A string that describes a char (e.g., 'a' -> "'a'"). */
static char const *char_name (char);
#define YYTYPE_INT16 int_fast16_t
#define YYTYPE_INT8 int_fast8_t
#define YYTYPE_UINT16 uint_fast16_t
#define YYTYPE_UINT8 uint_fast8_t
/* Add style to semantic values in traces. */
static void tron (FILE *yyo);
static void troff (FILE *yyo);
int gram_debug;
typedef struct {
GRAM_STYPE s;
GRAM_LTYPE l;
int t;
} gram_lex_ctx;
static int gram_lex_wrap(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
int type;
if (ctx->t == 0) {
type = gram_lex(&ctx->s, &ctx->l);
} else {
type = ctx->t;
}
/*fprintf(stderr, "%s %d from %s:%d:%d:%d to %s:%d:%d:%d\n",
ctx->t == 0 ? "Scanned" : "Rescanned", type,
ctx->l.start.file, ctx->l.start.line, ctx->l.start.column, ctx->l.start.byte,
ctx->l.end.file, ctx->l.end.line, ctx->l.end.column, ctx->l.end.byte);*/
ctx->t = 0;
if (sx) *sx = ctx->s;
if (lx) *lx = ctx->l;
return type;
}
static int gram_unlex_wrap(gram_lex_ctx *ctx, int t, GRAM_STYPE *s, GRAM_LTYPE *l) {
assert(ctx->t == 0);
ctx->t = t;
ctx->s = *s;
ctx->l = *l;
/*fprintf(stderr, "Unscanned %d from %s:%d:%d:%d to %s:%d:%d:%d\n",
t,
ctx->l.start.file, ctx->l.start.line, ctx->l.start.column, ctx->l.start.byte,
ctx->l.end.file, ctx->l.end.line, ctx->l.end.column, ctx->l.end.byte);*/
}
static void gram_get_last_loc(gram_lex_ctx *ctx, GRAM_LTYPE *l) {
*l = ctx->l;
}
static void parse_value(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[2];
GRAM_LTYPE l[2];
gram_get_last_loc(ctx, &l[0]);
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
switch (t) {
case ID:
YYLLOC_DEFAULT(*lx, l, 1);
sx->value.kind = muscle_keyword;
sx->value.chars = s[1].ID;
break;
case STRING:
YYLLOC_DEFAULT(*lx, l, 1);
sx->value.kind = muscle_string;
sx->value.chars = s[1].STRING;
break;
case BRACED_CODE:
YYLLOC_DEFAULT(*lx, l, 1);
sx->value.kind = muscle_code;
sx->value.chars = strip_braces(s[1].BRACED_CODE);
break;
default:
gram_unlex_wrap(ctx, t, &s[1], &l[1]);
YYLLOC_DEFAULT(*lx, l, 0);
sx->value.kind = muscle_keyword;
sx->value.chars = "";
break;
}
}
static void parse_int_opt(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[2];
GRAM_LTYPE l[2];
gram_get_last_loc(ctx, &l[0]);
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
if (t == INT) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->int_opt = s[1].INT;
} else {
gram_unlex_wrap(ctx, t, &s[1], &l[1]);
YYLLOC_DEFAULT(*lx, l, 0);
sx->int_opt = -1;
}
}
static int maybe_parse_string_as_id(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[2];
GRAM_LTYPE l[2];
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
if (t == STRING) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->string_as_id = symbol_get(quotearg_style(c_quoting_style, s[1].STRING), l[1]);
symbol_class_set(sx->string_as_id, token_sym, l[1], false);
return 1;
} else {
gram_unlex_wrap(ctx, t, &s[1], &l[1]);
return 0;
}
}
static void parse_string_as_id(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
int x = maybe_parse_string_as_id(ctx, sx, lx);
assert(x);
}
static void parse_string_as_id_opt(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[2];
GRAM_LTYPE l[2];
gram_get_last_loc(ctx, &l[0]);
int x = maybe_parse_string_as_id(ctx, &s[1], &l[1]);
if (x) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->string_as_id_opt = s[1].string_as_id;
} else {
YYLLOC_DEFAULT(*lx, l, 0);
sx->string_as_id_opt = NULL;
}
}
static int maybe_parse_id(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[2];
GRAM_LTYPE l[2];
gram_get_last_loc(ctx, &l[0]);
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
if (t == ID) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->id = symbol_from_uniqstr(s[1].ID, l[1]);
return 1;
} else {
gram_unlex_wrap(ctx, t, &s[1], &l[1]);
return 0;
}
}
static void parse_id(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
int x = maybe_parse_id(ctx, sx, lx);
assert(x);
}
static void parse_token_decl(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[4];
GRAM_LTYPE l[4];
parse_id(ctx, &s[1], &l[1]);
parse_int_opt(ctx, &s[2], &l[2]);
parse_string_as_id_opt(ctx, &s[3], &l[3]);
YYLLOC_DEFAULT(*lx, l, 3);
sx->token_decl = s[1].id;
symbol_class_set(s[1].id, current_class, l[1], true);
if (0 <= s[2].int_opt)
symbol_user_token_number_set(s[1].id, s[2].int_opt, l[2]);
if (s[3].string_as_id_opt)
symbol_make_alias(s[1].id, s[3].string_as_id_opt, l[3]);
}
static int maybe_parse_token_decl_1(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[3];
GRAM_LTYPE l[3];
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
gram_unlex_wrap(ctx, t, &s[1], &l[1]);
if (t != ID) {
return 0;
}
parse_token_decl(ctx, &s[1], &l[1]);
YYLLOC_DEFAULT(*lx, l, 1);
sx->token_decl_1 = symbol_list_sym_new(s[1].token_decl, l[1]);
while (1) {
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
gram_unlex_wrap(ctx, t, &s[1], &l[1]);
if (t != ID) {
return 1;
}
s[1] = *sx;
l[1] = *lx;
parse_token_decl(ctx, &s[2], &l[2]);
YYLLOC_DEFAULT(*lx, l, 2);
sx->token_decl_1 = symbol_list_append(s[1].token_decl_1, symbol_list_sym_new(s[2].token_decl, l[2]));
}
}
static void parse_token_decl_1(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
int x = maybe_parse_token_decl_1(ctx, sx, lx);
assert(x);
}
static void parse_token_decls(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[4];
GRAM_LTYPE l[4];
int begin_with_tokens = maybe_parse_token_decl_1(ctx, &s[1], &l[1]);
if (begin_with_tokens) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->token_decls = s[1].token_decl_1;
} else {
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
assert(t == TAG);
parse_token_decl_1(ctx, &s[2], &l[2]);
YYLLOC_DEFAULT(*lx, l, 2);
sx->token_decls = symbol_list_type_set(s[2].token_decl_1, s[1].TAG, l[1]);
}
while (1) {
s[1] = *sx;
l[1] = *lx;
int t = gram_lex_wrap(ctx, &s[2], &l[2]);
if (t != TAG) {
gram_unlex_wrap(ctx, t, &s[2], &l[2]);
return;
}
parse_token_decl_1(ctx, &s[3], &l[3]);
YYLLOC_DEFAULT(*lx, l, 3);
sx->token_decls = symbol_list_append(s[1].token_decls, symbol_list_type_set(s[3].token_decl_1, s[2].TAG, l[2]));
}
}
static int maybe_parse_symbol(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[2];
GRAM_LTYPE l[2];
int x = maybe_parse_string_as_id(ctx, &s[1], &l[1]);
if (x) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->symbol = s[1].string_as_id;
return 1;
}
x = maybe_parse_id(ctx, &s[1], &l[1]);
if (x) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->symbol = s[1].id;
return 1;
}
return 0;
}
static void parse_symbol(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
int x = maybe_parse_symbol(ctx, sx, lx);
assert(x);
}
static int maybe_parse_symbol_decl_1(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[3];
GRAM_LTYPE l[3];
int x = maybe_parse_symbol(ctx, &s[1], &l[1]);
if (!x) {
return 0;
}
YYLLOC_DEFAULT(*lx, l, 1);
sx->symbol_decl_1 = symbol_list_sym_new(s[1].symbol, l[1]);
while (1) {
s[1] = *sx;
l[1] = *lx;
x = maybe_parse_symbol(ctx, &s[2], &l[2]);
if (!x) {
return 1;
}
YYLLOC_DEFAULT(*lx, l, 2);
sx->symbol_decl_1 = symbol_list_append(s[1].symbol_decl_1, symbol_list_sym_new(s[2].symbol, l[2]));
}
}
static void parse_symbol_decl_1(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
int x = maybe_parse_symbol_decl_1(ctx, sx, lx);
assert(x);
}
static void parse_symbol_decls(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[4];
GRAM_LTYPE l[4];
int begin_with_tokens = maybe_parse_symbol_decl_1(ctx, &s[1], &l[1]);
if (begin_with_tokens) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->symbol_decls = s[1].symbol_decl_1;
} else {
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
assert(t == TAG);
parse_symbol_decl_1(ctx, &s[2], &l[2]);
YYLLOC_DEFAULT(*lx, l, 2);
sx->symbol_decls = symbol_list_type_set(s[2].symbol_decl_1, s[1].TAG, l[1]);
}
while (1) {
s[1] = *sx;
l[1] = *lx;
int t = gram_lex_wrap(ctx, &s[2], &l[2]);
if (t != TAG) {
gram_unlex_wrap(ctx, t, &s[2], &l[2]);
return;
}
parse_symbol_decl_1(ctx, &s[3], &l[3]);
YYLLOC_DEFAULT(*lx, l, 3);
sx->symbol_decls = symbol_list_append(s[1].symbol_decls, symbol_list_type_set(s[3].symbol_decl_1, s[2].TAG, l[2]));
}
}
static int maybe_parse_declaration(gram_lex_ctx *ctx, int prologue) {
GRAM_STYPE s[4];
GRAM_LTYPE l[4];
int t[4];
t[1] = gram_lex_wrap(ctx, &s[1], &l[1]);
if (prologue) {
switch (t[1]) {
/* Prologue declarations */
case PERCENT_DEFINE:
t[2] = gram_lex_wrap(ctx, &s[2], &l[2]);
assert(t[2] == ID);
parse_value(ctx, &s[3], &l[3]);
YYLLOC_DEFAULT(l[0], l, 3);
muscle_percent_define_insert(s[2].ID, l[0], s[3].value.kind, s[3].value.chars,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
return 1;
case PERCENT_DEFINES:
defines_flag = true;
return 1;
case PERCENT_EXPECT:
t[2] = gram_lex_wrap(ctx, &s[2], &l[2]);
assert(t[2] == INT);
expected_sr_conflicts = s[2].INT;
return 1;
case PERCENT_INITIAL_ACTION:
t[2] = gram_lex_wrap(ctx, &s[2], &l[2]);
assert(t[2] == BRACED_CODE);
muscle_code_grow("initial_action", translate_code(s[2].BRACED_CODE, l[2], false), l[2]);
code_scanner_last_string_free();
return 1;
case PERCENT_VERBOSE:
report_flag |= report_states;
return 1;
case SEMICOLON:
return 1;
}
}
switch (t[1]) {
/* Grammar declarations */
case PERCENT_CODE:
t[2] = gram_lex_wrap(ctx, &s[2], &l[2]);
if (t[2] == ID) {
t[3] = gram_lex_wrap(ctx, &s[3], &l[3]);
assert(t[3] == BRACED_CODE);
muscle_percent_code_grow(s[2].ID, l[2], translate_code_braceless(s[3].BRACED_CODE, l[3]), l[3]);
code_scanner_last_string_free();
} else {
assert(t[2] == BRACED_CODE);
muscle_code_grow("percent_code()", translate_code_braceless(s[2].BRACED_CODE, l[2]), l[2]);
code_scanner_last_string_free();
}
return 1;
/* Symbol declarations */
case PERCENT_TOKEN:
current_class = token_sym;
parse_token_decls(ctx, &s[2], &l[2]);
current_class = unknown_sym;
symbol_list_free(s[2].token_decls);
return 1;
case PERCENT_TYPE:
parse_symbol_decls(ctx, &s[2], &l[2]);
symbol_list_free(s[2].symbol_decls);
return 1;
case PERCENT_PERCENT:
return 2;
default:
gram_unlex_wrap(ctx, t[1], &s[1], &l[1]);
return 0;
}
}
static void parse_prologue_declarations(gram_lex_ctx *ctx) {
while (1) {
int x = maybe_parse_declaration(ctx, 1);
assert(x);
if (x == 2) {
return;
}
}
}
static void parse_id_colon(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[2];
GRAM_LTYPE l[2];
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
assert(t == ID_COLON);
YYLLOC_DEFAULT(*lx, l, 1);
sx->id_colon = symbol_from_uniqstr(s[1].ID_COLON, l[1]);
}
static void parse_named_ref_opt(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[2];
GRAM_LTYPE l[2];
gram_get_last_loc(ctx, &l[0]);
int t = gram_lex_wrap(ctx, &s[1], &l[1]);
if (t == BRACKETED_ID) {
YYLLOC_DEFAULT(*lx, l, 1);
sx->named_ref_opt = named_ref_new(s[1].BRACKETED_ID, l[1]);
} else {
gram_unlex_wrap(ctx, t, &s[1], &l[1]);
YYLLOC_DEFAULT(*lx, l, 0);
sx->named_ref_opt = NULL;
}
}
static void parse_rhs(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[5];
GRAM_LTYPE l[5];
gram_get_last_loc(ctx, &l[0]);
YYLLOC_DEFAULT(*lx, l, 0);
grammar_current_rule_begin(current_lhs_symbol, current_lhs_loc, current_lhs_named_ref);
while (1) {
s[1] = *sx;
l[1] = *lx;
int x = maybe_parse_symbol(ctx, &s[2], &l[2]);
if (x) {
parse_named_ref_opt(ctx, &s[3], &l[3]);
YYLLOC_DEFAULT(*lx, l, 3);
grammar_current_rule_symbol_append(s[2].symbol, l[2], s[3].named_ref_opt);
} else {
int t = gram_lex_wrap(ctx, &s[2], &l[2]);
switch (t) {
case BRACED_CODE:
/* Probably good */
s[3] = s[2];
l[3] = l[2];
s[2].tag_opt = NULL;
l[2] = l[1];
parse_named_ref_opt(ctx, &s[4], &l[4]);
YYLLOC_DEFAULT(*lx, l, 4);
grammar_current_rule_action_append(s[3].BRACED_CODE, l[3], s[4].named_ref_opt, s[2].tag_opt);
break;
case PERCENT_EMPTY:
YYLLOC_DEFAULT(*lx, l, 2);
grammar_current_rule_empty_set(l[2]);
break;
default:
gram_unlex_wrap(ctx, t, &s[2], &l[2]);
return;
}
}
}
}
static void parse_rhses_1(gram_lex_ctx *ctx, GRAM_STYPE *sx, GRAM_LTYPE *lx) {
GRAM_STYPE s[4];
GRAM_LTYPE l[4];
parse_rhs(ctx, &s[1], &l[1]);
YYLLOC_DEFAULT(*lx, l, 1);
grammar_current_rule_end(l[1]);
while (1) {
s[1] = *sx;
l[1] = *lx;
int t = gram_lex_wrap(ctx, &s[2], &l[2]);
switch (t) {
case PIPE:
parse_rhs(ctx, &s[3], &l[3]);
YYLLOC_DEFAULT(*lx, l, 3);
grammar_current_rule_end(l[3]);
break;
case SEMICOLON:
YYLLOC_DEFAULT(*lx, l, 2);
break;
default:
gram_unlex_wrap(ctx, t, &s[2], &l[2]);
return;
}
}
}
static void parse_rules(gram_lex_ctx *ctx) {
GRAM_STYPE s[6];
GRAM_LTYPE l[6];
parse_id_colon(ctx, &s[1], &l[1]);
parse_named_ref_opt(ctx, &s[2], &l[2]);
gram_get_last_loc(ctx, &l[3]);
current_lhs(s[1].id_colon, l[1], s[2].named_ref_opt);
int t = gram_lex_wrap(ctx, &s[4], &l[4]);
assert(t == COLON);
parse_rhses_1(ctx, &s[5], &l[5]);
current_lhs(0, l[1], 0);
}
static void parse_grammar(gram_lex_ctx *ctx) {
while (1) {
int x = maybe_parse_declaration(ctx, 0);
if (x == 1) {
int t = gram_lex_wrap(ctx, NULL, NULL);
assert(t == SEMICOLON);
} if (x == 2) {
return;
} else if (x == 0) {
parse_rules(ctx);
}
}
}
static void parse_epilogue(gram_lex_ctx *ctx) {
GRAM_STYPE s;
GRAM_LTYPE l;
int t = gram_lex_wrap(ctx, &s, &l);
assert(t == EPILOGUE);
muscle_code_grow("epilogue", translate_code(s.EPILOGUE, l, true), l);
code_scanner_last_string_free();
}
int gram_parse(void) {
gram_lex_ctx ctx = {};
boundary_set(&ctx.l.start, current_file, 1, 1, 1);
boundary_set(&ctx.l.end, current_file, 1, 1, 1);
parse_prologue_declarations(&ctx);
parse_grammar(&ctx);
parse_epilogue(&ctx);
assert(gram_lex_wrap(&ctx, NULL, NULL) == 0);
return 0;
}
// Epilogue
/* Return the location of the left-hand side of a rule whose
right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
the right-hand side, and return an empty location equal to the end
boundary of RHS[0] if the right-hand side is empty. */
static YYLTYPE
lloc_default (YYLTYPE const *rhs, int n)
{
YYLTYPE loc;
/* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
The bug is fixed in 7.4.2m, but play it safe for now. */
loc.start = rhs[n].end;
loc.end = rhs[n].end;
/* Ignore empty nonterminals the start of the right-hand side.
Do not bother to ignore them at the end of the right-hand side,
since empty nonterminals have the same end as their predecessors. */
for (int i = 1; i <= n; i++)
if (! equal_boundaries (rhs[i].start, rhs[i].end))
{
loc.start = rhs[i].start;
break;
}
return loc;
}
static
char *strip_braces (char *code)
{
code[strlen (code) - 1] = 0;
return code + 1;
}
static
char const *
translate_code (char *code, location loc, bool plain)
{
code_props plain_code;
if (plain)
code_props_plain_init (&plain_code, code, loc);
else
code_props_symbol_action_init (&plain_code, code, loc);
code_props_translate_code (&plain_code);
gram_scanner_last_string_free ();
return plain_code.code;
}
static
char const *
translate_code_braceless (char *code, location loc)
{
return translate_code (strip_braces (code), loc, true);
}
static void
add_param (param_type type, char *decl, location loc)
{
static char const alphanum[26 + 26 + 1 + 10 + 1] =
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"_"
"0123456789";
char const *name_start = NULL;
{
char *p;
/* Stop on last actual character. */
for (p = decl; p[1]; p++)
if ((p == decl
|| ! memchr (alphanum, p[-1], sizeof alphanum - 1))
&& memchr (alphanum, p[0], sizeof alphanum - 10 - 1))
name_start = p;
/* Strip the surrounding '{' and '}', and any blanks just inside
the braces. */
--p;
while (c_isspace ((unsigned char) *p))
--p;
p[1] = '\0';
++decl;
while (c_isspace ((unsigned char) *decl))
++decl;
}
if (! name_start)
complain (&loc, complaint, _("missing identifier in parameter declaration"));
else
{
char *name = xmemdup0 (name_start, strspn (name_start, alphanum));
if (type & param_lex)
muscle_pair_list_grow ("lex_param", decl, name);
if (type & param_parse)
muscle_pair_list_grow ("parse_param", decl, name);
free (name);
}
gram_scanner_last_string_free ();
}
static void
handle_error_verbose (location const *loc, char const *directive)
{
bison_directive (loc, directive);
muscle_percent_define_insert (directive, *loc, muscle_keyword, "",
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
}
static void
handle_file_prefix (location const *loc,
location const *dir_loc,
char const *directive, char const *value)
{
bison_directive (loc, directive);
bool warned = false;
if (location_empty (spec_file_prefix_loc))
{
spec_file_prefix_loc = *loc;
spec_file_prefix = value;
}
else
{
duplicate_directive (directive, spec_file_prefix_loc, *loc);
warned = true;
}
if (!warned
&& STRNEQ (directive, "%file-prefix"))
deprecated_directive (dir_loc, directive, "%file-prefix");
}
static void
handle_name_prefix (location const *loc,
char const *directive, char const *value)
{
bison_directive (loc, directive);
char buf1[1024];
size_t len1 = sizeof (buf1);
char *old = asnprintf (buf1, &len1, "%s\"%s\"", directive, value);
if (!old)
xalloc_die ();
if (location_empty (spec_name_prefix_loc))
{
spec_name_prefix = value;
spec_name_prefix_loc = *loc;
char buf2[1024];
size_t len2 = sizeof (buf2);
char *new = asnprintf (buf2, &len2, "%%define api.prefix {%s}", value);
if (!new)
xalloc_die ();
deprecated_directive (loc, old, new);
if (new != buf2)
free (new);
}
else
duplicate_directive (old, spec_file_prefix_loc, *loc);
if (old != buf1)
free (old);
}
static void
handle_pure_parser (location const *loc, char const *directive)
{
bison_directive (loc, directive);
deprecated_directive (loc, directive, "%define api.pure");
muscle_percent_define_insert ("api.pure", *loc, muscle_keyword, "",
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
}
static void
handle_require (location const *loc, char const *version)
{
/* Changes of behavior are only on minor version changes, so "3.0.5"
is the same as "3.0". */
errno = 0;
char* cp = NULL;
unsigned long major = strtoul (version, &cp, 10);
if (errno || *cp != '.')
{
complain (loc, complaint, _("invalid version requirement: %s"),
version);
return;
}
++cp;
unsigned long minor = strtoul (cp, NULL, 10);
if (errno)
{
complain (loc, complaint, _("invalid version requirement: %s"),
version);
return;
}
required_version = major * 100 + minor;
/* Pretend to be at least 3.4, to check features published in 3.4
while developping it. */
const char* api_version = "3.4";
const char* package_version =
strverscmp (api_version, PACKAGE_VERSION) > 0
? api_version : PACKAGE_VERSION;
if (strverscmp (version, package_version) > 0)
{
complain (loc, complaint, _("require bison %s, but have %s"),
version, package_version);
exit (EX_MISMATCH);
}
}
static void
handle_skeleton (location const *loc, char const *skel)
{
char const *skeleton_user = skel;
if (strchr (skeleton_user, '/'))
{
size_t dir_length = strlen (current_file);
while (dir_length && current_file[dir_length - 1] != '/')
--dir_length;
while (dir_length && current_file[dir_length - 1] == '/')
--dir_length;
char *skeleton_build =
xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
if (dir_length > 0)
{
memcpy (skeleton_build, current_file, dir_length);
skeleton_build[dir_length++] = '/';
}
strcpy (skeleton_build + dir_length, skeleton_user);
skeleton_user = uniqstr_new (skeleton_build);
free (skeleton_build);
}
skeleton_arg (skeleton_user, grammar_prio, *loc);
}
static void
handle_yacc (location const *loc, char const *directive)
{
bison_directive (loc, directive);
bool warned = false;
if (location_empty (yacc_loc))
yacc_loc = *loc;
else
{
duplicate_directive (directive, yacc_loc, *loc);
warned = true;
}
if (!warned
&& STRNEQ (directive, "%fixed-output-files")
&& STRNEQ (directive, "%yacc"))
deprecated_directive (loc, directive, "%fixed-output-files");
}
static void
gram_error (location const *loc, char const *msg)
{
complain (loc, complaint, "%s", msg);
}
static char const *
char_name (char c)
{
if (c == '\'')
return "'\\''";
else
{
char buf[4];
buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0';
return quotearg_style (escape_quoting_style, buf);
}
}
static
void
current_lhs (symbol *sym, location loc, named_ref *ref)
{
current_lhs_symbol = sym;
current_lhs_loc = loc;
if (sym)
symbol_location_as_lhs_set (sym, loc);
/* In order to simplify memory management, named references for lhs
are always assigned by deep copy into the current symbol_list
node. This is because a single named-ref in the grammar may
result in several uses when the user factors lhs between several
rules using "|". Therefore free the parser's original copy. */
free (current_lhs_named_ref);
current_lhs_named_ref = ref;
}
static void tron (FILE *yyo)
{
begin_use_class ("value", yyo);
}
static void troff (FILE *yyo)
{
end_use_class ("value", yyo);
}

View file

@ -0,0 +1,160 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
* This file is based on parse-gram.y from GNU Bison 3.4.1. It is the
* header for an implementation of a subset of the grammar described
* by parse-gram.y, just enough to provide a bootstrapping path for
* Bison.
*
* Copyright (c) 2020, Giovanni Mascellani <gio@debian.org>
*
* The copyright notice of the original file follows. This file is
* distributed under the same license and with the same conditions.
*/
/* Bison Grammar Parser -*- C -*-
Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef PARSE_GRAM_H
#define PARSE_GRAM_H
/* %code requires */
#include "symlist.h"
#include "symtab.h"
typedef enum
{
param_none = 0,
param_lex = 1 << 0,
param_parse = 1 << 1,
param_both = param_lex | param_parse
} param_type;
#include "muscle-tab.h"
typedef struct
{
char const *chars;
muscle_kind kind;
} value_type;
enum gram_tokentype {
GRAM_EOF = 0,
ID = 300,
STRING,
BRACED_CODE,
INT,
PERCENT_DEFINE,
PERCENT_DEFINES,
PERCENT_VERBOSE,
SEMICOLON,
PERCENT_TOKEN,
PERCENT_TYPE,
PERCENT_EMPTY,
COLON,
PERCENT_EXPECT,
PERCENT_PERCENT,
PERCENT_INITIAL_ACTION,
BRACKETED_ID,
PIPE,
EPILOGUE,
TAG,
PERCENT_CODE,
ID_COLON,
PERCENT_NONASSOC,
PERCENT_FLAG,
PERCENT_DEFAULT_PREC,
PERCENT_DESTRUCTOR,
PERCENT_DPREC,
PERCENT_EXPECT_RR,
EQUAL,
TAG_ANY,
CHAR,
BRACED_PREDICATE,
PERCENT_START,
PERCENT_UNION,
PERCENT_ERROR_VERBOSE,
PERCENT_NAME_PREFIX,
PERCENT_PURE_PARSER,
PERCENT_RIGHT,
PERCENT_PREC,
PERCENT_FILE_PREFIX,
PERCENT_YACC,
PERCENT_GLR_PARSER,
PERCENT_LANGUAGE,
PERCENT_LEFT,
PERCENT_PARAM,
PERCENT_MERGE,
PERCENT_NO_DEFAULT_PREC,
PERCENT_NO_LINES,
PERCENT_NONDETERMINISTIC_PARSER,
PERCENT_NTERM,
PERCENT_OUTPUT,
PERCENT_PRECEDENCE,
PRECENT_PRINTER,
PERCENT_REQUIRE,
PERCENT_SKELETON,
PERCENT_TOKEN_TABLE,
TAG_NONE,
PROLOGUE,
PERCENT_PRINTER,
};
union GRAM_STYPE {
value_type value;
uniqstr ID;
char *STRING;
symbol *symbol;
named_ref *named_ref_opt;
uniqstr tag_opt;
char *BRACED_CODE;
char *EPILOGUE;
symbol *id_colon;
uniqstr ID_COLON;
int int_opt;
int INT;
symbol *string_as_id;
symbol *string_as_id_opt;
symbol *token_decl;
symbol_list *token_decl_1;
symbol_list *token_decls;
symbol_list *symbol_decls;
symbol_list *symbol_decl_1;
uniqstr BRACKETED_ID;
symbol *id;
uniqstr TAG;
uniqstr PERCENT_FLAG;
uniqstr PERCENT_FILE_PREFIX;
uniqstr PERCENT_NAME_PREFIX;
uniqstr PERCENT_YACC;
param_type PERCENT_PARAM;
uniqstr PERCENT_PURE_PARSER;
uniqstr PERCENT_ERROR_VERBOSE;
unsigned char CHAR;
char *BRACED_PREDICATE;
char *PROLOGUE;
};
typedef union GRAM_STYPE GRAM_STYPE;
int gram_parse (void);
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2020 Giovanni Mascellani gio@debian.org
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
lib.a: allocator.o areadlink.o argmatch.o asnprintf.o basename.o basename-lgpl.o binary-io.o bitrotate.o bitset.o bitsetv.o calloc.o canonicalize-lgpl.o careadlinkat.o c-ctype.o cloexec.o close.o closeout.o close-stream.o concat-filename.o c-strcasecmp.o c-strncasecmp.o dirname.o dirname-lgpl.o dup2.o dup-safer.o dup-safer-flag.o exitfail.o fatal-signal.o fd-hook.o fd-safer.o fd-safer-flag.o fopen.o fopen-safer.o fprintf.o frexp.o frexpl.o fstat.o getdtablesize.o get-errno.o gethrxtime.o getopt.o getprogname.o getrusage.o gettime.o gettimeofday.o gl_array_list.o gl_list.o gl_xlist.o hard-locale.o hash.o isnan.o isnand.o isnanf.o isnanl.o itold.o ldexpl.o localcharset.o localtime-buffer.o lstat.o main.o malloca.o malloc.o math.o mbrtowc.o mbsinit.o mbswidth.o memchr.o msvc-inval.o obstack.o obstack_printf.o open.o path-join.o perror.o pipe2-safer.o pipe-safer.o printf-args.o printf.o printf-frexp.o printf-frexpl.o printf-parse.o progname.o progreloc.o quotearg.o raise.o rawmemchr.o readlink.o realloc.o relocatable.o rename.o rmdir.o setenv.o sig-handler.o signbitd.o signbitf.o signbitl.o spawnattr_destroy.o spawnattr_init.o sprintf.o stat.o stat-time.o stat-w32.o stpcpy.o strchrnul.o strdup.o strerror.o stripslash.o strndup.o strnlen.o strverscmp.o timespec.o timevar.o unistd.o unlink.o unsetenv.o vasnprintf.o wait-process.o wctype-h.o xalloc-die.o xconcat-filename.o xmalloc.o xmemdup0.o xreadlink.o xsize.o xstrndup.o xtime.o yyerror.o error.o bitset/array.o bitset/list.o bitset/stats.o bitset/table.o bitset/vector.o fseterr.o spawn-pipe.o
$(AR) r $@ $^
%.o: %.c
$(CC) $(CFLAGS) -g -c -I.. -I../lib -o $@ $<

View file

@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: 2020 Giovanni Mascellani gio@debian.org
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
CC=tcc
AR="tcc -ar"
all: bison
bison: src.a lib.a
$(CC) $(CFLAGS) -g -o $@ $^
%.a: FORCE
set -e ;\
DIR=$(basename $@ .a) ;\
$(MAKE) CC=$(CC) AR=$(AR) CFLAGS=$(CGLAGS) -C $$DIR $@ ;\
cp $$DIR/$@ $@
FORCE:
install:
install -D bison $(DESTDIR)$(PREFIX)/bin/bison
rm -rf $(PREFIX)/share/bison
install -d $(DESTDIR)$(PREFIX)/share/bison
mv data/skeletons/ $(DESTDIR)$(PREFIX)/share/bison
mv data/m4sugar/ $(DESTDIR)$(PREFIX)/share/bison

View file

@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2020 Giovanni Mascellani gio@debian.org
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src.a: AnnotationList.o assoc.o closure.o complain.o conflicts.o derives.o files.o fixits.o getargs.o gram.o graphviz.o ielr.o InadequacyList.o lalr.o location.o lr0.o main.o muscle-tab.o named-ref.o nullable.o output.o parse-gram.o print.o print-graph.o print-xml.o reader.o reduce.o relation.o Sbitset.o scan-code.o scan-gram.o scan-skel.o state.o symlist.o symtab.o tables.o uniqstr.o
$(AR) r $@ $^
closure.o: parse-gram.h
parse-gram.h: parse-gram.c
%.o: %.c
$(CC) $(CFLAGS) -g -c -I. -I.. -I../lib -o $@ $<
%.c: %.y
bison -dv $<
mv $(shell echo $@ | sed -e 's/c$$/tab.c/') $@
mv $(shell echo $@ | sed -e 's/c$$/tab.h/') $(shell echo $@ | sed -e 's/c$$/h/')
%.c: %.l
/bin/sh ../build-aux/ylwrap $< lex.yy.c $@ -- flex
.PRECIOUS: %.c %.o %.h

25
steps/bison-3.4.1/pass1.sh Executable file
View file

@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
mv lib/textstyle.in.h lib/textstyle.h
# Remove pre-generated flex/bison files
rm src/parse-gram.c src/parse-gram.h
rm src/scan-code.c
rm src/scan-gram.c
rm src/scan-skel.c
# Handwritten bison parser
mv parse-gram.c parse-gram.h src/
cp ../../mk/lib.mk lib/Makefile
cp ../../mk/src.mk src/Makefile
}
src_compile() {
make -j1 -f Makefile PREFIX="${PREFIX}"
}

25
steps/bison-3.4.1/pass2.sh Executable file
View file

@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
mv lib/textstyle.in.h lib/textstyle.h
# Remove pre-generated flex/bison files
rm src/parse-gram.c src/parse-gram.h
rm src/scan-code.c
rm src/scan-gram.c
rm src/scan-skel.c
# Simplified bison grammar
mv parse-gram.y src/
cp ../../mk/lib.mk lib/Makefile
cp ../../mk/src.mk src/Makefile
}
src_compile() {
make -j1 -f Makefile PREFIX="${PREFIX}"
}

22
steps/bison-3.4.1/pass3.sh Executable file
View file

@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
mv lib/textstyle.in.h lib/textstyle.h
# Remove pre-generated flex/bison files
rm src/parse-gram.c src/parse-gram.h
rm src/scan-code.c
rm src/scan-gram.c
rm src/scan-skel.c
cp ../../mk/lib.mk lib/Makefile
cp ../../mk/src.mk src/Makefile
}
src_compile() {
make -j1 -f Makefile PREFIX="${PREFIX}"
}

View file

@ -0,0 +1,23 @@
SPDX-FileCopyrightText: 2020 Giovanni Mascellani <gio@debian.org>
SPDX-License-Identifier: GPL-3.0-or-later
commit b1127f6821cc9c40c5a9ee406bee7564c549d9a3
Author: Giovanni Mascellani <gio@debian.org>
Date: Thu Mar 26 18:02:01 2020 +0100
Compile bison.
diff --git lib/fseterr.c lib/fseterr.c
index 8cd68e8..0ec7e2c 100644
--- lib/fseterr.c
+++ lib/fseterr.c
@@ -53,7 +53,7 @@ fseterr (FILE *fp)
#elif defined EPLAN9 /* Plan9 */
if (fp->state != 0 /* CLOSED */)
fp->state = 5 /* ERR */;
-#elif 0 /* unknown */
+#elif 1 /* unknown */
/* Portable fallback, based on an idea by Rich Felker.
Wow! 6 system calls for something that is just a bit operation!
Not activated on any system, because there is no way to repair FP when

View file

@ -0,0 +1,70 @@
SPDX-FileCopyrightText: 2020 Giovanni Mascellani <gio@debian.org>
SPDX-License-Identifier: GPL-3.0-or-later
commit b1127f6821cc9c40c5a9ee406bee7564c549d9a3
Author: Giovanni Mascellani <gio@debian.org>
Date: Thu Mar 26 18:02:01 2020 +0100
Compile bison.
diff --git src/scan-code.l src/scan-code.l
index 73a3b2d..f348b20 100644
--- src/scan-code.l
+++ src/scan-code.l
@@ -21,6 +21,7 @@
%option prefix="code_" outfile="lex.yy.c"
%{
+#include "config.h"
#include <c-ctype.h>
#include <get-errno.h>
#include <quote.h>
@@ -31,6 +32,7 @@
#include <src/reader.h>
#include <src/scan-code.h>
#include <src/symlist.h>
+#include "system.h"
#define FLEX_PREFIX(Id) code_ ## Id
#include <src/flex-scanner.h>
diff --git src/scan-gram.l src/scan-gram.l
index 66a8caa..efa391a 100644
--- src/scan-gram.l
+++ src/scan-gram.l
@@ -21,6 +21,7 @@
%option prefix="gram_" outfile="lex.yy.c"
%{
+#include "config.h"
#include <c-ctype.h>
#include <mbswidth.h>
#include <quote.h>
@@ -33,6 +34,7 @@
#include <src/reader.h>
#include <src/scan-gram.h>
#include <src/uniqstr.h>
+#include "system.h"
#define FLEX_PREFIX(Id) gram_ ## Id
#include <src/flex-scanner.h>
diff --git src/scan-skel.l src/scan-skel.l
index 487e9f5..19f4832 100644
--- src/scan-skel.l
+++ src/scan-skel.l
@@ -21,6 +21,7 @@
%option prefix="skel_" outfile="lex.yy.c"
%{
+#include "config.h"
#include <dirname.h>
#include <error.h>
#include <path-join.h>
@@ -30,6 +31,7 @@
#include <src/files.h>
#include <src/getargs.h>
#include <src/scan-skel.h>
+#include "system.h"
#define FLEX_PREFIX(Id) skel_ ## Id
#include <src/flex-scanner.h>

View file

@ -0,0 +1 @@
https://mirrors.kernel.org/gnu/bison/bison-3.4.1.tar.gz 7007fc89c216fbfaff5525359b02a7e5b612694df5168c74673f67055f015095

Some files were not shown because too many files have changed in this diff Show more