tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.85k stars 320 forks source link

tools.sh: directly decompress using tar #324

Open Gcenx opened 2 years ago

Gcenx commented 2 years ago

Modern tar directly supports compressing and decompressing these formats.

tpoechtrager commented 2 years ago

The reason behind this is backwards compatibility. Modern tar isn't available everywhere.

Gcenx commented 2 years ago

Is there any currently supported version of Linux/unix that ships and old version of tar that doesn’t support this?

The reason I bring it up is gnu tar 1.22 added support for this and that releases in 2009. Mac OS X 10.9 and later ships BSD tar that also supports this.

As the desire is to keep backwards comparability could this extraction be altered to allow the tar methods first then fallback to the current methods?

This is part of an attempt to shrink down the requirements for mac, this change and a couple of others gets the requirements down to clang-3.9Or later and cmake

tpoechtrager commented 2 years ago

Using only tar didn't work on NetBSD back in 2014 -> https://github.com/tpoechtrager/osxcross/commit/5f159c93a0619e8b698581bd31244dd8b2315d49. Don't know about now.

As the desire is to keep backwards comparability could this extraction be altered to allow the tar methods first then fallback to the current methods?

Sure. You can update this PR if you want to.

Gcenx commented 2 years ago

Sorry gotten sidetracked by other things.

Not sure I'll get chance to test on NetBSD to confirm if it's still shipping an ancient version of tar, after confirming the macOS related modifications I'll update this accordingly or just role it into another PR.