llvm-conf-9999.ebuild 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright 1999-2022 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. if [[ ${PV} == 9999 ]]; then
  5. EGIT_REPO_URI="https://github.com/clang-musl-overlay/llvm-conf.git"
  6. inherit git-r3
  7. else
  8. SRC_URI="https://github.com/clang-musl-overlay/llvm-conf/archive/refs/tags/v${PV}.tar.gz"
  9. KEYWORDS="amd64"
  10. fi
  11. DESCRIPTION="Utility to manage llvm profiles"
  12. HOMEPAGE="https://github.com/clang-musl-overlay/llvm-conf.git"
  13. LICENSE="GPL-2"
  14. SLOT="0"
  15. IUSE="+binutils-wrappers +clang-wrappers +native-symlinks"
  16. RDEPEND="
  17. >=sys-apps/gentoo-functions-0.10
  18. "
  19. _emake() {
  20. emake \
  21. PV="${PVR}" \
  22. SUBLIBDIR="$(get_libdir)" \
  23. USE_CLANG_WRAPPERS="$(usex clang-wrappers)" \
  24. USE_BINUTILS_WRAPPERS="$(usex binutils-wrappers)" \
  25. USE_NATIVE_LINKS="$(usex native-symlinks)" \
  26. TOOLCHAIN_PREFIX="${CHOST}-" \
  27. "$@"
  28. }
  29. src_compile() {
  30. _emake
  31. }
  32. src_install() {
  33. _emake DESTDIR="${D}" install
  34. }
  35. pkg_postinst() {
  36. # Do we have a valid setup ?
  37. if ! llvm-conf -C -c >/dev/null 2>&1 ; then
  38. llvm-conf latest
  39. fi
  40. }
  41. pkg_postrm() {
  42. # remove /etc/env.d/60llvm
  43. test -f /etc/env.d/60llvm && rm -f /etc/env.d/60llvm
  44. }