not working -- look at nix emscripten support first before further work

This commit is contained in:
Danny McClanahan
2022-04-22 23:45:41 +00:00
parent cc87de83cd
commit d38310fa02
14 changed files with 2415 additions and 7 deletions

4
lib/spack/env/cc vendored
View File

@@ -241,14 +241,14 @@ case "$command" in
mode=cpp
debug_flags="-g"
;;
cc|c89|c99|gcc|clang|armclang|icc|icx|pgcc|nvc|xlc|xlc_r|fcc|amdclang|cl.exe)
cc|c89|c99|gcc|clang|armclang|icc|icx|pgcc|nvc|xlc|xlc_r|fcc|amdclang|cl.exe|emcc)
command="$SPACK_CC"
language="C"
comp="CC"
lang_flags=C
debug_flags="-g"
;;
c++|CC|g++|clang++|armclang++|icpc|icpx|dpcpp|pgc++|nvc++|xlc++|xlc++_r|FCC|amdclang++)
c++|CC|g++|clang++|armclang++|icpc|icpx|dpcpp|pgc++|nvc++|xlc++|xlc++_r|FCC|amdclang++|em++)
command="$SPACK_CXX"
language="C++"
comp="CXX"

1
lib/spack/env/emscripten/em++ vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/emscripten/emcc vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

View File

@@ -15,8 +15,8 @@ class Emscripten(Compiler):
cxx_names = ['em++']
# Named wrapper links within build_env_path
link_paths = {'cc': os.path.join('upstream', 'emscripten', 'emcc'),
'cxx': os.path.join('upstream', 'emscripten', 'em++'),
link_paths = {'cc': os.path.join('emscripten', 'emcc'),
'cxx': os.path.join('emscripten', 'em++'),
'f77': '',
'fc': ''}
@@ -31,3 +31,7 @@ def debug_flags(self):
@property
def opt_flags(self):
return ['-O0', '-O1', '-O2', '-O3', '-Os', '-Oz']
@property
def disable_new_dtags(self):
return ''

View File

@@ -21,6 +21,8 @@ class AlsaLib(AutotoolsPackage):
variant('python', default=False, description='enable python')
patch('python.patch', when='@1.1.4:1.1.5 +python')
# Remove a type that only exists in the kernel.
patch('s64.patch')
depends_on('python', type=('link', 'run'), when='+python')

View File

@@ -0,0 +1,12 @@
diff --git a/include/alsa/sound/uapi/asound.h b/include/alsa/sound/uapi/asound.h
index ec610c2..5f9724b 100644
--- a/include/alsa/sound/uapi/asound.h
+++ b/include/alsa/sound/uapi/asound.h2
@@ -30,6 +30,7 @@
#else
#include <endian.h>
#include <sys/ioctl.h>
#endif
+typedef int64_t __s64;
#include <stdlib.h>

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
#include <stdio.h>
int main() {
printf("hello, world!\n");
return 0;
}

Binary file not shown.

Binary file not shown.

View File

@@ -66,10 +66,11 @@ class Ffmpeg(AutotoolsPackage):
variant('sdl2', default=False, description='sdl2 support')
variant('shared', default=True, description='build shared libraries')
variant('libx264', default=False, description='H.264 encoding')
variant('alsa', default=True, when='platform=linux', description='Build ALSA support')
depends_on('alsa-lib', when='platform=linux')
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')
@@ -132,6 +133,8 @@ 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')
# '+X' meta variant #

View File

@@ -3,6 +3,11 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import stat
from llnl.util.filesystem import chmod_x
from spack import *
@@ -23,3 +28,9 @@ class Yasm(AutotoolsPackage):
depends_on('automake', when='@develop')
depends_on('libtool', when='@develop')
depends_on('m4', when='@develop')
@run_after('configure')
def make_genversion_executable(self):
with working_dir(self.stage.source_path):
st = os.stat('./genversion')
chmod_x('genversion', st.st_mode | stat.S_IXUSR)

View File

@@ -78,7 +78,10 @@ def install(self, spec, prefix):
config_args = []
if '~shared' in spec:
config_args.append('--static')
configure('--prefix={0}'.format(prefix), *config_args)
if self.spec.satisfies('%emscripten'):
emconfigure('--prefix={0}'.format(prefix), *config_args)
else:
configure('--prefix={0}'.format(prefix), *config_args)
make()
if self.run_tests: