File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
use std:: { env, path:: * , process:: Command } ;
2
2
3
+ const OPENBLAS_SOURCE_URL : & str =
4
+ "https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21.tar.gz" ;
3
5
const OPENBLAS_VERSION : & str = "0.3.21" ;
4
6
5
7
#[ allow( unused) ]
@@ -177,13 +179,10 @@ fn build() {
177
179
178
180
let source = output. join ( format ! ( "OpenBLAS-{}" , OPENBLAS_VERSION ) ) ;
179
181
if !source. exists ( ) {
180
- let crate_root = PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
181
- Command :: new ( "tar" )
182
- . arg ( "xf" )
183
- . arg ( crate_root. join ( format ! ( "OpenBLAS-{}.tar.gz" , OPENBLAS_VERSION ) ) )
184
- . current_dir ( & output)
185
- . status ( )
186
- . expect ( "tar command not found" ) ;
182
+ let buf = ureq:: get ( OPENBLAS_SOURCE_URL ) . call ( ) . unwrap ( ) . into_reader ( ) ;
183
+ let gz_stream = flate2:: read:: GzDecoder :: new ( buf) ;
184
+ let mut ar = tar:: Archive :: new ( gz_stream) ;
185
+ ar. unpack ( & output) . unwrap ( ) ;
187
186
}
188
187
let deliv = cfg. build ( & source, & output) . unwrap ( ) ;
189
188
You can’t perform that action at this time.
0 commit comments