| Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | inherit chrpath | 
|  | 2 |  | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 3 | SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles" | 
| Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 |  | 
|  | 5 | python relocatable_binaries_preprocess() { | 
|  | 6 | rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d) | 
|  | 7 | } | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 8 |  | 
| Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 9 | relocatable_native_pcfiles() { | 
|  | 10 | for dir in ${libdir}/pkgconfig ${datadir}/pkgconfig; do | 
|  | 11 | files_template=${SYSROOT_DESTDIR}$dir/*.pc | 
|  | 12 | # Expand to any files matching $files_template | 
|  | 13 | files=$(echo $files_template) | 
|  | 14 | # $files_template and $files will differ if any files were found | 
|  | 15 | if [ "$files_template" != "$files" ]; then | 
|  | 16 | rel=$(realpath -m --relative-to=$dir ${base_prefix}) | 
|  | 17 | sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" $files | 
|  | 18 | fi | 
|  | 19 | done | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 20 | } |