Recent

Author Topic: changing OSX packages...  (Read 12191 times)

crorden

  • New Member
  • *
  • Posts: 36
changing OSX packages...
« on: August 11, 2008, 01:47:56 pm »
Hello-

I am trying to install the GLScene package - which I did successfully with Windows and Linux. However, I can not change any packages with the Mac Carbon version of Lazarus. I have this problem if I run the lazarus.app program as a regular user or as root. For example, if I launch a terminal and cd to /usr/local/share/lazarus and successfully "su" to become root, I can run the program by choosing "open lazarus.app" - the IDE launches. However, I can not change any of the packages. I tried creating the folder /var/root/.lazarus but this did not fix the problem...

Package/ConfigureInstalledPackages
 Change a selection (either install or uninstall a package).
Press 'Save and rebuild IDE'
 I get the error warning 'Write error: unable to create file "/var/root/.lazarus/staticpackages.inc

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
Re: changing OSX packages...
« Reply #1 on: August 12, 2008, 08:45:19 pm »
Quote from: "crorden"
Hello-

I am trying to install the GLScene package - which I did successfully with Windows and Linux. However, I can not change any packages with the Mac Carbon version of Lazarus. I have this problem if I run the lazarus.app program as a regular user or as root. For example, if I launch a terminal and cd to /usr/local/share/lazarus and successfully "su" to become root, I can run the program by choosing "open lazarus.app" - the IDE launches. However, I can not change any of the packages. I tried creating the folder /var/root/.lazarus but this did not fix the problem...


You cannot run GUI apps entirely as root. GUI apps can hower request authorisation for operations they want to perform with elevated permissions: http://developer.apple.com/documentation/Security/Conceptual/authorization_concepts/01introduction/chapter_1_section_1.html

The approach of requiring stuff to be changed in the installation location is however usually the wrong one, for exactly the same reason that you are having trouble: a user does not necessarily have write access to an installed application (and shouldn't have to — the application may even reside in a read-only location).

Lazarus should use a directory under "/Library/Application Support" for global custom files and under "~/Library/Application Support" for per-user custom files. That's what these directories are meant for.

crorden

  • New Member
  • *
  • Posts: 36
changing OSX packages...
« Reply #2 on: August 12, 2008, 09:52:46 pm »
Is there a way that I can include GLScene as a package and rebuild evedrything from the command line?

I have tried copying the entire lazarus folder to a user directory, but when I choose Package/ConfigureInstalledPackages it still attempts to modify /usr/local/share

Can you think of a practical solution for adding a package like GLScene to the Carbon Lazarus?

crorden

  • New Member
  • *
  • Posts: 36
changing OSX packages...
« Reply #3 on: August 12, 2008, 10:43:08 pm »
I also recursively gave the standard user read/write access to all the contents of /usr/local/share/lazarus - after this it did act as if it was able to compile glscene, however the Package/PackageGraph shows GLScene's status as 'Install on restart' even after I restart both the application and my computer....

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
changing OSX packages...
« Reply #4 on: August 13, 2008, 01:32:49 pm »
Did you start lazarus with the startlazarus executable? Otherwise it might not use the latest lazarus executable.

Lis

  • New member
  • *
  • Posts: 9
changing OSX packages...
« Reply #5 on: August 13, 2008, 07:13:24 pm »
1. You need to enable the root account first with the Active Directory utility.
2. su root (then insert the passwort you set with the Active directory utility)
3. cd /root
4. rm -rf .lazarus
5. cd /usr/local/share/lazarus/lazarus.app/Content/MacOS/
6. ./lazarus
lazarus runs now complete as root user and creates the /root/.lazarus dir on its own.
I did the same on the mac at work.
And here comes the problem i need to remember the paths so the path in 5. may not be correct.
If there is no lazarus application within that path you need to serve arround in the lazaruss.app folder and look for the executable.
If you open executables with open <prog> you will run the programm as unprivileged user therefore you need to execute the programm with ./ prefix directly.

crorden

  • New Member
  • *
  • Posts: 36
changing OSX packages...
« Reply #6 on: August 13, 2008, 09:19:08 pm »
Lis-

I followed your advice. The only modifications were that the root folder is
  /var/root
and the location of Lazarus is
 /usr/local/share/lazarus/lazarus.app/Contents/MacOS

When I run .lazarus I get

2# ./lazarus
[FORMS.PP] ExceptionOccurred
  Sender=EPrinter
  Exception=Printer " " does't exists.
  Stack trace:
  $0066A9FA
  $006692A1
  $00668FDA
  $0066A2D5
TApplication.HandleException Printer " " does't exists.
  Stack trace:
  $0066A9FA
  $006692A1
  $00668FDA
  $0066A2D5

crorden

  • New Member
  • *
  • Posts: 36
changing OSX packages...
« Reply #7 on: August 13, 2008, 10:13:29 pm »
I was able to get a few steps further by using the Apple menu to log out and log in as root - then I used the Apple/SystemPreferences/Print&Fax control panel to set a printer for the root user. I was then able to log out (using the Apple menu) and relogin as a normal user. I then started a X11 terminal and launched the following as root
  /usr/local/share/lazarus/lazarus.app/Contents/MacOS/startlazarus
I could then choose Package/ConfigureInstalledPackage to remove packages and then choose "Save and Rebuild IDE" - this worked well, I could remove components such as "runtimetypeinforcontrols" that I do not use - when the IDE restarted these compoents were no longer installed. Likewise, I could install selections (such as RTTI) and successfully "Save and Rebuld IDE" - with the components reappearing. However, I was unable to install the GLScene component - when I selected this (having installed the main cluster of GLScene files in the /Components/GLScene folder and the globallinks in /Packager/Globallinks), the "Save and Rebuild IDE" failed:
 Assembling lazarus
Linking ../lazarus
/usr/bin/ld: can't locate file for: -lX11
An error occurred while linking
Error: Error while linking
TExternalToolList.Run Exception: Error: Error while linking

This is strange, as I installed X11 from my developer Apple Install DVD, and FinkCommander  shows that x11, x11-dev and x11-shlibs are all "provided"...

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
changing OSX packages...
« Reply #8 on: August 14, 2008, 04:18:46 am »
Are you building Lazarus with Gtk or with Carbon? It may help to build with Carbon. There are instructions in the wiki.

Lis

  • New member
  • *
  • Posts: 9
changing OSX packages...
« Reply #9 on: August 14, 2008, 06:14:52 am »
Very interresting. Very very interresting....
I do not have any printers installed on my mac :D therefore i do not get this exception, thought. Anyway i use 0.9.25 lazarus and fpc 2.2.2 maybe that bug is already fixed. Bette write a bug report.
My soloution would have been to remove all printers temporarily, but
the logout login solution is more simple thought.
Im glad to hear you got it (at least in parts) to work.

If you want to compile lazarus on X11 try to instert
/usr/lib;/usr/X11/lib into the library path options.
Since you are not in any project i think you need to
modify them in the "Configure Build Lazarus" Dialog.
But sekel is right there are instructions in the wiki.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
changing OSX packages...
« Reply #10 on: August 14, 2008, 09:41:38 am »
Quote from: "Lis"
1. You need to enable the root account first with the Active Directory utility.
2. su root (then insert the passwort you set with the Active directory utility)


You almost never need to enable the root account. I.c., the above can be done from any regular administrator account by executing "sudo su" or "sudo -s"

Quote from: "Lis"

3. cd /root
4. rm -rf .lazarus
5. cd /usr/local/share/lazarus/lazarus.app/Content/MacOS/
6. ./lazarus
lazarus runs now complete as root


... which is a really, really bad idea. Any bug in Lazarus can now corrupt your entire system.

 

TinyPortal © 2005-2018