logo

live-bootstrap

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

pass1.sh (2497B)


  1. # SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
  2. # SPDX-FileCopyrightText: 2021 Michael Schierl <schierlm@gmx.de>
  3. # SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
  4. #
  5. # SPDX-License-Identifier: GPL-3.0-or-later
  6. # guile-psyntax-bootstrapping only supports Guile 3.0.7
  7. # We need Guile 3.0.8 or later in order to have reproducible builds when
  8. # parallelism (-jX) is enabled.
  9. #
  10. # To work around this issue, we;
  11. # 1. run guile-psyntax-bootstrapping on Guile 3.0.7
  12. # 2. take psyntax-pp.scm from Guile 3.0.7 and transplant into 3.0.9
  13. # 3. compile guile 3.0.9
  14. common_prepare() {
  15. find . -name '*.info*' -delete
  16. rm -r prebuilt/*/ice-9
  17. # Remove buildstamp
  18. sed -i "s/\`date -u +'%Y-%m-%d %T'.*\`/1970-01-01 00:00:00/" libguile/Makefile.am
  19. autoreconf-2.71 -fi
  20. }
  21. src_prepare() {
  22. # First, prepare Guile 3.0.7
  23. cd ../guile-3.0.7
  24. ../../import-gnulib-3.0.7.sh
  25. common_prepare
  26. # pp-syntax bootstrap: remove pre-gen file
  27. sha256sum module/ice-9/psyntax-pp.scm | tee psyntax-pp.sha256
  28. rm module/ice-9/psyntax-pp.scm
  29. ## now let us prepare to rebuild it
  30. echo '(primitive-load-path "psyntax-bootstrap/allsteps")' > module/ice-9/psyntax-pp.scm
  31. mkdir -p module/psyntax-bootstrap
  32. cp ../guile-psyntax-bootstrapping-guile-3.0.7/psyntax-bootstrap/*.scm module/psyntax-bootstrap
  33. cd module/ice-9
  34. cp psyntax.scm psyntax-patched.scm
  35. patch <../../../guile-psyntax-bootstrapping-guile-3.0.7/stage2.patch
  36. cd ../..
  37. # Now, Guile 3.0.9
  38. cd ../guile-3.0.9
  39. default
  40. ../../import-gnulib.sh
  41. common_prepare
  42. }
  43. src_configure() {
  44. for d in . ../guile-3.0.7; do
  45. pushd "${d}"
  46. PKG_CONFIG_PATH="${LIBDIR}/pkgconfig" ./configure \
  47. --prefix="${PREFIX}" \
  48. --libdir="${LIBDIR}" \
  49. --build=i386-unknown-linux-musl \
  50. --disable-shared \
  51. --disable-jit
  52. popd
  53. done
  54. }
  55. src_compile() {
  56. # pp-syntax: rebuild
  57. pushd ../guile-3.0.7
  58. make config.h
  59. make libguile/scmconfig.h
  60. make .version
  61. cd lib
  62. make all
  63. cd ../meta
  64. make all
  65. cd ../libguile
  66. make all
  67. cd ../module
  68. make ice-9/psyntax-pp.scm.gen
  69. cd ..
  70. # Note that on 32-bit systems psyntax-pp is not identical to the original
  71. # and some identifier names are different.
  72. popd
  73. # Transplant psyntax-pp.scm
  74. cp -f ../guile-3.0.7/module/ice-9/psyntax-pp.scm module/ice-9/
  75. # Now proceed with the build
  76. default
  77. }