make ffmpeg build with emscripten!!!!!!
This commit is contained in:
13
var/spack/repos/builtin/packages/ffmpeg/disable-asm.patch
Normal file
13
var/spack/repos/builtin/packages/ffmpeg/disable-asm.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/./configure b/./configure
|
||||
index 4ba72bf..43c1a0e 100755
|
||||
--- a/./configure
|
||||
+++ b/./configure
|
||||
@@ -4652,7 +4652,7 @@ probe_cc(){
|
||||
_depflags='-MMD'
|
||||
_cflags_speed='-O3'
|
||||
_cflags_size='-Os'
|
||||
- elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
|
||||
+ elif $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; then
|
||||
_type=clang
|
||||
_ident=$($_cc --version 2>/dev/null | head -n1)
|
||||
_depflags='-MMD -MF $(@:.o=.d) -MT $@'
|
||||
@@ -65,12 +65,18 @@ class Ffmpeg(AutotoolsPackage):
|
||||
variant('openssl', default=False, description='needed for https support')
|
||||
variant('sdl2', default=False, description='sdl2 support')
|
||||
variant('shared', default=True, description='build shared libraries')
|
||||
variant('static', default=True, description='build static libraries')
|
||||
variant('libx264', default=False, description='H.264 encoding')
|
||||
variant('alsa', default=True, when='platform=linux', description='Build ALSA support')
|
||||
variant('doc', default=True, description='Build documentation')
|
||||
variant('swscale', default=True, description='Build libswscale')
|
||||
variant('swresample', default=True, description='Build libswresample')
|
||||
variant('postproc', default=True, description='Build libpostproc')
|
||||
variant('stripping', default=True, description='Build stripped binaries')
|
||||
|
||||
depends_on('alsa-lib', when='+alsa')
|
||||
depends_on('libiconv')
|
||||
# depends_on('yasm@1.2.0:')
|
||||
depends_on('yasm@1.2.0:')
|
||||
depends_on('zlib')
|
||||
|
||||
depends_on('aom', when='+libaom')
|
||||
@@ -126,6 +132,17 @@ def enable_or_disable_meta(self, variant, options):
|
||||
switch = 'enable' if '+{0}'.format(variant) in self.spec else 'disable'
|
||||
return ['--{0}-{1}'.format(switch, option) for option in options]
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
if self.spec.satisfies('%emscripten'):
|
||||
if name == 'ldflags':
|
||||
# This is a patch to LLVM which only works if
|
||||
# "llvm+multiple-definitions" is enabled.
|
||||
flags.append('{}--allow-multiple-definition'
|
||||
.format(self.compiler.linker_arg))
|
||||
return (flags, None, None)
|
||||
|
||||
patch('disable-asm.patch', when='%emscripten')
|
||||
|
||||
def configure_args(self):
|
||||
spec = self.spec
|
||||
config_args = [
|
||||
@@ -133,8 +150,12 @@ def configure_args(self):
|
||||
'--cc={0}'.format(spack_cc),
|
||||
'--cxx={0}'.format(spack_cxx)
|
||||
]
|
||||
if '+alsa' not in self.spec:
|
||||
config_args.append('--disable-alsa')
|
||||
if self.spec.satisfies('%emscripten'):
|
||||
config_args.extend([
|
||||
'--disable-asm',
|
||||
'--arch=wasm32',
|
||||
'--disable-programs',
|
||||
])
|
||||
|
||||
# '+X' meta variant #
|
||||
|
||||
@@ -179,6 +200,13 @@ def configure_args(self):
|
||||
'nonfree',
|
||||
'openssl',
|
||||
'shared',
|
||||
'static',
|
||||
'alsa',
|
||||
'doc',
|
||||
'swscale',
|
||||
'swresample',
|
||||
'postproc',
|
||||
'stripping',
|
||||
'version3',
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user