@@ -339,17 +339,22 @@ def build(self, extracted_dir=None):
339
339
src_path = os .path .join (extracted_dir , self .package_name + "-" + self .version )
340
340
341
341
cmake_args = [
342
- f"cmake -S '{ src_path } ' -B '{ src_path } '" ,
342
+ "cmake" ,
343
+ "--log-level=ERROR" ,
343
344
f"-DCMAKE_C_COMPILER='{ get_config_var ('CC' )} '" ,
344
- f"-DCMAKE_INSTALL_PREFIX='{ src_path } /install'" ,
345
- f"-DCMAKE_INSTALL_LIBDIR='{ os .path .abspath (self .lib_install_dir )} '" ,
346
- f"-DCMAKE_INSTALL_INCLUDEDIR='{ os .path .abspath (self .include_install_dir )} '" ,
345
+ "-DEXPAT_BUILD_TOOLS=OFF" ,
346
+ "-DEXPAT_BUILD_EXAMPLES=OFF" ,
347
+ "-DEXPAT_BUILD_TESTS=OFF" ,
348
+ f"-S '{ src_path } '" ,
349
+ f"-B '{ src_path } '" ,
347
350
]
348
351
system (' ' .join (cmake_args ), msg = "Could not configure expat" )
349
- system (f"make -C '{ src_path } ' install" , msg = "Could not build expat" )
350
- # Touch the headers to avoid mx thinking it has to rebuild the C API every time
351
- for f in glob .glob (f"{ os .path .abspath (self .include_install_dir )} /expat*.h" ):
352
- os .utime (f )
352
+ system (f"make -C '{ src_path } '" , msg = "Could not build expat" )
353
+ # Install manually to avoid pulling in unnecessary files
354
+ for f in glob .glob (f"{ src_path } /*.so*" ):
355
+ shutil .copy (f , self .lib_install_dir , follow_symlinks = False )
356
+ for f in [f"{ src_path } /lib/expat.h" , f"{ src_path } /lib/expat_external.h" ]:
357
+ shutil .copy (f , self .include_install_dir )
353
358
return self .lib_install_dir
354
359
355
360
def install (self , build_dir = None ):
0 commit comments