logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

pass1.sh (1647B)


  1. # SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
  2. # SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
  3. # SPDX-FileCopyrightText: 2021 Bastian Bittorf <bb@npl.de>
  4. # SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
  5. #
  6. # SPDX-License-Identifier: GPL-3.0-or-later
  7. src_prepare() {
  8. # Remove bison generated files
  9. rm y.tab.c y.tab.h
  10. # Remove prebuilt translation catalogs
  11. rm po/*.gmo
  12. # Skip documentation
  13. mv doc/Makefile.in Makefile.in.doc
  14. rm doc/*
  15. mv Makefile.in.doc doc/Makefile.in
  16. # Erroneously included file (configure checks do not work)
  17. rm lib/sh/strtoimax.c
  18. touch lib/sh/strtoimax.c
  19. # Rebuild configure script
  20. rm configure
  21. autoconf-2.69
  22. # avoid non-deterministic build:
  23. printf '%s\n%s\n' \
  24. '#!/bin/sh' \
  25. 'echo "#define PIPESIZE 65536"' >builtins/psize.sh
  26. }
  27. src_configure() {
  28. # --build argument needed for reproducibility
  29. # bash_cv_dev_stdin and bash_cv_dev_fd are also used to
  30. # improve reproducibility because they make configure
  31. # skip checking for /dev/{fd,stdin,stdout,stderr} (build
  32. # output is affected by their availability otherwise).
  33. # size is part of binutils and is not yet available.
  34. ./configure --prefix="${PREFIX}" \
  35. --without-bash-malloc \
  36. --disable-nls \
  37. --build=i386-unknown-linux-musl \
  38. --enable-static-link \
  39. bash_cv_dev_stdin=absent \
  40. bash_cv_dev_fd=whacky
  41. }
  42. src_compile() {
  43. make -j1 PREFIX="${PREFIX}"
  44. }
  45. src_install() {
  46. install -D bash "${DESTDIR}${PREFIX}/bin/bash"
  47. install bash "${DESTDIR}${PREFIX}/bin/sh"
  48. }