aboutsummaryrefslogtreecommitdiffstats
path: root/gi-find-deps.sh.in
diff options
context:
space:
mode:
authorJani Välimaa <wally@mageia.org>2013-07-06 20:58:36 +0000
committerJani Välimaa <wally@mageia.org>2013-07-06 20:58:36 +0000
commit48bc13bd44345ba2f63d59df85e2fc5391a6a2a2 (patch)
treee6dc0f1b233e785ea775d4e00c4fcbbe9b663b92 /gi-find-deps.sh.in
parente6e28c55e3f2bd542b3fb9d4934c72b535c3f0d8 (diff)
downloadrpm-setup-48bc13bd44345ba2f63d59df85e2fc5391a6a2a2.tar
rpm-setup-48bc13bd44345ba2f63d59df85e2fc5391a6a2a2.tar.gz
rpm-setup-48bc13bd44345ba2f63d59df85e2fc5391a6a2a2.tar.bz2
rpm-setup-48bc13bd44345ba2f63d59df85e2fc5391a6a2a2.tar.xz
rpm-setup-48bc13bd44345ba2f63d59df85e2fc5391a6a2a2.zip
handle 'gi.require_version("Gtk", "3.0")' type requires (from SUSE)
Diffstat (limited to 'gi-find-deps.sh.in')
-rwxr-xr-xgi-find-deps.sh.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/gi-find-deps.sh.in b/gi-find-deps.sh.in
index a377d5f..999882a 100755
--- a/gi-find-deps.sh.in
+++ b/gi-find-deps.sh.in
@@ -45,6 +45,7 @@ function find_requires {
# - in python:
# . from gi.repository import foo [Unversioned requirement of 'foo']
# . from gi.repository import foo-1.0 [versioned requirement]
+# . gi.require_version('Gtk', '3.0') (To specify a version.. there is still an import needed)
# . And we do not stumble over:
# from gi.repository import foo as _bar
# from gi.repository import foo, bar
@@ -54,7 +55,6 @@ function find_requires {
# . The imports can be listed on one line, and we catch them.
# Forms currently not detected:
# - js: imports.gi.versions.Gtk = '3.0';
-# - py: gi.require_version('Gtk', '3.0')
while read file; do
case $file in
@@ -70,6 +70,10 @@ while read file; do
print_req_prov
echo "python-gi >= 2.90.2"
done
+ for module in $(grep -h -P -o "(gi\.require_version\(['\"][^'\"]+['\"],\s*['\"][^'\"]+['\"]\))" $file | sed -e 's:gi.require_version::' -e "s:[()\"' ]::g" -e 's:,:-:'); do
+ split_name_version $module
+ print_req_prov
+ done
;;
*.typelib)
for module in $(@RPMVENDORDIR@/g-ir-extract-deps $file | tr '|' ' '); do