mingw64-filesystem/mingw64-find-provides.sh
Jan Engelhardt 67e63d9c18 Accepting request 978864 from home:rhabacker:branches:windows:mingw:win64:devruntimedeps
- Update to 20220524
- On finding provides and requirements do not generate temporary 
  files in the global temporary directory (boo#1182356)
- Add optional support to add runtime dependencies for import
  libraries, see macros.mingw64 for details (boo#1194430)
- Fix warning 'file format not recognized' in mingw64-find-requires.sh
  when parsing xxx-config files

OBS-URL: https://build.opensuse.org/request/show/978864
OBS-URL: https://build.opensuse.org/package/show/windows:mingw:win64/mingw64-filesystem?expand=0&rev=133
2022-05-24 08:26:51 +00:00

41 lines
1.1 KiB
Bash

#!/bin/bash
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
target="mingw64"
host="x86_64-w64-mingw32"
if [ -n "$1" ]; then
package_name="$1"
fi
[ -z "$OBJDUMP" ] && OBJDUMP="$host-objdump"
filelist=`sed "s/['\"]/\\\&/g"`
dlls=$(echo "$filelist" | grep '\.dll$')
pcs=$(echo "$filelist" | grep '\.pc$')
libs=$(echo "$filelist" | grep '\.a$')
cmakes=$(echo "$filelist" | grep '[cC]onfig.cmake$')
for f in $dlls; do
[ ! -f "$f" ] && continue
basename=`basename "$f" | tr "[:upper:]" "[:lower:]"`
echo "$target($basename)"
done
for g in $pcs; do
[ ! -f "$g" ] && continue
PKG_CONFIG_PATH="${g%/*}" "$host-pkg-config" --print-errors --print-provides "$g" | awk '{ print "'"$target"'(pkg:"$1")", $2, $3 }'
done | sort -u
for h in $libs; do
[ ! -f "$h" ] && continue
libname=`basename "$h" | sed 's#^lib##g' | sed 's#\.dll\.#\.#g' | sed 's#\.a##g'`
echo "$target(lib:$libname)"
done
for h in $cmakes; do
[ ! -f "$h" ] && continue
echo $h | /usr/lib/rpm/mingw64-cmake.prov
done