From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1187650-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 4306713835A
	for <garchives@archives.gentoo.org>; Wed, 15 Jul 2020 18:41:55 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 667A4E08AC;
	Wed, 15 Jul 2020 18:41:54 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 4C432E08AC
	for <gentoo-commits@lists.gentoo.org>; Wed, 15 Jul 2020 18:41:54 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 530B134F068
	for <gentoo-commits@lists.gentoo.org>; Wed, 15 Jul 2020 18:41:53 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id E4D4C2DF
	for <gentoo-commits@lists.gentoo.org>; Wed, 15 Jul 2020 18:41:49 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1594838493.01d70c0d45be41860a69ea2b4b37a220da1a8f19.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ml/llvm-ocaml/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-ml/llvm-ocaml/llvm-ocaml-12.0.0.9999.ebuild
X-VCS-Directories: dev-ml/llvm-ocaml/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 01d70c0d45be41860a69ea2b4b37a220da1a8f19
X-VCS-Branch: master
Date: Wed, 15 Jul 2020 18:41:49 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 57dd5a18-ca77-468f-ba92-48853e0d16b4
X-Archives-Hash: 5cd7c3daf344b1dccc063509a6bf9089

commit:     01d70c0d45be41860a69ea2b4b37a220da1a8f19
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 15 18:36:18 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jul 15 18:41:33 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01d70c0d

dev-ml/llvm-ocaml: Add 12.0.0.9999 for master branch

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-ml/llvm-ocaml/llvm-ocaml-12.0.0.9999.ebuild | 115 ++++++++++++++++++++++++
 1 file changed, 115 insertions(+)

diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-12.0.0.9999.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-12.0.0.9999.ebuild
new file mode 100644
index 00000000000..f10bf23e527
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-12.0.0.9999.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+inherit cmake-utils llvm llvm.org python-any-r1
+
+DESCRIPTION="OCaml bindings for LLVM"
+HOMEPAGE="https://llvm.org/"
+LLVM_COMPONENTS=( llvm )
+llvm.org_set_globals
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC VE )
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
+	NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore
+	"${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}" )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0/${PV}"
+KEYWORDS=""
+IUSE="debug test ${ALL_LLVM_TARGETS[*]}"
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=dev-lang/ocaml-4.00.0:0=
+	dev-ml/ocaml-ctypes:=
+	~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,},debug?]
+	!sys-devel/llvm[ocaml(-)]"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	dev-lang/perl
+	dev-ml/findlib
+	test? ( dev-ml/ounit )
+	${PYTHON_DEPS}"
+
+pkg_setup() {
+	LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+	python-any-r1_pkg_setup
+}
+
+src_configure() {
+	local libdir=$(get_libdir)
+	local mycmakeargs=(
+		-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+		-DBUILD_SHARED_LIBS=OFF
+		-DLLVM_BUILD_LLVM_DYLIB=ON
+		-DLLVM_LINK_LLVM_DYLIB=ON
+		-DLLVM_OCAML_OUT_OF_TREE=ON
+
+		# cheap hack: LLVM combines both anyway, and the only difference
+		# is that the former list is explicitly verified at cmake time
+		-DLLVM_TARGETS_TO_BUILD=""
+		-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+		-DLLVM_BUILD_TESTS=$(usex test)
+
+		# disable various irrelevant deps and settings
+		-DLLVM_ENABLE_FFI=OFF
+		-DLLVM_ENABLE_TERMINFO=OFF
+		-DHAVE_HISTEDIT_H=NO
+		-DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+		-DLLVM_ENABLE_EH=ON
+		-DLLVM_ENABLE_RTTI=ON
+
+		-DLLVM_HOST_TRIPLE="${CHOST}"
+
+		# disable go bindings
+		-DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+
+		# TODO: ocamldoc
+	)
+
+	use test && mycmakeargs+=(
+		-DLLVM_LIT_ARGS="$(get_lit_flags)"
+	)
+
+	# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+	# also: custom rules for OCaml do not work for CPPFLAGS
+	use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG"
+	cmake-utils_src_configure
+
+	local llvm_libdir=$(llvm-config --libdir)
+	# an ugly hack; TODO: figure out a way to pass -L to ocaml...
+	cd "${BUILD_DIR}/${libdir}" || die
+	ln -s "${llvm_libdir}"/*.so . || die
+
+	if use test; then
+		local llvm_bindir=$(llvm-config --bindir)
+		# Force using system-installed tools.
+		sed -i -e "/llvm_tools_dir/s@\".*\"@\"${llvm_bindir}\"@" \
+			"${BUILD_DIR}"/test/lit.site.cfg.py || die
+	fi
+}
+
+src_compile() {
+	cmake-utils_src_compile ocaml_all
+}
+
+src_test() {
+	# respect TMPDIR!
+	local -x LIT_PRESERVES_TMP=1
+	cmake-utils_src_make check-llvm-bindings-ocaml
+}
+
+src_install() {
+	DESTDIR="${D}" \
+	cmake -P "${BUILD_DIR}"/bindings/ocaml/cmake_install.cmake || die
+
+	dodoc bindings/ocaml/README.txt
+}