Michael Benfield | b6b2033 | 2022-09-15 23:54:36 +0000 | [diff] [blame] | 1 | # Copyright 2022 The ChromiumOS Authors |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | |
| 4 | EAPI=7 |
| 5 | |
| 6 | inherit cros-llvm cros-constants cros-rustc-directories git-r3 |
| 7 | |
Michael Benfield | 5fab1f2 | 2022-11-14 05:30:11 +0000 | [diff] [blame] | 8 | LLVM_HASH="db1978b67431ca3462ad8935bf662c15750b8252" # r465103 |
| 9 | LLVM_NEXT_HASH="db1978b67431ca3462ad8935bf662c15750b8252" # r465103 |
Michael Benfield | b6b2033 | 2022-09-15 23:54:36 +0000 | [diff] [blame] | 10 | |
| 11 | EGIT_REPO_URI="${CROS_GIT_HOST_URL}/external/github.com/llvm/llvm-project |
| 12 | ${CROS_GIT_HOST_URL}/external/github.com/llvm/llvm-project" |
| 13 | EGIT_BRANCH=main |
| 14 | EGIT_CHECKOUT_DIR=${CROS_RUSTC_LLVM_SRC_DIR} |
| 15 | S=${CROS_RUSTC_LLVM_SRC_DIR} |
| 16 | |
| 17 | LICENSE="UoI-NCSA" |
| 18 | SLOT="8" |
| 19 | KEYWORDS="-* amd64" |
| 20 | |
| 21 | IUSE="llvm-next llvm-tot" |
| 22 | |
| 23 | pkg_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 | |
| 32 | src_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 Benfield | b3a161a | 2022-11-03 22:32:47 +0000 | [diff] [blame] | 40 | |
| 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 Benfield | b6b2033 | 2022-09-15 23:54:36 +0000 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | src_prepare() { |
| 48 | prepare_patches |
| 49 | eapply_user |
| 50 | } |
| 51 | |
| 52 | src_compile() { |
| 53 | true |
| 54 | } |
| 55 | |
| 56 | src_install() { |
| 57 | true |
| 58 | } |