From 91f2255bd346d43b8bad9f8b9a85db41ae7402c9 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Sep 21 2021 09:03:04 +0000 Subject: Autogenerate python dependency, also capture pc, pyd for dependency generation --- diff --git a/mingw-filesystem.spec b/mingw-filesystem.spec index 96b0446..aa80ec1 100644 --- a/mingw-filesystem.spec +++ b/mingw-filesystem.spec @@ -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 - 123-1 +- Autogenerate mingw-python3 BR +- Fix mingw{32/64}.attr to also capture pyd, pc files + * Thu Sep 02 2021 Sandro Mani - 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 $@ diff --git a/mingw.req b/mingw.req index 9e8e303..622e7f8 100755 --- a/mingw.req +++ b/mingw.req @@ -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 diff --git a/mingw32.attr b/mingw32.attr index 3baed2e..35c1e92 100644 --- a/mingw32.attr +++ b/mingw32.attr @@ -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])$ diff --git a/mingw64.attr b/mingw64.attr index 26b69cd..5142751 100644 --- a/mingw64.attr +++ b/mingw64.attr @@ -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])$