View Issue Details

IDProjectCategoryView StatusLast Update
0023054LazarusIDEpublic2020-03-31 21:25
ReporterAlexL Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version1.1 (SVN) 
Summary0023054: lazbuild + bigide
DescriptionIf to use --add-package for lazbuild, then I need to rebuild lazarus fully, but now no option "bigide" like "make clean bigide".
Option "--build-ide=" is not enough: I loose RTTI,IPro,Chart,SQLdb (see attachment).
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetGTK 2
Attached Files

Activities

2012-10-04 15:01

 

fggfg.png (73,486 bytes)   
fggfg.png (73,486 bytes)   

Reinier Olislagers

2012-10-04 15:15

developer   ~0062875

Try using --build-ide= --build-mode=Normal IDE

AlexL

2012-10-04 18:25

reporter   ~0062880

# lazbuild --build-ide= --build-mode="Normal IDE"
primary config path: /root/.lazarus
ERROR: IDE build mode "Normal IDE" not found

Available IDE build modes:
* Обычная IDE
  IDE в режиме отладки
  IDE с оптимизацией
  Очистить + Собрать все

AlexL

2012-10-04 18:28

reporter   ~0062881

# export LC_ALL=C; lazbuild --build-ide= --build-mode="Normal IDE"
No result. I loose RTTI,IPro,Chart,SQLdb also.

AlexL

2012-10-05 01:37

reporter   ~0062887

For more information, please, see my package lazarus-bgra: ftp://ftp.mageialinux.ru/mageia2/SRPMS/

Mattias Gaertner

2012-10-05 08:47

manager   ~0062891

"make bigide" is a fixed set of packages.

AlexL

2012-10-05 09:44

reporter   ~0062892

Now I must add RTTI,IPro,Chart,SQLdb manually before "lazbuild --build-ide=" (see spec file). But it must be automatic - I need new option. I can not be sure that lazarus needs only RTTI,IPro,Chart,SQLdb, because lazarus can be built with different components before rebuilding.
New option must detect all additional components automatic (automatic --add-package for additional components).
"make clean bigide" is too long operation.
"automatic --add-package for additional components" will be faster.
Now rpm package lazarus-bgra works quickly.

Mattias Gaertner

2012-10-05 10:12

manager   ~0062893

The IDE does not need RTTI, IPro, CHart, SQLDB.
The only purpose of "make bigide" is to make the life easier of the people that create the binary packages. This is a set of stable packages maintained by the Lazarus developers.

AlexL

2012-10-05 11:21

reporter   ~0062894

It's not reason to loose after lazarus's rebuilding additional packages, which included in IDE before rebuilding.
How must maintainer determine additional packages? No answer.
If I'll create new rpm package with new lpk in rpm package, for example, lazarus-*.rpm, how must I determine RTTI,IPro,Chart,SQLdb and yet BGRA Controls, which were included in IDE before? No answer.

Mattias Gaertner

2012-10-05 12:31

manager   ~0062895

The list of installed packages is stored in the users pcp.
When the IDE first starts there is no list, so it would be empty i.e. only the base packages would be in the list. Which means all extra packages would be uninstalled on next compile.
In order to keep the pre installed packages, the IDE must be compiled with a special flag. See ide/lazarus.pp.
Formerly the flag was -dBigIDE, which also used the fixed set of bigide.
I added the flag -dKeepInstalledPackages.

Mattias Gaertner

2012-10-05 12:36

manager   ~0062896

Use

lazbuild --addpackage=sqldb --build-ide=-dKeepInstalledPackages

AlexL

2012-10-05 16:16

reporter   ~0062905

Last edited: 2012-10-05 18:17

I rebuilt rpm package lazarus with patch:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/ide/lazarus.pp?r1=38971&r2=38970&pathrev=38971&root=lazarus&view=patch
and changed:
lazbuild --primary-config-path=/tmp/bgrabuild --build-ide=-dKeepInstalledPackages
No result and slower compiling, my variant works faster.
rpm and deb packages are installing with root privileges.
root (rpm or deb) can not watch users's directories.

AlexL

2012-10-05 17:44

reporter   ~0062906

Last edited: 2012-10-05 17:47

Let's create file $(LazarusDir)/.../list0
All installed extra packages will be written in $(LazarusDir)/.../list0
Then:
lazbuild --add-package new1.lpk
...
While not eof ($(LazarusDir)/.../list0) do
begin
  readln($(LazarusDir)/.../list0, inst_lpk);
  lazbuild --add-package inst_lpk
end;
...
lazbuild --build-ide=
...
If new1.lpk was installed, then to write in file $(LazarusDir)/.../list0
If new1.lpk was deleted, then to delete info about new1.lpk from file $(LazarusDir)/.../list0

Vincent Snijders

2012-10-05 18:18

manager   ~0062907

I guess that is expected, if you don't add
--build-ide=-dKeepInstalledPackages

AlexL

2012-10-05 18:45

reporter   ~0062908

Option -dKeepInstalledPackages knows nothing about RTTI,IPro,Chart,SQLdb, which are installed in IDE by default rpm package.

Mattias Gaertner

2012-10-05 20:26

manager   ~0062912

You lost me. Can you explain in other words what you are trying to achieve?

AlexL

2012-10-05 21:18

reporter   ~0062913

Last edited: 2012-10-08 18:06

It's my current work (spec file for rpm package):

%define ver_bgracontrols 1.4.0.1
%define ver_bgrabitmap 6.0
%define ver_lazarus 1.0.1.20120905

Name: lazarus-bgra
Version: %{ver_lazarus}
Release: %mkrel 14
Summary: BGRABitmap and BGRAControls for Lazarus
Group: Development/Other
License: modifiedLGPLv2+
URL: http://www.lazarus.freepascal.org/
Source0: http://sourceforge.net/projects/bgracontrols/files/bgracontrols-%{ver_bgracontrols}.zip
Source1: http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap%{ver_bgrabitmap}.zip
BuildRoot: %{_tmppath}/%{name}-%{ver}-%{release}-root
Requires: lazarus = %{ver_lazarus}
Requires: make

Provides: bgrabitmap, bgrabitmappack, bgracontrols
AutoReqProv: no

%description
BGRABitmap is a set of units designed to modify and create images with transparency (alpha channel).
BGRAControls is a set of components for lazarus which add alpha support for controls by using BGRABitmap drawing.

%prep
%setup -q -c bgracontrols-%{ver_bgracontrols}
%setup -q -b 1 -c bgrabitmap%{ver_bgrabitmap}

%install
mkdir -p %{buildroot}%{_libdir}/lazarus/components
mkdir -p %{buildroot}%{_libdir}/lazarus/components/bgrabitmappack
mkdir -p %{buildroot}%{_libdir}/lazarus/components/bgracontrols
mkdir -p %{buildroot}%{_libdir}/lazarus/packager/globallinks
echo '$(LazarusDir)/components/bgrabitmappack/bgrabitmappack.lpk' > %{buildroot}%{_libdir}/lazarus/packager/globallinks/bgrabitmappack-%{ver_bgrabitmap}.lpl
echo '$(LazarusDir)/components/bgracontrols/bgracontrols.lpk' > %{buildroot}%{_libdir}/lazarus/packager/globallinks/bgracontrols-%{ver_bgracontrols}.lpl
cp -af bgrabitmap%{ver_bgrabitmap}/* %{buildroot}%{_libdir}/lazarus/components/bgrabitmappack/
cp -af bgracontrols-%{ver_bgracontrols}/* %{buildroot}%{_libdir}/lazarus/components/bgracontrols/

%post
mkdir -p %{_sysconfdir}/lazarus
LazarusDir=%{_libdir}/lazarus

# create extra_lpk.conf.default for extra lazarus packages RTTI, IPro, Chart, SQLdb, which are included in IDE by default
if [ ! -f "%{_sysconfdir}/lazarus/extra_lpk.conf.default" ]
then
  echo '$(LazarusDir)/components/rtticontrols/runtimetypeinfocontrols.lpk' > %{_sysconfdir}/lazarus/extra_lpk.conf.default
  echo '$(LazarusDir)/components/turbopower_ipro/turbopoweripro.lpk' >> %{_sysconfdir}/lazarus/extra_lpk.conf.default
  echo '$(LazarusDir)/components/tachart/tachartlazaruspkg.lpk' >> %{_sysconfdir}/lazarus/extra_lpk.conf.default
  echo '$(LazarusDir)/components/sqldb/sqldblaz.lpk' >> %{_sysconfdir}/lazarus/extra_lpk.conf.default
fi

# create extra_lpk_gtk2.conf for keeping gtk2 lazarus packages
if [ ! -f "%{_sysconfdir}/lazarus/extra_lpk_gtk2.conf" ]
then
  cp -f %{_sysconfdir}/lazarus/extra_lpk.conf.default %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf
fi

# create extra_lpk_qt4.conf for keeping qt4 lazarus packages
if [ ! -f "%{_sysconfdir}/lazarus/extra_lpk_qt4.conf" ]
then
  cp -f %{_sysconfdir}/lazarus/extra_lpk.conf.default %{_sysconfdir}/lazarus/extra_lpk_qt4.conf
fi

# create clear list of installed packages
HOME0=$HOME
rm -rf /tmp/lazarus_build
mkdir -p /tmp/lazarus_build
export HOME=/tmp/lazarus_build

# backup lazarus executable
cp -f %{_libdir}/lazarus/lazarus /tmp/lazarus_build/

# add lazarus packages from this rpm package to our list of installed packages
lazbuild --primary-config-path=/tmp/lazarus_build --add-package $LazarusDir/components/bgrabitmappack/bgrabitmappack.lpk
lazbuild --primary-config-path=/tmp/lazarus_build --add-package $LazarusDir/components/bgracontrols/bgracontrols.lpk

# determine type for compiled IDE
#IDETYPE=`strings $LazarusDir/lazarus|grep qtwidgets`
IDETYPE=`ldd %{_bindir}/lazarus-ide|grep libQt4Pas`
if [ "$IDETYPE" = "" ]
then
  IDETYPE=gtk2
  echo IDETYPE: $IDETYPE
else
  IDETYPE=qt4
  echo IDETYPE: $IDETYPE
fi

# add lazarus packages from extra_lpk_gtk2.conf to our list of installed packages
if [ "$IDETYPE" = "gtk2" ]
then
  cat %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf | while read LPK
  do
    lazbuild --primary-config-path=/tmp/lazarus_build --add-package $LazarusDir/${LPK:14}
  done
fi

# add lazarus packages from extra_lpk_qt4.conf to our list of installed packages
if [ "$IDETYPE" = "qt4" ]
then
  cat %{_sysconfdir}/lazarus/extra_lpk_qt4.conf | while read LPK
  do
    lazbuild --primary-config-path=/tmp/lazarus_build --add-package $LazarusDir/${LPK:14}
  done
fi

# rebuild lazarus
if [ "$IDETYPE" = "gtk2" ]
then
  lazbuild --primary-config-path=/tmp/lazarus_build --build-ide=
fi
if [ "$IDETYPE" = "qt4" ]
then
  lazbuild --primary-config-path=/tmp/lazarus_build --build-ide= --widgetset=qt
fi

if [ ! -f "%{_libdir}/lazarus/lazarus" ]
then
  # error of compiling lazarus, return from backup
  cp -f /tmp/lazarus_build/lazarus %{_libdir}/lazarus/
else
  # if lazarus packages from this rpm works with gtk2, then add to extra_lpk_gtk2.conf
  STR=`cat %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf|grep '$(LazarusDir)/components/bgrabitmappack/bgrabitmappack.lpk'`
  if [ "$STR" = "" ]
  then
    echo '$(LazarusDir)/components/bgrabitmappack/bgrabitmappack.lpk' >> %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf
  fi
  STR=`cat %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf|grep '$(LazarusDir)/components/bgracontrols/bgracontrols.lpk'`
  if [ "$STR" = "" ]
  then
    echo '$(LazarusDir)/components/bgracontrols/bgracontrols.lpk' >> %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf
  fi
  # if lazarus packages from this rpm works with qt4, then add to extra_lpk_qt4.conf
  STR=`cat %{_sysconfdir}/lazarus/extra_lpk_qt4.conf|grep '$(LazarusDir)/components/bgrabitmappack/bgrabitmappack.lpk'`
  if [ "$STR" = "" ]
  then
    echo '$(LazarusDir)/components/bgrabitmappack/bgrabitmappack.lpk' >> %{_sysconfdir}/lazarus/extra_lpk_qt4.conf
  fi
  STR=`cat %{_sysconfdir}/lazarus/extra_lpk_qt4.conf|grep '$(LazarusDir)/components/bgracontrols/bgracontrols.lpk'`
  if [ "$STR" = "" ]
  then
    echo '$(LazarusDir)/components/bgracontrols/bgracontrols.lpk' >> %{_sysconfdir}/lazarus/extra_lpk_qt4.conf
  fi
fi

export HOME=$HOME0
rm -rf /tmp/lazarus_build

%preun
LazarusDir=%{_libdir}/lazarus
if [ $1 -eq 0 ]
# if this rpm package is deleting
then
  rm -rf $LazarusDir/components/bgrabitmappack
  rm -rf $LazarusDir/components/bgracontrols
  rm -f %{_libdir}/lazarus/packager/globallinks/bgrabitmappack-%{ver_bgrabitmap}.lpl
  rm -f %{_libdir}/lazarus/packager/globallinks/bgracontrols-%{ver_bgracontrols}.lpl
  
  # create clear list of installed packages
  HOME0=$HOME
  rm -rf /tmp/lazarus_build
  mkdir -p /tmp/lazarus_build
  export HOME=/tmp/lazarus_build
  
  # backup lazarus executable
  cp -f %{_libdir}/lazarus/lazarus /tmp/lazarus_build/

  # delete lazarus packages from this rpm package from extra_lpk_gtk2.conf
  grep -v '$(LazarusDir)/components/bgrabitmappack/bgrabitmappack.lpk' %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf > /tmp/lazarus_build/new_extra_lpk.conf
  mv /tmp/lazarus_build/new_extra_lpk.conf %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf
  grep -v '$(LazarusDir)/components/bgracontrols/bgracontrols.lpk' %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf > /tmp/lazarus_build/new_extra_lpk.conf
  mv /tmp/lazarus_build/new_extra_lpk.conf %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf

  # delete lazarus packages from this rpm package from extra_lpk_qt4.conf
  grep -v '$(LazarusDir)/components/bgrabitmappack/bgrabitmappack.lpk' %{_sysconfdir}/lazarus/extra_lpk_qt4.conf > /tmp/lazarus_build/new_extra_lpk.conf
  mv /tmp/lazarus_build/new_extra_lpk.conf %{_sysconfdir}/lazarus/extra_lpk_qt4.conf
  grep -v '$(LazarusDir)/components/bgracontrols/bgracontrols.lpk' %{_sysconfdir}/lazarus/extra_lpk_qt4.conf > /tmp/lazarus_build/new_extra_lpk.conf
  mv /tmp/lazarus_build/new_extra_lpk.conf %{_sysconfdir}/lazarus/extra_lpk_qt4.conf

  # determine type for compiled IDE
  #IDETYPE=`strings $LazarusDir/lazarus|grep qtwidgets`
  IDETYPE=`ldd %{_bindir}/lazarus-ide|grep libQt4Pas`
  if [ "$IDETYPE" = "" ]
  then
    IDETYPE=gtk2
    echo IDETYPE: $IDETYPE
  else
    IDETYPE=qt4
    echo IDETYPE: $IDETYPE
  fi

  # add lazarus packages from extra_lpk_gtk2.conf to our list of installed packages
  if [ "$IDETYPE" = "gtk2" ]
  then
    cat %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf | while read LPK
    do
      lazbuild --primary-config-path=/tmp/lazarus_build --add-package $LazarusDir/${LPK:14}
    done
  fi

  # add lazarus packages from extra_lpk_qt4.conf to our list of installed packages
  if [ "$IDETYPE" = "qt4" ]
  then
    cat %{_sysconfdir}/lazarus/extra_lpk_qt4.conf | while read LPK
    do
      lazbuild --primary-config-path=/tmp/lazarus_build --add-package $LazarusDir/${LPK:14}
    done
  fi
  
  # rebuild lazarus
  if [ "$IDETYPE" = "gtk2" ]
  then
    lazbuild --primary-config-path=/tmp/lazarus_build --build-ide=
  fi
  if [ "$IDETYPE" = "qt4" ]
  then
    lazbuild --primary-config-path=/tmp/lazarus_build --build-ide= --widgetset=qt
  fi
  
  if [ ! -f "%{_libdir}/lazarus/lazarus" ]
  then
    # error of compiling lazarus, return from backup
    cp -f /tmp/lazarus_build/lazarus %{_libdir}/lazarus/
  fi
  
  export HOME=$HOME0
  rm -rf /tmp/lazarus_build

  A=`cat %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf`
  B=`cat %{_sysconfdir}/lazarus/extra_lpk_qt4.conf`
  C=`cat %{_sysconfdir}/lazarus/extra_lpk.conf.default`

  if [ "$A" = "$C" ]
  then
    rm -f %{_sysconfdir}/lazarus/extra_lpk_gtk2.conf
  fi
  
  if [ "$B" = "$C" ]
  then
    rm -f %{_sysconfdir}/lazarus/extra_lpk_qt4.conf
  fi
  
  if [ ! -f "%{_sysconfdir}/lazarus/extra_lpk_gtk2.conf" ]
  then
    if [ ! -f "%{_sysconfdir}/lazarus/extra_lpk_qt4.conf" ]
    then
      # delete extra_lpk.conf.default, because extra_lpk.conf.default may be changed in future in new version of lazarus
      rm -f %{_sysconfdir}/lazarus/extra_lpk.conf.default
    fi
  fi
  
fi

%files
%{_libdir}/lazarus/components/*
%{_libdir}/lazarus/packager/globallinks/*

%changelog

Please, read my algorithm. Time for installing/deleting rpm package < 5 sec.
In lazbuild there are no options for same result. That's why I implemented extra_lpk_gtk2.conf, extra_lpk_qt4.conf, extra_lpk.conf.default.
-dKeepInstalledPackages is very slow and don't keep installed packages in fact, lost packages. You "keep list of installed packages is stored in the users pcp", but it's not good for rpm and deb packages with additional components for lazarus.

Juha Manninen

2020-03-31 21:25

developer   ~0121807

This can be safely resolved. Rebuilding Lazarus fully should be OK in this particular use case.

Issue History

Date Modified Username Field Change
2012-10-04 15:01 AlexL New Issue
2012-10-04 15:01 AlexL File Added: fggfg.png
2012-10-04 15:01 AlexL Widgetset => GTK 2
2012-10-04 15:15 Reinier Olislagers Note Added: 0062875
2012-10-04 18:25 AlexL Note Added: 0062880
2012-10-04 18:28 AlexL Note Added: 0062881
2012-10-05 01:37 AlexL Note Added: 0062887
2012-10-05 08:47 Mattias Gaertner Note Added: 0062891
2012-10-05 09:44 AlexL Note Added: 0062892
2012-10-05 10:12 Mattias Gaertner Note Added: 0062893
2012-10-05 11:21 AlexL Note Added: 0062894
2012-10-05 12:31 Mattias Gaertner Note Added: 0062895
2012-10-05 12:36 Mattias Gaertner LazTarget => -
2012-10-05 12:36 Mattias Gaertner Note Added: 0062896
2012-10-05 12:36 Mattias Gaertner Assigned To => Mattias Gaertner
2012-10-05 12:36 Mattias Gaertner Status new => resolved
2012-10-05 12:36 Mattias Gaertner Resolution open => fixed
2012-10-05 16:16 AlexL Status resolved => assigned
2012-10-05 16:16 AlexL Resolution fixed => reopened
2012-10-05 16:16 AlexL Note Added: 0062905
2012-10-05 16:41 AlexL Note Edited: 0062905
2012-10-05 17:25 AlexL Note Edited: 0062905
2012-10-05 17:44 AlexL Note Added: 0062906
2012-10-05 17:47 AlexL Note Edited: 0062906
2012-10-05 18:17 AlexL Note Edited: 0062905
2012-10-05 18:18 Vincent Snijders Note Added: 0062907
2012-10-05 18:45 AlexL Note Added: 0062908
2012-10-05 20:26 Mattias Gaertner Note Added: 0062912
2012-10-05 21:18 AlexL Note Added: 0062913
2012-10-05 21:42 AlexL Note Edited: 0062913
2012-10-06 12:05 AlexL Note Edited: 0062913
2012-10-07 12:40 AlexL Note Edited: 0062913
2012-10-07 14:37 AlexL Note Edited: 0062913
2012-10-08 18:06 AlexL Note Edited: 0062913
2020-03-31 21:25 Juha Manninen Status assigned => resolved
2020-03-31 21:25 Juha Manninen Resolution reopened => no change required
2020-03-31 21:25 Juha Manninen Widgetset GTK 2 => GTK 2
2020-03-31 21:25 Juha Manninen Note Added: 0121807