File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,9 @@ const pkg = await pantry.resolve(parse(pkgname))
5858const pantry_sh = await pantry . getScript ( pkg , 'build' , deps )
5959const sup_PATH = [ new Path ( new URL ( import . meta. url ) . pathname ) . parent ( ) . parent ( ) . join ( "share/brewkit" ) ]
6060
61- if ( ! deps . find ( ( { pkg} ) => pkg . project == 'llvm.org' || pkg . project == 'gnu.org/gcc' ) ) {
61+ const use_cc_shims = ! deps . find ( ( { pkg} ) => pkg . project == 'llvm.org' || pkg . project == 'gnu.org/gcc' )
62+
63+ if ( use_cc_shims ) {
6264 /// add our helper cc toolchain unless the package has picked its own toolchain
6365 sup_PATH . push ( new Path ( new URL ( import . meta. url ) . pathname ) . parent ( ) . parent ( ) . join ( "share/toolchain/bin" ) )
6466
@@ -110,6 +112,10 @@ if (host().platform == 'linux' && host().arch == 'x86-64') {
110112 env [ 'CFLAGS' ] = [ `${ env [ 'CFLAGS' ] ?. [ 0 ] ?? '' } -fPIC` . trim ( ) ]
111113 env [ 'CXXFLAGS' ] = [ `${ env [ 'CXXFLAGS' ] ?. [ 0 ] ?? '' } -fPIC` . trim ( ) ]
112114}
115+ if ( host ( ) . platform == 'darwin' && ! use_cc_shims ) {
116+ // our shims inject this but if we aren’t using them we need to add it manually or everything breaks
117+ env [ 'LDFLAGS' ] = [ `${ env [ 'LDFLAGS' ] ?. [ 0 ] ?? '' } -Wl,-rpath,${ useConfig ( ) . prefix } ` . trim ( ) ]
118+ }
113119
114120const text = undent `
115121 #!/usr/bin/env -S pkgx bash
You can’t perform that action at this time.
0 commit comments