lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | inherit chrpath |
| 2 | |
| 3 | SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles" |
| 4 | |
| 5 | python relocatable_binaries_preprocess() { |
| 6 | rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d) |
| 7 | } |
| 8 | |
| 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 |
| 20 | } |