This commit is contained in:
Sergey Zhemoytel 2024-05-14 15:27:56 +00:00
parent 71d1c88d9b
commit 248470867e

View file

@ -9,7 +9,7 @@ Version: 1.7.0
Release: 1
License: GPLv2+
Group: Development/Other
Url: http://devicetree.org/Device_Tree_Compiler
URL: http://devicetree.org/Device_Tree_Compiler
Source0: https://www.kernel.org/pub/software/utils/dtc/%{name}-%{version}.tar.xz
BuildRequires: bison
BuildRequires: flex
@ -19,6 +19,7 @@ BuildRequires: python3-pip
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
BuildRequires: python3-wheel
BuildRequires: python38-devel
%description
The Device Tree Compiler generates flattened Open Firmware style device trees
@ -59,7 +60,7 @@ Obsoletes: %{_lib}fdt1-devel < 1.7.0
This package provides development files for libfdt
%files -n %{devname}
%license GPL
%doc GPL
%{_libdir}/libfdt.so
%{_includedir}/*.h
@ -97,7 +98,7 @@ This package provides python3 bindings for %{name}.
%prep
%setup -q
%autopatch -p1
#autopatch -p1
sed -i 's@--prefix=$(PREFIX)@--prefix=$(PREFIX) --root=/@' pylibfdt/Makefile.pylibfdt
@ -111,8 +112,9 @@ echo '#define DTC_VERSION "DTC %{version}"' > version_gen.h
%set_build_flags
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
sed -i \
-e '/^CFLAGS =/s:=:+= %{optflags}:' \
-e '/^CFLAGS =/s:=:+= %{optflags}:' \
-e '/^CPPFLAGS =/s:=:+=:' \
-e '/^WARNINGS =/s:=:+=:' \
-e "/^PREFIX =/s:=.*:= %{_prefix}:" \
@ -121,10 +123,18 @@ sed -i \
# no-macro-redefined is a workaround for flex bug
# https://github.com/westes/flex/issues/155
export PYTHONPATH=%{python38_sitelib}
export PYTHON3=/usr/libexec/python3.8
export PYTHON=/usr/libexec/python3.8
%make_build \
CC=%{__cc} \
NO_PYTHON=1 \
CC=%{__cc} \
LDFLAGS="%{optflags}" \
WARNINGS+=-Wno-macro-redefined
WARNINGS+=-Wno-macro-redefined \
PYTHON=/usr/libexec/python3.8
%install
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}