204
204
)
205
205
206
206
207
- def download_tars (use_gnutls , stage ):
207
+ def download_tars (use_gnutls ):
208
208
# Try to download all tars at the start.
209
209
# If there is an curl error, do nothing, then try again in `main()`
210
210
211
211
local_libs = library_group
212
212
if use_gnutls :
213
213
local_libs += gnutls_group
214
214
215
- if stage is None :
216
- the_packages = local_libs + codec_group
217
- elif stage == 0 :
218
- the_packages = local_libs
219
- elif stage == 1 :
220
- the_packages = codec_group
221
- else :
222
- the_packages = []
223
-
224
- for package in the_packages :
215
+ for package in local_libs + codec_group :
225
216
tarball = os .path .join (
226
217
os .path .abspath ("source" ),
227
218
package .source_filename or package .source_url .split ("/" )[- 1 ],
@@ -238,18 +229,12 @@ def main():
238
229
239
230
parser = argparse .ArgumentParser ("build-ffmpeg" )
240
231
parser .add_argument ("destination" )
241
- parser .add_argument (
242
- "--stage" ,
243
- default = None ,
244
- help = "AArch64 build requires stage and possible values can be 1, 2" ,
245
- )
246
232
parser .add_argument ("--enable-gpl" , action = "store_true" )
247
233
parser .add_argument ("--disable-gpl" , action = "store_true" )
248
234
249
235
args = parser .parse_args ()
250
236
251
237
dest_dir = args .destination
252
- build_stage = None if args .stage is None else int (args .stage ) - 1
253
238
disable_gpl = args .disable_gpl
254
239
del args
255
240
@@ -258,8 +243,6 @@ def main():
258
243
# FFmpeg has native TLS backends for macOS and Windows
259
244
use_gnutls = plat == "Linux"
260
245
261
- if plat == "Linux" and os .environ .get ("CIBUILDWHEEL" ) == "1" :
262
- output_dir = "/output"
263
246
output_tarball = os .path .join (output_dir , f"ffmpeg-{ get_platform ()} .tar.gz" )
264
247
265
248
if os .path .exists (output_tarball ):
@@ -268,25 +251,11 @@ def main():
268
251
builder = Builder (dest_dir = dest_dir )
269
252
builder .create_directories ()
270
253
271
- download_tars (use_gnutls , build_stage )
254
+ download_tars (use_gnutls )
272
255
273
256
# install packages
274
257
available_tools = set ()
275
- if plat == "Linux" and os .environ .get ("CIBUILDWHEEL" ) == "1" :
276
- with log_group ("install packages" ):
277
- run (
278
- [
279
- "yum" ,
280
- "-y" ,
281
- "install" ,
282
- "gperf" ,
283
- "libuuid-devel" ,
284
- "libxcb-devel" ,
285
- "zlib-devel" ,
286
- ]
287
- )
288
- available_tools .update (["gperf" ])
289
- elif plat == "Windows" :
258
+ if plat == "Windows" :
290
259
available_tools .update (["gperf" , "nasm" ])
291
260
292
261
# print tool locations
@@ -372,10 +341,7 @@ def main():
372
341
library_group += gnutls_group
373
342
374
343
package_groups = [library_group + codec_group , [ffmpeg_package ]]
375
- if build_stage is not None :
376
- packages = package_groups [build_stage ]
377
- else :
378
- packages = [p for p_list in package_groups for p in p_list ]
344
+ packages = [p for p_list in package_groups for p in p_list ]
379
345
380
346
for package in packages :
381
347
if disable_gpl and package .gpl :
@@ -386,7 +352,7 @@ def main():
386
352
else :
387
353
builder .build (package )
388
354
389
- if plat == "Windows" and ( build_stage is None or build_stage == 1 ) :
355
+ if plat == "Windows" :
390
356
# fix .lib files being installed in the wrong directory
391
357
for name in (
392
358
"avcodec" ,
@@ -436,9 +402,8 @@ def main():
436
402
run (["strip" , "-s" ] + libraries )
437
403
438
404
# build output tarball
439
- if build_stage is None or build_stage == 1 :
440
- os .makedirs (output_dir , exist_ok = True )
441
- run (["tar" , "czvf" , output_tarball , "-C" , dest_dir , "bin" , "include" , "lib" ])
405
+ os .makedirs (output_dir , exist_ok = True )
406
+ run (["tar" , "czvf" , output_tarball , "-C" , dest_dir , "bin" , "include" , "lib" ])
442
407
443
408
444
409
if __name__ == "__main__" :
0 commit comments