From 33c0b7f11c14a84c428aa725619c059c3b5e86f3 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 6 Aug 2023 15:07:43 -0700 Subject: [PATCH] rav1e: use rust.envVars --- pkgs/tools/video/rav1e/default.nix | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/pkgs/tools/video/rav1e/default.nix b/pkgs/tools/video/rav1e/default.nix index b7ca158d2e70a..70e95cb4f0166 100644 --- a/pkgs/tools/video/rav1e/default.nix +++ b/pkgs/tools/video/rav1e/default.nix @@ -16,23 +16,6 @@ let rustTargetPlatformSpec = rust.toRustTargetSpec stdenv.hostPlatform; - # TODO: if another package starts using cargo-c (seems likely), - # factor this out into a makeCargoChook expression in - # pkgs/build-support/rust/hooks/default.nix - ccForBuild = "${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"; - cxxForBuild = "${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++"; - ccForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; - cxxForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"; - rustBuildPlatform = rust.toRustTarget stdenv.buildPlatform; - rustTargetPlatform = rust.toRustTarget stdenv.hostPlatform; - setEnvVars = '' - env \ - "CC_${rustBuildPlatform}"="${ccForBuild}" \ - "CXX_${rustBuildPlatform}"="${cxxForBuild}" \ - "CC_${rustTargetPlatform}"="${ccForHost}" \ - "CXX_${rustTargetPlatform}"="${cxxForHost}" \ - ''; - in rustPlatform.buildRustPackage rec { pname = "rav1e"; version = "0.6.6"; @@ -64,13 +47,11 @@ in rustPlatform.buildRustPackage rec { checkType = "debug"; postBuild = '' - ${setEnvVars} \ - cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec} + ${rust.envVars.setEnv} cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec} ''; postInstall = '' - ${setEnvVars} \ - cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec} + ${rust.envVars.setEnv} cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec} ''; meta = with lib; {