Package: support and extract jar
files like zip
files
#24001
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does ?
This PR make the
zig fetch
command but also the zig package system handlejar
likezip
A tiny story on why I make this PR
In one of my personal project, I used zig to make a cross platform audio player engine where FFmpeg was linked to my zig executable as a shared library.
Since the zig build system and package manager are so powerful, I'm able to directly fetch from the Internet my prebuild binaries of FFmpeg in my zig build so I could link them and install them along my executable.
Everything was fine for IOS, MacOS and even windows since I could download
zip
andtar
but for my Android build the library was shared withjar
file since some others android project could directly find theinclude
andlib
directories.However when I try to fetch my
jar
file to extract manually theinclude
andlib
directories from github I got this error :I understand jar file are more than zip file but I still think
zig
should be able to understand them like regularzip
. (If I take ajar
and useunzip
on it it's just works)Maybe I'm wrong and also this is the first time I contribute here but I didn't see anyone discuss about that and since it was simple to add the
mime-type
and the file extension recognition aszip
I still hope you will find this PR interesting ^^