blob: 079fb6406d6597456a3aa8a687c197ba8dc4df5c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#!/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=cygwin-objdump
targets=$@
if [ -z "$targets" ] ; then
echo "Usage: $0 [ cygwin32 ] [ cygwin64 ]"
exit 1
fi
# Get the list of files.
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
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' |
grep -v 'api-ms-win' | tr '[:upper:]' '[:lower:]' |
sed "s/\(.*\)/$target(\1)/"
dll_found=true
fi
done
# Add a dependency on filesystem and runtime if necessary
if [ $dll_found = true ]; then
echo "${target}-filesystem >= 95"
echo "${target}-w32api-runtime"
fi
pkgconfig_files_found=false
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
# 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
|