@@ -6,8 +6,8 @@ const { host } = utils
66export default async function finish ( config : Config ) {
77 const prefix = config . path . install
88 await fix_rpaths ( prefix , config . pkg , config . path . cache , config . deps . gas )
9- await fix_pc_files ( prefix )
10- await fix_cmake_files ( prefix )
9+ await fix_pc_files ( prefix , config . path . build_install )
10+ await fix_cmake_files ( prefix , config . path . build_install )
1111}
1212
1313//////////////////////////////////////////////////////////////////////////////////////
@@ -52,7 +52,7 @@ async function fix_rpaths(pkg_prefix: Path, pkg: Package, cache: Path, deps: Ins
5252 } }
5353}
5454
55- async function fix_pc_files ( pkg_prefix : Path ) {
55+ async function fix_pc_files ( pkg_prefix : Path , build_prefix : Path ) {
5656 //NOTE currently we only support pc files in lib/pkgconfig
5757 // we aim to standardize on this but will relent if a package is found
5858 // that uses share and other tools that build against it only accept that
@@ -66,7 +66,7 @@ async function fix_pc_files(pkg_prefix: Path) {
6666 // newer versions of brewkit append +brewing to the path; this will get both
6767 // variants
6868 const text = orig
69- . replaceAll ( pkg_prefix . join ( "+brewing" ) . string , `\${pcfiledir}/${ relative_path } ` )
69+ . replaceAll ( build_prefix . string , `\${pcfiledir}/${ relative_path } ` )
7070 . replaceAll ( pkg_prefix . string , `\${pcfiledir}/${ relative_path } ` )
7171 if ( orig !== text ) {
7272 console . log ( { fixing : path } )
@@ -77,7 +77,7 @@ async function fix_pc_files(pkg_prefix: Path) {
7777 }
7878}
7979
80- async function fix_cmake_files ( pkg_prefix : Path ) {
80+ async function fix_cmake_files ( pkg_prefix : Path , build_prefix : Path ) {
8181 // Facebook and others who use CMake sometimes rely on a libary's .cmake files
8282 // being shipped with it. This would be fine, except they have hardcoded paths.
8383 // But a simple solution has been found.
@@ -90,7 +90,7 @@ async function fix_cmake_files(pkg_prefix: Path) {
9090 // newer versions of brewkit append +brewing to the path; this will get both
9191 // variants
9292 const text = orig
93- . replaceAll ( pkg_prefix . join ( "+brewing" ) . string , `\${CMAKE_CURRENT_LIST_DIR}/${ relative_path } ` )
93+ . replaceAll ( build_prefix . string , `\${CMAKE_CURRENT_LIST_DIR}/${ relative_path } ` )
9494 . replaceAll ( pkg_prefix . string , `\${CMAKE_CURRENT_LIST_DIR}/${ relative_path } ` )
9595 if ( orig !== text ) {
9696 console . log ( { fixing : path } )
0 commit comments