build 997 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. distdir=/var/tmp/dist
  4. builddir=/var/tmp/build/[% project %]
  5. mkdir -p $distdir/[% project %]
  6. tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/rust') %]
  7. export PATH="/var/tmp/dist/rust/bin:$PATH"
  8. mkdir -p /var/tmp/build
  9. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  10. # Now prepare the offline build
  11. # Move the directory for hardcoding the path in .cargo/config
  12. mv /var/tmp/build/[% project %]-[% c('version') %] $builddir
  13. tar -C $builddir -xjf cbindgen-vendor.tar.bz2
  14. cd $builddir
  15. mkdir .cargo
  16. cat > .cargo/config << 'EOF'
  17. [source.crates-io]
  18. replace-with = "vendored-sources"
  19. [source.vendored-sources]
  20. directory = "/var/tmp/build/cbindgen/vendor"
  21. EOF
  22. cargo build --release --frozen --target x86_64-unknown-linux-gnu
  23. mv target/x86_64-unknown-linux-gnu/release/cbindgen $distdir/[% project %]
  24. cd $distdir
  25. [% c('tar', {
  26. tar_src => [ project ],
  27. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  28. }) %]