summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Barć <xgqt@gentoo.org>2023-06-24 19:01:45 +0200
committerMaciej Barć <xgqt@gentoo.org>2023-06-24 19:04:19 +0200
commit67adc3e48cabe2792319295fbdfb0636cd7d94ea (patch)
treea44604b3a006b51fe7d888f2a87d905a14eb0a8a
parentnet-wireless/broadcom-sta: add 6.30.223.271-r7 (diff)
downloadgentoo-67adc3e48cabe2792319295fbdfb0636cd7d94ea.tar.gz
gentoo-67adc3e48cabe2792319295fbdfb0636cd7d94ea.tar.bz2
gentoo-67adc3e48cabe2792319295fbdfb0636cd7d94ea.zip
sci-electronics/nvc: new package; add 1.9.2
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
-rw-r--r--sci-electronics/nvc/Manifest1
-rw-r--r--sci-electronics/nvc/files/nvc-1.9.2-jit-code-capstone.patch11
-rw-r--r--sci-electronics/nvc/metadata.xml30
-rw-r--r--sci-electronics/nvc/nvc-1.9.2.ebuild104
4 files changed, 146 insertions, 0 deletions
diff --git a/sci-electronics/nvc/Manifest b/sci-electronics/nvc/Manifest
new file mode 100644
index 000000000000..e72b4db912e4
--- /dev/null
+++ b/sci-electronics/nvc/Manifest
@@ -0,0 +1 @@
+DIST nvc-1.9.2.tar.gz 1487550 BLAKE2B 54105c3523e252ea4e157b352a702979297c6e45ff84f7e82d9a241d8ae6da1bb4393eb0efaec7a59c7f70631b8b5b1f511e1ef029523180e90d45a04b93af06 SHA512 b6033f1ce1017aeacccf15a0220ad0938f631ce5b7b43c6cb189d6f36fca3f4a930ff3304031b0628c133b5806a9dd1ffc087f439adf85f2fdca0954bb581174
diff --git a/sci-electronics/nvc/files/nvc-1.9.2-jit-code-capstone.patch b/sci-electronics/nvc/files/nvc-1.9.2-jit-code-capstone.patch
new file mode 100644
index 000000000000..963226b34c6d
--- /dev/null
+++ b/sci-electronics/nvc/files/nvc-1.9.2-jit-code-capstone.patch
@@ -0,0 +1,11 @@
+--- a/src/jit/jit-code.c
++++ b/src/jit/jit-code.c
+@@ -44,7 +44,7 @@
+ #endif
+
+ #ifdef HAVE_CAPSTONE
+-#include <capstone.h>
++#include <capstone/capstone.h>
+ #endif
+
+ #ifndef R_AARCH64_MOVW_UABS_G0_NC
diff --git a/sci-electronics/nvc/metadata.xml b/sci-electronics/nvc/metadata.xml
new file mode 100644
index 000000000000..0218efffa50a
--- /dev/null
+++ b/sci-electronics/nvc/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+
+<pkgmetadata>
+ <maintainer type="person">
+ <email>xgqt@gentoo.org</email>
+ <name>Maciej Barć</name>
+ </maintainer>
+ <longdescription>
+ NVC is a VHDL compiler and simulator. NVC supports almost all of VHDL-2008
+ with the exception of PSL, and it has been successfully used to simulate
+ several real-world designs. Experimental support for VHDL-2019 is under
+ development. NVC has a particular emphasis on simulation performance and
+ uses LLVM to compile VHDL to native machine code. NVC is not a synthesizer.
+ That is, it does not output something that could be used to program an FPGA
+ or ASIC. It implements only the simulation behaviour of the language as
+ described by the IEEE 1076 standard. NVC supports popular verification
+ frameworks including OSVVM, UVVM, and VUnit. See below for installation
+ instructions.
+ </longdescription>
+ <use>
+ <flag name="llvm">Build LLVM code generator</flag>
+ <flag name="jit">Enable experimental JIT complilation with LLVM</flag>
+ </use>
+ <upstream>
+ <bugs-to>https://github.com/nickg/nvc/issues/</bugs-to>
+ <remote-id type="github">nickg/nvc</remote-id>
+ <remote-id type="sourcehut">~nickg/nvc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-electronics/nvc/nvc-1.9.2.ebuild b/sci-electronics/nvc/nvc-1.9.2.ebuild
new file mode 100644
index 000000000000..f0d51228e05e
--- /dev/null
+++ b/sci-electronics/nvc/nvc-1.9.2.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools bash-completion-r1 llvm
+
+DESCRIPTION="NVC is a VHDL compiler and simulator"
+HOMEPAGE="https://www.nickg.me.uk/nvc/
+ https://github.com/nickg/nvc/"
+
+if [[ ${PV} == *9999* ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/nickg/nvc.git"
+
+ NVC_SOURCEDIR="${WORKDIR}"/${PN}-${PV}
+else
+ SRC_URI="https://github.com/nickg/nvc/archive/r${PV}.tar.gz
+ -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+
+ NVC_SOURCEDIR="${WORKDIR}"/${PN}-r${PV}
+fi
+
+LICENSE="GPL-3+"
+SLOT="0"
+IUSE="debug jit llvm"
+REQUIRED_USE="jit? ( llvm )"
+RESTRICT="test" # Some tests fail.
+
+RDEPEND="
+ app-arch/bzip2:=
+ app-arch/zstd:=
+ dev-libs/capstone:=
+ dev-libs/elfutils
+ dev-libs/icu:=
+ dev-libs/libffi:=
+ dev-libs/libxml2:=
+ sys-libs/ncurses:=
+ sys-libs/zlib:=
+ llvm? ( sys-devel/llvm:= )
+"
+DEPEND="
+ ${RDEPEND}
+"
+BDEPEND="
+ dev-libs/check
+ sys-devel/flex
+"
+
+NVC_BUILDDIR="${NVC_SOURCEDIR}_BuildDir"
+S="${NVC_BUILDDIR}"
+
+PATCHES=( "${FILESDIR}"/nvc-1.9.2-jit-code-capstone.patch )
+
+# Special libraries for NVC.
+QA_FLAGS_IGNORED="usr/lib[0-9]*/nvc/preload[0-9]*.so"
+
+pkg_setup() {
+ use llvm && llvm_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ mkdir -p "${S}" || die
+}
+
+src_prepare() {
+ pushd "${NVC_SOURCEDIR}" >/dev/null || die
+
+ default
+
+ eautoreconf
+
+ popd >/dev/null || die
+}
+
+src_configure() {
+ local ECONF_SOURCE="${NVC_SOURCEDIR}"
+ local -a myconf=(
+ --enable-verilog
+ --enable-vital
+ --with-bash-completion="$(get_bashcompdir)"
+ $(use_enable debug)
+ $(use_enable jit)
+ $(use_enable llvm)
+ )
+ econf "${myconf[@]}"
+
+ export V=1 # Verbose compilation and install.
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/"$(get_bashcompdir)"/nvc{.bash,} || die
+
+ dostrip -x /usr/$(get_libdir)/nvc
+}