Forum > Packages and Libraries
How to edit the LCL package?
richie765:
Hi there,
I'm tryng to fix a bug in the LCL package. I've narrowed down the problem to the file carbon/customdrawnwinapi_cocoa.inc. I'm pretty new to packages and how they work, so please forgive my ignorance. :) I'm trying to edit this file but it opens as read-only from the package viewer.
Can someone please give me a quick summary of how to edit and compile the package so I can test and debug my fix?
BTW I searched with Google but I didn't find what I needed.
Thanks!!
cdbc:
Hi
On my Linux-lappy, the lcl-units are located in a ReadOnly section /owned/ by 'root'. Maybe it's like that on your mac...?
Fwiw, @dbannon found a way to circumvent this, by locating the lcl-dir and 'chown' the owner to /you/, then compile and 'chown' back to root... that works, but be careful, when fiddling with the lcl... %)
Regards Benny
TRon:
As cdbc mentioned using a 'normal' installation of Lazarus (meaning by means of a package manager or some other form of pre-configured package) usually let the original Lazarus source-code end up in restricted directories.
If you want to fiddle with Lazarus' source-code then it is advisable to make a (free from any restriction) standalone installation, preferably created manually by compiling the sources.
This wiki page is a generic page on how to install Lazarus and if clicked f.e. on the Linux link, it'll end up here, which list instructions for building Lazarus from source (that are specific to Linux but there is much similarity regarding the described step/instructions to be able to almost do the same for/on other platforms. Some of the details, prerequisites, and some other platform specifics differ).
Once you have a standalone installation (don't forget to use the --pcp option with its separated configuration directory in case you have also other Lazarus installation(s)) you can edit the files that you wish to 'fix', and then you should be able to do a rebuild of Lazarus from within Lazarus itself or do a manual build (again) using make.
Be careful though, if you 'fixed' your issue wrongly you could end up with breaking your custom standalone installation, requiring you to take the described steps again. So make sure to backup the files that you modified to that you can easily restore things to a previous state.
richie765:
Thanks for the fast response! :D I see on my mac the files are created as 503:admin (503 user does not even exist). I'll try to change the user and see what happens. It's definitely interesting to recompile Lazarus as there are a few more things I'd like to change.
wp:
I only rarely work under Linux, and, if I do, always with installations in the home directory. But for me the trick to debug the LCL or third-party libraries is to add a "-gw3" (without quotes) as a "Custom option" to "Additions and overrides" in the project options. This forces the IDE to rebuild all needed units with Dwarf 3 debug information.
Navigation
[0] Message Index
[#] Next page