curl / wcurl

a simple wrapper around curl to easily download files
https://curl.se/wcurl
Other
239 stars 9 forks source link

Installation instructions #21

Open ilyagr opened 1 month ago

ilyagr commented 1 month ago

It would be nice if the docs contained an easy command to download wcurl on systems where it's not preinstalled and/or doesn't come with curl (e.g. Mac OS). For example, the following would work, but it would download the development version of wcurl. Ideally, there would be some stable URL where the last stable version of wcurl can be found.

curl -fLO https://raw.githubusercontent.com/curl/wcurl/main/wcurl
chmod +x wcurl
samueloph commented 3 weeks ago

Hello @ilyagr,

Thank you for the suggestion, I definitely think it's a good idea and I'll look into that.

I would also like to ask that if wcurl is not provided in the official repositories of the OS you use, please consider requesting them to package it.

wcurl is a simple script and packaging it won't take much work. You could also ask them to make wcurl be installed together with curl automatically (as in, either the curl package depends on wcurl or wcurl is bundled into the curl package).

andylima commented 2 weeks ago

On macOS, if you use Homebrew, brew install wcurl works.

ilyagr commented 2 weeks ago

On macOS, if you use Homebrew, brew install wcurl works.

Depending on your goals, brew install wget also works at that point. I was mostly thinking about a brand-new VM or something along those lines.

ryandesign commented 2 weeks ago

On macOS, if you use MacPorts, sudo port install wcurl works.

After a brand new install of macOS (whether in a VM or on real hardware), neither Homebrew nor MacPorts nor wcurl will be installed, of course. If you would like Apple to include wcurl in macOS, you can submit feedback to Apple. I expect you will get no response and that Apple won't change anything.

On GitHub Actions macOS runners, Homebrew is preinstalled and several software packages are preinstalled using Homebrew, including wget. If you want GitHub to include wcurl in GitHub Actions runners, you could file an issue. I expect you will get the response that those who want wcurl should program their workflows to install it.

Providing a predictable URL to download the latest stable version is reasonable. The first step toward that goal would be for wcurl to create a GitHub release for each tag. That will enable the unchanging URL https://github.com/curl/wcurl/releases/latest for accessing the latest release that is marked stable. It would then be fairly simple to write a short script that can download the latest wcurl script or wcurl.1 manpage using just two curl invocations (or download both with just three). A second step would be to attach assets to each of those releases. Typically one would attach the compressed release tarball. Additionally, one could attach the wcurl script and the wcurl.1 manpage so that they could each be downloaded with a single predictable curl call.

samueloph commented 1 week ago

I like @ryandesign's idea: to create a release (so we can get the latest link), and also to provide custom assets for releases (so we can get direct links to the script and manpage).

jmckenna commented 1 week ago

Also instructions for Windows would be helpful. (I am a packager, I came here to see how to package this for Windows users) Background: I compile cURL with MSVC 2022

samueloph commented 1 week ago

@jmckenna packaging should be straightforward, since wcurl is just a scritpt, you just need to ship it, there's no build process.

You can also decide to ship the manpage (not sure how that's handled in Windows), and you can decide to run the unit tests we ship, but that's really extra.

Overall just ship the script in a place where the user can call it and it's done (that's what we do on Debian, we ship the script as part of the curl package).

jmckenna commented 1 week ago

@samueloph I guess I need to re-read your script, as I assumed it was a shell script (for unix - meaning: it cannot be run on Windows through PowerShell or cmd).

Said differently: I wonder, if my assumptions above are correct, if somehow has forked this shell script and adapted it for PowerShell).

samueloph commented 1 week ago

@jmckenna Oh, you're right, I thought a POSIX script would be fine for Windows but it doesn't look like it.

samueloph commented 1 week ago

@jmckenna wcurl is packaged for MSYS2, does that solve the Windows usecase?

https://packages.msys2.org/package/wcurl?repo=msys&variant=x86_64

I mean, it carries a dependency on bash, but might be ok for most users. It's unlikely we would rewrite it in Powershell ourselves.

jmckenna commented 1 week ago

@samueloph Thanks. (my build environment is Visual Studio 2022 for cURL etc). So my short answer to your question is unfortunately: no. It solves for those packagers in the MSYS2 space indeed.

I'll look around for this tool as a Powershell/cmd wrapper. If all else fails, I'll have to create my own wrapper, and build an .exe in the Visual Studio space.

ryandesign commented 1 week ago

Can wcurl not be used as is on Windows using the Windows Subsystem for Linux? I have no personal experience with WSL but I assume that is what it would let you do.

jmckenna commented 1 week ago

@ryandesign indeed, and I anticipated this response here. In my case I will look for a wrapper, and continue on that way. As you said here, there are several other ways that Windows users can use this script as-is.

bagder commented 3 days ago

Maybe writing a separate implementation of wcurl in C just for the purpose of running on more places (without shell) could be an idea. That still invokes the curl command line tool.