From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1475066-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 5EA77158010
	for <garchives@archives.gentoo.org>; Sun,  8 Jan 2023 05:46:54 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 6AF27E07D3;
	Sun,  8 Jan 2023 05:46:53 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 52987E07E0
	for <gentoo-commits@lists.gentoo.org>; Sun,  8 Jan 2023 05:46:53 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 5E957340B9C
	for <gentoo-commits@lists.gentoo.org>; Sun,  8 Jan 2023 05:46:52 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id E49DB804
	for <gentoo-commits@lists.gentoo.org>; Sun,  8 Jan 2023 05:46:50 +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: <1673156796.0c2f8b88166f43867c14a0e79da583edad53dbf9.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/Manifest dev-ml/llvm-ocaml/llvm-ocaml-16.0.0_pre20230107.ebuild
X-VCS-Directories: dev-ml/llvm-ocaml/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 0c2f8b88166f43867c14a0e79da583edad53dbf9
X-VCS-Branch: master
Date: Sun,  8 Jan 2023 05:46:50 +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: d0c0fbb6-d139-4ed7-bc48-23902f797650
X-Archives-Hash: 152f0287923d799ad7250aef0bc04020

commit:     0c2f8b88166f43867c14a0e79da583edad53dbf9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  7 17:33:52 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 05:46:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c2f8b88

dev-ml/llvm-ocaml: Add 16.0.0_pre20230107 snapshot

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

 dev-ml/llvm-ocaml/Manifest                         |   1 +
 .../llvm-ocaml-16.0.0_pre20230107.ebuild           | 112 +++++++++++++++++++++
 2 files changed, 113 insertions(+)

diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest
index 8fb4cecf6fdd..528a54626cc7 100644
--- a/dev-ml/llvm-ocaml/Manifest
+++ b/dev-ml/llvm-ocaml/Manifest
@@ -2,5 +2,6 @@ DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B ee67c5407df8cef493b9c0004f
 DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f SHA512 b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6
 DIST llvm-project-15.0.6.src.tar.xz 112074576 BLAKE2B 74b1aa967c95191fa492f06b3a21930842da0ccbd9995dd33b4c2cf07852bbedcae97041fd5966209b16c63b90c87cc02fb2e858eda13dd9cc0641edcede0f75 SHA512 3311d85f4e02610af52f06e83c8c6d2b93950d24324b831b7afc47c39a20a546d39683a14e1a315da87d226379042de900a3f36a0351053547482af9035ab949
 DIST llvm-project-15.0.6.src.tar.xz.sig 438 BLAKE2B 3c97dbd55667f52dad964ef71257c36e3075794f5616cfd46de8bf874867e861bf45c0d56cff2d0ad5d4f1b5a1c9b3a395aedcc40bce545ce7f3c84ac75ae3da SHA512 a184103d84f8197a709c6c067fa83ca9290cd06532c487ad2c1fefa423438a1ac3c7f88835a94e3c9f04876e8d5f09afabef15bd8605df38aec6a4118597090c
+DIST llvm-project-6dc85bd3fde7df2999fda07e9e9f2e83d52c6125.tar.gz 175208511 BLAKE2B cf87cf7e9bf7c74aab8ccda0f153369cb81798047fdd48025c3c7030857b128babbaafb667385a5c8e9916e16038b14fee39f1623d329471e73c39c2f2d7bbfa SHA512 e6dc0cacd6c079be8a00364e4c244782d764d9a8d514d65f9078427cb4a0c1663ff88761bfbc1e955a1a990451439110497c2cb7af7f56b2c91f2e9db4389894
 DIST llvm-project-b20dd2b186fdc76828219b705a2b58f5830f4b9d.tar.gz 175044630 BLAKE2B f9a955e8413b57067fb697792316fb0c1e3eac00b1af208ba5d29db01a9acc96b88c7edca12c43762b1425c71a716a7c74d5d7edad45a442f32ba73f88f548b6 SHA512 5133c32d7856c8280bfeb47c3e5a9c0d8c1c291aad29af93586523110f95b08e582ff416fc6be02241eabfe80c35ad4f0334de5ead2a41bc6504616b1c6fd15a
 DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f

diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-16.0.0_pre20230107.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-16.0.0_pre20230107.ebuild
new file mode 100644
index 000000000000..32a62fa4b1c6
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-16.0.0_pre20230107.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+inherit cmake llvm llvm.org python-any-r1
+
+DESCRIPTION="OCaml bindings for LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0/${PV}"
+KEYWORDS=""
+IUSE="debug test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=dev-lang/ocaml-4.00.0:0=
+	dev-ml/ocaml-ctypes:=
+	~sys-devel/llvm-${PV}:=[debug?]
+	!sys-devel/llvm[ocaml(-)]
+"
+
+DEPEND="
+	${RDEPEND}
+"
+BDEPEND="
+	${PYTHON_DEPS}
+	dev-lang/perl
+	dev-ml/findlib
+	>=dev-util/cmake-3.16
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+pkg_setup() {
+	LLVM_MAX_SLOT=${LLVM_MAJOR} 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}"
+
+		-DPython3_EXECUTABLE="${PYTHON}"
+
+		# 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_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_build ocaml_all
+}
+
+src_test() {
+	# respect TMPDIR!
+	local -x LIT_PRESERVES_TMP=1
+	cmake_build check-llvm-bindings-ocaml
+}
+
+src_install() {
+	DESTDIR="${D}" \
+	cmake -P "${BUILD_DIR}"/bindings/ocaml/cmake_install.cmake || die
+
+	dodoc bindings/ocaml/README.txt
+}