commit: 4820925d836d626b96bc362c00a44e2d4474ec5b Author: Maciej Barć <xgqt <AT> gentoo <DOT> org> AuthorDate: Sat Aug 24 10:26:34 2024 +0000 Commit: Maciej Barć <xgqt <AT> gentoo <DOT> org> CommitDate: Sat Aug 24 15:30:24 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4820925d
sci-electronics/ghdl: add static-libs USE for llvm Closes: https://bugs.gentoo.org/938171 Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org> sci-electronics/ghdl/ghdl-4.1.0-r1.ebuild | 100 ++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/sci-electronics/ghdl/ghdl-4.1.0-r1.ebuild b/sci-electronics/ghdl/ghdl-4.1.0-r1.ebuild new file mode 100644 index 000000000000..ab07376f8f4f --- /dev/null +++ b/sci-electronics/ghdl/ghdl-4.1.0-r1.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ADA_COMPAT=( gnat_2021 gcc_13 ) +LLVM_COMPAT=( {16..17} ) # Check configure script for supported LLVM versions. + +inherit ada edo llvm-r1 toolchain-funcs + +DESCRIPTION="Open-source analyzer, compiler, and simulator for VHDL 2008/93/87" +HOMEPAGE="https://ghdl.github.io/ghdl/ + https://github.com/ghdl/ghdl/" + +if [[ "${PV}" == *9999* ]] ; then + inherit git-r3 + + EGIT_REPO_URI="https://github.com/ghdl/${PN}.git" +else + SRC_URI="https://github.com/ghdl/${PN}/archive/v${PV}.tar.gz + -> ${P}.tar.gz" + + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="GPL-2+" +SLOT="0" +IUSE="llvm +static-libs" + +# The LLVM backend requires static libraries to work, see bug: https://bugs.gentoo.org/938171 +REQUIRED_USE="${ADA_REQUIRED_USE} llvm? ( static-libs )" + +RDEPEND=" + ${ADA_DEPS} + llvm? ( + $(llvm_gen_dep ' + sys-devel/llvm:${LLVM_SLOT}= + ') + ) +" +DEPEND=" + ${RDEPEND} +" +BDEPEND=" + dev-util/patchelf +" + +PATCHES=( "${FILESDIR}/${PN}-4.0.0_pre20231218-no-pyunit.patch" ) + +pkg_setup() { + ada_pkg_setup + + use llvm && llvm-r1_pkg_setup +} + +src_prepare() { + default + + sed -i "s|ar rc|$(tc-getAR) rc|g" Makefile.in || die +} + +src_configure() { + tc-export CC CXX + + local -a myconf=( + # Build. + --disable-werror + + # Install location. + --libdir=$(get_libdir) + --prefix="/usr" + + # Features. + --enable-libghdl + --enable-synth + ) + + if use llvm ; then + myconf+=( + --with-llvm-config="llvm-config" + ) + fi + + # Not a autotools script! + edo sh ./configure "${myconf[@]}" +} + +src_compile() { + default + + patchelf --set-soname libghw.so lib/libghw.so || die +} + +src_install() { + default + + if ! use static-libs ; then + find "${ED}" -type f -name '*.a' -delete || die + fi +}