logo

live-bootstrap

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

pass2.sh (1465B)


  1. # SPDX-FileCopyrightText: © 2023 fosslinux <fosslinux@aussies.space>
  2. #
  3. # SPDX-License-Identifier: GPL-3.0-or-later
  4. src_prepare() {
  5. default
  6. # Remove bison generated files
  7. rm y.tab.c y.tab.h
  8. # Skip documentation
  9. mv doc/Makefile.in Makefile.in.doc
  10. rm doc/*
  11. mv Makefile.in.doc doc/Makefile.in
  12. # Rebuild configure script
  13. rm configure
  14. autoconf-2.69
  15. # avoid non-deterministic build:
  16. printf '%s\n%s\n' \
  17. '#!/bin/sh' \
  18. 'echo "#define PIPESIZE 65536"' >builtins/psize.sh
  19. }
  20. src_configure() {
  21. # --build argument needed for reproducibility
  22. # bash_cv_dev_stdin and bash_cv_dev_fd are also used to
  23. # improve reproducibility because they make configure
  24. # skip checking for /dev/{fd,stdin,stdout,stderr} (build
  25. # output is affected by their availability otherwise).
  26. # size is part of binutils and is not yet available.
  27. CC=tcc LD=tcc AR="tcc -ar" SIZE=true ./configure --prefix="${PREFIX}" \
  28. --without-bash-malloc \
  29. --disable-nls \
  30. --build=i386-linux-gnu \
  31. --enable-static-link \
  32. bash_cv_dev_stdin=absent \
  33. bash_cv_dev_fd=whacky
  34. }
  35. src_compile() {
  36. make -j1
  37. }
  38. src_install() {
  39. install -D bash "${DESTDIR}${PREFIX}/bin/bash"
  40. # Work around weird symlink bug
  41. install bash "${DESTDIR}${PREFIX}/bin/sh"
  42. # Needs special handling b/c is currently running - tar doesn't like this
  43. rm -f "${PREFIX}/bin/bash" "${PREFIX}/bin/sh"
  44. }