%global pkgvers 1 %global scdate0 20230529 %global schash0 7198cf647113f56041e02abf3eb623692820c5e1 %global branch0 main %global source0 https://github.com/google/skywater-pdk.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: open-pdk-skywater Version: 0.0.0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Open PDK for SkyWater 130nm node License: Apache 2.0 BuildArch: noarch URL: https://github.com/google/skywater-pdk BuildRequires: make git python3-devel python3-setuptools python3-dataclasses-json %if 0%{?fedora} BuildRequires: python3-sphinx python3-sphinxcontrib-bibtex %endif %global _python_dist_allow_version_zero 1 %define build_targets %(curl https://raw.githubusercontent.com/google/skywater-pdk/main/.gitmodules | grep submodule | awk '{print $2}' | cut -d'/' -f2 | uniq | grep sky) %description Open source process design kit for usage with SkyWater Technology Foundry's 130nm node. %package python3 Summary: %{summary} Provides: %{name} Requires: python3-dataclasses-json # base std io cell lib Requires: %{name}-sky130_fd_sc_hd %description python3 Open source process design kit for usage with SkyWater Technology Foundry's 130nm node. %{lua: for target in string.gmatch(rpm.expand("%{build_targets}"), "[%w_-]+") do print("%package "..target.."\n") print("Summary: PDK library for "..target.."\n") print("Requires: open-pdk-skywater\n\n") print("%description "..target.."\n") print("PDK library for "..target.." parts.\n") print("\n") end } %prep %setup -T -c -n %{name} find %{_builddir} -name SPECPARTS -exec rm -rf {} + git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller %build # disable conda bloats # run native binaries only sed -i '/^TOP_DIR/,/^include/d' Makefile sed -i 's|python -m|python3 -m|' Makefile # fix py >= 3.11 sed -i '/>>> .*TimingType.*names()/,/basic, ccsnoise/d' \ scripts/python-skywater-pdk/skywater_pdk/liberty.py %if 0%{?fedora} # sphinx missing plugins sed -i '/sphinx_symbiflow_theme/d' docs/conf.py sed -i '/sphinxcontrib_hdl_diagrams/d' docs/conf.py # build docs sphinx-build docs html %endif # build python pushd scripts/python-skywater-pdk %py3_build popd # fetch PDK git submodule sync list=$(cat .gitmodules | grep submodule | awk -F'\"' '{print $2}' | grep libraries) for lib in $(echo "$list" | cut -d'/' -f2 | uniq) do submodule=$(echo "$list" | grep -v latest | grep "\/$lib\/" | sort -r -n | head -n 1) git submodule init $submodule done # clone submodules git submodule update --depth 1 # rebuild timings PYTHONPATH=%{_builddir}/%{name}/scripts/python-skywater-pdk/ \ make timing; %install mkdir -p %{buildroot}/%{_datadir}/%{name}/libraries find libraries -empty -type d -delete mv -f libraries %{buildroot}/%{_datadir}/%{name}/ # alias with latest symlink for d in $(find %{buildroot}/%{_datadir}/%{name}/libraries/*/ -mindepth 1 -maxdepth 1 -type d) do pushd $(dirname $d) ln -sf $(basename $d) latest popd done # install python pushd scripts/python-skywater-pdk %py3_install mv -f %{buildroot}%{_bindir}/sample \ %{buildroot}%{_bindir}/skywater-sample.py popd %files python3 %doc README.* %if 0%{?fedora} %doc html %else %doc docs %endif %license LICENSE %{_bindir}/* %{python3_sitelib}/* %{lua: for target in string.gmatch(rpm.expand("%{build_targets}"), "[%w_-]+") do print("%files "..target.."\n") print(rpm.expand("%{_datadir}/%{name}/libraries/")..target.."/*\n\n") end } %changelog * Thu Dec 23 2021 Cristian Balint - github update releases