1

The idea is this: Have a dedicated Mac for building the ports. This Mac has HomeBrew, or MacPorts, or Fink installed. Compile a port on this Mac, and produce a binary package that can be distributed to other Macs (of the same architecture). The distributed binary should function on the target Mac without HomeBrew, or MacPorts, or Fink ever being present.

For clarification: when I say "produce a binary package", I don't really care about the type of that "package". It does not need to be a proper PKG. I am happy with a tgz or zip archive as well, as long as it contains everything delivered for the right directories for the tool to work fine (including config file, sample, man, libs, etc) and nothing more. Sources and headers are not needed to run the tool, so those should be exluded from the package if possible.

Manually assembling all the necessary files for such a package is something I would not attempt. So I wonder if there is a recipe in any of HomeBrew/MacPorts/Fink to do something like this.

Take Midnight Commander as an example. The goal is to build it on one computer, then distribute and use on many target Macs. However, those target Macs would not have HomeBrew/MacPorts/Fink, nor Xcode or gcc. Those are just regular Macs with macOS installed, nothing else. But I would like to run my build of Midnight Commander on all of them. A week or so later I may also want to add MariaDB, or any other tool that can be built from source using HomeBrew/MacPorts/Fink. Again, I would build it on one Mac, but intend to run it on many other.

The target Macs are managed computers. Their users are just that, users. Tools required would be built from source on the dedicated Mac, and provided as binary for the target Macs. Yes, I could install MacPorts or HomeBrew on those Macs too and compile what is needed, in place. But I hope this can be avoided. If I remember correctly, MacPorts offers something like "make package" or "make pkg". Which is what gave me the idea to investigate this possibility further.

Any pointers or suggestions are welcome.


Supplemental: I found the below documentation very useful. If you can point me to similar readings, please do so. Particularly if that covers a similar function in HomeBrew or Fink. MacPorts howto - CreateInstallers
Instructions on github

The focus is NOT on how to create a package. The focus is on WHAT files go into the package.

6
  • So you basically want to build your own distribution system and use Homebrew et al just to compile the binaries? MacPorts already installs binaries directly if they are provided, wouldn't this be enough in your scenario?
    – nohillside
    Jun 20, 2022 at 18:43
  • Take Midnight Commander as an example. The goal is to build it on one computer, then distribute and use on many target Macs. However, those target Macs would not have HomeBrew/MacPorts/Fink, nor Xcode or gcc. Those are just regular Macs with macOS installed, nothing else. But I would like to run my build of Midnight Commander on all of them. A week or so later I may also want to add MariaDB, or any other tool that can be built from source using HomeBrew/MacPorts/Fink. Again, I would build it on one Mac, but intend to run it on many other.
    – Keve
    Jun 20, 2022 at 19:20
  • Is there a specific reason you can‘t install MacPorts in all Macs?
    – nohillside
    Jun 20, 2022 at 20:05
  • Other than the fact that I do not want to, no, there isn't. The target Macs are managed computers. Their users are just that, users. Tools required would be built from source on the dedicated Mac, and provided as binary for the target Macs. Yes, I could install MacPorts or HomeBrew on those Macs too and compile what is needed, in place. But I hope this can be avoided. If I remember correctly, MacPorts offers something like "make package" or "make pkg". Which is what gave me the idea to investigate this possibility further.
    – Keve
    Jun 20, 2022 at 22:02
  • Please add any additional info to the question itself, rather than in the comments. That way, all of the info is in one place. Jun 21, 2022 at 19:43

1 Answer 1

2

Sure, there are tons of tools for packaging files on macOS and you could choose the one that matches your specific pain points.

The best writing I’ve seen on this from a “how to package” standpoint is

Unless you have a large fleet of machines to manage, MDM and tools for orchestrating the scoping / staging / installation and patching may be overkill. Here is one lead on an open source option.

There are benefits to not installing ports or brew on all machines like starting to handle software supply chain issues and being able to control when and what you install and uninstall.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .