Recent

Author Topic: [SOLVED] Building IDE with packages preinstalled  (Read 3915 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 7507
[SOLVED] Building IDE with packages preinstalled
« on: January 01, 2024, 09:00:17 am »
I habitually build GTK (now v2) and Qt variants of the IDE from the sources, with a locally-built copy of FPC.

Is there a way on incorporating a package such as the project group manager at the stage of this initial build, without having to do it by running multiple variants of the IDE?

Updated: usable script at https://forum.lazarus.freepascal.org/index.php/topic,67244.msg517129.html#msg517129

MarkMLl
« Last Edit: May 12, 2024, 12:13:48 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

ccrause

  • Hero Member
  • *****
  • Posts: 933
Re: Building IDE with packages preinstalled
« Reply #1 on: January 01, 2024, 09:14:43 am »
Maybe the make target useride is what you are looking for?  Requires lazbuild.

Perhaps make lazbuild followed by make useride will work for you, provided of course the correct packages are included in the active Lazarus profile.

MarkMLl

  • Hero Member
  • *****
  • Posts: 7507
Re: Building IDE with packages preinstalled
« Reply #2 on: January 01, 2024, 09:31:26 am »
Presumably that requires an additional parameter to pass lazbuild a suitable --pcp

I'll try it in a few days, but was hoping that there was something which could be patched at the source level.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4516
  • I like bugs.
Re: Building IDE with packages preinstalled
« Reply #3 on: January 01, 2024, 11:24:50 am »
I do it from the "Configure Build Lazarus" window. I select widgetset GTK2, then builld, then rename (or copy) the binary as "lazarus_gtk2". Then I build a QT5 version the same way and rename the binary as "lazarus_qt5".
My earlier configured list of packages is used in both cases.
Yes, "make useride" does about the same thing.

The --pcp parameter should not be used if you want the packages from your main config.
--pcp opens another configuration with another set of packages.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 7507
Re: Building IDE with packages preinstalled
« Reply #4 on: January 01, 2024, 12:23:48 pm »
I do it from the "Configure Build Lazarus" window. I select widgetset GTK2, then builld, then rename (or copy) the binary as "lazarus_gtk2". Then I build a QT5 version the same way and rename the binary as "lazarus_qt5".
My earlier configured list of packages is used in both cases.
Yes, "make useride" does about the same thing.

But can one do it from a makefile on a clean system, i.e. no precompiled Lazarus, no profile and so on?

Quote
The --pcp parameter should not be used if you want the packages from your main config.
--pcp opens another configuration with another set of packages.

I don't have a main config. I've got lots of separate ones named for the FPC and Lazarus version they're intended for.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4516
  • I like bugs.
Re: Building IDE with packages preinstalled
« Reply #5 on: January 01, 2024, 01:32:14 pm »
But can one do it from a makefile on a clean system, i.e. no precompiled Lazarus, no profile and so on?
lazbuild has a parameter "--add-package". Together with parameter "--build-ide=<options>" it should do the job.
I confess I never used it myself.

BTW, the "<options>" can be empty but "--build-ide=" still needs the trailing "=". For some reason it bothers me. :)
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 7507
Re: Building IDE with packages preinstalled
« Reply #6 on: January 01, 2024, 02:43:47 pm »
Thanks, I'll take a look and report back.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 7507
Re: Building IDE with packages preinstalled
« Reply #7 on: February 17, 2024, 01:02:47 pm »
I've come across something interesting, although I must warn that I'm still on v2.

If I use this to build two sets of binaries:

Code: Text  [Select][+][-]
  1. #!/bin/sh
  2.  
  3. make clean
  4. make distclean
  5.  
  6. make LCL_PLATFORM=qt5 bigide
  7. cp -p lazarus lazarus-qt5
  8. cp -p lazbuild lazbuild-qt5
  9. cp -p startlazarus startlazarus-qt5
  10.  
  11. # Unless all files are removed the About box will not be redone, so
  12. # will show qt5 irrespective of the widget set being used.
  13.  
  14. make clean
  15. # make distclean
  16.  
  17. make LCL_PLATFORM=gtk2 bigide
  18. cp -p lazarus lazarus-gtk2
  19. cp -p lazbuild lazbuild-gtk2
  20. cp -p startlazarus startlazarus-gtk2
  21.  
  22. # It will probably be necessary to reinstall plugins from inside
  23. # the IDE. However see https://forum.lazarus.freepascal.org/index.php/topic,65706.msg500981.html
  24.  

and then run the ./lazarus binary, the about box indicates that it's using the gtk2 widget set.

If I then add a package and allow the IDE to rebuild, the about box immediately claims that it's using qt5.

Slightly later: this also affects the "LCL Widget Set" as displayed by the project options. Looking carefully at the UI style, it does appear to be doing an IDE rebuild from gtk2 to Qt5, which explains why some combinations of compiler and widget set stop working on some of my systems with a Qt library version error.

MarkMLl
« Last Edit: February 17, 2024, 02:40:46 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 7507
Re: Building IDE with packages preinstalled
« Reply #8 on: February 20, 2024, 02:48:39 pm »
Apologies for commenting to my own posting.

The script below will both compile Lazarus v2 or v3 from scratch, or once a configuration directory exists will recompile it for multiple widget sets (subject obviously to library compatibility etc.)

Code: Text  [Select][+][-]
  1. #!/bin/sh
  2.  
  3. # Build the Lazarus IDE with extra installed packages. The suffix is what is
  4. # after the - in the binary and configuration directories, so if the directory
  5. # is e.g. /usr/local/share/lazarus-2.2.6+3.2.2 it is 2.2.6+3.2.2 .
  6.  
  7. # PREREQUISITE: The FPC compiler's PPC symlink points to the correct version.
  8.  
  9. SUFFIX=newstable
  10.  
  11. # set -x
  12.  
  13. make distclean
  14. make LCL_PLATFORM=gtk2 bigide
  15.  
  16. if [ -d ~/.lazarus-$SUFFIX ]; then
  17.  
  18.   # The --build-ide= option defaults to reading the existing configuration
  19.   # directory. Preserve original file ownership etc. if possible.
  20.  
  21.   if lazbuild-$SUFFIX --no-write-project --widgetset=qt5 --add-package lazprojectgroups --build-ide= ; then
  22.     cp -p lazarus lazarus-qt5
  23.   else
  24.     rm -f lazarus-qt5
  25.   fi
  26.  
  27.   if lazbuild-$SUFFIX --no-write-project --widgetset=gtk2 --add-package lazprojectgroups --build-ide= ; then
  28.     cp -p lazarus lazarus-gtk2
  29.   else
  30.     rm -f lazarus-gtk2
  31.   fi
  32.  
  33.   echo
  34.   ls -lt lazarus lazarus-* lazbuild lazbuild-* startlazarus startlazarus-* 2> /dev/null
  35.   echo
  36.  
  37. else
  38.  
  39.   # No configuration directory exists.
  40.  
  41.   echo
  42.   echo Run lazarus-$SUFFIX to establish the basic configuration. Do not install
  43.   echo any extra packages, or recompile from inside the IDE for any other
  44.   echo reason since doing so might mess up the widget set choice.
  45.   echo
  46.  
  47. fi
  48.  

It assumes that each particular Lazarus variant is stored in a directory such as /usr/local/share.lazarus/lazarus-newstable, and that there's a configuration directory ~/.lazarus-newstable

I wasn't able to work out from the help text, documentation or wiki what sort of parameter --build-ide= expected. In practice, the above suits my requirements.

There's something wrong with rebuilding from inside the IDE when there are multiple widget sets being used, e.g. qt5 and gtk2. Checking with readelf indicates that the lazarus binary correctly indicates with widget set, but rebuilding leaves multiple binaries all using the same widget set (qt5 in my case).

Updated: further-developed script at https://forum.lazarus.freepascal.org/index.php/topic,67244.msg517129.html#msg517129

MarkMLl
« Last Edit: May 12, 2024, 12:12:41 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018