%global pkgvers 0 %global scdate0 20241127 %global schash0 2b8a23577659adc043696af967e8ae0b239cf4e6 %global branch0 master %global source0 https://github.com/YosysHQ/nextpnr.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: nextpnr Version: 0.7 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 wget yum BuildRequires: python3-devel capnproto-devel capnproto 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 %if 0%{?rhel} > 8 BuildRequires: python3.11-pybind11-devel %else BuildRequires: pybind11-devel %endif %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 cp 3rdparty/imgui/LICENSE.txt LICENSE-imgui.txt cp 3rdparty/qtimgui/LICENSE LICENSE-qtimgui.txt cp 3rdparty/python-console/LICENSE LICENSE-python-console.txt # 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 # 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 \ -DPython3_EXECUTABLE=%{python3} \ %if 0%{?fedora} -DARCH="generic;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;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 \ %cmake_build mkdir -p examples/ice40 examples/ecp5 cp -r ice40/examples/* examples/ice40 %install %cmake_install %files %{_bindir}/nextpnr-generic %{_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