File yosys-slang.spec of Package yosys-slang
%define _unpackaged_files_terminate_build 1
%define debug_package %{nil}
%define _githash ba1859e
Name: yosys-slang
Version: 2025.10.31.%{_githash}
Release: <CI_CNT>.<B_CNT>
Summary: SystemVerilog frontend for Yosys
Group: Applications/Engineering
License: ISC
URL: https://github.com/povik/yosys-slang.git
Source0: %{name}-%{version}.tar.gz
#Packager: Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
Requires: yosys >= 0.44
BuildRequires: python3
BuildRequires: pkgconfig
BuildRequires: cmake
BuildRequires: tcl-devel >= 8.0.0
BuildRequires: yosys >= 0.44
# ALmaLinux 8
%if 0%{?rhel} == 8
BuildRequires: gcc-toolset-14-gcc-c++
BuildRequires: gcc-toolset-14-libstdc++-devel
%endif
# ALmaLinux 9
%if 0%{?rhel} >= 9 || 0%{?fedora} >= 39
BuildRequires: gcc-c++
%endif
%if 0%{?fedora} >= 39
BuildRequires: gcc-c++
%endif
#opensuse
%if 0%{?suse_version} > 1400 && 0%{?is_opensuse}
BuildRequires: gcc-c++
%endif
%if 0%{?sle_version} == 150600 && 0%{?is_opensuse}
BuildRequires: gcc13
BuildRequires: gcc13-c++
%endif
%description
yosys-slang is a Yosys plugin providing a new command (read_slang)
for loading SystemVerilog designs.
yosys-slang builds on top of the slang library to provide
comprehensive SystemVerilog support. The plugin supports an
(informally defined) synthesizable subset of SystemVerilog in version
IEEE 1800-2017 or IEEE 1800-2023.
%prep
%setup
%build
export CC="gcc"
export CXX="g++"
%if 0%{?sle_version} == 150600 && 0%{?is_opensuse}
CC="/usr/bin/gcc-13"
CXX="/usr/bin/g++-13"
%endif
cd yosys-slang
%if 0%{?rhel} == 8
scl enable gcc-toolset-14 -- make build
%else
make build
%endif
%install
rm -rf %{buildroot}
export DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_datadir}/yosys/plugins
cd yosys-slang
make install
%files
%defattr(-,root,root,-)
%doc yosys-slang/README.md yosys-slang/LICENSE
%{_datadir}/yosys/plugins/slang.so
%changelog
* Fri Oct 31 2025 Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr> - 2025-10-31.ba1859e
- Initial packaging.