diff --git a/.gitignore b/.gitignore index 030903d..fcbfa62 100644 --- a/.gitignore +++ b/.gitignore @@ -66,8 +66,3 @@ /yosys-967b47d.tar.gz /yosys-1717fa0.tar.gz /yosys-3bc26ff.tar.gz -/yosys-90c26fe.tar.gz -/yosys-86f2dde.tar.gz -/yosys-b88b73a.tar.gz -/yosys_0.65-1.debian.tar.xz -/yosys-22c15a7.tar.gz diff --git a/0001-fedora-unbundle-cxxopts.patch b/0001-fedora-unbundle-cxxopts.patch deleted file mode 100644 index d72d7b5..0000000 --- a/0001-fedora-unbundle-cxxopts.patch +++ /dev/null @@ -1,49 +0,0 @@ -From e54bbc1ffa4b8f81559e3e4d9d2521e9d83f1748 Mon Sep 17 00:00:00 2001 -From: Gabriel Somlo -Date: Mon, 13 Jul 2026 17:01:17 -0400 -Subject: [PATCH] fedora: unbundle cxxopts - ---- - kernel/CMakeLists.txt | 1 - - kernel/driver.cc | 2 +- - libs/CMakeLists.txt | 1 - - 3 files changed, 1 insertion(+), 3 deletions(-) - -diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt -index 4cd76b4ff..24d86997b 100644 ---- a/kernel/CMakeLists.txt -+++ b/kernel/CMakeLists.txt -@@ -91,7 +91,6 @@ yosys_core(kernel - INCLUDE_DIRS - ${pybind11_INCLUDE_DIR} - LIBRARIES -- cxxopts - $<${YOSYS_ENABLE_PLUGINS}:${Dlfcn_LIBRARIES}> - $<${YOSYS_ENABLE_ZLIB}:PkgConfig::zlib> - $<${YOSYS_ENABLE_READLINE}:PkgConfig::readline> -diff --git a/kernel/driver.cc b/kernel/driver.cc -index 2a4ad1295..7bb67ffea 100644 ---- a/kernel/driver.cc -+++ b/kernel/driver.cc -@@ -21,7 +21,7 @@ - #include "kernel/hashlib.h" - #include "libs/sha1/sha1.h" - #define CXXOPTS_VECTOR_DELIMITER '\0' --#include "libs/cxxopts/include/cxxopts.hpp" -+#include - #include - #include - -diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt -index cb81b3af2..4eb313c5d 100644 ---- a/libs/CMakeLists.txt -+++ b/libs/CMakeLists.txt -@@ -1,5 +1,4 @@ - add_subdirectory(bigint) --add_subdirectory(cxxopts) - add_subdirectory(dlfcn-win32) - add_subdirectory(ezsat) - add_subdirectory(fst) --- -2.54.0 - diff --git a/0001-fedora-yosys-cfginc-patch.patch b/0001-fedora-yosys-cfginc-patch.patch new file mode 100644 index 0000000..1dd68fe --- /dev/null +++ b/0001-fedora-yosys-cfginc-patch.patch @@ -0,0 +1,42 @@ +From 6407842130dd6430c9e754e6551d6c41ba7c495c Mon Sep 17 00:00:00 2001 +From: Gabriel Somlo +Date: Tue, 16 Jul 2024 15:20:56 -0400 +Subject: [PATCH 1/3] fedora yosys-cfginc patch + +Fedora-specific patch: +Change the substitution done when making yosys-config so that it outputs +CXXFLAGS with -I/usr/include/yosys +--- + Makefile | 2 +- + tests/various/plugin.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 507c74a63..1ec01d2e8 100644 +--- a/Makefile ++++ b/Makefile +@@ -840,7 +840,7 @@ LIBS_NOVERIFIC = $(LIBS) + endif + + $(PROGRAM_PREFIX)yosys-config: misc/yosys-config.in $(YOSYS_SRC)/Makefile +- $(P) $(SED) -e 's#@CXXFLAGS@#$(subst -Ilibs/dlfcn-win32,,$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(strip $(CXXFLAGS_NOVERIFIC))))#;' \ ++ $(P) $(SED) -e 's#@CXXFLAGS@#$(subst -Ilibs/dlfcn-win32,,$(subst -I. -I"$(YOSYS_SRC)",-I"$(PREFIX)/include/yosys",$(strip $(CXXFLAGS_NOVERIFIC))))#;' \ + -e 's#@CXX@#$(strip $(CXX))#;' -e 's#@LINKFLAGS@#$(strip $(LINKFLAGS) $(PLUGIN_LINKFLAGS))#;' -e 's#@LIBS@#$(strip $(LIBS_NOVERIFIC) $(PLUGIN_LIBS))#;' \ + -e 's#@BINDIR@#$(strip $(BINDIR))#;' -e 's#@DATDIR@#$(strip $(DATDIR))#;' < $< > $(PROGRAM_PREFIX)yosys-config + $(Q) chmod +x $(PROGRAM_PREFIX)yosys-config +diff --git a/tests/various/plugin.sh b/tests/various/plugin.sh +index 75b4c9e56..ddc8f139f 100644 +--- a/tests/various/plugin.sh ++++ b/tests/various/plugin.sh +@@ -4,7 +4,7 @@ rm -rf plugin_search + CXXFLAGS=$(../../yosys-config --cxxflags) + DATDIR=$(../../yosys-config --datdir) + DATDIR=${DATDIR//\//\\\/} +-CXXFLAGS=${CXXFLAGS//$DATDIR/..\/..\/share} ++CXXFLAGS=${CXXFLAGS//\/usr\/include\/yosys/..\/..\/share\/include} + ../../yosys-config --exec --cxx ${CXXFLAGS} --ldflags -shared -o plugin.so plugin.cc + ../../yosys -m ./plugin.so -p "test" | grep -q "Plugin test passed!" + mkdir -p plugin_search +-- +2.52.0 + diff --git a/0002-fedora-yosys-mancfginc-patch.patch b/0002-fedora-yosys-mancfginc-patch.patch new file mode 100644 index 0000000..90f522c --- /dev/null +++ b/0002-fedora-yosys-mancfginc-patch.patch @@ -0,0 +1,72 @@ +From ee84a2a0ed040405b85913018f5be232a3744a21 Mon Sep 17 00:00:00 2001 +From: Gabriel Somlo +Date: Thu, 5 Sep 2024 20:56:02 -0400 +Subject: [PATCH 2/3] fedora yosys-mancfginc patch + +Fedora-specific patch: +When invoking yosys-config for examples in "make docs", need to use +relative path for includes, as they're not installed in build host +filesystem. +--- + docs/source/code_examples/extensions/Makefile | 2 +- + docs/source/code_examples/extensions/my_cmd.cc | 4 ++-- + docs/source/code_examples/stubnets/Makefile | 2 +- + docs/source/code_examples/stubnets/stubnets.cc | 4 ++-- + 4 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/docs/source/code_examples/extensions/Makefile b/docs/source/code_examples/extensions/Makefile +index 74b547a20..91e1e7b28 100644 +--- a/docs/source/code_examples/extensions/Makefile ++++ b/docs/source/code_examples/extensions/Makefile +@@ -11,7 +11,7 @@ CXXFLAGS=$(shell $(YOSYS)-config --cxxflags) + DATDIR=$(shell $(YOSYS)-config --datdir) + + my_cmd.so: my_cmd.cc +- $(YOSYS)-config --exec --cxx $(subst $(DATDIR),../../../../share,$(CXXFLAGS)) --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs ++ $(YOSYS)-config --exec --cxx $(subst $(DATDIR),../../../../share,$(CXXFLAGS)) -I../../../../ --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs + + test0.log: my_cmd.so + $(YOSYS) -QTl test0.log_new -m ./my_cmd.so -p 'my_cmd foo bar' -f verilog absval_ref.v +diff --git a/docs/source/code_examples/extensions/my_cmd.cc b/docs/source/code_examples/extensions/my_cmd.cc +index d52268b4a..6b67f10f3 100644 +--- a/docs/source/code_examples/extensions/my_cmd.cc ++++ b/docs/source/code_examples/extensions/my_cmd.cc +@@ -1,5 +1,5 @@ +-#include "kernel/yosys.h" +-#include "kernel/sigtools.h" ++#include ++#include + + USING_YOSYS_NAMESPACE + PRIVATE_NAMESPACE_BEGIN +diff --git a/docs/source/code_examples/stubnets/Makefile b/docs/source/code_examples/stubnets/Makefile +index 17f700c88..a15eb3005 100644 +--- a/docs/source/code_examples/stubnets/Makefile ++++ b/docs/source/code_examples/stubnets/Makefile +@@ -11,7 +11,7 @@ test: stubnets.so + tail test1.log test2.log test3.log + + stubnets.so: stubnets.cc +- yosys-config --exec --cxx --cxxflags --ldflags -o $@ -shared $^ --ldlibs ++ yosys-config --exec --cxx --cxxflags -I../../../../ --ldflags -o $@ -shared $^ --ldlibs + + .PHONY: clean + clean: +diff --git a/docs/source/code_examples/stubnets/stubnets.cc b/docs/source/code_examples/stubnets/stubnets.cc +index 566d24b18..b09bc567c 100644 +--- a/docs/source/code_examples/stubnets/stubnets.cc ++++ b/docs/source/code_examples/stubnets/stubnets.cc +@@ -5,8 +5,8 @@ + // binary, for any purpose, commercial or non-commercial, and by any + // means. + +-#include "kernel/yosys.h" +-#include "kernel/sigtools.h" ++#include ++#include + + #include + #include +-- +2.52.0 + diff --git a/0003-fedora-yosys-cxxopts-patch.patch b/0003-fedora-yosys-cxxopts-patch.patch new file mode 100644 index 0000000..857b34d --- /dev/null +++ b/0003-fedora-yosys-cxxopts-patch.patch @@ -0,0 +1,28 @@ +From 793a337eacce0f5d51d470f0dcd196808541c9d6 Mon Sep 17 00:00:00 2001 +From: Gabriel Somlo +Date: Sat, 11 Jan 2025 17:39:16 -0500 +Subject: [PATCH 3/3] fedora yosys-cxxopts patch + +Fedora-specific patch: +Use relative path (instead of assuming a bundled submodule) when +referencing the cxxopts.hpp include file. +--- + kernel/driver.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/driver.cc b/kernel/driver.cc +index fa78bad59..ea1c01f87 100644 +--- a/kernel/driver.cc ++++ b/kernel/driver.cc +@@ -21,7 +21,7 @@ + #include "kernel/hashlib.h" + #include "libs/sha1/sha1.h" + #define CXXOPTS_VECTOR_DELIMITER '\0' +-#include "libs/cxxopts/include/cxxopts.hpp" ++#include + #include + + #ifdef YOSYS_ENABLE_READLINE +-- +2.52.0 + diff --git a/sources b/sources index c58da99..80be969 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (yosys-22c15a7.tar.gz) = 2fbc300e1532e770e6988f19e162fe8cafc2d086418d9b77cf0ba1524679fb305a0e642f95fe57b809fa4b16b74b471e26fdeac2828a43bc2d11ce2c06b21da1 -SHA512 (yosys_0.65-1.debian.tar.xz) = a0a68a8229b42d48f87618d3c4e40acf3576e8d18188b83ef3d83c277a17c09ea783fab45dfc3c52cc0fcee220af1a00b7d012a258dc3b124a44d65696d490ba +SHA512 (yosys-3bc26ff.tar.gz) = 45bd87d1789d9f0efedc43f480aef6c672a39dd43c3edfdce3f2f2f8191eb6c8f8210208b3853c3df4b15bc8627509f5c827bc6974dd1378c5b5d1b23101e935 +SHA512 (yosys_0.52-2.debian.tar.xz) = 9ceba3ae42b16a0b8b7f7c6e8248e6b50fb411ccb755948e184c70aafbcbd1121b011338be29c3abf6f473b23c904f2058f7ca36bfea8562e05e10f5cc24ffdf diff --git a/yosys.spec b/yosys.spec index 7452e91..3ae2913 100644 --- a/yosys.spec +++ b/yosys.spec @@ -1,11 +1,11 @@ -%global commit0 22c15a7ecd53437f18f67c72572bd693f78357ca +%global commit0 3bc26ff4d055adfbba8b424508ab4a36405ffc0b %global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7}) -%global snapdate 20260713 +%global snapdate 20260304 Name: yosys -Version: 0.67 -Release: 3.%{snapdate}git%{shortcommit0}%{?dist} +Version: 0.63 +Release: 1.%{snapdate}git%{shortcommit0}%{?dist} Summary: Yosys Open SYnthesis Suite, including Verilog synthesizer License: ISC and MIT URL: http://www.clifford.at/yosys/ @@ -14,30 +14,38 @@ Source0: https://github.com/YosysHQ/%{name}/archive/%{commit0}/%{name}-%{ Source1: https://github.com/mdaines/viz.js/releases/download/0.0.3/viz.js # man pages written for Debian: -Source2: http://http.debian.net/debian/pool/main/y/yosys/yosys_0.65-1.debian.tar.xz +Source2: http://http.debian.net/debian/pool/main/y/yosys/yosys_0.52-2.debian.tar.xz # requested that upstream include those man pages: # https://github.com/YosysHQ/yosys/issues/278 -# Fedora-specific patch: # unbundle cxxopts dependency -Patch1: 0001-fedora-unbundle-cxxopts.patch +# Fedora-specific patch: +# Change the substitution done when making yosys-config so that it outputs +# CXXFLAGS with -I/usr/include/yosys +Patch1: 0001-fedora-yosys-cfginc-patch.patch +# Fedora-specific patch: +# When invoking yosys-config for examples in "make docs", need to use +# relative path for includes, as they're not installed in build host +# filesystem. +Patch2: 0002-fedora-yosys-mancfginc-patch.patch -BuildRequires: cmake +# Fedora-specific patch: +# Use relative path (instead of assuming a bundled submodule) when +# referencing the cxxopts.hpp include file. +Patch3: 0003-fedora-yosys-cxxopts-patch.patch + +BuildRequires: make BuildRequires: gcc-c++ BuildRequires: cxxopts-devel BuildRequires: bison flex readline-devel pkgconfig BuildRequires: tcl-devel libffi-devel -BuildRequires: editline-devel -BuildRequires: yosyshq-abc >= 0.67 +BuildRequires: yosyshq-abc >= 0.63 BuildRequires: iverilog >= 12.0 -BuildRequires: fmt-devel -BuildRequires: tomlplusplus-devel BuildRequires: python%{python3_pkgversion} BuildRequires: python3-devel BuildRequires: txt2man BuildRequires: gtkwave BuildRequires: gtest-devel -BuildRequires: gmock-devel # required for documentation: BuildRequires: graphviz @@ -56,7 +64,7 @@ BuildRequires: rsync Requires: %{name}-share = %{version}-%{release} Requires: graphviz python-click python-xdot -Requires: yosyshq-abc >= 0.67 +Requires: yosyshq-abc >= 0.63 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval : ExcludeArch: %{ix86} @@ -111,23 +119,17 @@ do done %build -# turning off newly-added sv-slang frontend support, for now; -# FIXME: decide on packaging slang dependency vs. enabling bundled subrepo! -%cmake -DYOSYS_ABC_EXECUTABLE=%{_bindir}/abc \ - -DYOSYS_WITHOUT_SLANG=ON -%cmake_build +make config-gcc +%make_build PREFIX="%{_prefix}" ABCEXTERNAL=%{_bindir}/abc PRETTY=0 all #manual -# For some reason, `yosys-sbtbmc` & `yosys-witness` python scripts -# end up not being executable (which causes building the manual to fail): -chmod +x %{__cmake_builddir}/%{name}* -%cmake_build -t docs-latexpdf +make ABCEXTERNAL=%{_bindir}/abc DOC_TARGET=latexpdf SPHINXOPTS='' docs date=$(stat -c %y debian/man/yosys-smtbmc.txt | cut -d' ' -f1) txt2man -d $date -t YOSYS-SMTBMC debian/man/yosys-smtbmc.txt >yosys-smtbmc.1 %install -%cmake_install +%make_install PREFIX="%{_prefix}" ABCEXTERNAL=%{_bindir}/abc STRIP=/bin/true # move include files to includedir install -d -m0755 %{buildroot}%{_includedir} @@ -144,7 +146,7 @@ install -m 0644 docs/build/latex/yosyshqyosys.pdf %{buildroot}%{_docdir}/%{name} %py_byte_compile %{python3} %{buildroot}%{_datadir}/yosys/python3 %check -%cmake_build -t test +make test ABCEXTERNAL=%{_bindir}/abc SEED=314159265359 %files @@ -173,23 +175,6 @@ install -m 0644 docs/build/latex/yosyshqyosys.pdf %{buildroot}%{_docdir}/%{name} %changelog -* Fri Jul 17 2026 Fedora Release Engineering - 0.67-3.20260713git22c15a7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Mon Jul 13 2026 Gabriel Somlo - 0.67.2.20260713git22c15a7 -- update to newer 0.67 snapshot -- simplify downstream (un-bundling) patch since some upstream support added - -* Thu Jul 09 2026 Gabriel Somlo - 0.67.1.20260709gitb88b73a -- update to 0.67 snapshot -- switch build to cmake - -* Mon Jun 01 2026 Gabriel Somlo - 0.66.1.20260601git86f2dde -- update to 0.66 snapshot - -* Tue May 12 2026 Gabriel Somlo - 0.65.1.20260512git90c26fe -- update to 0.65 snapshot - * Wed Mar 04 2026 Gabriel Somlo - 0.63.1.20260304git3bc26ff - update to 0.63 snapshot