%global pkgvers 0 %global scdate0 20230905 %global schash0 c5b257463a5cc46a29d1c164755800c1c24eb720 %global branch0 main %global source0 https://github.com/siliconcompiler/siliconcompiler.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} %define with_docs 0 %define with_test 0 Name: siliconcompiler Version: 0.13.1 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Compiler to automate translation from source code to silicon License: BSD URL: https://www.siliconcompiler.com Patch0: siliconcompiler.patch BuildRequires: git gcc-c++ cmake python3 python3-devel python3-setuptools python3-Cython BuildRequires: lef-devel surelog klayout magic openroad yosys nextpnr verilator iverilog BuildRequires: ghdl icestorm netgen vtr python3-aiohttp python3-packaging python3-pytest BuildRequires: python3-pandas python3-yaml python3-pyvirtualdisplay python3-graphviz BuildRequires: python3-distro python3-netifaces python3-pytest-xdist python3-requests BuildRequires: python3-cryptography python3-psutil python3-defusedxml python3-jinja2 BuildRequires: python3-sphinx python3-sphinx_rtd_theme config(latexmk) tex(tex) tex(latex) BuildRequires: tex(fncychap.sty) tex(wrapfig.sty) tex(capt-of.sty) tex(framed.sty) BuildRequires: tex(upquote.sty) tex(needspace.sty) tex(tabulary.sty) ImageMagick Requires: surelog openroad yosys nextpnr verilator iverilog ghdl klayout icestorm Requires: verilator iverilog ghdl icestorm netgen vtr python3-aiohttp python3-packaging Requires: python3-pytest python3-pandas python3-yaml python3-pyvirtualdisplay Requires: python3-graphviz python3-distro python3-netifaces python3-pytest-xdist Requires: python3-requests python3-cryptography python3-psutil python3-defusedxml Requires: python3-jinja2 %global __cmake_in_source_build 1 %description SiliconCompiler is an open source compiler framework that aims to automate translation from source code to silicon. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller %patch0 -p1 -b .cmake~ # ext lef sed -i '/add_subdirectory(${LEF_DIR})/d' CMakeLists.txt sed -i '/set_target_properties(lef PROPERTIES/d' CMakeLists.txt mkdir -p third_party/tools/openroad/src # ext openroad sed -i '/include(FetchContent)/d' CMakeLists.txt sed -i '/FetchContent_Populate/d' CMakeLists.txt sed -i '/FetchContent_Declare(openroad/,/)/d' CMakeLists.txt # no version checks sed -i "/'vswitch'/d" siliconcompiler/tools/nextpnr/nextpnr.py sed -i "/'version'/d" siliconcompiler/tools/nextpnr/nextpnr.py sed -i "/'vswitch'/d" siliconcompiler/tools/openroad/openroad.py sed -i "/'version'/d" siliconcompiler/tools/openroad/openroad.py # no pip licenses # sed -i '/requirements_licenses/,/version/d' docs/user_guide/licenses.rst %build # build mkdir build pushd build %cmake .. -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_VERBOSE_MAKEFILE=OFF %cmake_build popd %install export READTHEDOCS=True %{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib=%{python3_sitearch} mkdir -p %{buildroot}/%{python3_sitearch}/%{name} cp -R -p %{name} %{buildroot}/%{python3_sitearch}/ cp -p build/*.so %{buildroot}/%{python3_sitearch}/%{name}/leflib/ # docs %if %{with_docs} pushd docs export PATH=$PATH:%{buildroot}%{_bindir} export PYTHONPATH=%{buildroot}%{python3_sitearch} make latexpdf popd %endif %check %if %{with_test} %ifnarch ppc64le rm -rf %{name} # filing tests (missing tools) rm -rf examples/test_fibone.py rm -rf tests/examples/test_fibone.py rm -rf tests/examples/test_gcd_chisel.py rm -rf tests/examples/test_gcd_hls.py rm -rf tests/flows/test_sv.py rm -rf tests/flows/test_flowstatus.py export PATH=$PATH:%{buildroot}%{_bindir} export PYTHONPATH=%{buildroot}%{python3_sitearch} python3 -m pytest -vv %endif %endif %files %license LICENSE %doc README.md %if %{with_docs} %doc docs/_build/latex/*.pdf %endif %{_bindir}/* %{python3_sitearch}/* %changelog * Fri Apr 01 2022 Cristian Balint - github update releases