PDA

View Full Version : Proper install and configuration of Lazarus on Mac OS X



WILL
16-10-2010, 12:56 AM
Hey everyone, I've been trying for ages to get a properly working install of Lazarus on my iMac running Mac OS X Snow Lepoard. Can someone, anyone, everyone with a working install that can compile proper working executable applications help me out here?

I've tried the last stable version with the installer and for some reason as a default it does not compile a proper executable. So... how did you set yours up? What versions did you use? And what version of Mac OS X do you have?

I list of steps would be super, but at this point, I'd take any kind of help from someone who has actually successfully gotten Laz working on the Mac. Thanks.

Andru
16-10-2010, 05:43 AM
I have never used Lazarus for GUI projects under MacOS X(only FreePascal and Makefiles for compilation :)), but I think Lazarus, in your situation, compile only executable without a bundle. Bundle - it is a directory with special structure inside for executables, icons, resources, frameworks and other stuff. One of solution is copying executable(for example with name MyApp) to this directory:
MyApp.app\Contents\MacOS\

Or try to find some option in "Project Options", there must be something for autogeneration a bundle.

WILL
16-10-2010, 05:51 AM
I have never used Lazarus for GUI projects under MacOS X(only FreePascal and Makefiles for compilation :)),

How do you use/structure your makefiles?

Andru
16-10-2010, 06:08 AM
For example here my universal Makefile for demos(that written for my library) :) I use it for Linux and MacOS X. But it's hard to describe all of lines in English to me.


FPC = fpc
FPC_MAC = /usr/local/bin/ppc
FLAGS = -O3 -XsX -CX -Sd
INCLUDE = -Fu../../../headers/ -Fu../../../src/ -Fu../../../lib/ -Fu../../../lib/PasJPEG
OUTPUT = ../bin/
TMP = ../tmp/
UNIT = demo01.pas
TARGET = demo01
TARGETW = demo01.exe
TARGETM = demo01
BUNDLE = $(OUTPUT)$(TARGETM).app

all: clean
$(FPC) $(UNIT) $(INCLUDE) -FE$(OUTPUT) -FU$(TMP) $(FLAGS) -o$(TARGET) -TLINUX
strip $(OUTPUT)$(TARGET) --strip-unneeded -R .comment -R .note

win32: clean
$(FPC) $(UNIT) $(INCLUDE) -FE$(OUTPUT) -FU$(TMP) $(FLAGS) -o$(TARGETW) -TWIN32 -WG

win64: clean
$(FPC) $(UNIT) $(INCLUDE) -FE$(OUTPUT) -FU$(TMP) $(FLAGS) -o$(TARGETW) -TWIN64 -WG

macos: clean
rm -Rf $(BUNDLE)
mkdir {$(BUNDLE),$(BUNDLE)/{Contents,Contents/{MacOS,Resources,Frameworks}}}
$(FPC_MAC)386 $(UNIT) $(INCLUDE) -FE$(OUTPUT) -FU$(TMP) $(FLAGS) -o$(TARGETM)-386
$(FPC_MAC)ppc $(UNIT) $(INCLUDE) -FE$(OUTPUT) -FU$(TMP) $(FLAGS) -o$(TARGETM)-ppc
lipo -create $(OUTPUT)$(TARGETM)-ppc $(OUTPUT)$(TARGETM)-386 -output $(BUNDLE)/Contents/MacOS/$(TARGETM)
rm $(OUTPUT)$(TARGETM)-386 $(OUTPUT)$(TARGETM)-ppc

clean:
rm -f *.*~
rm -f $(TMP)*.*

Andru
16-10-2010, 06:15 AM
Oh, about using. I put this Makefile to directory with source code of demo. Then in terminal I go to this directory and run command "make macos" :) But if you use iMac every day this is not a good solution, I think...

WILL
08-11-2010, 12:13 AM
Ok, I've installed the 0.9.29.x version (from snapshot) of Lazarus and FPC 2.4.0 and it's source, but I still have remains of the Lazarus configuration files which I need to replace with settings that will work. Why these settings are not updated on installation of a new version is beyond me. Makes for an 'extremely poor' installation practice if you ask me.

So now I have to find and delete these files, where are they located? I'm still rather new to Mac/Linux so my knowledge is a bit unripened still. OR... can someone give me steps towards changing my configuration to FIND the right file for the 2.4.0 FPC compiler for my new installation of Laz.

As a side note: I really, really HATE the way that Laz installs on Mac OS X. I would think that with enough people using it that it would be a bit more streamlined of a process. Macs are made to be simple, unlike Linux, however the Mac installers are just as bad as the Linux ones. There is no option to uninstall and the documentation doesn't even properly keep track of all the files that are thrown about my system unkempt. I think the Laz team seriously needs to get their Mac port's house in order here as it's hurting potential users of Lazarus on Mac. Which is such a shame as both the FPC and Laz people have put a lot of time and effort into Mac support.

code_glitch
08-11-2010, 09:51 PM
couldnt you just



apt-get install lazarus


I hear if you have Xcode this sometimes works... As far as I know, the linux and Mac Os X command lines both have this functionality; Don't they?

Stoney
08-11-2010, 10:14 PM
The command lines can similar functionality, but there is no package manager on Mac OS X pre-installed, so any apt-get tricks wouldn't work. (And this has nothing to do with XCode. :) )
There are Fink (http://www.finkproject.org/) and DarwinPorts (http://darwinports.com/) if you want or need to install a package manager system on Mac OS X. But this isn't really recommended since any application created with Fink-/Darwinport-Lazarus links against absolute filenames of the used libraries and requires Fink or DarwinPort installed on the user's system.

WILL
09-11-2010, 07:43 AM
I'm not a huge fan of package managers to be honest. They are messy and too Linux-like. Yeah I know Mac OS X is a Linux-a-like, but it's only built on top of a Linux-a-like core made to be simple, yet powerful and easy to use. Linux is not. Save partially for Ubuntu, nice distro...

That aside; The folks at Blaise Pascal Magazine are developing a Lazarus on a stick for Mac OS X and Linux, which I'm eagerly interested in. That could be a later solution, however that doesn't excuse the Laz Team from making their distribution for Mac better.

That said, I have an OLD copy of the Lazarus configuration file(s) and I need to nuke it all completely in order to get Laz working properly on my Mac. Does anyone know how to A) get rid of Lazarus, FPC and it's source completely (ALL FILES) or B) nuke the configuration files of Lazarus and/or replace them with the newer ones for the latest LAz and the FPC version it supports?

If it's as simple as, what version of FPC are you using, then go to these fields in the Laz menus and put in these file paths, awesome, give me a list, but I'm finding that the old documentation is garbage and doesn't apply to any of what the current versions are like now at all. So I need someone who knows what they are doing to walk me through this as existing docs are worthless.

code_glitch
09-11-2010, 04:00 PM
Lazarus on a stick

Now I do like that idea... Might be quite useful considering I Use windows (all colours of it from DOS based 98SE to win7) and a few flavours of linux (netbooks that dont ship propper oses grrrr) and I have even used a mac before (waaat??). I must say, that moving all my code onto one fpc + laz (once i get to learn how to use it) would be quite nice...

But coming from a windows only environment; A package manager is HEAVEN on earth. And peronsally, I find the whole .deb and software sources approach quite nice :) Especially since I can get 80% of all the stuff I need by just sudo apt-get installing everything. Its sooo nice. Maybe I'll get a mac one day. Come on hardware - just one small temporary screwup to justify the me getting a mac. pleaaaase? Darn, it's all working 100% for the first time ever.

Andru
09-11-2010, 06:03 PM
I don't know what a problem do you have, and how you get it, but I just have downloaded the latest snapshot of Lazarus 0.9.29(lazarus-0.9.29.28159-20101109-i386-macosx.dmg) and installed it from dmg. All works fine after that, without any problems. About uninstall under Linux - there is no problem with it, and never been. But under MacOS X I didn't find something like package manager under Linux or Install/Uninstall under Windows. Here your path's:
- compiler path - /usr/local/bin/ppc386
- fpc source - /usr/local/share/fpcsrc/

You can find FPC in /usr/local/lib/fpc. But you can't go there using Finder... :)

WILL
09-11-2010, 08:17 PM
I don't know what a problem do you have, and how you get it, but I just have downloaded the latest snapshot of Lazarus 0.9.29(lazarus-0.9.29.28159-20101109-i386-macosx.dmg) and installed it from dmg. All works fine after that, without any problems. About uninstall under Linux - there is no problem with it, and never been. But under MacOS X I didn't find something like package manager under Linux or Install/Uninstall under Windows. Here your path's:
- compiler path - /usr/local/bin/ppc386
- fpc source - /usr/local/share/fpcsrc/

You can find FPC in /usr/local/lib/fpc. But you can't go there using Finder... :)

See thats the problem if you've installed it from scratch, fresh, no other previous Lazarus installed then you're probably ok. But I already installed the older "stable" 0.9.28.0 before and the config files are stuck there. I have to reset them or remove it all and install this new snapshot of Laz from scratch.

I can't figure out where the config files for Laz are...

WILL
11-11-2010, 06:06 AM
It's sort of working now...

I fixed the file paths and I have FPC 2.4.0 and it's source installed.

I can generate applications, however the debugger crashes on me after a successful build and the app won't run after. (via pressing the 'Run' icon to compile and test your app)

Anyone know what might be up with my debugger?