Skip to content

Instantly share code, notes, and snippets.

@pikajude
Created April 11, 2020 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pikajude/20bfcaad08870e1f01d48fe3b5d0f33d to your computer and use it in GitHub Desktop.
Save pikajude/20bfcaad08870e1f01d48fe3b5d0f33d to your computer and use it in GitHub Desktop.
{
buildPhase = ''
runHook preBuild
export NIX_RUST_BUILD_FLAGS=
for dep in $nativeBuildInputs $propagatedNativeBuildInputs; do
if [ -e "$dep/lib/.cargo/link-flags" ]; then
NIX_RUST_BUILD_FLAGS+=" $(< $dep/lib/.cargo/link-flags)"
fi
if [ -e "$dep/lib/.cargo/env" ]; then
. "$dep/lib/.cargo/env"
fi
done
export NIX_RUST_FLAGS=
for dep in $buildInputs $propagatedBuildInputs; do
if [ -e "$dep/lib/.cargo/link-flags" ]; then
NIX_RUST_FLAGS+=" $(< $dep/lib/.cargo/link-flags)"
fi
done
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment