sys-libs/compiler-rt: Add a stand-alone ebuild for compiler-rt
authorMichał Górny <mgorny@gentoo.org>
Sun, 21 Aug 2016 09:43:45 +0000 (11:43 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 22 Aug 2016 15:11:48 +0000 (17:11 +0200)
sys-libs/compiler-rt/compiler-rt-9999.ebuild [new file with mode: 0644]
sys-libs/compiler-rt/metadata.xml [new file with mode: 0644]

diff --git a/sys-libs/compiler-rt/compiler-rt-9999.ebuild b/sys-libs/compiler-rt/compiler-rt-9999.ebuild
new file mode 100644 (file)
index 0000000..7c93672
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+CMAKE_MIN_VERSION=3.4.3
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils git-r3 python-single-r1
+
+DESCRIPTION="Compiler runtime libraries for clang"
+HOMEPAGE="http://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="http://llvm.org/git/compiler-rt.git
+       https://github.com/llvm-mirror/compiler-rt.git"
+
+LICENSE="UoI-NCSA"
+SLOT="0/${PV%.*}"
+KEYWORDS=""
+IUSE="+sanitize"
+
+RDEPEND="
+       ~sys-devel/llvm-${PV}
+       !<sys-devel/llvm-${PV}
+       sanitize? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+       ${PYTHON_DEPS}"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+src_configure() {
+       local clang_version=4.0.0
+       local libdir=$(get_libdir)
+       local mycmakeargs=(
+               # used to find cmake modules
+               -DLLVM_LIBDIR_SUFFIX="${libdir#lib}"
+               -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${clang_version}"
+
+               # TODO: tests do not support standalone builds
+               -DCOMPILER_RT_INCLUDE_TESTS=OFF
+               -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
+       )
+
+       cmake-utils_src_configure
+}
+
+src_install() {
+       cmake-utils_src_install
+
+       use sanitize && python_doscript "${S}"/lib/asan/scripts/asan_symbolize.py
+}
diff --git a/sys-libs/compiler-rt/metadata.xml b/sys-libs/compiler-rt/metadata.xml
new file mode 100644 (file)
index 0000000..ea472dc
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="project">
+               <email>llvm@gentoo.org</email>
+       </maintainer>
+       <use>
+               <flag name="sanitize">Build compiler-rt's sanitizers</flag>
+       </use>
+</pkgmetadata>