commit 58d6189af6914b00264bf556ef61b8c53ff5f2f1 Author: Georg Koppen gk@torproject.org Date: Thu Jul 9 15:09:07 2020 +0000
Bug 40018: Add libtapi project for cctools --- projects/libtapi/build | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ projects/libtapi/config | 20 ++++++++++++++++++++ 2 files changed, 68 insertions(+)
diff --git a/projects/libtapi/build b/projects/libtapi/build new file mode 100644 index 0000000..a0d9c3e --- /dev/null +++ b/projects/libtapi/build @@ -0,0 +1,48 @@ +#!/bin/bash +[% c("var/set_default_env") -%] +builddir=/var/tmp/build/[% project %]-[% c('version') %] +distdir=/var/tmp/dist/[% project %] +mkdir -p /var/tmp/dist +tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %] +tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %] +tar -C /var/tmp/dist -xf [% c('input_files_by_name/ninja') %] + +# We don't export the path to clang here to follow Mozilla's build script at +# taskcluster/scripts/misc/build-cctools-port.sh more closely. +export PATH="/var/tmp/dist/cmake/bin:/var/tmp/dist/ninja:$PATH" +export CLANG_DIR=/var/tmp/dist/clang +mkdir -p /var/tmp/build +tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz +export CC=$CLANG_DIR/bin/clang +export CXX=$CLANG_DIR/bin/clang++ +# We also need this LD_LIBRARY_PATH at build time, since tapi builds bits of +# clang build tools, and then executes those tools. +export LD_LIBRARY_PATH=$CLANG_DIR/lib + +cd $builddir +mkdir build +cd build +# Values taken from build.sh +TAPI_REPOSITORY=tapi-1000.10.8 +TAPI_VERSION=10.0.0 + +INCLUDE_FIX="-I $builddir/src/llvm/projects/clang/include -I $PWD/projects/clang/include" + +cmake $builddir/src/llvm \ + -GNinja \ + -DCMAKE_CXX_FLAGS="$INCLUDE_FIX" \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DCMAKE_BUILD_TYPE=RELEASE \ + -DCMAKE_INSTALL_PREFIX=$distdir \ + -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ + -DTAPI_REPOSITORY_STRING=$TAPI_REPOSITORY \ + -DTAPI_FULL_VERSION=$TAPI_VERSION + +ninja clangBasic +ninja libtapi install-libtapi install-tapi-headers + +cd /var/tmp/dist +[% c('tar', { + tar_src => [ project ], + tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), + }) %] diff --git a/projects/libtapi/config b/projects/libtapi/config new file mode 100644 index 0000000..6c4f5d0 --- /dev/null +++ b/projects/libtapi/config @@ -0,0 +1,20 @@ +# vim: filetype=yaml sw=2 +filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' +version: '[% c("abbrev") %]' +# This can be found in +# taskcluster/ci/fetch/toolchains.yml +git_hash: 3efb201881e7a76a21e0554906cf306432539cef +git_url: https://github.com/tpoechtrager/apple-libtapi + +var: + container: + use_container: 1 + +input_files: + - project: container-image + - name: clang + project: clang + - name: cmake + project: cmake + - name: ninja + project: ninja