logo

live-bootstrap

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

pass1.sh (2020B)


  1. # SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
  2. # SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
  3. #
  4. # SPDX-License-Identifier: GPL-3.0-or-later
  5. noextract="autogen-5.18.16.tar.xz"
  6. src_prepare() {
  7. mkdir build
  8. mv ../autogen-5.18.16 build/src
  9. mv ../autogen-5.18.16.tar.xz build/
  10. rm -f build/src/add-on/char-mapper/cm.tar
  11. }
  12. src_compile() {
  13. (
  14. set -e
  15. declare -x PKG_CONFIG_PATH="${LIBDIR}/pkgconfig"
  16. sed -i "s/make install/make install DESTDIR=\${DESTDIR}/" bootstrap_tarball.sh
  17. sed -i "/make check/d" bootstrap_tarball.sh
  18. declare -x FINALPREFIX="${PREFIX}"
  19. declare -x GUILE_STATIC="--static"
  20. declare -x GNULIBDIR="${PWD}"/../gnulib-8f4538a5
  21. declare -x MAN_PAGE_DATE=1970-01-01
  22. SKIP_MAIN=1 . ./bootstrap_tarball.sh
  23. prepare_tarball
  24. bootstrap_columns
  25. bootstrap_getdefs
  26. bootstrap_autogen
  27. bootstrap_tpl_config
  28. # Build stage2 autogen (stage1 autogen is not easy to install into /usr)
  29. rm -R build/tarball
  30. cp -ar build/autogen-5.18.16 build/tarball
  31. cd build/tarball
  32. # These files does not respect MAN_PAGE_DATE
  33. sed -i "s/+%Y/+1970/; s/%m/01/; s/%d'/01'/; s/%Y/2018/" autoopts/aoconf.tpl
  34. sed -i 's/%Y/2018/' autoopts/options_h.tpl
  35. SOURCE_DIR="$PWD" ./config/bootstrap
  36. # Specify timeout to avoid non-reproducibility
  37. CPPFLAGS=-D_LARGEFILE64_SOURCE=1 ./configure \
  38. --prefix="${FINALPREFIX}" \
  39. --libdir="${FINALPREFIX}/lib/i386-unknown-linux-musl" \
  40. --disable-shared \
  41. --enable-timeout=15
  42. touch doc/agdoc.texi # build later
  43. make -j1 CFLAGS=-Wno-error
  44. # Fix non-reproducible man-page
  45. awk '{gsub("\\(/tmp/.*", "", $7); print}' agen5/autogen.1 > autogen.1
  46. mv autogen.1 agen5/autogen.1
  47. cd ../..
  48. )
  49. }
  50. src_install() {
  51. cd build/tarball
  52. make DESTDIR="${DESTDIR}" install MAN_PAGE_DATE=1970-01-01
  53. # Some reproducibility issues and generally not useful for bootstrapping
  54. rm "${DESTDIR}${PREFIX}/share/autogen/libopts-"*.tar.gz
  55. cd ../..
  56. }