Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-06

Embedded Firebird bundled with OSX application

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Has anybody here managed to bundle the required Embedded Firebird libraries with an OSX application? If so, do you mind sharing your solution. I am very new to developing applications for OSX, and have been struggling with this problem for a while now.

I have looked through the Lazarus Wiki, and found many different links on the internet. Many are instructions written back in the 2008-2010 time frame, and it seems those instructions don't work any more.

I'm using OSX 10.9.5 with FPC 2.6.4 and Lazarus 1.4 and trying to get this to work with Firebird 2.5.x

Regards,
- Graeme -

Reply by email

Tony Whyman
to Graeme Geldenhuys

I would guess that this is going to be very similar to running the same on Linux - but with the usual different flie location/conventions.

I have written up how to do this with IBX on Linux here http://mwasoftware.co.uk/on-linux

However you do it, the really key point is to use an empty username and password as otherwise the embedded server will try and access the security database - and probably fail. Otherwise, set the FIREBIRD environment variable to point to the firebird installation and LD_LIBRARY_PATH to where the embedded server shared object is located and it may even work under OSX.

Regards

Tony

Graeme Geldenhuys wrote 24 lines
Hi, Has anybody here managed to bundle the required Embedded Firebird libraries with an OSX application? If so, do you mind sharing your solution. I am very new to developing applications for OSX, and have been struggling with this problem for a while now. I have looked through the Lazarus Wiki, and found many different links on the internet. Many are instructions written back in the 2008-2010 time frame, and it seems those instructions don't work any more. I'm using OSX 10.9.5 with FPC 2.6.4 and Lazarus 1.4 and trying to get this to work with Firebird 2.5.x Regards, - Graeme - -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

FreeMan
to Graeme Geldenhuys: Has anybody here managed to bundle the required Embedded Firebird libraries with an OSX…

Why you want use embeded ? I'm using yosemite and firebird server 2.5.4 I bookmarked this link
http://paulbeachsblog.blogspot.com.tr/2012/09/firebird-embedded-on-macosx.html I planned, after finish my project then I'll test this.

Graeme Geldenhuys wrote 13 lines
Hi, Has anybody here managed to bundle the required Embedded Firebird libraries with an OSX application? If so, do you mind sharing your solution. I am very new to developing applications for OSX, and have been struggling with this problem for a while now. I have looked through the Lazarus Wiki, and found many different links on the internet. Many are instructions written back in the 2008-2010 time frame, and it seems those instructions don't work any more. I'm using OSX 10.9.5 with FPC 2.6.4 and Lazarus 1.4 and trying to get this to work with Firebird 2.5.x

Reply by email

Graeme Geldenhuys
to Tony Whyman: I would guess that this is going to be very similar to running the same on Linux - but…
Tony Whyman wrote
I would guess that this is going to be very similar to running the same on Linux - but with the usual different flie location/conventions.

That was my initial thought too... should be similar to Linux. But it ended up not being the case (at least for me).
For example:
* In OSX frameworks have a hard-code location compiled into the libraries. You need to patch such libraries to a new location if they are moved.
* Libraries need to be included inside the application bundle. I'm still trying to get my head around application bundles.
* Environment variables in OSX seems different to Linux and FreeBSD
* Locations of files, tools etc are very different in OSX
* Permissions are handled different. eg: in OSX I can't find the firebird group in /etc/groups but yet it is defined somewhere.

I have tried quite a few things already. I'll definitely take a look at your link and try again. Many thanks for your response.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Graeme Geldenhuys
to FreeMan: Why you want use embeded ? I'm using yosemite and firebird server 2.5.4 I bookmarked this…
FreeMan wrote
Why you want use embeded ?

It is a requirement from my client and the project I'm working on. They want to reduce the installation complexity of the application. Every extra installation requirement, is a requirement too much.

I've read many blog posts from Paul Beach. I'm not sure if I have seen the one you posted. I see it has a comment saying "updated 15th April 2014", so that is probably the most current instructions I have seen to date. Many thanks for sharing, I'll give that a try now.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

FreeMan
to Graeme Geldenhuys

I'll pleasure if share results. I wrote, its my in plan, thank you

Graeme Geldenhuys wrote 11 lines
It is a requirement from my client and the project I'm working on. They want to reduce the installation complexity of the application. Every extra installation requirement, is a requirement too much. I've read many blog posts from Paul Beach. I'm not sure if I have seen the one you posted. I see it has a comment saying "updated 15th April 2014", so that is probably the most current instructions I have seen to date. Many thanks for sharing, I'll give that a try now. Regards, - Graeme -

Reply by email

Dmitry Boyarintsev
to Graeme Geldenhuys: That was my initial thought too... should be similar to Linux. But it ended up not being…

On Mon, Jun 22, 2015 at 7:54 AM, Graeme Geldenhuys <

Show quoted text 8 lines
wrote: That was my initial thought too... should be similar to Linux. But it ended up not being the case (at least for me). For example: * Libraries need to be included inside the application bundle. I'm still trying to get my head around application bundles.

They're. If Firebird comes in a form of framework or dynamic library you should unclude them in your application bundle.
Just "Frameworks" directory needs to be created, within "Contents" directory.
Put firebird framework/dynamic library there and that's it. No changes in the code needed, if firebird is already dynamically linked.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150622/ce4133bf/attachment.html>

Reply by email

Graeme Geldenhuys
to Dmitry Boyarintsev
Dmitry Boyarintsev wrote
Just "Frameworks" directory needs to be created, within "Contents" directory. Put firebird framework/dynamic library there and that's it.

Yes and no - according to all the blog posts I've read. The required embedded library is missing from the official OSX package. They all recommend building your own Embedded Firebird from the source (why they don't included this as standard with a release I don't know). There lies half the problem. Trying to get Firebird to compile under OSX. I have found 10+ different instructions and none of them work on my Macbook Pro. I've installed XCode and everything else that was mentioned, but no luck.

Then after the compilation is complete, you need to run a tool called 'install_name_tool' on all the files, which patches them by changing the hard-coded library location from
/Library/Frameworks/Firebird.framework/..../ to whatever the new location is in your application bundle. If you don't do this, then apparently applications and supporting tools will always look for the libraries in /Library/Frameworks/Firebird.framework/

It seems there is a demand for Embedded Firebird, but neither the official FirebirdSql.org nor anybody else wants to share a pre-built bundle. They expect everybody to always build Firebird from source and struggle for days on end with no clear/working instructions. The firebirdsql.org shows in their OSX download section "Classic, SuperClassic & Embedded (Intel)", but after installing that pkg there is no sign of a libfbembed.dylib file anywhere. So somebody seems to have forgotten something.

I've already wasted quite a few days on this, and now trying to use SQLite3 with this application instead. Apparently SQLite3 comes standard with OSX since 10.4, so this should be a usable solution. I'll come back to the Embedded Firebird issue at a later date, as that would still be the preferred option in the end.

I'll update the Lazarus Wiki will all the information I found - that would hopefully save somebody else a lot of time searching on the internet.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

FreeMan
to Graeme Geldenhuys

Hello Graeme,
Are you work on this still ? I wanna share my experience. We mailed with Paul and I founded how to work with embeded firebird on osx. first, I asked to him same question about you :) and this is him answer

Show quoted text 10 lines
<<In this link http://www.firebirdsql.org/en/firebird-2-5-4/#MacOSX header write "Mac OS X 64-bit Classic, Superclassic & Embedded (Intel)" but no fbembed file and info there.>> Yes there is: http://paulbeachsblog.blogspot.fr/2008/03/where-is-libfbclientdylib-on-macosx.html Read carefully. Regards Paul

From him (Paul Beach's blog)
http://paulbeachsblog.blogspot.fr/2012/09/firebird-embedded-on-macosx.html Unknown User wrote at October 10, 2014 at 12:29 PM :

I did and libfbembed.dylib builded. its under ../gen/firebird.app/..... but can not use this if you check isql under bin folder it should be work. This mean your builded "libfbembed.dylib" is working. But when you try in application you will get error, it will looking for "/Library/Frameworks/Firebird.framework/Resources/English.lproj/var/" if you create this folder and copy "security2.fdb" and if you wanna us alias you haveto create "aliases.conf" files here, then you can use "libfbembed.dylib" with out install firebird.

After 3 days work I founded. There is no where find this:

1-) My Application has to be JUST in ONE folder under where is "libfbembed.dylib".
if you try run isql app in up folder of bin, I mean same folder libfbembed.dylib you will get this error.
? fb_embed_osx ./isql
dyld: Library not loaded: ../libfbembed.dylib
Referenced from:
/test/fb_embed_test_darwin.app/Contents/MacOS/fb_embed_osx/./isql Reason: image not found
[1] 62746 trace trap ./isql

2-) In my Application, for libfbembed.dylib I HAVE TO write full path. not accept "../libfbembed.dylib"

At this point, In "firebird.conf" "RootDirectory=" for just dream.

with "install_name_tool" command can be fix this. I'm not use this command before, is any body know this, can change working rule, our application not need under libfbembed.dylib's folder.

Graeme Geldenhuys wrote 43 lines
On 2015-06-22 18:46, Dmitry Boyarintsev wrote: > Just "Frameworks" directory needs to be created, within "Contents" > directory. > Put firebird framework/dynamic library there and that's > it. Yes and no - according to all the blog posts I've read. The required embedded library is missing from the official OSX package. They all recommend building your own Embedded Firebird from the source (why they don't included this as standard with a release I don't know). There lies half the problem. Trying to get Firebird to compile under OSX. I have found 10+ different instructions and none of them work on my Macbook Pro. I've installed XCode and everything else that was mentioned, but no luck. Then after the compilation is complete, you need to run a tool called 'install_name_tool' on all the files, which patches them by changing the hard-coded library location from /Library/Frameworks/Firebird.framework/..../ to whatever the new location is in your application bundle. If you don't do this, then apparently applications and supporting tools will always look for the libraries in /Library/Frameworks/Firebird.framework/ It seems there is a demand for Embedded Firebird, but neither the official FirebirdSql.org nor anybody else wants to share a pre-built bundle. They expect everybody to always build Firebird from source and struggle for days on end with no clear/working instructions. The firebirdsql.org shows in their OSX download section "Classic, SuperClassic & Embedded (Intel)", but after installing that pkg there is no sign of a libfbembed.dylib file anywhere. So somebody seems to have forgotten something. I've already wasted quite a few days on this, and now trying to use SQLite3 with this application instead. Apparently SQLite3 comes standard with OSX since 10.4, so this should be a usable solution. I'll come back to the Embedded Firebird issue at a later date, as that would still be the preferred option in the end. I'll update the Lazarus Wiki will all the information I found - that would hopefully save somebody else a lot of time searching on the internet. Regards, - Graeme -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150819/01b46b1e/attachment.html>

Reply by email