Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rhabacker:branches:windows:mingw:win32:test
mingw32-filesystem
mingw32-find-requires.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mingw32-find-requires.sh of Package mingw32-filesystem
#!/bin/bash # This script reads filenames from STDIN and outputs any relevant provides # information that needs to be included in the package. target="mingw32" host="i686-w64-mingw32" if [ -n "$1" ]; then package_name="$1" fi [ -z "$OBJDUMP" ] && OBJDUMP="$host-objdump" # Get the list of files. filelist="/tmp/$target-find-requires.$$" sed "s/['\"]/\\\&/g" >"$filelist" libs_to_exclude=" " exclude_pattern="" for i in $libs_to_exclude; do if [ -z "$exclude_pattern" ]; then exclude_pattern="$i" else exclude_pattern="$exclude_pattern|$i" fi done if [ -n "$exclude_pattern" ]; then grep_exclude="grep -Ev $exclude_pattern" else grep_exclude="cat" fi dlls=$(grep -Ei '\.(dll|exe)$' "$filelist") pcs=$(grep '\.pc$' "$filelist") configs=$(grep 'config$' "$filelist") for f in $dlls; do [ ! -f "$f" ] && continue "$OBJDUMP" -p "$f" | grep 'DLL Name' | tr "[:upper:]" "[:lower:]" | grep -Eo '[-._\+[:alnum:]]+\.dll' | $grep_exclude | sed 's/\(.*\)/'"$target"'(\1)/' done | sort -u ( for g in $pcs; do dirname="${g%/*}" PKG_CONFIG_PATH="$dirname" "$host-pkg-config" --print-errors --print-requires "$g" | awk '{ print "'"$target"'(pkg:"$1")", $2, $3 }' PKG_CONFIG_PATH="$dirname" "$host-pkg-config" --print-errors --print-requires-private "$g" | $grep_exclude | awk '{ print "'"$target"'(pkg:"$1")", $2, $3 }' for h in $(PKG_CONFIG_PATH="$dirname" "$host-pkg-config" --libs-only-l "$g" | sed 's#\-l##g'); do echo "$target(lib:$h)" done done for k in $configs; do for j in $(PKG_CONFIG="$host-pkg-config" "$k" --libs); do case "$j" in -l*) echo "$j" | sed 's#\-l##g' | grep -Ev "$exclude_pattern" | awk '{ print "'"$target"'(lib:"$1")" }' ;; esac done done ) | sort -u rm "$filelist"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor