Skip to content

Commit

Permalink
Fix CI (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Dec 15, 2023
1 parent 9ff6185 commit 33c03f7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
echo "PWD"
ls -lh /project/alsa-lib/src/.libs
CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR SHERPA_ONNX_MAKE_ARGS="VERBOSE=1"
CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR SHERPA_ONNX_MAKE_ARGS="VERBOSE=1" SHERPA_ONNX_ENABLE_ALSA=1
CIBW_BUILD: "${{ matrix.python-version}}-* "
CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
CIBW_BUILD_VERBOSITY: 3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
echo "PWD"
ls -lh /project/alsa-lib/src/.libs
CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR SHERPA_ONNX_MAKE_ARGS="VERBOSE=1"
CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR SHERPA_ONNX_MAKE_ARGS="VERBOSE=1" SHERPA_ONNX_ENABLE_ALSA=1

CIBW_BUILD: "${{ matrix.python-version}}-* "
CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
Expand Down
7 changes: 6 additions & 1 deletion cmake/cmake_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def is_x86():
return platform.machine() in ["i386", "i686", "x86_64"]


def enable_alsa():
build_alsa = os.environ.get("SHERPA_ONNX_ENABLE_ALSA", None)
return build_alsa and is_linux() and (is_arm64() or is_x86())


try:
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel

Expand Down Expand Up @@ -157,7 +162,7 @@ def build_extension(self, ext: setuptools.extension.Extension):
binaries += ["sherpa-onnx-offline-tts"]
binaries += ["sherpa-onnx-offline-tts-play"]

if is_linux() and (is_arm64() or is_x86()):
if enable_alsa():
binaries += ["sherpa-onnx-alsa"]
binaries += ["sherpa-onnx-offline-tts-play-alsa"]

Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
BuildExtension,
bdist_wheel,
cmake_extension,
enable_alsa,
is_windows,
is_linux,
is_arm64,
is_x86,
)


Expand Down Expand Up @@ -64,7 +62,7 @@ def get_binaries_to_install():
binaries += ["sherpa-onnx-offline-tts"]
binaries += ["sherpa-onnx-offline-tts-play"]

if is_linux() and (is_arm64() or is_x86()):
if enable_alsa():
binaries += ["sherpa-onnx-alsa"]
binaries += ["sherpa-onnx-offline-tts-play-alsa"]

Expand Down

0 comments on commit 33c03f7

Please sign in to comment.