> On Feb 20, 2020, at 8:14 AM, Pascal <p....@orange.fr> wrote:
> 
>> 
>> Le 3 févr. 2020 à 22:19, John Ralls <jra...@ceridwen.us> a écrit :
>> 
>>> On Feb 3, 2020, at 12:38 PM, Pascal <p....@orange.fr> wrote:
>>> 
>>> Hello,
>>> 
>>> I modify the bundle spec with an absolute binary path:
>>> <main-binary>/opt/chapitre6/exampleapp</main-binary>
>>> 
>>> But I've got this error:
>>> ValueError: If the source /opt/chapitre6/exampleapp doesn't use a ${prefix} 
>>> or ${prefix:*} macro, the destination path must be set
>>> 
>>> So I add:
>>> <main-binary 
>>> dest="${bundle}/Contents/MacOS">/opt/chapitre6/exampleapp</main-binary>
>>> 
>>> Why dest is then required? What is the relation with prefix macro?
>>> 
>> 
>> Pascal,
>> 
>> The prefix macro represents the part of the source path that's replaced with 
>> the destination path. If there's no prefix macro then bundler doesn't know 
>> how much of the path to copy over. I suppose that that could be 
>> special-cased for the main-binary tag, but it isn't.
>> 
>> Remember that gtk-mac-bundler is designed for bundling applications built 
>> with gtk-osx and that those install everything into a designated prefix. 
>> There's some probably misguided flexibility built in to allow pulling files 
>> from outside of the prefix but especially in the case of binaries it has a 
>> good chance of breaking the install_name rewriting and should be used with 
>> extreme care.
> 
> Hell John,
> 
> Just to better understand the underlying mechanism in the bundle script:
> a)   <binary>
>    
> ${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so
>  </binary>
> or
>  <data>
>    ${prefix}/share/themes
>  </data>
> 
> The bundler put all just after $(prefix) in $(bundle)/Contents/Ressources.
> Is it correct?
> 
> b)   <main-binary>${prefix}/bin/gtk3-demo</main-binary>
> 
> The bundler is here aware of bin folder and put the file after $(prefix)/bin 
> in $(bundle)/Contents/MacOS.
> Is it correct?
> 
> In this latter case, wouldn't the script put just the file designated by its 
> path in $(bundle)/Contents/MacOS, even with an absolute path?

Pascal,

Yes to a. For b the main-binary also renames the binary to the value of 
cfBundleExectutable from the bundle's Info.plist appending '-bin' if there's a 
launcher script set in the bundle file in which case the launcher script is 
renamed to the cfBundleExecutable value. It strips all of the preceding path 
information as well. LaunchServices (that's the daemon that actually executes 
when you run `open` from the command line or double-click an app bundle in 
Finder) reads Info.plist and runs the file indicated by cfBundleExecutable.

Regards,
John Ralls

_______________________________________________
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list

Reply via email to