diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-01-11 23:37:02 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-01-11 23:41:30 +0000 |
commit | 6c557e3f1c28cf87e9fba232811d6875dd1399c1 (patch) | |
tree | 035a071d5d8980df6de0fa42e2ef8fc0cce7055e /nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix | |
parent | da7500bc026e937ac7fce7b50f67a0e1765737a7 (diff) | |
parent | e4134747f5666bcab8680aff67fa3b63384f9a0f (diff) | |
download | nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.gz nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.bz2 nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.lz nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.xz nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.zst nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.zip |
Merge commit 'e4134747f5666bcab8680aff67fa3b63384f9a0f'
Diffstat (limited to 'nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix')
-rw-r--r-- | nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix b/nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix index 2a40240671cb..efc538f0fd61 100644 --- a/nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix +++ b/nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, echo_build_heading, noisily, makeDeps }: +{ lib, stdenv, echo_build_heading, noisily, mkRustcDepArgs }: { build , buildDependencies , colors @@ -20,12 +20,12 @@ , verbose , workspace_member }: let version_ = lib.splitString "-" crateVersion; - versionPre = if lib.tail version_ == [] then "" else builtins.elemAt version_ 1; - version = lib.splitString "." (lib.head version_); - rustcOpts = lib.lists.foldl' (opts: opt: opts + " " + opt) + versionPre = if lib.tail version_ == [] then "" else lib.elemAt version_ 1; + version = lib.splitVersion (lib.head version_); + rustcOpts = lib.foldl' (opts: opt: opts + " " + opt) (if release then "-C opt-level=3" else "-C debuginfo=2") (["-C codegen-units=$NIX_BUILD_CORES"] ++ extraRustcOpts); - buildDeps = makeDeps buildDependencies crateRenames; + buildDeps = mkRustcDepArgs buildDependencies crateRenames; authors = lib.concatStringsSep ":" crateAuthors; optLevel = if release then 3 else 0; completeDepsDir = lib.concatStringsSep " " completeDeps; @@ -90,9 +90,9 @@ in '' export HOST="${stdenv.hostPlatform.config}" export PROFILE=${if release then "release" else "debug"} export OUT_DIR=$(pwd)/target/build/${crateName}.out - export CARGO_PKG_VERSION_MAJOR=${builtins.elemAt version 0} - export CARGO_PKG_VERSION_MINOR=${builtins.elemAt version 1} - export CARGO_PKG_VERSION_PATCH=${builtins.elemAt version 2} + export CARGO_PKG_VERSION_MAJOR=${lib.elemAt version 0} + export CARGO_PKG_VERSION_MINOR=${lib.elemAt version 1} + export CARGO_PKG_VERSION_PATCH=${lib.elemAt version 2} export CARGO_PKG_VERSION_PRE="${versionPre}" export CARGO_PKG_HOMEPAGE="${crateHomepage}" export NUM_JOBS=1 @@ -150,4 +150,3 @@ in '' fi runHook postConfigure '' - |