@@ -9,6 +9,9 @@ export default async function finish(config: Config) {
99 await fix_pc_files ( prefix , config . path . build_install )
1010 await fix_cmake_files ( prefix , config . path . build_install )
1111 await remove_la_files ( prefix )
12+ if ( host ( ) . platform == 'linux' ) {
13+ await consolidate_lib64 ( prefix )
14+ }
1215 await flatten_headers ( prefix )
1316}
1417
@@ -115,6 +118,25 @@ async function remove_la_files(pkg_prefix: Path) {
115118 }
116119}
117120
121+ async function consolidate_lib64 ( pkg_prefix : Path ) {
122+ // some build systems install to lib64 on x86-64 Linux; we standardize on lib
123+ const lib64 = pkg_prefix . join ( "lib64" )
124+ if ( ! lib64 . isDirectory ( ) ) return
125+
126+ const lib = pkg_prefix . join ( "lib" )
127+ lib . mkpath ( )
128+
129+ for await ( const [ path , { isFile, isSymlink } ] of lib64 . ls ( ) ) {
130+ const dest = lib . join ( path . basename ( ) )
131+ if ( isFile || isSymlink ) {
132+ Deno . renameSync ( path . string , dest . string )
133+ }
134+ }
135+
136+ Deno . removeSync ( lib64 . string , { recursive : true } )
137+ Deno . symlinkSync ( "lib" , lib64 . string )
138+ }
139+
118140async function flatten_headers ( pkg_prefix : Path ) {
119141 // if include/ contains exactly one subdirectory and no loose files, flatten it
120142 // eg. include/foo/*.h → include/*.h with include/foo → symlink to .
0 commit comments