about summary refs log tree commit diff
path: root/pkgs/build-support/builder-defs
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2009-05-10 09:13:25 +0000
committerMichael Raskin <7c6f434c@mail.ru>2009-05-10 09:13:25 +0000
commit1c43ab8b17a9882c54dbb664d10a2e2813e1ed9c (patch)
treec0884b337420e4f160087e5e0bf3d3606de161b2 /pkgs/build-support/builder-defs
parent3ea1d5b07a4f0cf4a8913f75f8514786c487bd00 (diff)
downloadnixlib-1c43ab8b17a9882c54dbb664d10a2e2813e1ed9c.tar
nixlib-1c43ab8b17a9882c54dbb664d10a2e2813e1ed9c.tar.gz
nixlib-1c43ab8b17a9882c54dbb664d10a2e2813e1ed9c.tar.bz2
nixlib-1c43ab8b17a9882c54dbb664d10a2e2813e1ed9c.tar.lz
nixlib-1c43ab8b17a9882c54dbb664d10a2e2813e1ed9c.tar.xz
nixlib-1c43ab8b17a9882c54dbb664d10a2e2813e1ed9c.tar.zst
nixlib-1c43ab8b17a9882c54dbb664d10a2e2813e1ed9c.zip
More archive types..
svn path=/nixpkgs/trunk/; revision=15525
Diffstat (limited to 'pkgs/build-support/builder-defs')
-rw-r--r--pkgs/build-support/builder-defs/builder-defs.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/build-support/builder-defs/builder-defs.nix b/pkgs/build-support/builder-defs/builder-defs.nix
index 8556c9529a48..0cd9aa34722c 100644
--- a/pkgs/build-support/builder-defs/builder-defs.nix
+++ b/pkgs/build-support/builder-defs/builder-defs.nix
@@ -19,6 +19,7 @@ args: with args; with stringsWithDeps; with lib;
                 else if (hasSuffixHack ".tar.gz" s) || (hasSuffixHack ".tgz" s) then "tgz" 
                 else if (hasSuffixHack ".tar.bz2" s) || (hasSuffixHack ".tbz2" s) || 
 			(hasSuffixHack ".tbz" s) then "tbz2"
+                else if (hasSuffixHack ".tar.Z" s) then "tZ" 
                 else if (hasSuffixHack ".tar.lzma" s) then "tar.lzma"
                 else if (hasSuffixHack ".zip" s) || (hasSuffixHack ".ZIP" s) then "zip"
                 else if (hasSuffixHack "-cvs-export" s) then "cvs-dir"
@@ -29,6 +30,7 @@ args: with args; with stringsWithDeps; with lib;
 
                 # Last block - for single files!! It should be always after .tar.*
                 else if (hasSuffixHack ".bz2" s) then "plain-bz2"
+                else if (hasSuffixHack ".gz" s) then "plain-gz"
 
                 else (abort "unknown archive type : ${s}"));
 
@@ -197,6 +199,9 @@ args: with args; with stringsWithDeps; with lib;
         " else if (archiveType s) == "tbz2" then "
                 tar xvjf '${s}'
                 cd \"\$(tar tjf '${s}' | head -1 | sed -e 's@/.*@@' )\"
+        " else if (archiveType s) == "tZ" then "
+                uncompress < '${s}' | tar x
+                cd \"\$(uncompress < '${s}' | tar t | head -1 | sed -e 's@/.*@@' )\"
         " else if (archiveType s) == "tar.lzma" then "
                 unlzma -d -c <'${s}' | tar xv
                 cd \"\$(unlzma -d -c <'${s}' | tar t | head -1 | sed -e 's@/.*@@' )\"
@@ -220,6 +225,11 @@ args: with args; with stringsWithDeps; with lib;
                 NAME=\$(basename ${s} .bz2)
                 bzip2 -d <${s} > \$PWD/\$(basename ${s} .bz2)/\${NAME#*-}
                 cd \$(basename ${s} .bz2)
+        " else if (archiveType s) == "plain-gz" then "
+                mkdir \$PWD/\$(basename ${s} .gz)
+                NAME=\$(basename ${s} .gz)
+                gzip -d <${s} > \$PWD/\$(basename ${s} .gz)/\${NAME#*-}
+                cd \$(basename ${s} .gz)
         " else (abort "unknown archive type : ${s}"))+
                 # goSrcDir is typically something like "cd mysubdir" .. but can be anything else 
                 (if args ? goSrcDir then args.goSrcDir else "")