build 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. # We need a link to our GCC, otherwise the system cc gets used which points to
  4. # /usr/bin/gcc.
  5. [% pc('gcc', 'var/setup', { compiler_tarfile => c('input_files_by_name/gcc'),
  6. hardened_gcc => 0 }) %]
  7. ln -s gcc /var/tmp/dist/gcc/bin/cc
  8. distdir=/var/tmp/dist
  9. builddir=/var/tmp/build/[% project %]
  10. mkdir -p $distdir
  11. tar -C /var/tmp/dist -xf [% c('input_files_by_name/binutils') %]
  12. tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %]
  13. tar -C /var/tmp/dist -xf [% c('input_files_by_name/ninja') %]
  14. export PATH=/var/tmp/dist/binutils/bin:/var/tmp/dist/cmake/bin:/var/tmp/dist/ninja:$PATH
  15. mkdir -p /var/tmp/build
  16. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  17. mv /var/tmp/build/[% project %]-[% c('version') %] $builddir
  18. cd $builddir
  19. # We have no .git in our tar ball but the Makefile depends on that. Just
  20. # hard-code the version for now.
  21. patch -p1 < $rootdir/no-git.patch
  22. make -j[% c("buildconf/num_procs") %] PREFIX=$distdir/[% project %]
  23. cd $distdir
  24. [% c('tar', {
  25. tar_src => [ project ],
  26. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  27. }) %]