%global pkgvers 0 %global scdate0 20231126 %global schash0 6d9322457ec075bb8302d6100f6867ca8eaf6387 %global branch0 master %global source0 https://github.com/YosysHQ/nextpnr.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: nextpnr Version: 0.6 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: FPGA place and route tool License: ISC and BSD and MIT and (MIT or Public Domain) Epoch: 1 URL: https://github.com/YosysHQ/nextpnr %define have_gui 0 %define ext_json 1 BuildRequires: git cmake gcc-c++ make python3-devel wget BuildRequires: capnproto-devel capnproto pybind11-devel tbb-devel BuildRequires: boost-python3-devel icestorm eigen3-devel tcl-devel tk-devel BuildRequires: boost-iostreams boost-filesystem boost-thread boost-program-options BuildRequires: prjoxide-devel prjtrellis-devel prjtrellis-python3 BuildRequires: python-fpga-interchange fpga-interchange-schema-devel Requires: python-fpga-interchange fpga-interchange-schema %if 0%{?fedora} BuildRequires: prjapicula prjxray pypy3 %endif %if 0%{?rhel} BuildRequires: python3-importlib-resources %endif %if %{ext_json} BuildRequires: json11-devel %endif %if %{have_gui} BuildRequires: qt5-qtconfiguration-devel cmake(QtConfiguration) libglvnd-devel # License: ISC Provides: bundled(qtimgui) # Qt5 enabled fork of QtPropertyBrowser # License: BSD Provides: bundled(QtPropertyBrowser) # License: MIT Provides: bundled(python-console) # License: (MIT or Public Domain) Provides: bundled(imgui) = 1.66-wip %endif %global __cmake_in_source_build 1 %description NextPNR aims to be a vendor neutral, timing driven, FOSS FPGA place and route tool. %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 submodule update --init --depth 1 himbaechel/uarch/xilinx/meta git log --format=fuller %autosetup -D -p 1 -T -c -n %{name} %if %{ext_json} rm -rf 3rdparty/json11 %endif rm -rf 3rdparty/pybind11 rm -rf 3rdparty/googletest rm -rf 3rdparty/abseil-cpp rm -rf 3rdparty/fpga-interchange-schema cp 3rdparty/imgui/LICENSE.txt LICENSE-imgui.txt cp 3rdparty/qtimgui/LICENSE LICENSE-qtimgui.txt cp 3rdparty/python-console/LICENSE LICENSE-python-console.txt # fix older boost sed -i '/safe_integer.hpp/d' fpga_interchange/lookahead.cc # external absl-cpp sed -i '/abseil-cpp/d' CMakeLists.txt sed -i 's|absl::flat_hash_set|absl_raw_hash_set absl_hash absl_throw_delegate|g' CMakeLists.txt sed -i 's|absl::flat_hash_map|absl_raw_hash_set absl_hash absl_throw_delegate|g' CMakeLists.txt %if %{ext_json} # external json11 sed -i 's|set(EXTRA_LIB_DEPS)|set(EXTRA_LIB_DEPS json11)|' CMakeLists.txt %endif # external fpga-interchange sed -i '/3rdparty\/fpga-interchange-schema/d' fpga_interchange/family.cmake sed -i '1i include_directories(%{_includedir}/interchange)' fpga_interchange/family.cmake # gcc13 sed -i '1i #include ' common/kernel/hashlib.h # fix path sed -i -e 's|/lib/|/%{_lib}/|g' ecp5/CMakeLists.txt sed -i -e 's|share/icebox|share/icestorm|g' ice40/CMakeLists.txt %build %global optflags %(echo "%{optflags} -w -fpermissive") %cmake . -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ %if 0%{?fedora} -DARCH="generic;fpga_interchange;himbaechel;ice40;ecp5;nexus;gowin;machxo2" \ -DHIMBAECHEL_GOWIN_DEVICES=all \ -DHIMBAECHEL_XILINX_DEVICES="xc7a100t;xc7a200t;xc7a50t;xc7k70t;xc7s50;xc7z010;xc7z020" \ -DHIMBAECHEL_PRJXRAY_DB="/usr/share/xray/database/" \ %else -DARCH="generic;fpga_interchange;himbaechel;ice40;ecp5;nexus;machxo2" \ %endif %if %{have_gui} -DBUILD_GUI=ON \ %else -DBUILD_GUI=OFF \ %endif -DUSE_OPENMP=ON \ -DPRJOXIDE_PREFIX=/usr \ -DOXIDE_INSTALL_PREFIX=/usr \ -DTRELLIS_INSTALL_PREFIX=/usr \ -DICESTORM_INSTALL_PREFIX=/usr \ -DRAPIDWRIGHT_PATH=%{_datadir}/rapidwright \ -DPYTHON_INTERCHANGE_PATH=%{python3_sitelib}/fpga_interchange \ -DINTERCHANGE_SCHEMA_PATH=%{_includedir}/interchange %cmake_build mkdir -p examples/ice40 examples/ecp5 cp -r ice40/examples/* examples/ice40 %install %cmake_install %files %{_bindir}/nextpnr-generic %{_bindir}/nextpnr-fpga_interchange %{_bindir}/nextpnr-himbaechel %{_bindir}/nextpnr-ice40 %{_bindir}/nextpnr-ecp5 %{_bindir}/nextpnr-nexus %if 0%{?fedora} %{_bindir}/nextpnr-gowin %{_datadir}/%{name}/himbaechel %endif %{_bindir}/nextpnr-machxo2 %doc README.md docs examples %license COPYING %license LICENSE-imgui.txt %license LICENSE-qtimgui.txt %license LICENSE-python-console.txt %changelog * Sat Feb 06 2021 Cristian Balint - update github releases