From 5647e9ae4ea3c918807d4e4fa3bee566a48c2f47 Mon Sep 17 00:00:00 2001 From: Justin Humm Date: Sun, 7 Oct 2018 22:14:19 +0200 Subject: [PATCH] buildRustPackage: fix regex for separating lib and bin E.g. exa was wrongly put into /lib, as it matches .*.a but not .*\.a (cherry picked from commit 64d0676fe1cafc47d710f0e62ff1139814e314ad) --- pkgs/build-support/rust/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 964df2248f63..8d8e2d15e7d9 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -94,8 +94,8 @@ in stdenv.mkDerivation (args // { installPhase = args.installPhase or '' runHook preInstall mkdir -p $out/bin $out/lib - find target/release -maxdepth 1 -type f -executable ! \( -regex ".*.\(so.[0-9.]+\|so\|a\|dylib\)" \) -print0 | xargs -r -0 cp -t $out/bin - find target/release -maxdepth 1 -regex ".*.\(so.[0-9.]+\|so\|a\|dylib\)" -print0 | xargs -r -0 cp -t $out/lib + find target/release -maxdepth 1 -type f -executable ! \( -regex ".*\.\(so.[0-9.]+\|so\|a\|dylib\)" \) -print0 | xargs -r -0 cp -t $out/bin + find target/release -maxdepth 1 -regex ".*\.\(so.[0-9.]+\|so\|a\|dylib\)" -print0 | xargs -r -0 cp -t $out/lib rmdir --ignore-fail-on-non-empty $out/lib $out/bin runHook postInstall '';