[SOLVED] Building IDE with packages preinstalled lazarus / 11-Options ---------------------------------------------------------------------- MarkMLl · 2024-01-01 08:00 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.p hp/topic,67244.msg517129.html#msg517129 MarkMLl ---------------------------------------------------------------------- ccrause · 2024-01-01 08:14 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 · 2024-01-01 08:31 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 ---------------------------------------------------------------------- JuhaManninen · 2024-01-01 10:24 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. ---------------------------------------------------------------------- MarkMLl · 2024-01-01 11:23 Quote from: JuhaManninen on January 01, 2024, 11:24:50 amI 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? QuoteThe --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 ---------------------------------------------------------------------- JuhaManninen · 2024-01-01 12:32 Quote from: MarkMLl on January 01, 2024, 12:23:48 pmBut 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=" it should do the job. I confess I never used it myself. BTW, the "" can be empty but "--build-ide=" still needs the trailing "=". For some reason it bothers me. ---------------------------------------------------------------------- MarkMLl · 2024-01-01 13:43 Thanks, I'll take a look and report back. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-02-17 12:02 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #!/bin/sh make cleanmake distclean make LCL_PLATFORM=qt5 bigidecp -p lazarus lazarus-qt5cp -p lazbuild lazbuild-qt5cp -p startlazarus startlazarus-qt5 # Unless all files are removed the About box will not be redone, so# will show qt5 irrespective of the widget set being used. make clean# make distclean make LCL_PLATFORM=gtk2 bigidecp -p lazarus lazarus-gtk2cp -p lazbuild lazbuild-gtk2cp -p startlazarus startlazarus-gtk2 # It will probably be necessary to reinstall plugins from inside# the IDE. However see https://forum.lazarus.freepascal.org /index.php/topic,65706.msg500981.html  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 ---------------------------------------------------------------------- MarkMLl · 2024-02-20 13:48 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #!/bin/sh # Build the Lazarus IDE with extra installed packages. The suffix is what is# after the - in the binary and configuration directories, so if the directory# is e.g. /usr/local/share/lazarus-2.2.6+3.2.2 it is 2.2.6+3.2.2 . # PREREQUISITE: The FPC compiler's PPC symlink points to the correct version. SUFFIX=newstable # set -x make distcleanmake LCL_PLATFORM=gtk2 bigide if [ -d ~/.lazarus-$SUFFIX ]; then   # The --build-ide= option defaults to reading the existing configuration  # directory. Preserve original file ownership etc. if possible.   if lazbuild-$SUFFIX --no-write-project --widgetset=qt5 --add-package lazprojectgroups --build-ide= ; then    cp -p lazarus lazarus-qt5  else    rm -f lazarus-qt5  fi   if lazbuild-$SUFFIX --no-write-project --widgetset=gtk2 --add-package lazprojectgroups --build-ide= ; then  cp -p lazarus lazarus-gtk2  else    rm -f lazarus-gtk2  fi   echo  ls -lt lazarus lazarus-* lazbuild lazbuild-* startlazarus startlazarus-* 2> /dev/null  echo else   # No configuration directory exists.   echo  echo Run lazarus-$SUFFIX to establish the basic configuration. Do not install  echo any extra packages, or recompile from inside the IDE for any other  echo reason since doing so might mess up the widget set choice.  echo fi  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