diff options
-rwxr-xr-x | gi-find-deps.sh.in | 6 |
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 |