@@ -192,7 +192,6 @@ impl EnvVars {
192192#[ cfg( not( target_os = "windows" ) ) ]
193193mod non_windows {
194194 use super :: * ;
195- use std:: process:: Command ;
196195
197196 /// Try probing ffmpeg installed in system with no side effect. Return unfound Err(library name) when failed.
198197 // TODO: this is useful in static lib searching
@@ -210,106 +209,6 @@ mod non_windows {
210209 }
211210 }
212211
213- // TODO: this is useful in ffmpeg placement building
214- #[ allow( dead_code) ]
215- fn clone_and_build_ffmpeg ( out_dir : & str ) {
216- let ffmpeg_dir = & format ! ( "{}/ffmpeg" , out_dir) ;
217-
218- // Check if FFmpeg is cloned.
219- if !PathBuf :: from ( format ! ( "{}/fftools" , ffmpeg_dir) ) . is_dir ( ) {
220- Command :: new ( "git" )
221- . current_dir ( out_dir)
222- . args ( [ "clone" , "https://github.com/ffmpeg/ffmpeg" , "--depth" , "1" ] . iter ( ) )
223- . spawn ( )
224- . expect ( "Failed to clone FFmpeg submodule." )
225- . wait ( )
226- . expect ( "Failed to clone FFmpeg submodule." ) ;
227- }
228-
229- let path = & format ! ( "{}/build/bin:{}" , ffmpeg_dir, env:: var( "PATH" ) . unwrap( ) ) ;
230-
231- // All outputs are stored in ./ffmpeg/build/{bin, lib, share, include}
232- // If no prebuilt FFmpeg libraries provided, we build a custom FFmpeg.
233-
234- // Corresponding to the shell script below:
235- // ./configure \
236- // --prefix="$PWD/build" \
237- // --extra-cflags="-I$PWD/build/include" \
238- // --extra-ldflags="-L$PWD/build/lib" \
239- // --bindir="$PWD/build/bin" \
240- // --pkg-config-flags="--static" \
241- // --extra-libs="-lpthread -lm" \
242- // --enable-gpl \
243- // --enable-libass \
244- // --enable-libfdk-aac \
245- // --enable-libfreetype \
246- // --enable-libmp3lame \
247- // --enable-libopus \
248- // --enable-libvorbis \
249- // --enable-libvpx \
250- // --enable-libx264 \
251- // --enable-libx265 \
252- // --enable-nonfree
253- Command :: new ( format ! ( "{}/configure" , ffmpeg_dir) )
254- . current_dir ( ffmpeg_dir)
255- . env ( "PATH" , path)
256- . env (
257- "PKG_CONFIG_PATH" ,
258- format ! ( "{}/build/lib/pkgconfig" , ffmpeg_dir) ,
259- )
260- . args (
261- [
262- format ! ( r#"--prefix={}/build"# , ffmpeg_dir) ,
263- format ! ( r#"--extra-cflags=-I{}/build/include"# , ffmpeg_dir) ,
264- format ! ( r#"--extra-ldflags=-L{}/build/lib"# , ffmpeg_dir) ,
265- format ! ( r#"--bindir={}/build/bin"# , ffmpeg_dir) ,
266- ]
267- . iter ( ) ,
268- )
269- . args (
270- [
271- "--pkg-config-flags=--static" ,
272- "--extra-libs=-lpthread -lm" ,
273- "--enable-gpl" ,
274- "--enable-libass" ,
275- "--enable-libfdk-aac" ,
276- "--enable-libfreetype" ,
277- "--enable-libmp3lame" ,
278- "--enable-libopus" ,
279- "--enable-libvorbis" ,
280- "--enable-libvpx" ,
281- "--enable-libx264" ,
282- "--enable-libx265" ,
283- "--enable-nonfree" ,
284- ]
285- . iter ( ) ,
286- )
287- . spawn ( )
288- . expect ( "FFmpeg build process: configure failed!" )
289- . wait ( )
290- . expect ( "FFmpeg build process: configure failed!" ) ;
291-
292- let num_cpus = num_cpus:: get ( ) ;
293-
294- Command :: new ( "make" )
295- . current_dir ( ffmpeg_dir)
296- . env ( "PATH" , path)
297- . arg ( format ! ( "-j{}" , num_cpus) )
298- . spawn ( )
299- . expect ( "FFmpeg build process: make compile failed!" )
300- . wait ( )
301- . expect ( "FFmpeg build process: make compile failed!" ) ;
302-
303- Command :: new ( "make" )
304- . current_dir ( ffmpeg_dir)
305- . arg ( format ! ( "-j{}" , num_cpus) )
306- . arg ( "install" )
307- . spawn ( )
308- . expect ( "FFmpeg build process: make install failed!" )
309- . wait ( )
310- . expect ( "FFmpeg build process: make install failed!" ) ;
311- }
312-
313212 pub fn static_linking_with_pkg_config (
314213 library_names : & [ & str ] ,
315214 ffmpeg_pkg_config_path : & str ,
0 commit comments