sci-electronics/verilator: add 5.052-r1

The release sets VERILATOR_SRC_VERSION, which src/config_rev reads before
falling back to git, so the Gentoo revision stamp applies. The 9999 ebuild
loses the dead guard that tried the same thing through sed.

Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui committed 2026-09-10 21:30:52 -07:00
1 parent 91ceec6e89
commit 1a6652a7d1
3 files changed
+93 -4

No files matched your search

+1
View File
@@ -1 +1,2 @@
DIST verilator-5.050.tar.gz 6339575 BLAKE2B 3d1acac34e5ff5285c1d238d8c0df1722b72105f492accf39a7e4b5d7c0957da691c63ee0c9016a18f5bb0613edde788aa933c9e3fa2685de9d257d429f6562d SHA512 d4e29997d3a13daff62801203683e933ae1ae0537ac19cd28aebf3553f677546165a736e98f509553c1ddaad68110ad176ef234b5c00a3cb8f988253dbbf9b39
DIST verilator-5.052.tar.gz 7061822 BLAKE2B a863a06180eecab4387d91a58d7bf7291da0a98891298cf89baa5b177488cc032388770e4ab673d68cdfc2f5f18e6b192c5280c9081f8742a4232f863283a7cb SHA512 0b99da49c05150d3a24f5d2072d410b80cc44ac796bc4227b4cc5766a9b4f77cb63338cc8374036de516b63f42586dcfd8c0d98feefb3ca1878c5b7e84b715b3
@@ -0,0 +1,92 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
PYTHON_COMPAT=( python3_{12..15} )
inherit autotools python-single-r1
DESCRIPTION="The fast free Verilog/SystemVerilog simulator"
HOMEPAGE="
https://verilator.org
https://github.com/verilator/verilator
"
if [[ "${PV}" == "9999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
else
SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
LICENSE="|| ( Artistic-2 LGPL-3 )"
SLOT="0"
IUSE="debug test"
RESTRICT="!test? ( test )"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="
${PYTHON_DEPS}
dev-lang/perl
app-arch/lz4:=
virtual/zlib:=
"
DEPEND="
${RDEPEND}
"
BDEPEND="
sys-devel/bison
sys-devel/flex
test? (
dev-build/cmake
dev-debug/gdb
$(python_gen_cond_dep 'dev-python/distro[${PYTHON_USEDEP}]')
)
"
src_prepare() {
default
# https://bugs.gentoo.org/785151 and https://bugs.gentoo.org/975566
sed -i "s/\<python3\>/${EPYTHON}/g" "${S}"/configure.ac || die
find . -name "Makefile" -exec sed -i "s/\<python3\>/${EPYTHON}/g" {} + || die
find test_regress -type f -exec sed -i "s/\<python3\>/${EPYTHON}/g" {} + || die
python_fix_shebang .
# https://bugs.gentoo.org/887917 and https://bugs.gentoo.org/975970
# Upstream hard-codes -O3 / -Og / -ggdb / -gz / -Os / -O0, overriding user
# CFLAGS/CXXFLAGS.
local v
for v in CFG_CXXFLAGS_OPT CFG_CXXFLAGS_DBG CFG_LDFLAGS_DBG ; do
sed -i "/AC_SUBST(${v})/i ${v}=\"\"" "${S}"/configure.ac || die
done
sed -i -e 's/^OPT_FAST = .*/OPT_FAST =/' \
-e 's/^OPT_GLOBAL = .*/OPT_GLOBAL =/' \
"${S}"/include/verilated.mk.in || die
sed -i -e 's/"OPT_FAST=-O0"/""/g' \
-e 's/"OPT_GLOBAL=-O0"/""/g' \
-e 's/"-Os" if param\[.benchmark.\] else "-O0"/"" if True else ""/g' \
"${S}"/test_regress/driver.py || die
find "${S}"/examples -name Makefile_obj -exec sed -i \
-e 's/^OPT_FAST = .*/OPT_FAST =/' \
-e 's/^OPT_SLOW = .*/OPT_SLOW =/' \
-e 's/^OPT_GLOBAL = .*/OPT_GLOBAL =/' {} + || die
eautoconf --force
}
src_configure() {
# https://bugs.gentoo.org/887919
econf CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}"
}
src_compile() {
# https://github.com/verilator/verilator/issues/3352
export VERILATOR_SRC_VERSION="(Gentoo ${PVR})"
default
}
src_test() {
emake test
}
@@ -49,10 +49,6 @@ BDEPEND="
src_prepare() {
default
if [[ ! "${PV}" == "9999" ]] ; then
# https://github.com/verilator/verilator/issues/3352
sed -i "s/UNKNOWN_REV/(Gentoo ${PVR})/g" "${S}"/src/config_rev || die
fi
# https://bugs.gentoo.org/785151
sed -i "s/python3/${EPYTHON}/g" "${S}"/configure.ac || die
find . -name "Makefile" -exec sed -i "s/python3/${EPYTHON}/g" {} + || die