Gabriel Somlo 410cb2d
%global commit0 64b38dfda6f0bc556839b513820f943f64b23cc3
Gabriel L. Somlo a9423fb
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Gabriel L. Somlo a9423fb
Gabriel Somlo 410cb2d
%global commit1 35d900a94ff0db152679a67bf6e4fbf40ebc34aa
Gabriel L. Somlo a9423fb
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
Gabriel L. Somlo a9423fb
Gabriel Somlo 410cb2d
%global snapdate 20220509
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%global __python %{__python3}
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
Name:          trellis
Gabriel Somlo 54a8699
Version:       1.2.1
Gabriel Somlo 410cb2d
Release:       5.%{snapdate}git%{shortcommit0}%{?dist}
Gabriel L. Somlo a9423fb
Summary:       Lattice ECP5 FPGA bitstream creation/analysis/programming tools
Gabriel L. Somlo a9423fb
License:       ISC
Gabriel Somlo 54a8699
URL:           https://github.com/YosysHQ/prj%{name}
Gabriel Somlo 54a8699
Source0:       https://github.com/YosysHQ/prj%{name}/archive/%{commit0}/prj%{name}-%{shortcommit0}.tar.gz
Gabriel Somlo 54a8699
Source1:       https://github.com/YosysHQ/prj%{name}-db/archive/%{commit1}/prj%{name}-db-%{shortcommit1}.tar.gz
Gabriel L. Somlo a9423fb
4e063ed
BuildRequires: make
Gabriel Somlo 813fb87
BuildRequires: cmake
Gabriel Somlo 813fb87
BuildRequires: gcc-c++
Gabriel L. Somlo a9423fb
BuildRequires: python3-devel
Gabriel L. Somlo a9423fb
BuildRequires: boost-python3-devel
Gabriel L. Somlo a9423fb
# for building docs:
Gabriel Somlo fef6632
BuildRequires: python3-sphinx-latex
Gabriel L. Somlo a9423fb
BuildRequires: python3-recommonmark
Gabriel L. Somlo a9423fb
BuildRequires: latexmk
Gabriel L. Somlo a9423fb
# for building manpages:
Gabriel L. Somlo a9423fb
BuildRequires: help2man
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
Requires:      %{name}-data = %{version}-%{release}
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%description
Gabriel L. Somlo a9423fb
Project Trellis enables a fully open-source flow for ECP5 FPGAs using
Gabriel L. Somlo a9423fb
Yosys for Verilog synthesis and nextpnr for place and route. Project
Gabriel L. Somlo a9423fb
Trellis provides the device database and tools for bitstream creation.
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%package devel
Gabriel L. Somlo a9423fb
Summary:       Development files for Project Trellis
Gabriel L. Somlo a9423fb
Requires:      %{name}%{?_isa} = %{version}-%{release}
Gabriel L. Somlo a9423fb
Requires:      %{name}-data = %{version}-%{release}
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%description devel
Gabriel L. Somlo a9423fb
Development files to build packages using Project Trellis
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%package data
Gabriel L. Somlo a9423fb
Summary:       Project Trellis - Lattice ECP5 Bitstream Database
Gabriel L. Somlo a9423fb
BuildArch:     noarch
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%description data
Gabriel L. Somlo a9423fb
This package contains the bitstream documentation database for
Gabriel L. Somlo a9423fb
Lattice ECP5 FPGA devices.
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%prep
Gabriel L. Somlo a9423fb
%setup -q -n prj%{name}-%{commit0} -a 1
Gabriel L. Somlo a9423fb
rm -rf database
Gabriel L. Somlo a9423fb
mv prj%{name}-db-%{commit1} database
Gabriel L. Somlo 2aea649
# add "-fPIC -g1" to CMAKE_CXX_FLAGS:
Gabriel L. Somlo 2aea649
# (NOTE: "-g1" reduces debuginfo verbosity over "-g", which helps on armv7hl)
Gabriel L. Somlo 2aea649
sed -i '/CMAKE_CXX_FLAGS/s/-O3/-O3 -fPIC -g1/' libtrellis/CMakeLists.txt
Gabriel L. Somlo 2aea649
# prevent "lib64" false positive (e.g., on i386):
Gabriel L. Somlo 7df7ee7
sed -i 's/"lib64"/"lib${LIB_SUFFIX}"/' libtrellis/CMakeLists.txt
Gabriel L. Somlo 928e9ce
# fix shebang lines in Python scripts:
Gabriel L. Somlo a9423fb
find . -name \*.py -exec sed -i 's|/usr/bin/env python3|/usr/bin/python3|' {} \;
Gabriel L. Somlo 928e9ce
# remove .gitignore files in examples:
Gabriel L. Somlo a9423fb
find . -name \.gitignore -delete
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%build
Gabriel Somlo 08e8e62
# building manpages requires in-source build:
Gabriel Somlo 08e8e62
%define __cmake_in_source_build 1
Gabriel Somlo 08e8e62
# disable LTO to allow building for f33 rawhide (BZ 1865586):
Gabriel Somlo 08e8e62
%define _lto_cflags %{nil}
Gabriel Somlo 9a061f3
%cmake libtrellis -DCURRENT_GIT_VERSION=%{version}-%{release}
Gabriel Somlo 08e8e62
%cmake_build
Gabriel L. Somlo a9423fb
%make_build -C docs latexpdf
Gabriel L. Somlo a9423fb
# build manpages:
Gabriel L. Somlo a9423fb
mkdir man1
Gabriel L. Somlo a9423fb
for f in ecp*
Gabriel L. Somlo a9423fb
do
Gabriel L. Somlo a9423fb
  [ -x $f ] || continue
Gabriel L. Somlo a9423fb
  LD_PRELOAD=./libtrellis.so \
Gabriel L. Somlo a9423fb
    help2man --no-discard-stderr --version-string %{version} -N \
Gabriel L. Somlo a9423fb
             -o man1/$f.1 ./$f
Gabriel L. Somlo a9423fb
  sed -i '/required but missing/d' man1/$f.1
Gabriel L. Somlo a9423fb
done
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%install
Gabriel Somlo 08e8e62
%cmake_install
Gabriel L. Somlo a9423fb
install -Dpm644 -t %{buildroot}%{_mandir}/man1 man1/*
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%check
Gabriel L. Somlo a9423fb
# nothing to do for now.
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%files
Gabriel L. Somlo a9423fb
%license COPYING
Gabriel Somlo 9a061f3
%doc README.md
Gabriel Somlo 9a061f3
%doc docs/_build/latex/ProjectTrellis.pdf
Gabriel L. Somlo a9423fb
%doc examples
Gabriel L. Somlo a9423fb
%{_bindir}/*
Gabriel L. Somlo a9423fb
%dir %{_libdir}/%{name}
Gabriel L. Somlo a9423fb
%{_libdir}/%{name}/libtrellis.so
Gabriel L. Somlo a9423fb
%{_datadir}/%{name}/misc
Gabriel L. Somlo a9423fb
%{_mandir}/man1/ecp*.1*
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%files devel
Gabriel L. Somlo a9423fb
%doc libtrellis/examples
Gabriel L. Somlo a9423fb
%{_libdir}/%{name}/pytrellis.so
Gabriel L. Somlo a9423fb
%{_datadir}/%{name}/timing
Gabriel L. Somlo a9423fb
%{_datadir}/%{name}/util
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%files data
Gabriel L. Somlo a9423fb
%dir %{_datadir}/%{name}
Gabriel L. Somlo a9423fb
%{_datadir}/%{name}/database
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%changelog
Gabriel Somlo 410cb2d
* Mon May 09 2022 Gabriel Somlo <gsomlo@gmail.com> - 1.2.1-5.20220509git64b38df
Gabriel Somlo 410cb2d
- Update to newer snapshot.
Gabriel Somlo 410cb2d
Gabriel Somlo 410cb2d
* Wed May 04 2022 Thomas Rodgers <trodgers@redhat.com> - 1.2.1-4.20220407git46f50f7
Gabriel Somlo 410cb2d
- Rebuilt for Boost 1.78
Gabriel Somlo 410cb2d
Gabriel Somlo fef6632
* Thu Apr 07 2022 Gabriel Somlo <gsomlo@gmail.com> - 1.2.1-3.20220407git46f50f7
Gabriel Somlo fef6632
- Update to newer snapshot.
Gabriel Somlo fef6632
Gabriel Somlo fef6632
* Wed Apr 06 2022 Karolina Surma <ksurma@redhat.com> - 1.2.1-2.20220127git3ae21cf
Gabriel Somlo fef6632
- Use versioned BR on python3-sphinx-latex
Gabriel Somlo fef6632
Gabriel Somlo 54a8699
* Mon Feb 21 2022 Gabriel Somlo <gsomlo@gmail.com> - 1.2.1-1.20220222git3ae21cf
Gabriel Somlo 54a8699
- Switch upstream to YosysHQ
Gabriel Somlo 54a8699
- Update to version 1.21
Gabriel Somlo 54a8699
Gabriel Somlo 726f664
* Thu Jan 27 2022 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.23.20220127git2f06397
Gabriel Somlo 726f664
- Update to newer snapshot.
Gabriel Somlo 726f664
Gabriel Somlo 726f664
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-0.22.20210904git03e0070
Gabriel Somlo 726f664
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Gabriel Somlo 726f664
Gabriel Somlo 052b7a4
* Sat Sep 04 2021 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.21.20210904git03e0070
Gabriel Somlo 052b7a4
- Update to newer snapshot.
Gabriel Somlo 052b7a4
Gabriel Somlo 052b7a4
* Sat Aug 07 2021 Jonathan Wakely <jwakely@redhat.com> - 1.0-0.20.20210523gitfe1c39c
Gabriel Somlo 052b7a4
- Rebuilt for Boost 1.76
Gabriel Somlo 052b7a4
Gabriel Somlo 052b7a4
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-0.19.20210523gitfe1c39c
Gabriel Somlo 052b7a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Gabriel Somlo 052b7a4
Gabriel Somlo 052b7a4
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.0-0.18.20210523gitfe1c39c
Gabriel Somlo 052b7a4
- Rebuilt for Python 3.10
Gabriel Somlo 052b7a4
Gabriel Somlo f0034fd
* Sun May 23 2021 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.17.20210523gitfe1c39c
Gabriel Somlo f0034fd
- Update to newer snapshot.
Gabriel Somlo f0034fd
- Remove patch for pdf doc build (revert applied upstream).
Gabriel Somlo f0034fd
Gabriel Somlo 813fb87
* Sun Mar 07 2021 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.16.20210307git210a0a7
Gabriel Somlo 813fb87
- Update to newer snapshot.
Gabriel Somlo 813fb87
da124e5
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-0.15.20201124git52d2915
da124e5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
da124e5
Gabriel Somlo 813fb87
* Fri Jan 22 2021 Jonathan Wakely <jwakely@redhat.com> - 1.0-0.14.              20201124git52d2915
69d8964
- Rebuilt for Boost 1.75
69d8964
Gabriel Somlo 1ad2aab
* Tue Nov 24 2020 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.13.20201124git52d2915
Gabriel Somlo 1ad2aab
- Update to newer snapshot.
Gabriel Somlo 1ad2aab
- Fix Python 3.10 build (BZ #1898928).
Gabriel Somlo 1ad2aab
Gabriel Somlo 08e8e62
* Thu Aug 06 2020 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.12.20200806gitf93243b
Gabriel Somlo 08e8e62
- Update to newer snapshot.
Gabriel Somlo 08e8e62
- Disable LTO for f33 rebuild (BZ 1865586)
Gabriel Somlo 08e8e62
4458851
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-0.11.20200127git30ee6f2
4458851
- Second attempt - Rebuilt for
4458851
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
4458851
86df15b
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-0.10.20200127git30ee6f2
86df15b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
86df15b
46a68ed
* Sat May 30 2020 Jonathan Wakely <jwakely@redhat.com> - 1.0-0.9.20200127git30ee6f2
46a68ed
- Rebuilt for Boost 1.73
46a68ed
7781357
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.0-0.8.20200127git30ee6f2
7781357
- Rebuilt for Python 3.9
7781357
1272eae
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-0.7.20200127git30ee6f2
1272eae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
1272eae
Gabriel Somlo 9a061f3
* Mon Jan 27 2020 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.6.20200127git30ee6f2
Gabriel Somlo 9a061f3
- Update to newer snapshot.
Gabriel Somlo 9a061f3
- Fix Python 3.9 build (BZ #1793496).
Gabriel Somlo 9a061f3
- Fix pdf doc build (upstream requires obscure python/sphinx dependency).
Gabriel Somlo 9a061f3
7fe71d9
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0-0.5.20190806git7e97b5b
7fe71d9
- Rebuilt for Python 3.8
7fe71d9
Gabriel L. Somlo 74ce6ae
* Tue Aug 06 2019 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.4.20190806git7e97b5b
Gabriel L. Somlo 74ce6ae
- Update to newer snapshot.
Gabriel L. Somlo 74ce6ae
- Fix python 3.8 build (BZ #1737016).
Gabriel L. Somlo 74ce6ae
cba8946
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-0.3.20190327gitf1b1b35
cba8946
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
cba8946
Gabriel L. Somlo 7df7ee7
* Wed Mar 27 2019 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.2.20190327gitf1b1b35
Gabriel L. Somlo 74ce6ae
- Update to newer snapshot.
Gabriel L. Somlo 7df7ee7
- Fix library suffix mis-detection on i686.
Gabriel L. Somlo 74ce6ae
Gabriel L. Somlo 2aea649
* Wed Mar 20 2019 Gabriel Somlo <gsomlo@gmail.com> - 1.0-0.1.20190320git26d6667
Gabriel L. Somlo a9423fb
- Initial version.