Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rhabacker:linkedprojecttest
mingw32-qml-autoreqprov
mingw32-qmldirreqprov.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mingw32-qmldirreqprov.sh of Package mingw32-qml-autoreqprov
#!/bin/bash # SPDX-FileCopyrightText: 2020-2021 Fabian Vogt <fabian@ritter-vogt.de> # SPDX-License-Identifier: GPL-3.0-or-later set -euo pipefail provides= requires= ret=0 versioned=0 #installed_only=0 while [ $# -gt 0 ]; do case $1 in --provides) provides=1 ;; --requires) requires=1 ;; --versioned) versioned=1 ;; *) echo "Unknown argument $1" >&2 exit 1 esac shift done declare -A moduleExports # foundModuleExport Module.Uri.42 69 # In the moduleExports array, it sets the version of Module.Uri.42 to 69, if lower foundModuleExport() { if [[ $versioned -eq 1 ]]; then if [ ${moduleExports[$1]:=0} -lt $2 ]; then moduleExports[$1]=$2 fi else moduleExports[$1]=1 fi } # TODO fixme # Hack: We have to load .so files which need libraries inside the build root #if ! [[ -z "${RPM_BUILD_ROOT:-}" ]]; then # for path in /{,usr/}lib{,64}; do # export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:${RPM_BUILD_ROOT}${path}" # done #fi while read file; do # TODO #if test "$installed_only" -eg 1; then # if ! [[ $file =~ /qt([5-9])/qml/.*/qmldir$ ]]; then # continue # fi # qtver=${BASH_REMATCH[1]} #else qtver=5 #fi dir="$(dirname "${file}")" module="$(awk '/^module/ { print $2; exit }' "$file")" if [[ -z "${module}" ]]; then echo "$file has no module declaration - ignoring" >&2 continue fi if [[ $requires ]]; then if [[ $versioned -eq 1 ]]; then gawk '$1 == depends && match($2, /^([0-9]+)\.([0-9]+)$/, ver) { printf "mingw32(qt'${qtver}'qmlimport:%s.%d) >= %d", $2, ver[1], ver[2]; }' "$file" else gawk '$1 == depends && match($2, /^([0-9]+)\.([0-9]+)$/, ver) { printf "mingw32(qt'${qtver}'qmlimport:%s.%d)", $2, ver[1], ver[2]; }' "$file" fi fi if [[ $provides ]]; then # Handle regular (.qml, .js) exports while read maj min; do foundModuleExport "mingw32(qt${qtver}qmlimport:${module}.${maj})" "$min" done < <(gawk 'match($0, /(singleton )?[^ ] ([0-9]+)\.([0-9]+) [^ ]+\.(qml|js)$/, type) { printf "%d %d\n", type[2], type[3]; }' "$file") # Handle plugins plugins=() while read pluginname location; do if [[ -z $location ]]; then location="$dir" elif [[ $location == /* ]]; then location="${RPM_BUILD_ROOT:-}/$location/" else location="${dir}/${location}/" fi plugins+=("${location}/${pluginname}") done < <(awk '$1 == "plugin" { printf "lib%s.dll %s\n", $2, $3; }' "$file") if [ ${#plugins[@]} -eq 0 ]; then # No plugins? continue fi qmlpluginexports="/usr/bin/i686-w64-mingw32-qmlpluginexports-qt${qtver}" if ! command -v "$qmlpluginexports" &>/dev/null; then echo "Module uses plugin, but $qmlpluginexports not installed!" >&2 ret=1 continue fi for plugin in "${plugins[@]}"; do # TODO: Get exit status of qmlpluginexports while read import min; do if [[ $import != *${module}* ]]; then echo "Ignoring ${import}" >&2 continue fi foundModuleExport "mingw32(qt${qtver}qmlimport:${import})" "$min" done < <($qmlpluginexports "$plugin" "$module") done fi done for export in "${!moduleExports[@]}"; do if [[ $versioned -eq 1 ]]; then echo "${export} = ${moduleExports["$export"]}" else echo "${export}" fi done exit $ret
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