cookutils rev 1053
modules/deps: line "Requires: ..." in the *.pc files may contain variables (see cogl-dev package)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue May 01 16:00:00 2018 +0300 (2018-05-01) |
parents | 847d0e99c922 |
children | 4eda0d90416e |
files | modules/deps |
line diff
1.1 --- a/modules/deps Thu Apr 26 10:39:12 2018 +0300 1.2 +++ b/modules/deps Tue May 01 16:00:00 2018 +0300 1.3 @@ -237,7 +237,10 @@ 1.4 *.pc) 1.5 # found dependencies in the *.pc files 1.6 variables=$(mktemp) 1.7 - grep '^[a-zA-Z_][a-zA-Z_]*=' $1 > $variables 1.8 + # variable value may contain spaces, so use pkg-config to safely get variable's value 1.9 + for i in $(grep '^[a-zA-Z_][a-zA-Z_]*=' $1 | cut -d= -f1); do 1.10 + echo "$i=\"$(pkg-config --variable=$i $1)\"" 1.11 + done > $variables 1.12 . $variables 1.13 rm $variables 1.14 # Syntax examples: 1.15 @@ -246,6 +249,8 @@ 1.16 # Requires: gobject-2.0,gio-2.0 1.17 # Requires.private: nspr >= 4.9.2 1.18 pcs=$(grep '^Requires' $1 | cut -d: -f2 | tr ',' ' ' | tr '\n' ' ') 1.19 + # expand $variables here, if any: 1.20 + pcs=$(eval echo $pcs) 1.21 for i in $pcs; do 1.22 isitlib=$(echo $i | tr -d '<=>0-9.') 1.23 # if it contains only comparisons, numbers, dot - it is not lib, skip