Move python dependency generation to mingw32/64_python3.attr in mingw-python3 package

This commit is contained in:
Sandro Mani 2022-02-10 13:51:35 +01:00
parent 03aa020c11
commit 21591ade5e
3 changed files with 3 additions and 15 deletions

View File

@ -359,6 +359,7 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-c
%changelog
* Thu Feb 10 2022 Sandro Mani <manisandro@gmail.com> - 131-1
- Move python dependency generation to mingw32/64_python3.attr in mingw-python3 package
- More generic mingw_pkg_name macros to also deduce mingw package name from native name
* Wed Feb 02 2022 Sandro Mani <manisandro@gmail.com> - 130-1

View File

@ -28,7 +28,7 @@ do
mingw-objcopy --only-keep-debug $f $dest || :
pushd `dirname $dest`
keep_symbols=`mktemp`
mingw-nm $dest --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "Function") print $1 }' | sort > "$keep_symbols"
mingw-nm $dest --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "Function") print $1 }' | sort > "$keep_symbols"
mingw-objcopy --add-gnu-debuglink=`basename $dest` --strip-unneeded $f --keep-symbols="$keep_symbols" || :
rm -f "$keep_symbols"
popd

View File

@ -17,7 +17,6 @@ filelist=`sed "s/['\"]/\\\&/g"`
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
@ -38,6 +37,7 @@ for target in $targets; do
echo "${target}-crt"
fi
# Add a dependency on $target-pkg-config if necessary
pkgconfig_files_found=false
for f in $pkgconfig_files; do
if [[ $f =~ .*$host_triplet.* ]]; then
@ -46,21 +46,8 @@ for target in $targets; do
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
# Add a dependency on $target-pkg-config if necessary
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