[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nix-dev
Subject:    Re: [nix-devel] Cannot find alsa when compiling the Amethyst game engine in a rust overlay
From:       Linus <acc () sphalerite ! org>
Date:       2018-07-12 16:30:16
Message-ID: 613774FF-32DA-42DB-857E-37CCD11047CF () sphalerite ! org
[Download RAW message or body]

On 12 July 2018 15:53:18 CEST, ilav@nym.hush.com wrote:
> Hi,
> I'm trying out a Rust game engine called Amethyst and I've set up a
> rust overlay with this guide:
> https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#using-the-rust-nightlies-overlay
>  My default.nix is as follows:
> ```nixwith import  {};
> 
> stdenv.mkDerivation rec {
> name = "env";
> env = buildEnv { name = name; paths = buildInputs; };
> 
> buildInputs = [ latest.rustChannels.stable.rust
> alsaLib
> alsa-firmware
> alsaOss
> alsaPlugins
> alsaTools
> alsaUtils
> ams-lv2
> alsaPluginWrapper
> apulse
> python3
> ];
> }
> ```
> So far I'm only trying to get the project compiled. When I run `cargo
> build` inside a nix-shell I get this error: ```   Compiling alsa-sys
> v0.1.2
> Compiling wayland-client v0.12.5
> Compiling wayland-protocols v0.12.5
> Compiling syn v0.14.4
> error: failed to run custom build command for `alsa-sys v0.1.2`
> process didn't exit successfully:
> `/home/lassi/Documents/amethyst_test/target/debug/build/alsa-sys-c596e20bf4672788/build-script-build`
>  (exit code: 101)
> --- stderr
> thread 'main' panicked at 'called `Result::unwrap()` on an `Err`
> value: "Failed to run `"pkg-config" "--libs" "--cflags" "alsa"`: No
> such file or directory (os error 2)"', libcore/result.rs:945:5
> note: Run with `RUST_BACKTRACE=1` for a backtrace.
> 
> warning: build failed, waiting for other jobs to finish...
> error: build failed```
> I've tried to put all nix packages containing the word 'alsa' as build
> inputs but to no avail. Any ideas? My Cargo.toml (for the relevant
> parts) looks like this:```[dependencies]
> amethyst = "0.7.0"```
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "nix-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to nix-devel+unsubscribe@googlegroups.com.
> To post to this group, send email to nix-devel@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nix-devel/20180712135318.C68CDA0126%40smtp.hushmail.com.
>  For more options, visit https://groups.google.com/d/optout.

Hey,

Try adding nativeBuildInputs = [ pkgconfig ];. The only alsa one you should need is \
alsaLib AFAIK.

Hope this helps!
Linus

-- 
You received this message because you are subscribed to the Google Groups "nix-devel" \
group. To unsubscribe from this group and stop receiving emails from it, send an \
email to nix-devel+unsubscribe@googlegroups.com. To post to this group, send email to \
nix-devel@googlegroups.com. To view this discussion on the web visit \
https://groups.google.com/d/msgid/nix-devel/613774FF-32DA-42DB-857E-37CCD11047CF%40sphalerite.org.
 For more options, visit https://groups.google.com/d/optout.


[Attachment #3 (text/html)]

<html><head></head><body><div class="gmail_quote">On 12 July 2018 15:53:18 CEST, \
ilav@nym.hush.com wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt \
0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <span \
style="font-family: Arial; font-size: 14px; line-height: \
150%;"><div>Hi,</div><div><br></div><div>I'm trying out a Rust game engine called \
Amethyst and I've set up a rust overlay with this guide: <a \
href="https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.secti \
on.md#using-the-rust-nightlies-overlay">https://github.com/NixOS/nixpkgs/blob/master/d \
oc/languages-frameworks/rust.section.md#using-the-rust-nightlies-overlay</a></div><div><br></div><div>My \
default.nix is as follows:</div><div><br></div><div>```nix</div><div>with import \
&lt;nixpkgs&gt; {};<br><br>stdenv.mkDerivation rec {<br>&nbsp; name = \
"env";<br>&nbsp; env = buildEnv { name = name; paths = buildInputs; };<br><br>&nbsp; \
buildInputs = [ latest.rustChannels.stable.rust<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
];<br>}<br></div><div>```</div><div><br></div><div>So far I'm only trying to get the \
project compiled. When I run `cargo build` inside a nix-shell I get this \
error:&nbsp;</div><div>```</div><div>&nbsp;&nbsp; Compiling alsa-sys \
v0.1.2<br>&nbsp;&nbsp; Compiling wayland-client v0.12.5<br>&nbsp;&nbsp; Compiling \
wayland-protocols v0.12.5<br>&nbsp;&nbsp; Compiling syn v0.14.4<br>error: failed to \
run custom build command for `alsa-sys v0.1.2`<br>process didn't exit successfully: \
`/home/lassi/Documents/amethyst_test/target/debug/build/alsa-sys-c596e20bf4672788/build-script-build` \
(exit code: 101)<br>--- stderr<br>thread 'main' panicked at 'called \
`Result::unwrap()` on an `Err` value: "Failed to run `\"pkg-config\" \"--libs\" \
\"--cflags\" \"alsa\"`: No such file or directory (os error 2)"', \
libcore/result.rs:945:5<br>note: Run with `RUST_BACKTRACE=1` for a \
backtrace.<br><br>warning: build failed, waiting for other jobs to \
finish...<br>error: build failed</div><div>```</div><div><br></div><div>I've tried to \
put all nix packages containing the word 'alsa' as build inputs but to no avail. Any \
ideas? My Cargo.toml (for the relevant parts) looks like \
this:</div><div>```</div><div>[dependencies]<br>amethyst = \
"0.7.0"</div><div>```<br></div></span>

<p></p></blockquote></div><br clear="all">Hey,<br>
<br>
Try adding nativeBuildInputs = [ pkgconfig ];. The only alsa one you should need is \
alsaLib AFAIK.<br> <br>
Hope this helps!<br>
Linus</body></html>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups \
&quot;nix-devel&quot; group.<br /> To unsubscribe from this group and stop receiving \
emails from it, send an email to <a \
href="mailto:nix-devel+unsubscribe@googlegroups.com">nix-devel+unsubscribe@googlegroups.com</a>.<br \
/> To post to this group, send email to <a \
href="mailto:nix-devel@googlegroups.com">nix-devel@googlegroups.com</a>.<br /> To \
view this discussion on the web visit <a \
href="https://groups.google.com/d/msgid/nix-devel/613774FF-32DA-42DB-857E-37CCD11047CF \
%40sphalerite.org?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/nix-devel/613774FF-32DA-42DB-857E-37CCD11047CF%40sphalerite.org</a>.<br \
/> For more options, visit <a \
href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br \
/>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic