dorothy icon indicating copy to clipboard operation
dorothy copied to clipboard

Suggestion: setup-util support for streamlined {bin,man,lib,etc} extraction

Open edmcman opened this issue 3 months ago • 4 comments

I'm creating a command to setup Ghidra. Ghidra is distributed as a zip file that is extracted somewhere and then run with a script. You need all the files, unfortunately. It's similar to gradle's binary distribution if you've used that.

Is setup-util compatible with such a package? It seems like most of the DOWNLOAD options assume the utility is going to be a single file.

edmcman avatar Apr 25 '24 13:04 edmcman

Sure, setup-util-bash unzips and builds. Others unzip multiple files, and others unzip a single file. If you have vscode you can run dorothy edit then file search for DOWNLOAD_ARCHIVE_GLOB

balupton avatar Apr 25 '24 14:04 balupton

If it has github assets, you can use this structure instead: https://github.com/bevry/dorothy/blob/master/commands/setup-util-sd

balupton avatar Apr 25 '24 14:04 balupton

Thanks, I played with these a bit. If I understand correctly, sd downloads a zip and extracts a single file. bash downloads a zip, extracts a bunch of files and builds, but only installs a single file. Ghidra needs to have multiple files installed. The ghidraRun file/script is used to start it, but that's just a small script.

Here's what I'm using now: https://github.com/edmcman/dotfiles/blob/main/commands/setup-util-ghidra

Basically the support files have to live somewhere. I don't see a way to accomplish this now with setup-util. Maybe it's rare enough that it's not needed.

edmcman avatar Apr 25 '24 15:04 edmcman

From memory there are existing utilities that would benefit from having other files extracted as well, but yeah, the download technique in setup-util doesn't currently natively support that. The complexity is that I'm not sure XDG supports such extractions, so they would have to go to /usr/local or whatever, which sometimes requires sudo.

If we get a few more utilities needing such, will make sense to do a PR.

Marking as a suggestion.

balupton avatar Apr 25 '24 22:04 balupton