From adcc6d41026c31423879d720ce0b909c4dc13e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 12 Mar 2012 09:45:14 +0000 Subject: [PATCH] gcc-cross-wrapper-libs: Gracefully deal with non-existent /TRIPLET/lib dir. This fixes the cross-MinGW environment. svn path=/nixpkgs/trunk/; revision=33010 --- .../gcc-cross-wrapper/default.nix | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/gcc-cross-wrapper/default.nix b/pkgs/build-support/gcc-cross-wrapper/default.nix index ab879c1841fc..be071607d8bd 100644 --- a/pkgs/build-support/gcc-cross-wrapper/default.nix +++ b/pkgs/build-support/gcc-cross-wrapper/default.nix @@ -20,13 +20,20 @@ let phases = [ "installPhase" ]; installPhase = '' echo $out - mkdir -p $out - cp -Rd ${gcc}/${cross.config}/lib $out/lib - chmod -R +w $out/lib - for a in $out/lib/*.la; do - sed -i -e s,${gcc}/${cross.config}/lib,$out/lib,g $a - done - rm -f $out/lib/*.py + mkdir -p "$out" + + if [ -d "${gcc}/${cross.config}/lib" ] + then + cp -Rd "${gcc}/${cross.config}/lib" "$out/lib" + chmod -R +w "$out/lib" + for a in "$out/lib/"*.la; do + sed -i -e "s,${gcc}/${cross.config}/lib,$out/lib,g" $a + done + rm -f "$out/lib/"*.py + else + # The MinGW cross-compiler falls into this category. + mkdir "$out/lib" + fi ''; }; in