File tree Expand file tree Collapse file tree 3 files changed +37
-10
lines changed Expand file tree Collapse file tree 3 files changed +37
-10
lines changed Original file line number Diff line number Diff line change @@ -3,22 +3,30 @@ name = "openblas-build"
3
3
version = " 0.10.7"
4
4
license = " Apache-2.0/MIT"
5
5
edition = " 2018"
6
- authors = [
7
- " Toshiki Teramura <toshiki.teramura@gmail.com>" ,
8
- ]
6
+ authors = [" Toshiki Teramura <toshiki.teramura@gmail.com>" ]
9
7
description = " The package provides a build helper for OpenBLAS."
10
8
documentation = " https://docs.rs/openblas-build"
11
9
homepage = " https://github.com/blas-lapack-rs/openblas-src"
12
10
repository = " https://github.com/blas-lapack-rs/openblas-src"
13
- readme = " ../README.md"
14
- exclude = [
15
- " test_build/" ,
11
+ readme = " ../README.md"
12
+ exclude = [" test_build/" ]
13
+
14
+ [features ]
15
+ default = [" tls" ]
16
+
17
+ tls = [" ureq/tls" , " ureq/gzip" ]
18
+ native-certs = [
19
+ " native-tls" ,
20
+ " ureq/native-certs" ,
21
+ " ureq/native-tls" ,
22
+ " ureq/gzip" ,
16
23
]
17
24
18
25
[dependencies ]
19
26
anyhow = " 1.0.68"
20
27
flate2 = " 1.0.25"
21
28
tar = " 0.4.38"
22
29
thiserror = " 1.0.22"
23
- ureq = " 2.5.0"
30
+ ureq = { version = " 2.5.0" , default-features = false }
31
+ native-tls = { version = " 0.2.11" , optional = true }
24
32
walkdir = " 2.3.1"
Original file line number Diff line number Diff line change @@ -13,11 +13,28 @@ pub fn openblas_source_url() -> String {
13
13
pub fn download ( out_dir : & Path ) -> Result < PathBuf > {
14
14
let dest = out_dir. join ( format ! ( "OpenBLAS-{}" , OPENBLAS_VERSION ) ) ;
15
15
if !dest. exists ( ) {
16
- let buf = ureq:: get ( & openblas_source_url ( ) ) . call ( ) ?. into_reader ( ) ;
16
+ let buf = get_agent ( )
17
+ . get ( & openblas_source_url ( ) )
18
+ . call ( ) ?
19
+ . into_reader ( ) ;
17
20
let gz_stream = flate2:: read:: GzDecoder :: new ( buf) ;
18
21
let mut ar = tar:: Archive :: new ( gz_stream) ;
19
22
ar. unpack ( out_dir) ?;
20
23
assert ! ( dest. exists( ) ) ;
21
24
}
22
25
Ok ( dest)
23
26
}
27
+
28
+ #[ cfg( feature = "native-tls" ) ]
29
+ fn get_agent ( ) -> ureq:: Agent {
30
+ ureq:: AgentBuilder :: new ( )
31
+ . tls_connector ( std:: sync:: Arc :: new (
32
+ native_tls:: TlsConnector :: new ( ) . expect ( "failed to create TLS connector" ) ,
33
+ ) )
34
+ . build ( )
35
+ }
36
+
37
+ #[ cfg( not( feature = "native-tls" ) ) ]
38
+ fn get_agent ( ) -> ureq:: Agent {
39
+ ureq:: agent ( )
40
+ }
Original file line number Diff line number Diff line change @@ -24,20 +24,22 @@ build = "build.rs"
24
24
links = " openblas"
25
25
26
26
[features ]
27
- default = [" cblas" , " lapacke" ]
27
+ default = [" cblas" , " lapacke" , " tls " ]
28
28
29
29
cache = []
30
30
cblas = []
31
31
lapacke = []
32
32
static = []
33
33
system = []
34
+ tls = [" openblas-build/tls" ]
35
+ native-certs = [" openblas-build/native-certs" ]
34
36
35
37
[dev-dependencies ]
36
38
libc = " 0.2"
37
39
38
40
[build-dependencies ]
39
41
dirs = " 3.0.1"
40
- openblas-build = { version = " 0.10.7" , path = " ../openblas-build" }
42
+ openblas-build = { version = " 0.10.7" , path = " ../openblas-build" , default-features = false }
41
43
42
44
[target .'cfg(target_os="windows")' .build-dependencies ]
43
45
vcpkg = " 0.2"
You can’t perform that action at this time.
0 commit comments