From a9423fb82cf0ffae29bcb875681365ca92fb75fd Mon Sep 17 00:00:00 2001 From: Gabriel L. Somlo Date: Mar 19 2019 15:55:05 +0000 Subject: Initial version. --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..35a33cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/prjtrellis-26d6667.tar.gz +/prjtrellis-db-d0b219a.tar.gz diff --git a/sources b/sources new file mode 100644 index 0000000..73a10fb --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (prjtrellis-26d6667.tar.gz) = 2ff50f8495834b75b05db13585fa4d9dc57e3cac8270323b0039c5e58c2d9da073a346da3b6f87a62636d6dd1f6d527a4bb26877c98468a1f162713be8dbddaa +SHA512 (prjtrellis-db-d0b219a.tar.gz) = 08f2b5d4de5cfeaa881c61222002824c5a9370d7a4fa17b723288e835d860719f016336514611017265e5e8539b17dee183e4171998fb8c515bdd150ee0991d5 diff --git a/trellis.spec b/trellis.spec new file mode 100644 index 0000000..7a0c6fd --- /dev/null +++ b/trellis.spec @@ -0,0 +1,112 @@ +%global commit0 26d6667d7e72ee81c94b0ae2041fcecdcdc795ce +%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) + +%global commit1 d0b219af41ae3da6150645fbc5cc5613b530603f +%global shortcommit1 %(c=%{commit1}; echo ${c:0:7}) + +%global snapdate 20190319 + +%global __python %{__python3} + +Name: trellis +Version: 1.0 +Release: 0.1.%{snapdate}git%{shortcommit0}%{?dist} +Summary: Lattice ECP5 FPGA bitstream creation/analysis/programming tools +License: ISC +URL: https://github.com/SymbiFlow/prj%{name} +Source0: https://github.com/SymbiFlow/prj%{name}/archive/%{commit0}/prj%{name}-%{shortcommit0}.tar.gz +Source1: https://github.com/SymbiFlow/prj%{name}-db/archive/%{commit1}/prj%{name}-db-%{shortcommit1}.tar.gz + +# Patches: +#Patch1: some.patch + +BuildRequires: cmake gcc-c++ +BuildRequires: python3-devel +BuildRequires: boost-python3-devel +# for building docs: +BuildRequires: python-sphinx-latex +BuildRequires: python3-recommonmark +BuildRequires: latexmk +# for building manpages: +BuildRequires: help2man + +Requires: %{name}-data = %{version}-%{release} + +%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 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 -q -n prj%{name}-%{commit0} -a 1 +rm -rf database +mv prj%{name}-db-%{commit1} database +#%%patch1 -p1 +# add "-fPIC -g" to CMAKE_CXX_FLAGS: +sed -i '/CMAKE_CXX_FLAGS/s/-O3/-O3 -fPIC -g/' 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 + +%build +%cmake libtrellis +%make_build +%make_build -C docs latexpdf +# build manpages: +mkdir man1 +for f in ecp* +do + [ -x $f ] || continue + LD_PRELOAD=./libtrellis.so \ + help2man --no-discard-stderr --version-string %{version} -N \ + -o man1/$f.1 ./$f + sed -i '/required but missing/d' man1/$f.1 +done + +%install +%make_install PREFIX="%{_prefix}" +install -Dpm644 -t %{buildroot}%{_mandir}/man1 man1/* + +%check +# nothing to do for now. + +%files +%license COPYING +%doc README.md docs/_build/latex/ProjectTrellis.pdf +%doc examples +%{_bindir}/* +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/libtrellis.so +%{_datadir}/%{name}/misc +%{_mandir}/man1/ecp*.1* + +%files devel +%doc libtrellis/examples +%{_libdir}/%{name}/pytrellis.so +%{_datadir}/%{name}/timing +%{_datadir}/%{name}/util + +%files data +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/database + +%changelog +* Tue Mar 19 2019 Gabriel Somlo - 1.0-0.1.20190319git26d6667 +- Initial version.