Install from cargo fails
sarmong opened this issue · comments
I'm trying to install hunter from cargo with cargo install hunter
and get the following error.
MacOS Mojave
error: failed to run custom build command for `gstreamer-sys v0.8.1`
Caused by:
process didn't exit successfully: `/var/folders/6g/x2w6kspd73jcx_bw8h7gmd400000gn/T/cargo-installlMmyER/release/build/gstreamer-sys-48139b3acb15290a/build-script-build` (exit code: 1)
--- stderr
`"pkg-config" "--libs" "--cflags" "gstreamer-1.0" "gstreamer-1.0 >= 1.12"` did not exit successfully: exit code: 1
--- stderr
Package gstreamer-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gstreamer-1.0' found
Package gstreamer-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gstreamer-1.0' found
warning: build failed, waiting for other jobs to finish...
error: failed to compile `hunter v1.3.5`, intermediate artifacts can be found at `/var/folders/6g/x2w6kspd73jcx_bw8h7gmd400000gn/T/cargo-installlMmyER`
Caused by:
build failed
Unfortunately, compiling hunter with all features enabled, i.e. image and video support, isn't very streamlined yet. I'm currently trying to improve that, but meanwhile, you have two options here:
-
Install hunter without those features:
cargo install --no-default-features hunter
-
Fix the problem:
-
Make sure you have the required packages installed:
brew install gst-editing-services gst-libav gst-plugins-bad gst-plugins-base gst-plugins-good gst-plugins-ugly gstreamer gst-rtsp-server
-
Prepend the environment variable for
pkg-config
when installing hunter, like this:
PKG_CONFIG_PATH='/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig' cargo install hunter
-
@straussdd Thanks.
I tried the second option. Installed brew packages. Run the second command and got the error below. Then run rustup toolchain install nightly
as recommended. And rerun second command again. Got the same error.
error: failed to run custom build command for `hunter v1.3.5`
Caused by:
process didn't exit successfully: `/var/folders/6g/x2w6kspd73jcx_bw8h7gmd400000gn/T/cargo-installqO023d/release/build/hunter-07403f1317860899/build-script-build` (exit code: 1)
--- stderr
NIHGTLY COMPILER required
Please install a nighlty compiler to proceed: https://rustup.rs/
rustup toolchain install nightly
source ~/.cargo/env
Error: ()
warning: build failed, waiting for other jobs to finish...
error: failed to compile `hunter v1.3.5`, intermediate artifacts can be found at `/var/folders/6g/x2w6kspd73jcx_bw8h7gmd400000gn/T/cargo-installqO023d`
Caused by:
build failed
@michalens I'm not 100% sure now, but I think the problem is, that nightly
isn't set as your default toolchain in cargo
. You could either:
- Set it as the default toolchain:
rustup default nightly
- Explicitly state which toolchain
cargo
should use:
PKG_CONFIG_PATH='/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig' cargo +nightly install hunter
Second option worked. Thank you!