Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for using cargo install in macOS Big Sur #91

Open
msdos opened this issue Feb 20, 2022 · 13 comments
Open

Improve documentation for using cargo install in macOS Big Sur #91

msdos opened this issue Feb 20, 2022 · 13 comments

Comments

@msdos
Copy link

msdos commented Feb 20, 2022

brew install atk gtk+3 is needed to correctly compile gdk-sys.

@marin-m
Copy link
Owner

marin-m commented Feb 21, 2022

Hello,

Thank you for the information, is the overall functionality of the software correctly usable under macOS? If the matter is to update the README.md file at the root of the repository, do you have any other building command to suggest in order to facilitate/ease the macOS building process, if it is confirmed working and can be repeated?

Regards,

@msdos
Copy link
Author

msdos commented Feb 22, 2022

Since in this machine I already have plenty of packages installed with homebrew and cargo, I cannot for sure say that only installing these packages it's going to work. For example: there's no libssl-dev in homebrew. But, after calling brew install openssl I added in my .profile:

CPPFLAGS="-I$(brew --prefix openssl)/include"
LDFLAGS="-L$(brew --prefix openssl)/lib"

Since some compiled packages (like a custom Python on this machine) that were expecting ssl headers needed this to properly find the headers (this "hack" is already on the wild for example in https://devguide.python.org/setup/#macos-and-os-x).

When doing cargo install songrec, it failed on gdk-sys, but after installing these two packages from the first message of this issue, just calling cargo install songrec made songrec available.

If you don't have an Apple hardware to properly test indeed it's hard to put it in an official README.md. Let's hope that this issue will be properly indexed by google so if more people show interest we can test in an environment with less installed packages than mine to officially put in a README.md.

@msdos msdos changed the title Improve documentation for using cargo install in macOS Improve documentation for using cargo install in macOS Big Sur Feb 22, 2022
@MichaelDepner
Copy link

I don't have a lot of build packages floating around since I tend to use Docker for everything.

brew install atk gtk+3 dbus, then cargo install songrec was all it took on my Mac. Terminal and GUI is working flawlessly :)

@kyle-seongwoo-jun
Copy link

error: failed to run custom build command for `libdbus-sys v0.2.2`

I got this error on cargo install songrec before installing dbus.

brew install atk gtk+3 dbus

And, This works perfectly for me!

@samuelvaneck
Copy link

samuelvaneck commented Mar 9, 2023

For anyone that got an error installing songrec with cargo about an incorrect version of libffi:

 Package 'gobject-2.0' requires 'libffi >= 3.0.0' but version of libffi is 2.1

Set the correct PKG_CONFIG_PATH environment variable. Mine was:

export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.4.4/lib/pkgconfig

or

export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

Found that solution in this Github issue.

@kyle-seongwoo-jun
Copy link

I got this error when compiling the source code.

error: failed to run custom build command for `glib-sys v0.10.1`

this fixed the issue.

brew install pkg-config

@erlonbie
Copy link

erlonbie commented Aug 3, 2023

@kyle-seongwoo-jun solution fixed for me

Related to this issue, is there a way to create a application on the dock with a cool icon?

I could only create a shortcut on the dock that spawns a terminal that launches songrec.

@ghost
Copy link

ghost commented Feb 18, 2024

How come none of you had to brew install pulseaudio ?

I got this error after cargo install songrec:

error: linking with `cc` failed: exit status: 1
  = note: ld: library not found for -l:libpulse.0.dylib
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

@marin-m
Copy link
Owner

marin-m commented Feb 18, 2024

There are indications telling to use --no-default-features to opt-out components such as libpulse now in the README.

@ghost
Copy link

ghost commented Feb 19, 2024

@marin-m thank you. I couldn't understand what the -F switch means though, based on the README. I tried to not add gui, pulseaudio, or mpris, by passing -F gui,pulse,mpris, but I still got the same error message as before. What is the dbus dependency for?

@marin-m
Copy link
Owner

marin-m commented Feb 19, 2024

DBus is used on native Linux by GLib/GTK+ for keeping the app single-instance, also it is used more directly for interfacing with the MPRIS DBus API which optionally allows SongRec recognition results to be displayed as media originating from a media playet.

@ghost
Copy link

ghost commented Feb 19, 2024

I misunderstood what -F is based on the readme. I tried to not add gui, pulseaudio, or mpris, by passing -F gui,pulse,mpris, but compilation still failed because "ld: library not found for -l:libpulse.0.dylib"

@marin-m
Copy link
Owner

marin-m commented Feb 19, 2024

--no-default-features is for removing the extra features (including pulse), all which are on by default. -F is for re-adding the extra features. -F pulse re-enables the libpulse dependency. Please read the manpage of cargo for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants