%global pkgvers 1 %global scdate0 20240129 %global schash0 2dab0095e1a5691855b0955b329cb4946b6a13b8 %global branch0 master %global source0 https://github.com/YosysHQ/prjtrellis.git %global scdate1 20230928 %global schash1 4dda149b9e4f1753ebc8b011ece2fe794be1281a %global branch1 master %global source1 https://github.com/YosysHQ/prjtrellis-db.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: prjtrellis Version: 1.4 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Lattice ECP5 FPGA bitstream creation/analysis/programming tools License: ISC URL: https://github.com/YosysHQ/prjtrellis BuildRequires: cmake gcc-c++ git help2man BuildRequires: python3-devel pybind11-devel boost-python3-devel Requires: %{name}-data = %{version}-%{release} %global __cmake_in_source_build 1 %description Project Trellis enables a fully open-source flow for ECP5 FPGAs using Yosys for Verilog synthesis and nextpnr for place and route. Project Trellis provides the device database and tools for bitstream creation. %package devel Summary: Development files for Project Trellis Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-data = %{version}-%{release} %description devel Development files to build packages using Project Trellis %package python3 Summary: Development files for Project Trellis Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-data = %{version}-%{release} %description python3 Development files to build packages using Project Trellis %package data Summary: Project Trellis - Lattice ECP5 Bitstream Database BuildArch: noarch %description data This package contains the bitstream documentation database for Lattice ECP5 FPGA devices. %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 rm -rf database git clone --depth 1 -n -b %{branch1} %{source1} database pushd database git fetch --depth 1 origin %{schash1} git reset --hard %{schash1} git log --format=fuller popd # add "-fPIC -g1" to CMAKE_CXX_FLAGS: sed -i '/CMAKE_CXX_FLAGS/s/-O3/-O3 -fPIC -g1/' libtrellis/CMakeLists.txt # prevent "lib64" false positive (e.g., on i386): sed -i 's/"lib64"/"lib${LIB_SUFFIX}"/' libtrellis/CMakeLists.txt # fix shebang lines in Python scripts: find . -name \*.py -exec sed -i 's|/usr/bin/env python3|/usr/bin/python3|' {} \; # remove .gitignore files in examples: find . -name \.gitignore -delete # ext pybind11 rm -rf libtrellis/3rdparty/pybind11 # pybind11 bug sed -i -e 's|py::bind_map - github upstream releases