From 74f36e4f50a2e8b1795df1169626a731ae2dfff7 Mon Sep 17 00:00:00 2001 From: Craig Drummond Date: Tue, 22 Feb 2022 12:01:21 +0000 Subject: [PATCH] USe git verison of bliss-audio, until 0.4.5 released, and add github workflow --- .github/workflows/build.yml | 115 ++++++++++++++++++++++++++++++++++++ Cargo.lock | 79 ++++++++++++------------- Cargo.toml | 2 +- 3 files changed, 155 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..db36c25 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,115 @@ +name: Build for all platforms + +on: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + Linux: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Packages + run: sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg libsqlite3-dev + + - name: Build + run: | + cargo build --release + strip target/release/bliss-analyser + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: bliss-analyser-linux + path: releases/ + + macOS: + runs-on: macos-11.0 + + steps: + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Checkout + uses: actions/checkout@v2 + + - name: Install deps + run: | + brew install ffmpeg sqlite + + - name: Install Rust support for ARM64 & prepare environment + run: | + rustup target add aarch64-apple-darwin + mkdir releases + + - name: Build + run: | + cargo build --release + strip target/release/bliss-analyser + cp target/release/bliss-analyser releases/bliss-analyser-x86_64 + cargo build --target=aarch64-apple-darwin --release + strip target/aarch64-apple-darwin/release/bliss-analyser + cp target/aarch64-apple-darwin/release/bliss-analyser releases/bliss-analyser-arm64 + + - name: Build fat binary + run: | + lipo -create \ + -arch x86_64 releases/bliss-analyser-x86_64 \ + -arch arm64 releases/bliss-analyser-arm64 \ + -output releases/bliss-analyser + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: bliss-analyser-mac + path: releases/ + + Windows: + runs-on: windows-2019 + strategy: + matrix: + include: + - ffmpeg_version: latest + ffmpeg_download_url: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z + fail-fast: false + env: + FFMPEG_DOWNLOAD_URL: ${{ matrix.ffmpeg_download_url }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install deps + run: | + $VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath) + Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n" + Invoke-WebRequest "${env:FFMPEG_DOWNLOAD_URL}" -OutFile ffmpeg-release-full-shared.7z + 7z x ffmpeg-release-full-shared.7z + mkdir ffmpeg + mv ffmpeg-*/* ffmpeg/ + Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n" + Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n" + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Build + run: | + cargo build --release + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: bliss-analyser-windows + path: releases/ diff --git a/Cargo.lock b/Cargo.lock index 64d3ef7..7f55e18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,13 +77,12 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bindgen" -version = "0.54.0" +version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" dependencies = [ "bitflags", "cexpr", - "cfg-if 0.1.10", "clang-sys", "lazy_static", "lazycell", @@ -134,9 +133,8 @@ dependencies = [ [[package]] name = "bliss-audio" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0b2c4717cf81f58eb01c3134061f948ec65c7675d4055dbc8740389ee961f0" +version = "0.4.6" +source = "git+https://github.com/Polochon-street/bliss-rs?rev=5f366b0#5f366b0d809886265ac54398a61523431b44f8a0" dependencies = [ "bliss-audio-aubio-rs", "crossbeam", @@ -234,19 +232,13 @@ dependencies = [ [[package]] name = "cexpr" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -274,9 +266,9 @@ checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "clang-sys" -version = "0.29.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" +checksum = "4cc00842eed744b858222c4c9faf7243aafc6d33f92f96935263ef4d8a41ce21" dependencies = [ "glob", "libc", @@ -314,7 +306,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -323,7 +315,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-channel", "crossbeam-deque", "crossbeam-epoch", @@ -337,7 +329,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -347,7 +339,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -358,7 +350,7 @@ version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "lazy_static", "memoffset", @@ -371,7 +363,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd435b205a4842da59efd07628f921c096bc1cc0a156835b4fa0bcb9a19bcce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -381,7 +373,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "lazy_static", ] @@ -459,9 +451,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "ffmpeg-next" -version = "4.4.0" +version = "5.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4676cda947a87a1e8a42e154059c567e75de64860252cce52c684acd8c074fa0" +checksum = "70a1fc87054b079ade0b081b023c5fef309cd4bbcb569c09eed2aa39b25a0a11" dependencies = [ "bitflags", "ffmpeg-sys-next", @@ -470,9 +462,9 @@ dependencies = [ [[package]] name = "ffmpeg-sys-next" -version = "4.4.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de57234f2c49c6e093fe67bbbaa9142c228f6e2d5533ef27980993d5b6adef2a" +checksum = "6ba12dea33516e30c160ce557c7e43dd857276368eb1cd0eef4fce6529f2dee5" dependencies = [ "bindgen", "cc", @@ -488,7 +480,7 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crc32fast", "libc", "miniz_oxide", @@ -529,7 +521,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -540,7 +532,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.10.0+wasi-snapshot-preview1", ] @@ -673,11 +665,11 @@ checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" [[package]] name = "libloading" -version = "0.5.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ - "cc", + "cfg-if", "winapi", ] @@ -699,7 +691,7 @@ checksum = "96b98a3a1ca2f3054b802e5012e5800674d37dc4af7f99f3037fb57af6a2aeaa" dependencies = [ "base64", "byteorder", - "cfg-if 1.0.0", + "cfg-if", "flate2", "ogg_pager", "once_cell", @@ -712,7 +704,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -751,6 +743,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.4.4" @@ -815,11 +813,12 @@ dependencies = [ [[package]] name = "nom" -version = "5.1.2" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" dependencies = [ "memchr", + "minimal-lexical", "version_check", ] @@ -1237,9 +1236,9 @@ dependencies = [ [[package]] name = "shlex" -version = "0.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "smallvec" @@ -1476,7 +1475,7 @@ version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] diff --git a/Cargo.toml b/Cargo.toml index 8de8282..9839dde 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["audio", "song", "similarity"] readme = "README.md" [dependencies] -bliss-audio = "0.4.4" +bliss-audio = { git = "https://github.com/Polochon-street/bliss-rs", rev = "5f366b0" } argparse = "0.2.2" anyhow = "1.0.40" rusqlite = "0.25.0"