Skip to content

Commit

Permalink
feat: pre-build libmusly on windows runner
Browse files Browse the repository at this point in the history
  • Loading branch information
andban committed Nov 2, 2024
1 parent 24f0df6 commit 6a511c4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 28 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,28 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: seanmiddleditch/gha-setup-ninja@v5
if: ${{ matrix.os == 'windows-latest' }}

- name: Build libmusly
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: |
curl -SL https://github.com/andban/musly/archive/1f98bf8af82f4e1f87581e274854d1d20e1603d5.zip -o $RUNNER_TEMP/musly.zip
cd $RUNNER_TEMP
7z x musly.zip
cd musly-1f98bf8af82f4e1f87581e274854d1d20e1603d5
cmake -G Ninja -S . -B build -DMUSLY_USE_OWN_LIBRESAMPLE=TRUE -DMUSLY_USE_OWN_LIBKISSFFT=TRUE
cmake --build build --config Release
cmake --install build
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: pp* *-musllinux*
CIBW_ARCHS_MACOS: auto
CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_WINDOWS: AMD64
CIBW_ENVIRIONMENT: "RUNNER_TEMP=${{ runner.temp }}"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 3 additions & 1 deletion native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ include(FetchContent)
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)

set(MUSLY_USE_OWN_LIBRESAMPLE TRUE)
set(MUSLY_USE_OWN_LIBKISSFFT TRUE)
FetchContent_Declare(
Musly
GIT_REPOSITORY https://github.com/andban/musly.git
GIT_TAG origin/feat/modernized-build-scripts
GIT_TAG 1f98bf8af82f4e1f87581e274854d1d20e1603d5
DOWNLOAD_EXTRACT_TIMESTAMP TRUE EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS
)

Expand Down
2 changes: 1 addition & 1 deletion native/pymusly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if(DEFINED musly_SOURCE_DIR AND ${SKBUILD_STATE} STREQUAL "wheel")
RENAME LICENSE.resample.txt
)
install(
FILES ${musly_SOURCE_DIR}/libmusly/src/kissfft/COPYING
FILES ${musly_SOURCE_DIR}/libkissfft/COPYING
DESTINATION ${SKBUILD_METADATA_DIR}/licenses
RENAME LICENSE.kissfft.txt
)
Expand Down
25 changes: 0 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,6 @@ manylinux-aarch64-image = "manylinux_2_28"
musllinux-x86_64-image = "musllinux_1_2"
musllinux-aarch64-image = "musllinux_1_2"

[tool.cibuildwheel.linux]
before-all = [
"RUNNER_TEMP=$(bash -c 'echo $RUNNER_TEMP')",
"curl -SL https://github.com/andban/musly/archive/refs/heads/feat/modernized-build-scripts.tar.gz | tar -xzC $RUNNER_TEMP",
"cd $RUNNER_TEMP/musly-feat-modernized-build-scripts",
"cmake -S . -B build",
"cmake --build build",
"cmake --install build"
]

[tool.cibuildwheel.macos]
before-all = [
"RUNNER_TEMP=$(bash -c 'echo $RUNNER_TEMP')",
"curl -SL https://github.com/andban/musly/archive/refs/heads/feat/modernized-build-scripts.tar.gz | tar -xzC $RUNNER_TEMP",
"cd $RUNNER_TEMP/musly-feat-modernized-build-scripts",
"cmake -S . -B build",
"cmake --build build",
"cmake --install build"
]

[tool.cibuildwheel.windows]
before-all = [
"pwsh -Command { curl -SL https://github.com/andban/musly/archive/refs/heads/feat/modernized-build-scripts.tar.gz | tar -f - -xzC $env:RUNNER_TEMP ; cd $env:RUNNER_TEMP/musly-feat-modernized-build-scripts && cmake -S . -B build && cmake --build build && cmake --install build }"
]

[tool.pytest.ini_options]
minversion = 8.0
addopts = [
Expand Down

0 comments on commit 6a511c4

Please sign in to comment.