|
| 1 | +[tool.cibuildwheel.linux] |
| 2 | + |
| 3 | +manylinux-x86_64-image = "mtgupf/essentia-builds:manylinux2014_x86_64" |
| 4 | + |
| 5 | +# Only support x86_64 for essentia-tensorflow. |
| 6 | +build = "cp**-manylinux_x86_64" |
| 7 | + |
| 8 | +skip = ["pp*", "*-musllinux*", "*i686", "*cp36*", "*cp37*", "*cp38*"] |
| 9 | + |
| 10 | +environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1 } |
| 11 | + |
| 12 | +before-all = [ |
| 13 | + "PYBIN=/opt/python/cp36-cp36m/bin/", |
| 14 | + "\"${PYBIN}/python\" waf configure --with-gaia --with-tensorflow --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\"", |
| 15 | + "\"${PYBIN}/python\" waf", |
| 16 | + "\"${PYBIN}/python\" waf install", |
| 17 | + # Monkey-patch package name. |
| 18 | + # We could have a separate pyproject.toml configuration, but the build backend does not accept custom configuration filepaths. |
| 19 | + "sed 's/^name *= *\"essentia\"$/name = \"essentia-tensorflow\"/' pyproject.toml > pyproject.toml.patched && mv pyproject.toml.patched pyproject.toml" |
| 20 | +] |
| 21 | + |
| 22 | +test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter, TensorflowPredict'" |
| 23 | + |
| 24 | + |
| 25 | +[tool.cibuildwheel.macos] |
| 26 | + |
| 27 | +skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"] |
| 28 | + |
| 29 | +environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, MACOSX_DEPLOYMENT_TARGET=14.2 } |
| 30 | + |
| 31 | +before-all = [ |
| 32 | + "brew install pkg-config gcc readline sqlite gdbm freetype libpng", |
| 33 | + "brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag", |
| 34 | + "brew link --force ffmpeg@2.8", |
| 35 | + "brew install chromaprint", |
| 36 | + "brew link --overwrite ffmpeg@2.8", |
| 37 | + # Delocate checks for the min OS version (LC_BUILD_VERSION or C_VERSION_MIN_MACOSX). |
| 38 | + # Tensorflow bottle a has minimum target of 14.2 which is too new. |
| 39 | + # We could build from source as a workaround, however, it takes too much time on the CI worker. |
| 40 | + # To keep it simple, just use the bottles available for tensorflow. |
| 41 | + "brew install tensorflow", |
| 42 | + # --- |
| 43 | + # Building tensorflow from source: |
| 44 | + #"echo Checking available SDKs:", |
| 45 | + #"xcodebuild -showsdks", |
| 46 | + #"SDKROOT=$(xcrun --sdk macosx13.0 --show-sdk-path) brew install --build-from-source tensorflow", |
| 47 | + # --- |
| 48 | + # Override VIRTUAL_ENV set by cibuildwheel to ensure global install |
| 49 | + "VIRTUAL_ENV=/usr/local python waf configure --with-tensorflow --pkg-config-path=\"${PKG_CONFIG_PATH}\"", |
| 50 | + "python waf", |
| 51 | + "python waf install", |
| 52 | + # Monkey-patch package name. |
| 53 | + # We could have a separate pyproject.toml configuration, but the build backend does not accept custom configuration filepaths. |
| 54 | + "sed 's/^name *= *\"essentia\"$/name = \"essentia-tensorflow\"/' pyproject.toml > pyproject.toml.patched && mv pyproject.toml.patched pyproject.toml" |
| 55 | +] |
| 56 | + |
| 57 | +# FIXME Temporarily disable testing on macos-13 runner. The wheel is tagged as macosx_14_2 due to the Tensorflow dependency, so it can't be installed by pip ("not a supported wheel on this platform"). |
| 58 | +#test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter, TensorflowPredict'" |
| 59 | + |
| 60 | + |
| 61 | +[[tool.cibuildwheel.overrides]] |
| 62 | +select = "*macosx_arm64*" |
| 63 | + |
| 64 | +skip = ["pp*", "*cp36*", "*cp37*", "*cp38*"] |
| 65 | + |
| 66 | +environment = { PROJECT_NAME="essentia-tensorflow", ESSENTIA_PROJECT_NAME="${PROJECT_NAME}", ESSENTIA_WHEEL_SKIP_3RDPARTY=1, ESSENTIA_WHEEL_ONLY_PYTHON=1, ESSENTIA_MACOSX_ARM64=1, MACOSX_DEPLOYMENT_TARGET=15.2 } |
| 67 | + |
| 68 | +before-all = [ |
| 69 | + "brew install pkg-config gcc readline sqlite gdbm libpng", |
| 70 | + "brew install eigen libyaml fftw ffmpeg@2.8 libsamplerate libtag", |
| 71 | + "brew link --force ffmpeg@2.8", |
| 72 | + "brew install chromaprint", |
| 73 | + "brew link --overwrite ffmpeg@2.8", |
| 74 | + # Delocate checks for the min OS version (LC_BUILD_VERSION or C_VERSION_MIN_MACOSX). |
| 75 | + # Tensorflow bottle a has minimum target of 15.2 which is too new. |
| 76 | + # We could build from source as a workaround, however, it takes too much time on the CI worker. |
| 77 | + # To keep it simple, just use the bottles available for tensorflow. |
| 78 | + "brew install tensorflow", |
| 79 | + # --- |
| 80 | + # Building tensorflow from source: |
| 81 | + #"echo Checking available SDKs:", |
| 82 | + #"xcodebuild -showsdks", |
| 83 | + #"SDKROOT=$(xcrun --sdk macosx14.0 --show-sdk-path) brew install --build-from-source tensorflow", |
| 84 | + # --- |
| 85 | + # Override VIRTUAL_ENV set by cibuildwheel to ensure global install |
| 86 | + "VIRTUAL_ENV=/usr/local python waf configure --with-tensorflow --pkg-config-path=\"${PKG_CONFIG_PATH}\" --arch arm64 --no-msse", |
| 87 | + "python waf", |
| 88 | + "sudo python waf install", |
| 89 | + # Monkey-patch package name. |
| 90 | + # We could have a separate pyproject.toml configuration, but the build backend does not accept custom configuration filepaths. |
| 91 | + "sed 's/^name *= *\"essentia\"$/name = \"essentia-tensorflow\"/' pyproject.toml > pyproject.toml.patched && mv pyproject.toml.patched pyproject.toml" |
| 92 | +] |
| 93 | + |
| 94 | +# On Mac arm64, libavcodec.56.60.100, libavformat.56.40.101 and |
| 95 | +# libavutil.54.31.100, depend on libSDL1.2-compat, which is a compatibility |
| 96 | +# layer for SDL2. libSDL1.2-compat expects SDL2 to be installed in the default |
| 97 | +# brew location (i.e., /opt/homebrew/opt/sdl2/lib), so the user would need to |
| 98 | +# install it via brew manually. Alternativelly, we can manualy copy the SDL2 |
| 99 | +# libs into the wheel. This is a temporary solution, and in the long term we |
| 100 | +# should move to FFmpeg > 2.X. |
| 101 | +repair-wheel-command = [ |
| 102 | + "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}", |
| 103 | + "mkdir -p {dest_dir}/essentia/.dylibs", |
| 104 | + "cp /opt/homebrew/opt/sdl2/lib/libSDL2*.dylib {dest_dir}/essentia/.dylibs", |
| 105 | + "wheel_rel=$(echo {wheel} | grep -o '[^/]*$')", |
| 106 | + "cd {dest_dir} && zip -u {dest_dir}/$wheel_rel essentia/.dylibs/*" |
| 107 | +] |
0 commit comments