Publishing an X11 based application to the App Store
Ryan Schmidt
ryandesign at macports.org
Wed Jan 20 23:53:27 UTC 2021
On Jan 20, 2021, at 09:47, filhol wrote:
> I am new at this mailing list and I hope my question is not out of scope.
Welcome!
> An X11 based application can easily notarised, but is it possible to publish to it to the Mac App Store ?
> If someone already succeeded what is the recipe ?
> For example, would it be enough to copy the contents of /opt/X11/bin/Xquartz to the App bundle and set a RPATH ?
I don't know if you can publish an X11-based app to the app store. If Apple allows it, then I don't know how best to accomplish it.
Certainly just copying the Xquartz program into your app bundle is not sufficient. It links with many libraries. You would need to copy those as well. MacPorts builds libraries with absolute paths in their install_names (we don't use rpath for most ports) so they are not relocatable, so once you copy the libraries, their library paths will be wrong. You would have to edit each of their install_names, and the inter-library linkages, so that they become relative to one another. Apple's install_name_tool program included with Xcode can be used to do this. The dylib_bundler program available in MacPorts can be used to automate this for an entire app bundle.
For a non-X11 app, the above might be sufficient (assuming there are not other instances of the installation path baked into any of the files), however X11 also requires a launchd plist to be loaded and requires the user to log out and log back in before it takes effect. I don't know if Apple permits apps to install and load launchd plists. I suspect not; I suspect they require apps to be contained within their app bundle.
A final consideration anytime you want to use third-party libraries in your app is whether the combination of their licenses permits that.
More information about the macports-dev
mailing list