From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 F1ABF138351 for ; Sat, 18 Jan 2020 17:18:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DD20EE08BD; Sat, 18 Jan 2020 17:18:52 +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 7CCE1E08BD for ; Sat, 18 Jan 2020 17:18:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 5927434E192 for ; Sat, 18 Jan 2020 17:18:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A5989E5 for ; Sat, 18 Jan 2020 17:18:48 +0000 (UTC) From: "Michał Górny" 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" Message-ID: <1579367911.3416dc3ef79664a37186e5920bfe96f17e12c75c.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-11.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: 3416dc3ef79664a37186e5920bfe96f17e12c75c X-VCS-Branch: master Date: Sat, 18 Jan 2020 17:18:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 076d7805-f58f-4c15-825f-135350cf1c76 X-Archives-Hash: 25b778e72af06a98f498b04cf7c3ab1d commit: 3416dc3ef79664a37186e5920bfe96f17e12c75c Author: Michał Górny gentoo org> AuthorDate: Sat Jan 18 16:40:47 2020 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Jan 18 17:18:31 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3416dc3e dev-ml/llvm-ocaml: Include 11.* ebuilds for master Signed-off-by: Michał Górny gentoo.org> dev-ml/llvm-ocaml/llvm-ocaml-11.0.0.9999.ebuild | 126 ++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-11.0.0.9999.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-11.0.0.9999.ebuild new file mode 100644 index 00000000000..b9f6124e6f0 --- /dev/null +++ b/dev-ml/llvm-ocaml/llvm-ocaml-11.0.0.9999.ebuild @@ -0,0 +1,126 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python{2_7,3_{6,7}} ) +inherit cmake-utils llvm llvm.org multiprocessing 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 AVR ) +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM 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}" + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +pkg_setup() { + LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup + python-any-r1_pkg_setup +} + +src_prepare() { + # Python is needed to run tests using lit + python_setup + + cmake-utils_src_prepare +} + +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 + -DWITH_POLLY=OFF + -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="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}" + ) + + # 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 +}