Gabriel Somlo 9a061f3
%global commit0 30ee6f2eba8a68f25f4d591819db9b28abbbed94
Gabriel L. Somlo a9423fb
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Gabriel L. Somlo a9423fb
Gabriel Somlo 9a061f3
%global commit1 717478b757a702bbc7e3e11a5fbecee2a64f7922
Gabriel L. Somlo a9423fb
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
Gabriel L. Somlo a9423fb
Gabriel Somlo 9a061f3
%global snapdate 20200127
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
%global __python %{__python3}
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
Name:          trellis
Gabriel L. Somlo a9423fb
Version:       1.0
1272eae
Release:       0.7.%{snapdate}git%{shortcommit0}%{?dist}
Gabriel L. Somlo a9423fb
Summary:       Lattice ECP5 FPGA bitstream creation/analysis/programming tools
Gabriel L. Somlo a9423fb
License:       ISC
Gabriel L. Somlo a9423fb
URL:           https://github.com/SymbiFlow/prj%{name}
Gabriel L. Somlo a9423fb
Source0:       https://github.com/SymbiFlow/prj%{name}/archive/%{commit0}/prj%{name}-%{shortcommit0}.tar.gz
Gabriel L. Somlo a9423fb
Source1:       https://github.com/SymbiFlow/prj%{name}-db/archive/%{commit1}/prj%{name}-db-%{shortcommit1}.tar.gz
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
# Patches:
Gabriel Somlo 9a061f3
Patch1:        pdf-doc-build-de5eec3.patch
Gabriel L. Somlo a9423fb
Gabriel L. Somlo a9423fb
BuildRequires: cmake 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 L. Somlo a9423fb
BuildRequires: python-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 Somlo 9a061f3
%patch1 -p1
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 9a061f3
%cmake libtrellis -DCURRENT_GIT_VERSION=%{version}-%{release}
Gabriel L. Somlo a9423fb
%make_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 L. Somlo a9423fb
%make_install PREFIX="%{_prefix}"
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
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.