Autogenerate python dependency, also capture pc, pyd for dependency generation

This commit is contained in:
Sandro Mani 2021-09-21 11:03:04 +02:00
parent 0a51e8a6f9
commit 91f2255bd3
4 changed files with 24 additions and 4 deletions

View File

@ -6,7 +6,7 @@
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Name: mingw-filesystem
Version: 122
Version: 123
Release: 1%{?dist}
Summary: MinGW cross compiler base filesystem and environment
@ -351,6 +351,10 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-c
%changelog
* Tue Sep 21 2021 Sandro Mani <manisandro@gmail.com> - 123-1
- Autogenerate mingw-python3 BR
- Fix mingw{32/64}.attr to also capture pyd, pc files
* Thu Sep 02 2021 Sandro Mani <manisandro@gmail.com> - 122-1
- Allow overriding CMake INCLUDE_INSTALL_DIR in MINGWXX_CMAKE_ARGS
- Drop evaling $@ in mingw-scripts, ensure mingw macros invoked by mingw-scripts contain $@

View File

@ -15,12 +15,14 @@ fi
filelist=`sed "s/['\"]/\\\&/g"`
dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(dll|exe)$')
dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(dll|exe|pyd)$')
pkgconfig_files=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(pc)$')
py3_files=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(pyd?)$')
for target in $targets; do
dll_found=false
host_triplet=`rpm --eval "%{${target}_target}"`
libdir=`rpm --eval "%{${target}_libdir}"`
for f in $dlls; do
if [[ $f =~ .*$host_triplet.* ]]; then
$OBJDUMP -p $f | grep 'DLL Name' | grep -Eio '[-._\+[:alnum:]]+\.dll' |
@ -40,6 +42,15 @@ for target in $targets; do
for f in $pkgconfig_files; do
if [[ $f =~ .*$host_triplet.* ]]; then
pkgconfig_files_found=true
break
fi
done
py3_files_found=false
for f in $py3_files; do
if [[ $f =~ .*$host_triplet.*lib/python3.* ]]; then
py3_files_found=true
break
fi
done
@ -47,4 +58,9 @@ for target in $targets; do
if [ $pkgconfig_files_found = true ]; then
echo "${target}-pkg-config"
fi
# Add a dependency on python if necessary
if [ $py3_files_found = true ]; then
echo "${target}-python3";
fi
done | sort -u

View File

@ -1,3 +1,3 @@
%__mingw32_provides %{_rpmconfigdir}/mingw.prov mingw32
%__mingw32_requires %{_rpmconfigdir}/mingw.req mingw32
%__mingw32_path ^%{mingw32_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$
%__mingw32_path ^%{mingw32_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee]|[Pp][Yy][Dd]?|[Pp][Cc])$

View File

@ -1,3 +1,3 @@
%__mingw64_provides %{_rpmconfigdir}/mingw.prov mingw64
%__mingw64_requires %{_rpmconfigdir}/mingw.req mingw64
%__mingw64_path ^%{mingw64_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$
%__mingw64_path ^%{mingw64_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee]|[Pp][Yy][Dd]?|[Pp][Cc])$