From f6cc2b6d756f8201c3119b34046a4da5bf85456a Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Aug 29 2021 21:04:14 +0000 Subject: Don't use deprecated external dependency generator --- diff --git a/macros.mingw b/macros.mingw index 78417ef..5e5b5f0 100644 --- a/macros.mingw +++ b/macros.mingw @@ -9,8 +9,6 @@ %mingw_objcopy mingw-objcopy %mingw_nm mingw-nm -%mingw_findprovides %{_rpmconfigdir}/mingw-find-provides.sh %{mingw_build_targets} -%mingw_findrequires %{_rpmconfigdir}/mingw-find-requires.sh %{mingw_build_targets} %mingw_finddebuginfo %{_rpmconfigdir}/mingw-find-debuginfo.sh %mingw_find_lang %{_rpmconfigdir}/mingw-find-lang.sh %{buildroot} @@ -29,11 +27,6 @@ %mingw_package_header \ %global __strip %{mingw_strip} \ %global __objdump %{mingw_objdump} \ -%if 0%{?rhel} == 6 \ -%global _use_internal_dependency_generator 0 \ -%global __find_requires %{mingw_findrequires} \ -%global __find_provides %{mingw_findprovides} \ -%endif \ %global __debug_install_post %%{mingw_debug_install_post} \ %{nil} diff --git a/mingw-filesystem.spec b/mingw-filesystem.spec index b043420..8d3ee47 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: 120 +Version: 121 Release: 1%{?dist} Summary: MinGW cross compiler base filesystem and environment @@ -21,8 +21,8 @@ Source3: macros.mingw64 Source4: mingw32.sh Source5: mingw64.sh Source6: mingw-find-debuginfo.sh -Source7: mingw-find-requires.sh -Source8: mingw-find-provides.sh +Source7: mingw.req +Source8: mingw.prov Source9: mingw-scripts.sh Source10: mingw-rpmlint.config Source11: toolchain-mingw32.cmake @@ -351,6 +351,11 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-c %changelog +* Sun Aug 29 2021 Sandro Mani - 121-1 +- Drop use of deprecated external dependency generator +- Fix file listed twice +- Fix copying minidebug symbols to binary in mingw-find-debuginfo.sh + * Fri Aug 27 2021 Sandro Mani - 120-1 - Adapt mingw-find-debuginfo.sh to store debug files below /usr/lib/debug - See https://fedoraproject.org/wiki/Changes/F36MingwDebugLocation diff --git a/mingw-find-provides.sh b/mingw-find-provides.sh deleted file mode 100755 index 1bcb2da..0000000 --- a/mingw-find-provides.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# This script reads filenames from STDIN and outputs any relevant provides -# information that needs to be included in the package. - -targets=$@ -if [ -z "$targets" ] ; then - echo "Usage: $0 [ mingw32 ] [ mingw64 ]" - exit 1 -fi - -filelist=`sed "s/['\"]/\\\&/g"` - -dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep '\.dll$') - -for f in $dlls; do - basename=`basename $f | tr '[:upper:]' '[:lower:]'` - for target in $targets; do - host_triplet=`rpm --eval "%{${target}_target}"` - [[ $f =~ .*$host_triplet.* ]] && echo "$target($basename)" - done -done - -exit 0 diff --git a/mingw-find-requires.sh b/mingw-find-requires.sh deleted file mode 100755 index 9e8e303..0000000 --- a/mingw-find-requires.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# This script reads filenames from STDIN and outputs any relevant provides -# information that needs to be included in the package. - -[ -z "$OBJDUMP" ] && OBJDUMP=mingw-objdump - -targets=$@ -if [ -z "$targets" ] ; then - echo "Usage: $0 [ mingw32 ] [ mingw64 ]" - exit 1 -fi - -# Get the list of files. - -filelist=`sed "s/['\"]/\\\&/g"` - -dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(dll|exe)$') -pkgconfig_files=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(pc)$') - -for target in $targets; do - dll_found=false - host_triplet=`rpm --eval "%{${target}_target}"` - for f in $dlls; do - if [[ $f =~ .*$host_triplet.* ]]; then - $OBJDUMP -p $f | grep 'DLL Name' | grep -Eio '[-._\+[:alnum:]]+\.dll' | - grep -v 'api-ms-win' | tr '[:upper:]' '[:lower:]' | - sed "s/\(.*\)/$target(\1)/" - dll_found=true - fi - done - - # Add a dependency on filesystem and crt if necessary - if [ $dll_found = true ]; then - echo "${target}-filesystem >= 95" - echo "${target}-crt" - fi - - pkgconfig_files_found=false - for f in $pkgconfig_files; do - if [[ $f =~ .*$host_triplet.* ]]; then - pkgconfig_files_found=true - fi - done - - # Add a dependency on $target-pkg-config if necessary - if [ $pkgconfig_files_found = true ]; then - echo "${target}-pkg-config" - fi -done | sort -u diff --git a/mingw.prov b/mingw.prov new file mode 100755 index 0000000..1bcb2da --- /dev/null +++ b/mingw.prov @@ -0,0 +1,24 @@ +#!/bin/bash + +# This script reads filenames from STDIN and outputs any relevant provides +# information that needs to be included in the package. + +targets=$@ +if [ -z "$targets" ] ; then + echo "Usage: $0 [ mingw32 ] [ mingw64 ]" + exit 1 +fi + +filelist=`sed "s/['\"]/\\\&/g"` + +dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep '\.dll$') + +for f in $dlls; do + basename=`basename $f | tr '[:upper:]' '[:lower:]'` + for target in $targets; do + host_triplet=`rpm --eval "%{${target}_target}"` + [[ $f =~ .*$host_triplet.* ]] && echo "$target($basename)" + done +done + +exit 0 diff --git a/mingw.req b/mingw.req new file mode 100755 index 0000000..9e8e303 --- /dev/null +++ b/mingw.req @@ -0,0 +1,50 @@ +#!/bin/bash + +# This script reads filenames from STDIN and outputs any relevant provides +# information that needs to be included in the package. + +[ -z "$OBJDUMP" ] && OBJDUMP=mingw-objdump + +targets=$@ +if [ -z "$targets" ] ; then + echo "Usage: $0 [ mingw32 ] [ mingw64 ]" + exit 1 +fi + +# Get the list of files. + +filelist=`sed "s/['\"]/\\\&/g"` + +dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(dll|exe)$') +pkgconfig_files=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(pc)$') + +for target in $targets; do + dll_found=false + host_triplet=`rpm --eval "%{${target}_target}"` + for f in $dlls; do + if [[ $f =~ .*$host_triplet.* ]]; then + $OBJDUMP -p $f | grep 'DLL Name' | grep -Eio '[-._\+[:alnum:]]+\.dll' | + grep -v 'api-ms-win' | tr '[:upper:]' '[:lower:]' | + sed "s/\(.*\)/$target(\1)/" + dll_found=true + fi + done + + # Add a dependency on filesystem and crt if necessary + if [ $dll_found = true ]; then + echo "${target}-filesystem >= 95" + echo "${target}-crt" + fi + + pkgconfig_files_found=false + for f in $pkgconfig_files; do + if [[ $f =~ .*$host_triplet.* ]]; then + pkgconfig_files_found=true + fi + done + + # Add a dependency on $target-pkg-config if necessary + if [ $pkgconfig_files_found = true ]; then + echo "${target}-pkg-config" + fi +done | sort -u diff --git a/mingw32.attr b/mingw32.attr index 498385b..3baed2e 100644 --- a/mingw32.attr +++ b/mingw32.attr @@ -1,3 +1,3 @@ -%__mingw32_provides %{_rpmconfigdir}/mingw-find-provides.sh mingw32 -%__mingw32_requires %{_rpmconfigdir}/mingw-find-requires.sh mingw32 +%__mingw32_provides %{_rpmconfigdir}/mingw.prov mingw32 +%__mingw32_requires %{_rpmconfigdir}/mingw.req mingw32 %__mingw32_path ^%{mingw32_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$ diff --git a/mingw64.attr b/mingw64.attr index 9e7ab01..26b69cd 100644 --- a/mingw64.attr +++ b/mingw64.attr @@ -1,3 +1,3 @@ -%__mingw64_provides %{_rpmconfigdir}/mingw-find-provides.sh mingw64 -%__mingw64_requires %{_rpmconfigdir}/mingw-find-requires.sh mingw64 +%__mingw64_provides %{_rpmconfigdir}/mingw.prov mingw64 +%__mingw64_requires %{_rpmconfigdir}/mingw.req mingw64 %__mingw64_path ^%{mingw64_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$