11#[ cfg( not( feature = "rustdoc" ) ) ]
22mod source {
3- //pub const REPOSITORY: &str = "https://github.com/aubio/aubio";
4- //pub const VERSION: &str = "0.4.9";
5- pub const REPOSITORY : & str = "https://github.com/katyo/aubio" ;
6- pub const VERSION : & str = "master" ;
3+ pub const REPOSITORY : & str = "https://aubio.org/pub/aubio-" ;
4+ pub const VERSION : & str = "0.4.9" ;
75
86 #[ cfg( feature = "with-fftw3" ) ]
97 pub mod fftw3 {
@@ -96,7 +94,7 @@ mod utils {
9694 use fetch_unroll:: Fetch ;
9795
9896 if !out_dir. is_dir ( ) {
99- let src_url = format ! ( "{repo}/archive/ {ver}.tar.gz" ,
97+ let src_url = format ! ( "{repo}{ver}.tar.gz" ,
10098 repo = src. repository,
10199 ver = src. version) ;
102100
@@ -199,8 +197,8 @@ mod utils {
199197 let profile = env:: var ( "PROFILE" )
200198 . expect ( "The PROFILE is set by cargo." ) ;
201199
202- let num_jobs = env:: var ( "NUM_JOBS" )
203- . expect ( "The NUM_JOBS is set by cargo." ) ;
200+ // let num_jobs = env::var("NUM_JOBS")
201+ // .expect("The NUM_JOBS is set by cargo.");
204202
205203 let mut wafopts = String :: new ( ) ;
206204
@@ -247,11 +245,22 @@ mod utils {
247245 env_vars. push ( ( "PKG_CONFIG_PATH" , pkg_config_path. join ( ":" ) ) ) ;
248246 }
249247
250- run_command ( Command :: new ( "make" )
248+ env_vars. push ( ( "WAFOPTS" , wafopts) ) ;
249+
250+ let make = env:: var ( "MAKE" )
251+ . unwrap_or ( "make" . into ( ) ) ;
252+
253+ run_command ( Command :: new ( & make)
254+ . envs ( env_vars. clone ( ) )
255+ . current_dir ( src_dir)
256+ //.arg(format!("-j{}", num_jobs))
257+ . arg ( "checkwaf" ) ) ;
258+
259+ run_command ( Command :: new ( & make)
260+ . envs ( env_vars. clone ( ) )
251261 . current_dir ( src_dir)
252- . arg ( format ! ( "-j{}" , num_jobs) )
253- . env ( "WAFOPTS" , wafopts)
254- . envs ( env_vars) ) ;
262+ //.arg(format!("-j{}", num_jobs))
263+ . arg ( "build" ) ) ;
255264 }
256265
257266 println ! ( "cargo:rustc-link-search=native={}" , lib_dir. display( ) ) ;
@@ -270,16 +279,9 @@ mod utils {
270279
271280 #[ cfg( feature = "with-fftw3" ) ]
272281 pub mod fftw3 {
273- use super :: {
274- toolchain_env,
275- run_command,
276- lib_file,
277- } ;
282+ use super :: lib_file;
278283
279- use std:: {
280- env,
281- path:: Path ,
282- } ;
284+ use std:: path:: Path ;
283285
284286 pub struct Source {
285287 pub location : String ,
@@ -314,14 +316,22 @@ mod utils {
314316
315317 create_dir_all ( out_dir) . unwrap ( ) ;
316318
317- let library = Config :: new ( src_dir)
318- . define ( "BUILD_SHARED_LIBS" , if cfg ! ( feature = "shared-fftw3" ) { "ON" } else { "OFF" } )
319- . define ( "BUILD_TESTS" , "OFF" )
320- . define ( "ENABLE_FLOAT" , if cfg ! ( feature = "with-double" ) { "OFF" } else { "ON" } )
321- . define ( "DISABLE_FORTRAN" , "ON" )
319+ fn bool_flag ( flag : bool ) -> & ' static str {
320+ if flag { "ON" } else { "OFF" }
321+ }
322+
323+ let _library = Config :: new ( src_dir)
324+ . define ( "BUILD_SHARED_LIBS" , bool_flag ( cfg ! ( feature = "shared-fftw3" ) ) )
325+ . define ( "BUILD_TESTS" , bool_flag ( false ) )
326+ . define ( "ENABLE_FLOAT" , bool_flag ( !cfg ! ( feature = "with-double" ) ) )
327+ . define ( "DISABLE_FORTRAN" , bool_flag ( true ) )
328+ . define ( "ENABLE_SSE" , bool_flag ( cfg ! ( target_feature = "sse" ) ) )
329+ . define ( "ENABLE_SSE2" , bool_flag ( cfg ! ( target_feature = "sse2" ) ) )
330+ . define ( "ENABLE_AVX" , bool_flag ( cfg ! ( target_feature = "avx" ) ) )
331+ . define ( "ENABLE_AVX2" , bool_flag ( cfg ! ( target_feature = "avx2" ) ) )
322332 . define ( "CMAKE_INSTALL_LIBDIR" , "lib" )
323- . define ( "CMAKE_C_COMPILER_WORKS" , "1" )
324- . define ( "CMAKE_CXX_COMPILER_WORKS" , "1" )
333+ . define ( "CMAKE_C_COMPILER_WORKS" , bool_flag ( true ) )
334+ . define ( "CMAKE_CXX_COMPILER_WORKS" , bool_flag ( true ) )
325335 . always_configure ( true )
326336 . very_verbose ( true )
327337 . out_dir ( out_dir)
0 commit comments