RB Build Automation and Valentina

Thorsten Hohage thohage at genericobjects.de
Wed Jan 20 12:09:22 CST 2010


Hi Jon,

On 2010-01-20, at 18:11, jda wrote:
> Thank you very much, I'll do that. I still wonder what I wasn't 
> installing (everything seemed to be there)?



But being THERE is not enough! They must be waken up to life ;-) So let's have a close look

> #####################################
just this and few more comments we simply jump over

> app=$1
setting some variables here, no vodoo 


> #####################################
> # COPY files of VComponents into APP.
> #####################################
> 
> if [ ! -d "$app_vcomp" ] ; then
> 	mkdir "$app_vcomp"
> fi
> 
> if [ ! -e "$app_vcomp"/libvshared_fat_release.dylib ] ; then
> 	cp /usr/local/lib/vcomponents/libvshared_fat_release.dylib 	"$app_vcomp"
> fi
> 

> ....

> 
> cp -R /usr/local/lib/vcomponents/vresources 					"$app_vcomp"

so in this sections all the files are copied to the propitiate place, that is the part you obviously did right with the RB script.


But NOW we start the super secret part and do some magic :-)

> #####################################
> # CHANGE executable_path for ICU dylibs:
> #####################################
> 	
> 	# change id of data library
> 	install_name_tool -id "@executable_path/../VComponents/libicudata.dylib" "$app_vcomp"/libicudata.dylib
> 
> 	# change id and dependencies in common library
> 	install_name_tool -id "/usr/local/lib/vcomponents/libicuuc.dylib" "$app_vcomp"/libicuuc.dylib
...
> 	install_name_tool -change "/usr/local/lib/vcomponents/libicui18n.dylib" "@executable_path/../VComponents/libicui18n.dylib" "$app_vcomp"/libicuio.dylib

now we start to change paths INSIDE of a compiled app / lib / ... :-O 		yes, this is a common way Apple do things behind the curtains, all the day when using XCode. If you want to integrate you own libs and you didn't want them in the place a lib should be, e.g. in /Library/...., but inside the app, then we need to tell the app where they are. The used syntax should be obvious when seeing the examples.

I know, this install_name_tool is a beast living in the shadow of nowhere, but when you start to know his name, then you can search e.g. the XCode helpfile (or should I better say, Mulder search the XFiles ;-), best place to start is the "Mac OS X Developer Tools"



> #####################################
> # CHANGE executable_path for engine dylibs:
> #####################################
> 
> 	# change id of VSHARED
> 	install_name_tool -id "@executable_path/../VComponents/libvshared_fat_release.dylib" "$app_vcomp"/libvshared_fat_release.dylib
> 
> ...

same game for ngine dylibs


> #####################################
> # now we need update yet App/Contents/Frameworks/V4RB.rbx_0_xxx.dylib
> # REALBasic can assign any digits xxx, so we use globbing (regex) here to locate file.
> #####################################
> 
...
> 
> 	install_name_tool -change "/usr/local/lib/vcomponents/libvshared_fat_release.dylib" 	"@executable_path/../VComponents/libvshared_fat_release.dylib" 		"$v4rb_dylib"
> 
> ...

and guess what, we do it a third time again.

Simply open the INSTALL_VCOMPONENTS_V4RB script in e.g. BBEdit and you can see all the statements. 

And with this explanation you should be able to write your own full fledged script, without simply calling INSTALL_VCOMPONENTS_V4RB from inside you RB Build Automation.




Btw. and just for the records, all this did apply for V4CC, too. So if someone finds this explanation while searching for help ... here we go.

Under Targets -> "your target" :

	"Add" -> "New Build Phase" -> "New Run Script Build Phase"

to add this new phase. With double cklicking on this you can open the editor (what a name for a plain large text field) and paste the same statements like above in ... voila thats all you need to do. If you unsure what you need here, e.g. to patch V4CC don't hesitate to ask me or someone from the team.


regards,

Thorsten Hohage
-- 

Valentina Technology Evangelist
generic objects  GmbH - Leiter Solution Center Nord



More information about the Valentina-beta mailing list