spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

Compilation on Apple Silicon (ARM64)

Open johnalanwoods opened this issue 5 years ago • 6 comments

Description Currently cargo build doesn't compile on the M1 SOC. (ARM64).

To Reproduce

  • clone repo
  • issue cargo build

Expected behavior

  • successful build

Logs

error: failed to run custom build command for `alsa-sys v0.1.2`

Caused by:
  process didn't exit successfully: `/Users/john/tmp/spotify/spotifyd/target/release/build/alsa-sys-a395ecfc1e968121/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "`\"pkg-config\" \"--libs\" \"--cflags\" \"alsa\"` did not exit successfully: exit code: 1\n--- stderr\nPackage alsa was not found in the pkg-config search path.\nPerhaps you should add the directory containing `alsa.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'alsa\' found\n"', /Users/john/.cargo/registry/src/github.com-1ecc6299db9ec823/alsa-sys-0.1.2/build.rs:4:38
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Compilation flags

  • [ ] dbus_mpris
  • [ ] dbus_keyring
  • [x] alsa_backend
  • [ ] portaudio_backend
  • [ ] pulseaudio_backend
  • [ ] rodio_backend

Versions (please complete the following information):

  • OS: Big Sur 11.1
  • Spotifyd: HEAD, also occurs on #v0.2.24
  • cargo: cargo 1.48.0, rustc 1.49.0

johnalanwoods avatar Jan 06 '21 14:01 johnalanwoods

ALSA isn’t available on Mac; it stands for Advanced Linux Sound Architecture. Try compiling with the flags —no-default-features and —features “portaudio_backend”

Icelk avatar Jan 07 '21 18:01 Icelk

i get same error building

lux1992 avatar Jan 09 '21 21:01 lux1992

@lux1992 Have you tried using the portaudio_backend feature with the --no-default-features flag?

Icelk avatar Jan 11 '21 19:01 Icelk

Yes, just got it to with works with cargo build --release --no-default-features --features="portaudio_backend" && cargo install --path . --locked --no-default-features --features="portaudio_backend Amazing tool!

lux1992 avatar Jan 11 '21 20:01 lux1992

thanks @Iselk!, closing this as it seems resolved. Feel free to reopen if this was not your issue @johnalanwoods

robinvd avatar Jan 12 '21 14:01 robinvd

@robinvd sorry for late reply on this. Yep all resolved. Great to have Spotifyd on the M1 Mac, so much more efficient than the official client.

johnalanwoods avatar Jan 12 '21 14:01 johnalanwoods