3
3
# environment variables must be updated to, etc...
4
4
import Base: convert, joinpath, show
5
5
using SHA, CodecZlib, TOML, LibGit2_jll
6
- import Bzip2_jll, Gzip_jll, Tar_jll, XZ_jll, Zstd_jll
6
+ import Bzip2_jll, Gzip_jll, Tar_jll, XZ_jll, Zstd_jll, unzip_jll
7
7
using JLLWrappers: pathsep, LIBPATH_env
8
8
9
9
export Prefix, bindir, libdirs, includedir, logdir, temp_prefix, package
294
294
295
295
function setup (source:: SetupSource{ArchiveSource} , targetdir, verbose; tar_flags = verbose ? " xvof" : " xof" )
296
296
mkpath (targetdir)
297
- # Extract with host tools because it is _much_ faster on e.g. OSX.
298
- # If this becomes a compatibility problem, we'll just have to install
299
- # our own `tar` and `unzip` through BP as dependencies for BB.
300
297
cd (targetdir) do
301
298
if any (endswith (source. path, ext) for ext in tar_extensions)
302
299
if verbose
@@ -334,7 +331,9 @@ function setup(source::SetupSource{ArchiveSource}, targetdir, verbose; tar_flags
334
331
if verbose
335
332
@info " Extracting zipball $(basename (source. path)) ..."
336
333
end
337
- run (` unzip -q $(source. path) ` )
334
+ if unzip_jll. is_available ()
335
+ run (` $(unzip_jll. unzip ()) -q $(source. path) ` )
336
+ end
338
337
elseif endswith (source. path, " .conda" )
339
338
if verbose
340
339
@info " Extracting conda package $(basename (source. path)) ..."
@@ -343,7 +342,9 @@ function setup(source::SetupSource{ArchiveSource}, targetdir, verbose; tar_flags
343
342
# Replace initial hash with pkg, and change the file extension to obtain the name
344
343
pkg_name = replace (basename (source. path), r" ^[a-z0-9]{64}-" => " pkg-" , " .conda" => " .tar.zst" )
345
344
# First unzip the pkg tarball from .conda file
346
- run (` unzip -q $(source. path) $pkg_name ` )
345
+ if unzip_jll. is_available ()
346
+ run (` $(unzip_jll. unzip ()) -q $(source. path) $(pkg_name) ` )
347
+ end
347
348
# Second untar the pkg tarball
348
349
pkg_source = SetupSource {ArchiveSource} (joinpath (targetdir, pkg_name), source. hash, source. target)
349
350
# Run setup again to untar the pkg binaries
0 commit comments