TypedDevs / bashunit

A simple testing library for bash scripts. Test your bash scripts in the fastest and simplest way, discover the most modern bash testing library.
https://bashunit.typeddevs.com
MIT License
317 stars 27 forks source link

docs: add MacPorts install info #197

Closed herbygillot closed 11 months ago

herbygillot commented 11 months ago

📚 Description

Add instructions on how to install bashunit via MacPorts. https://ports.macports.org/port/bashunit/

🔖 Changes

✅ To-do list

JesusValera commented 11 months ago

Thank you so much for your PR @herbygillot 🙌🏼

I just tried to install macports and bashunits and it works, but I have a question:

I would say most of them are not related to bashunit, additionally, it took a few minutes to be installed, although, if you try to install the program via curl -s https://bashunit.typeddevs.com/install.sh | bash it takes no time as the application is only 38k. 😃

herbygillot commented 11 months ago

I think what's going on is that in bashunit depends on bash (we use MacPorts bash for consistency across macOS versions), and so all those dependencies are probably for bash. It's a chain of dependencies.

Chemaclass commented 11 months ago

@herbygillot, what about new releases? Will this MacPort tool be updated automatically? Eg: https://github.com/macports/macports-ports/blob/master/devel/bashunit/Portfile#L6 or do we/you need to apply manual changes here? How do you usually work to keep up to date the tools under MacPorts? It's a new tool for me and I would like to understand it better before using it :)

Chemaclass commented 11 months ago

I think what's going on is that in bashunit depends on bash (we use MacPorts bash for consistency across macOS versions), and so all those dependencies are probably for bash. It's a chain of dependencies.

Actually, bashunit run perfectly (and it will keep this way for BC) on the default bash version that comes with MacOS, which is the 3.2 Screenshot 2023-10-16 at 22 30 49

I don't think we need to install the latest bash (and therefore that level of dependencies) when using bashunit in MacOS 🤔 For this reason, I think we could consider using the installer tool that we created; it will ensure you have the latest version with only 38KB dependency that will run in your MacOS bash by default. Or, another alternative, maybe it would be enough removing the line with depends_lib-append port:bash L32 from here? Would this be an option as in brew we dont have bash as a dependency... What do you think, @herbygillot ?

herbygillot commented 11 months ago

MacPorts follows a similar model to many other packaging projects (such as FreeBSD ports or Debian's) where every package has a maintainer, and it's the maintainer's responsibility to keep the package up to date.

A package in MacPorts is called a "port", and yes, I added and maintain the port for bashunit. You are correct that the procedure is updating the Portfile. I am subscribed to the repos for most all the software I maintain, and get updates that way, as well as through newreleases.io and Repology.

That aside, anyone can open a PR to update bashunit's Portfile in the macports/macports-ports repo (or really any Portfile for any port, not just bashunit), and it will be reviewed and merged.

That said, we don't yet have automatic Portfile updates just yet, unfortunately.

herbygillot commented 11 months ago

Actually, bashunit run perfectly (and it will keep this way for BC) on the default bash version that comes with MacOS, which is the 3.2 Screenshot 2023-10-16 at 22 30 49

I don't think we need to install the latest bash (and therefore that level of dependencies) when using bashunit in MacOS 🤔 For this reason, I think we could consider using the installer tool that we created; it will ensure you have the latest version with only 38KB dependency that will run in your MacOS bash by default. Or, another alternative, maybe it would be enough removing the line with depends_lib-append port:bash L32 from here? Would this be an option as in brew we dont have bash as a dependency... What do you think, @herbygillot ?

So the key point here is that MacPorts has an opposite philosophy to Homebrew: ports in MacPorts should depend as much as possible on other ports inside of MacPorts, and not so much on the external built-in macOS tooling. This helps ensure that the MacPorts ecosystem is as self-contained as possible, and consistent across most versions of macOS, both old and new. Installing bash along with bashunit isn't that big of a deal, and also many MacPorts users will have bash already installed, meaning that it only needs to fetch bashunit, which is a tiny download.

herbygillot commented 11 months ago

Thank you

antonio-gg-dev commented 11 months ago

Thank you very much for your contribution @herbygillot , and thank you as well for taking the time to resolve all our questions.

herbygillot commented 11 months ago

Thank you very much for your contribution @herbygillot , and thank you as well for taking the time to resolve all our questions.

Thank you all for bashunit 🙏🏾