sudipghimire533 / ytui-music

Youtube client in terminal for music ( lightweight youtube client )
GNU General Public License v2.0
467 stars 19 forks source link

Building on OpenBSD #45

Open albino opened 8 months ago

albino commented 8 months ago

While trying to build on OpenBSD the build fails because the linker can't find libmpv. by default, OpenBSD's linker only searches /usr/lib, not /usr/local/lib, so we need to tell it where to look for libmpv. Solution is to set RUSTFLAGS=-L/usr/local/lib.

It should be possible to configure Cargo so it builds ytui-music without needing this environment variable set. I tried the following in Cargo.toml:

[target.x86_64-unknown-openbsd]
rustc-link-lib = ["/usr/local/lib"]

... but it didn't work :(

Can someone who knows a bit more about rust toolchain advise?

Also, building openssl-sys fails on recent OpenBSD because only old LibreSSL versions are supported. The quick solution is to install openssl-1.1.1wv0 and set OPENSSL_LIB_DIR=/usr/local/lib/eopenssl11 OPENSSL_INCLUDE_DIR=/usr/local/include/eopenssl11. Of course, this is an upstream problem, but I mention it in case anyone else is trying to build under OpenBSD or you want to mention it in the build instructions.

After setting these three env variables, ytui-music builds and runs with no problems.