Fix build

* Add missing BuildRequires
* Manually define version for setuptools_scm
* Package mingw static libraries
This commit is contained in:
Yaakov Selkowitz 2023-07-04 20:09:53 -04:00
parent 0a058ff298
commit 796c762032

View File

@ -17,7 +17,11 @@ Source0: https://www.kernel.org/pub/software/utils/%{name}/%{name}-%{versi
BuildRequires: gcc make BuildRequires: gcc make
BuildRequires: flex bison swig BuildRequires: flex bison swig
BuildRequires: python3-devel python3-setuptools BuildRequires: python3-devel
BuildRequires: python3-pip
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
BuildRequires: python3-wheel
%if %{with_mingw} %if %{with_mingw}
BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw32-filesystem >= 95
@ -75,6 +79,14 @@ BuildArch: noarch
libfdt is a library to process Open Firmware style device trees on various libfdt is a library to process Open Firmware style device trees on various
architectures. architectures.
%package -n mingw32-libfdt-static
Summary: Static version of MinGW Device tree library
Requires: mingw32-libfdt = %{version}-%{release}
BuildArch: noarch
%description -n mingw32-libfdt-static
This package provides the static library of mingw32-libfdt
%package -n mingw64-libfdt %package -n mingw64-libfdt
Summary: MinGW Device tree library Summary: MinGW Device tree library
BuildArch: noarch BuildArch: noarch
@ -83,6 +95,14 @@ BuildArch: noarch
libfdt is a library to process Open Firmware style device trees on various libfdt is a library to process Open Firmware style device trees on various
architectures. architectures.
%package -n mingw64-libfdt-static
Summary: Static version of MinGW Device tree library
Requires: mingw64-libfdt = %{version}-%{release}
BuildArch: noarch
%description -n mingw64-libfdt-static
This package provides the static library of mingw64-libfdt
%{?mingw_debug_package} %{?mingw_debug_package}
%endif %endif
@ -90,6 +110,7 @@ architectures.
%autosetup -p1 %autosetup -p1
%build %build
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%{make_build} EXTRA_CFLAGS="%{build_cflags}" LDFLAGS="%{build_ldflags}" %{make_build} EXTRA_CFLAGS="%{build_cflags}" LDFLAGS="%{build_ldflags}"
%if %{with_mingw} %if %{with_mingw}
@ -98,6 +119,7 @@ architectures.
%endif %endif
%install %install
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%{make_install} DESTDIR=%{buildroot} PREFIX=%{buildroot}/%{_prefix} \ %{make_install} DESTDIR=%{buildroot} PREFIX=%{buildroot}/%{_prefix} \
LIBDIR=%{_libdir} BINDIR=%{_bindir} INCLUDEDIR=%{_includedir} LIBDIR=%{_libdir} BINDIR=%{_bindir} INCLUDEDIR=%{_includedir}
@ -139,12 +161,18 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/ftdump
%{mingw32_libdir}/libfdt.dll.a %{mingw32_libdir}/libfdt.dll.a
%{mingw32_libdir}/pkgconfig/libfdt.pc %{mingw32_libdir}/pkgconfig/libfdt.pc
%files -n mingw32-libfdt-static
%{mingw32_libdir}/libfdt.a
%files -n mingw64-libfdt %files -n mingw64-libfdt
%license GPL %license GPL
%{mingw64_bindir}/libfdt-1.dll %{mingw64_bindir}/libfdt-1.dll
%{mingw64_includedir}/*fdt*.h %{mingw64_includedir}/*fdt*.h
%{mingw64_libdir}/libfdt.dll.a %{mingw64_libdir}/libfdt.dll.a
%{mingw64_libdir}/pkgconfig/libfdt.pc %{mingw64_libdir}/pkgconfig/libfdt.pc
%files -n mingw64-libfdt-static
%{mingw64_libdir}/libfdt.a
%endif %endif
%changelog %changelog