6
6
use fs_utils:: copy:: copy_directory;
7
7
use glob:: glob;
8
8
9
+ use :: dirs:: home_dir;
10
+
9
11
use std:: env;
10
12
use std:: fs;
11
13
use std:: path:: PathBuf ;
@@ -86,7 +88,21 @@ fn main() {
86
88
. current_dir ( out. join ( "htslib" ) )
87
89
. arg ( "clean" )
88
90
. status ( ) . unwrap ( ) . success ( )
89
-
91
+
92
+ &&
93
+
94
+ !Command :: new ( "autoconf" )
95
+ . current_dir ( out. join ( "htslib" ) )
96
+ . status ( ) . unwrap ( ) . success ( )
97
+
98
+ &&
99
+
100
+ !Command :: new ( "./configure" )
101
+ . current_dir ( out. join ( "htslib" ) )
102
+ . env ( "CFLAGS" , & cc_cflags)
103
+ . arg ( format ! ( "--host={}" , & host) )
104
+ . status ( ) . unwrap ( ) . success ( )
105
+
90
106
&&
91
107
92
108
!Command :: new ( "autoreconf" )
@@ -98,8 +114,7 @@ fn main() {
98
114
99
115
!Command :: new ( "./configure" )
100
116
. current_dir ( out. join ( "htslib" ) )
101
- . env ( "CFLAGS" , & cc_cflags)
102
- . arg ( format ! ( "--host={}" , & host) )
117
+ . arg ( format ! ( "--prefix={}/local" , home_dir( ) . unwrap( ) . into_os_string( ) . into_string( ) . unwrap( ) ) )
103
118
. status ( ) . unwrap ( ) . success ( )
104
119
{
105
120
panic ! ( "could not configure htslib nor any of its plugins" )
@@ -117,6 +132,16 @@ fn main() {
117
132
panic ! ( "failed to build htslib" ) ;
118
133
}
119
134
135
+ if !Command :: new ( "make" )
136
+ . current_dir ( out. join ( "htslib" ) )
137
+ . arg ( "install" )
138
+ . status ( )
139
+ . unwrap ( )
140
+ . success ( )
141
+ {
142
+ panic ! ( "failed to build htslib" ) ;
143
+ }
144
+
120
145
cfg. file ( "wrapper.c" ) . compile ( "wrapper" ) ;
121
146
122
147
bindgen:: Builder :: default ( )
0 commit comments