logo

live-bootstrap

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

pass1.sh (1743B)


  1. # SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
  2. #
  3. # SPDX-License-Identifier: GPL-3.0-or-later
  4. src_prepare() {
  5. default
  6. # Remove broken file
  7. rm Lib/test/test_pep263.py
  8. # Delete generated files
  9. rm Modules/glmodule.c
  10. rm Modules/unicodedata_db.h Objects/unicodetype_db.h
  11. rm Lib/stringprep.py
  12. mv Lib/plat-generic .
  13. rm -r Lib/plat-*
  14. mv plat-generic Lib/
  15. grep generated -r . -l | grep encodings | xargs rm
  16. # Disable unicode
  17. patch -Np1 -i disable-unicode.patch
  18. # Regenerate sre_constants.h
  19. rm Modules/sre_constants.h
  20. python Lib/sre_constants.py
  21. # Regen ast module
  22. rm Lib/compiler/ast.py
  23. pushd Tools/compiler
  24. python astgen.py > ../../Lib/compiler/ast.py
  25. popd
  26. # Regenerate autoconf
  27. autoreconf-2.71 -fi
  28. }
  29. src_configure() {
  30. MACHDEP=linux ac_sys_system=Linux \
  31. CFLAGS="-U__DATE__ -U__TIME__" \
  32. ./configure \
  33. --prefix="${PREFIX}" \
  34. --libdir="${LIBDIR}" \
  35. --with-wctype-functions \
  36. --enable-ipv6
  37. }
  38. src_compile() {
  39. # Build pgen
  40. make "${MAKEJOBS}" Parser/pgen
  41. # Regen graminit.c and graminit.h
  42. make "${MAKEJOBS}" Include/graminit.h
  43. # Regenerate some Python scripts using the other regenerated files
  44. # Must move them out to avoid using Lib/ module files which are
  45. # incompatible with running version of Python
  46. cp Lib/{symbol,keyword,token}.py .
  47. python symbol.py
  48. python keyword.py
  49. python token.py
  50. # Now build the main program
  51. make "${MAKEJOBS}" CFLAGS="-U__DATE__ -U__TIME__"
  52. }
  53. src_install() {
  54. default
  55. # Remove non-reproducible .pyc/o files
  56. find "${DESTDIR}" -name "*.pyc" -delete
  57. find "${DESTDIR}" -name "*.pyo" -delete
  58. }