at master 734 B view raw
1# shellcheck shell=bash 2 3echo "Sourcing setuptools-rust-hook" 4 5setuptoolsRustSetup() { 6 # This can work only if rustPlatform.cargoSetupHook is also included 7 if ! command -v cargoSetupPostPatchHook >/dev/null; then 8 echo "ERROR: setuptools-rust has to be used alongside with rustPlatform.cargoSetupHook!" 9 exit 1 10 fi 11 12 export PYO3_CROSS_LIB_DIR="@pyLibDir@" 13 export CARGO_BUILD_TARGET=@cargoBuildTarget@ 14 # TODO theoretically setting linker should not be required because it is 15 # already set in pkgs/build-support/rust/hooks/default.nix but build fails 16 # on missing linker without this. 17 export CARGO_TARGET_@cargoLinkerVar@_LINKER=@targetLinker@ 18} 19 20preConfigureHooks+=(setuptoolsRustSetup)