mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 09:02:46 +00:00
buildRustPackage: make dependencies' source writable
Some packages, such as the xcb crate, do code generation at build-time; therefore, the dependencies' source tree must be writable.
This commit is contained in:
parent
eb85761137
commit
7ede960a27
|
@ -43,6 +43,10 @@ in stdenv.mkDerivation (args // {
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
eval "$cargoDepsHook"
|
eval "$cargoDepsHook"
|
||||||
|
|
||||||
|
unpackFile "$cargoDeps"
|
||||||
|
cargoDepsCopy=$(stripHash $(basename $cargoDeps))
|
||||||
|
chmod -R +w "$cargoDepsCopy"
|
||||||
|
|
||||||
mkdir .cargo
|
mkdir .cargo
|
||||||
cat >.cargo/config <<-EOF
|
cat >.cargo/config <<-EOF
|
||||||
[source.crates-io]
|
[source.crates-io]
|
||||||
|
@ -50,9 +54,11 @@ in stdenv.mkDerivation (args // {
|
||||||
replace-with = 'vendored-sources'
|
replace-with = 'vendored-sources'
|
||||||
|
|
||||||
[source.vendored-sources]
|
[source.vendored-sources]
|
||||||
directory = '$cargoDeps'
|
directory = '$(pwd)/$cargoDepsCopy'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
unset cargoDepsCopy
|
||||||
|
|
||||||
export RUST_LOG=${logLevel}
|
export RUST_LOG=${logLevel}
|
||||||
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
|
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
|
||||||
'' + (args.postUnpack or "");
|
'' + (args.postUnpack or "");
|
||||||
|
|
Loading…
Reference in a new issue