mandelbulber2 icon indicating copy to clipboard operation
mandelbulber2 copied to clipboard

Quick wins for a proper macOS app

Open vitorgalvao opened this issue 3 years ago • 13 comments

From (and not including) version 2.11.1, mandelbulber2’s macOS app changed its bundle ID (CFBundleIdentifier key in Info.plist) to com.yourcompany.mandelbulber2 and no longer reports any version (neither CFBundleVersion nor CFBundleShortVersionString).

While the bundle ID isn’t too problematic (though something like com.mandelbulber.mandelbulber2 would be more appropriate), lack of version information makes it hard to manage the app on the system or check for updates with third-party tools.

Even something like a date (easily scriptable in the build step) would already be useful.

vitorgalvao avatar Aug 04 '20 15:08 vitorgalvao

Are you able to help me in this topic? I'm not familiar with MacOS at all. Script for building Mandelbulber for MacOS is here: https://github.com/buddhi1980/mandelbulber2/blob/master/.circleci/config.yml (there is used CircleCI service for baking builds and packages)

buddhi1980 avatar Aug 04 '20 18:08 buddhi1980

I’m not familiar with QT, but I searched around and it seems the solution may be to stick the information in the .pro file:

QMAKE_FULL_VERSION = 2.2
QMAKE_SHORT_VERSION = 2.2
QMAKE_TARGET_BUNDLE_PREFIX = com.mandelbulber.mandelbulber2

I tried that, but the build failed on my machine after churning away for a while, so I wasn’t able to confirm if it worked.

It could also be done if the app were built and then packaged as a DMG (because it’s simple to alter the info.plist where the information resides), but it seems your script builds and packages in the same command.

vitorgalvao avatar Aug 04 '20 19:08 vitorgalvao

Thanks for hint. I will try it tomorrow and paste you a link to package fro testing

buddhi1980 avatar Aug 04 '20 19:08 buddhi1980

Change to qmake was just commited https://github.com/buddhi1980/mandelbulber2/commit/ddf0857721689c3fa57fc8e516c122a0831e7a8b In few ours I will have fresh MacOS package and provide the link.

buddhi1980 avatar Aug 06 '20 15:08 buddhi1980

Download link: https://1886-33041722-gh.circle-artifacts.com/0/~/mandelbulber2/build/artifacts/mandelbulber2-macOS-d50ea1cce7e8172ca249b78e676e941c7f2c6a72.dmg

buddhi1980 avatar Aug 06 '20 19:08 buddhi1980

There’s progress, though we’re not there yet.

The bundle ID was set, but to com.mandelbulber.mandelbulber2.mandelbulber2. Looking closely, the option’s name is QMAKE_TARGET_BUNDLE_PREFIX (prefix), so it should be set to com.mandelbulber.

The versions weren’t set.

How about this instead?

QMAKE_TARGET_BUNDLE_PREFIX = com.mandelbulber
VERSION = 2.2

vitorgalvao avatar Aug 10 '20 11:08 vitorgalvao

In commit https://github.com/buddhi1980/mandelbulber2/commit/4624cfa692f67e850a57504aced0d9320d05ca5a I have changed configuration as you proposed

buddhi1980 avatar Aug 12 '20 17:08 buddhi1980

In commit 4624cfa I have changed configuration as you proposed

If you’re able to provide a build, I’ll be able to check if it’s working as expected.

vitorgalvao avatar Aug 12 '20 18:08 vitorgalvao

https://1902-33041722-gh.circle-artifacts.com/0/~/mandelbulber2/build/artifacts/mandelbulber2-macOS-4624cfa692f67e850a57504aced0d9320d05ca5a.dmg

buddhi1980 avatar Aug 12 '20 19:08 buddhi1980

The Bundle ID is OK, but the versions still weren’t set. I’m unsure if we’re doing something wrong or if it’s an upstream bug (I’ve encountered some reports that suggest that might be the case).

vitorgalvao avatar Aug 19 '20 12:08 vitorgalvao

hello @vitorgalvao i recently joined the mandelbulber2 project and will focos on CI/CD and macos stuff.

Would be happy to talk with you about the issue You can find me at https://gitter.im/buddhi1980/mandelbulber2

networkpanic avatar May 21 '21 15:05 networkpanic

Unfortunately I’m unsure how I could be of further help, @networkpanic.

I can tell you is that the CFBundleVersion and CFBundleShortVersionString keys in Info.plist should be set. I can also tell you how to do it once the app is built:

mandelbulber_path='/PATH/TO/MANDELBULBER2APP/HERE'
mandelbulber_version='VERSION NUMBER HERE'

/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string ${mandelbulber_version}" "${mandelbulber_path}/Contents/Info.plist"
/usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string ${mandelbulber_version}" "${mandelbulber_path}/Contents/Info.plist"

But I don’t know how to do it with QT during the build process, which is the problem here.

Technically CFBundleVersion should be an ever increasing build number (e.g. 1450) and CFBundleShortVersionString a “human centered” version (e.g. 2.2.5), but even having one of them in both places would be a huge improvement.

vitorgalvao avatar May 23 '21 02:05 vitorgalvao

thanks for your help, i will try to get this fixed as soon my job grants me some spare time

networkpanic avatar May 25 '21 10:05 networkpanic