Skip to content

Commit

Permalink
iverilog: update to s20250103, split documentation, add libvvp patch
Browse files Browse the repository at this point in the history
- Update iverilog from version 12.0 to tag s20250103 to support libvvp integration with ngspice.
- Split documentation into a new `iverilog-docs` port due to increased compile dependencies and source tree changes.
- Many text files, such as `cadpli.txt`, are no longer included upstream.
- Add patch for `libvvp.so` to ensure proper functionality.
  • Loading branch information
bpdegnan committed Feb 19, 2025
1 parent 2e62c6f commit aa1311b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 21 deletions.
78 changes: 57 additions & 21 deletions science/iverilog/Portfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup github 1.0
PortGroup compiler_blacklist_versions 1.0

github.setup steveicarus iverilog 12_0 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version [string map {_ .} ${github.version}]
github.setup steveicarus iverilog s20250103
version s20250103
revision 0
set major [lindex [split ${version} .] 0]
set major 12
set minor 0

name iverilog
categories science
license GPL-2+
maintainers {keeh.net:paf @padf} openmaintainer

description Icarus Verilog

long_description Icarus Verilog is a Verilog simulation and synthesis tool. \
It operates as a compiler, compiling source code writen in \
Verilog (IEEE-1364) into some target format. For batch \
Expand All @@ -26,18 +25,35 @@ long_description Icarus Verilog is a Verilog simulation and synthesis tool. \

homepage http://iverilog.icarus.com/

checksums rmd160 56a9fa32ae1b8b5240b0770bff6dc7a72fb05f4f \
sha256 8be4bc86aa97013dd16eb7d63c6a5bdd896eddcf760a05b309d633647b7eb2eb \
size 2995764
checksums rmd160 98db64171883ddf097546ccc50814ddf90401658 \
sha256 3580e33374eb4bf82a4ec22b2325ff519b80f206e7194c690ff35f8b90a57e6e \
size 3110688
#checksums-append patch-vvp-Makefile.in.diff \
# sha256 85abc8e9787a2d41a151dcf4f856c4de52e5b1ce5dabe882a88f5f4339257017

depends_lib-append port:bzip2 \
depends_lib port:bzip2 \
port:readline \
port:zlib

depends_build port:bison
depends_build port:bison \
port:autoconf \
port:gperf

use_autoconf yes

configure.args-append --enable-libvvp
configure.ldflags-append -Wl,-rpath,${prefix}/lib

patchfiles-append patch-vvp-Makefile.in.diff

platform darwin {
#under MacOS, this is needed
configure.cxxflags-append -fPIC
#the library references were incorrect as-is

}


compiler.cxx_standard 2011

if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} ne ""} {
Expand All @@ -50,15 +66,35 @@ test.target check
destroot.destdir prefix=${destroot}${prefix}

post-destroot {
set docdir ${destroot}${prefix}/share/doc/${name}
xinstall -d ${docdir}
copy ${worksrcpath}/examples ${docdir}
xinstall -m 644 {*}[glob ${worksrcpath}/*.txt] ${docdir}
xinstall -d ${docdir}/vvp
xinstall -m 644 {*}[glob ${worksrcpath}/vvp/*.txt] ${docdir}/vvp
xinstall -m 644 -W ${worksrcpath} cadpli/cadpli.txt ivlpp/ivlpp.txt \
${docdir}
if {[file exists ${destroot}${prefix}/lib/libvvp.so]} {
# Fix just the library's install name
system "install_name_tool -id ${prefix}/lib/libvvp.so ${destroot}${prefix}/lib/libvvp.so"
}
}

# g++-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
universal_variant no

subport ${name}-docs {
description Documentation for Icarus Verilog
long_description This subport provides the documentation for Icarus Verilog, \
including user guides and API references.

depends_build port:py312-sphinx \
port:sphinx

worksrcdir ${github.project}-${github.version}

build {
system -W ${worksrcpath}/Documentation "make html"
}

destroot {
set docdir ${destroot}${prefix}/share/doc/${name}
xinstall -d ${docdir}
system "cp -R ${worksrcpath}/Documentation/_build/html/* ${docdir}/"
}

depends_lib
}

11 changes: 11 additions & 0 deletions science/iverilog/files/patch-vvp-Makefile.in.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- vvp/Makefile.in.orig 2025-02-19 14:26:54
+++ vvp/Makefile.in 2025-02-19 14:27:14
@@ -159,7 +159,7 @@
$(CXX) $(LDFLAGS) -o vvp@EXEEXT@ main.o -L. -lvvp $(LIBS)

libvvp.so: $O
- $(CXX) -shared $(LDFLAGS) -o libvvp.so $O $(LIBS) $(dllib)
+ $(CXX) -shared $(LDFLAGS) -install_name $(libdir)/libvvp.so -o libvvp.so $O $(LIBS) $(dllib)
else
vvp@EXEEXT@: $O main.o
$(CXX) $(LDFLAGS) -o vvp@EXEEXT@ main.o $O $(LIBS) $(dllib)

0 comments on commit aa1311b

Please sign in to comment.