blob: 45b6af89fc2b36183107e2918b5bb8beb35d5d9d [file] [log] [blame]
Michael Benfieldb6b20332022-09-15 23:54:36 +00001# Copyright 2022 The ChromiumOS Authors
2# Distributed under the terms of the GNU General Public License v2
3
4EAPI=7
5
6inherit cros-llvm cros-constants cros-rustc-directories git-r3
7
Michael Benfield5fab1f22022-11-14 05:30:11 +00008LLVM_HASH="db1978b67431ca3462ad8935bf662c15750b8252" # r465103
9LLVM_NEXT_HASH="db1978b67431ca3462ad8935bf662c15750b8252" # r465103
Michael Benfieldb6b20332022-09-15 23:54:36 +000010
11EGIT_REPO_URI="${CROS_GIT_HOST_URL}/external/github.com/llvm/llvm-project
12 ${CROS_GIT_HOST_URL}/external/github.com/llvm/llvm-project"
13EGIT_BRANCH=main
14EGIT_CHECKOUT_DIR=${CROS_RUSTC_LLVM_SRC_DIR}
15S=${CROS_RUSTC_LLVM_SRC_DIR}
16
17LICENSE="UoI-NCSA"
18SLOT="8"
19KEYWORDS="-* amd64"
20
21IUSE="llvm-next llvm-tot"
22
23pkg_setup() {
24 addwrite "${CROS_RUSTC_DIR}"
25 if ! [[ -e "${CROS_RUSTC_DIR}" ]]; then
26 # shellcheck disable=SC2174
27 mkdir -p -m 755 "${CROS_RUSTC_DIR}"
28 chown "${PORTAGE_USERNAME}:${PORTAGE_GRPNAME}" "${CROS_RUSTC_DIR}"
29 fi
30}
31
32src_unpack() {
33 if use llvm-next || use llvm-tot; then
34 EGIT_COMMIT="${LLVM_NEXT_HASH}"
35 else
36 EGIT_COMMIT="${LLVM_HASH}"
37 fi
38
39 git-r3_src_unpack
Michael Benfieldb3a161a2022-11-03 22:32:47 +000040
41 # git-r3_src_unpack won't freshly unpack sources if they're already
42 # there, so we do the following to get to a clean state.
43 git -C "${S}" reset --hard HEAD || die
44 git -C "${S}" clean -fd || die
Michael Benfieldb6b20332022-09-15 23:54:36 +000045}
46
47src_prepare() {
48 prepare_patches
49 eapply_user
50}
51
52src_compile() {
53 true
54}
55
56src_install() {
57 true
58}