logo

live-bootstrap

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

pass2.sh (1858B)


  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 Lib/stringprep.py
  11. mv Lib/plat-generic .
  12. rm -r Lib/plat-*
  13. mv plat-generic Lib/
  14. grep generated -r . -l | grep encodings | xargs rm
  15. # Regenerate unicode
  16. rm Modules/unicodedata_db.h Modules/unicodename_db.h Objects/unicodetype_db.h
  17. mv ../UnicodeData-3.2.0.txt UnicodeData.txt
  18. mv ../CompositionExclusions-3.2.0.txt CompositionExclusions.txt
  19. python Tools/unicode/makeunicodedata.py
  20. # Regenerate sre_constants.h
  21. rm Modules/sre_constants.h
  22. python Lib/sre_constants.py
  23. # Regen ast module
  24. rm Lib/compiler/ast.py
  25. pushd Tools/compiler
  26. python astgen.py > ../../Lib/compiler/ast.py
  27. popd
  28. # Regenerate autoconf
  29. autoreconf-2.71 -fi
  30. }
  31. src_configure() {
  32. MACHDEP=linux ac_sys_system=Linux \
  33. CFLAGS="-U__DATE__ -U__TIME__" \
  34. ./configure \
  35. --prefix="${PREFIX}" \
  36. --libdir="${LIBDIR}" \
  37. --enable-ipv6
  38. }
  39. src_compile() {
  40. # Build pgen
  41. make "${MAKEJOBS}" Parser/pgen
  42. # Regen graminit.c and graminit.h
  43. make "${MAKEJOBS}" Include/graminit.h
  44. # Regenerate some Python scripts using the other regenerated files
  45. # Must move them out to avoid using Lib/ module files which are
  46. # incompatible with running version of Python
  47. cp Lib/{symbol,keyword,token}.py .
  48. python symbol.py
  49. python keyword.py
  50. python token.py
  51. # Now build the main program
  52. make "${MAKEJOBS}" CFLAGS="-U__DATE__ -U__TIME__"
  53. }
  54. src_install() {
  55. default
  56. # Remove non-reproducible .pyc/o files
  57. find "${DESTDIR}" -name "*.pyc" -delete
  58. find "${DESTDIR}" -name "*.pyo" -delete
  59. }