1- import useConfig from "libpkgx/hooks/useConfig.ts"
1+ import usePkgxConfig from "libpkgx/hooks/useConfig.ts"
2+ import BrewkitConfig from "brewkit/config.ts"
23import { SupportedPlatforms , SupportedArchitectures } from "libpkgx/utils/host.ts"
34import { isArray , isString , isPlainObject , PlainObject , isPrimitive , isBoolean , isNumber } from "is-what"
45import { Package , Installation , hooks , utils , semver , Path , PantryParseError } from "libpkgx"
@@ -7,19 +8,23 @@ import undent from "outdent"
78const { validate, host } = utils
89const { useMoustaches } = hooks
910
10- export const getScript = async ( pkg : Package , key : 'build' | 'test' , deps : Installation [ ] , install_prefix : Path ) => {
11+ export const getScript = async ( pkg : Package , key : 'build' | 'test' , deps : Installation [ ] , config : BrewkitConfig ) => {
1112 const yml = await hooks . usePantry ( ) . project ( pkg ) . yaml ( )
1213 const node = yml [ key ]
1314
1415 const mm = useMoustaches ( )
1516 const tokens = mm . tokenize . all ( pkg , deps )
1617 tokens . push ( {
17- from : "pkgx.dir" , to : useConfig ( ) . prefix . string
18+ from : "pkgx.dir" , to : usePkgxConfig ( ) . prefix . string
19+ } , {
20+ from : "srcroot" , to : config . path . build . string
21+ } , {
22+ from : "props" , to : config . path . build . join ( "props" ) . string
1823 } )
1924
2025 for ( const [ index , token ] of tokens . entries ( ) ) {
2126 if ( token . from == "prefix" ) {
22- tokens [ index ] = { from : "prefix" , to : install_prefix . string }
27+ tokens [ index ] = { from : "prefix" , to : config . path . build_install . string }
2328 }
2429 }
2530
@@ -87,7 +92,7 @@ export const getScript = async (pkg: Package, key: 'build' | 'test', deps: Insta
8792 const rv = [ ]
8893 for ( const token of tokens ) {
8994 if ( token . from == "prefix" ) {
90- rv . push ( { from : "prefix" , to : install_prefix . string } )
95+ rv . push ( { from : "prefix" , to : config . path . build_install . string } )
9196 } else {
9297 rv . push ( token )
9398 }
0 commit comments