Newbie: macos: pkgbuild: incompatible version

Dear forum,

New on macos. Need to create a .pkg file on the command line. The tooling seems to be pkgbuild(1) and productbuild(1). My problem is that while I can create .pkg files both using pkgbuild and productbuild and also install them any attempt to start the application fails with a You can’t use this version of the application “OpenCPN” with this version of MacOS. You have MacOS 10.15.7, the application requires MacOS 12.0 or later.

The message is bogus, application is built with 10.15 compatibility level and works fine if started from the command line.

I have tried adding the LSMinimunSystemVersion key to Info.plist before running pkgbuild. The key is available in the installed package, but no change.

Have also tried to add the allowed-os-versions to a distribution file and feed it into productbuild. Same result, it requires 12.0 and refuses to start from GUI.

Any hints out there?

1 Like

Corresponding tweet for this thread:

Share link for this tweet.

1 Like

So, answering myself.

On Xcode 14.2.0, perhaps somewhat earlier, pkgbuild has an option –min-os-version which does the job.

Otherwise, my theory is that pkgbuild looks into the bundled code including dependencies and uses the lowest link level available in all of them, which in my case is 12. And there is just no way around this without the option available in 14.2.0.

1 Like

I was gonna say is there a -version flag. Did it work for you after? If not I would submit a bug and see what they say, they are usually pretty good…