logo

live-bootstrap

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

pass2.sh (1827B)


  1. # SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
  2. #
  3. # SPDX-License-Identifier: GPL-3.0-or-later
  4. src_prepare() {
  5. default
  6. # Delete generated files
  7. rm Modules/glmodule.c
  8. mv Lib/plat-generic .
  9. rm -r Lib/plat-*
  10. mv plat-generic Lib/
  11. grep generated -r . -l | grep encodings | xargs rm
  12. # Regenerate unicode
  13. rm Modules/unicodedata_db.h Objects/unicodetype_db.h
  14. mv ../UnicodeData-3.0.0.txt UnicodeData-Latest.txt
  15. python Tools/unicode/makeunicodedata.py
  16. # Regenerate sre_constants.h
  17. rm Modules/sre_constants.h
  18. python Lib/sre_constants.py
  19. # Regenerate autoconf
  20. autoreconf-2.71 -fi
  21. }
  22. src_configure() {
  23. MACHDEP=linux ac_sys_system=Linux \
  24. ./configure \
  25. --prefix="${PREFIX}" \
  26. --libdir="${LIBDIR}"
  27. }
  28. src_compile() {
  29. # Build pgen
  30. pushd Parser
  31. make -j1 pgen
  32. popd
  33. # Regen graminit.c and graminit.h
  34. pushd Grammar
  35. make -j1 graminit.c
  36. popd
  37. # Regenerate some Python scripts using the other regenerated files
  38. gcc -o keyword keyword.c
  39. gcc -o token token.c
  40. # This gets all of the grammar tokens
  41. grep -E '\{1, "[^"]+"' Python/graminit.c | ./keyword > Lib/keyword.py.new
  42. mv Lib/keyword.py.new Lib/keyword.py
  43. ./token Lib/symbol.py < Include/graminit.h > Lib/symbol.py.new
  44. mv Lib/symbol.py.new Lib/symbol.py
  45. # These get all of the #defines that have to be translated
  46. grep '#define[[:space:]][A-Z]*[[:space:]][[:space:]]*[0-9][0-9]*' Include/token.h | ./token Lib/token.py > Lib/token.py.new
  47. mv Lib/token.py.new Lib/token.py
  48. # Now build the main program
  49. make -j1
  50. }
  51. src_install() {
  52. mkdir -p "${DESTDIR}/usr"
  53. default
  54. # Remove non-reproducible .pyc/o files
  55. find "${DESTDIR}" -name "*.pyc" -delete
  56. find "${DESTDIR}" -name "*.pyo" -delete
  57. }