Author Topic: On building Retroshare-0.5.2 ... errors [FIXED]  (Read 1317 times)

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
On building Retroshare-0.5.2 ... errors [FIXED]
« on: November 24, 2011, 10:06:45 PM »
Hi... another mystery that needed your help and explanation to get Retroshare-0.5.2 packaged. As per the following output:

Code: [Select]
In file included from /usr/include/glib-2.0/glib/galloca.h:34:0,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/gnome-keyring-1/gnome-keyring.h:27,
                 from rsserver/rsloginhandler.cc:9:
/usr/include/glib-2.0/glib/gtypes.h:34:24: fatal error: glibconfig.h: No such file or directory
compilation terminated.
In file included from ./services/p3photoservice.h:34:0,
                 from rsserver/rsinit.cc:1717:
./serialiser/rsphotoitems.h:113:21: warning: unused parameter ‘item’
./serialiser/rsphotoitems.h:113:21: warning: unused parameter ‘data’
./serialiser/rsphotoitems.h:113:21: warning: unused parameter ‘size’
./serialiser/rsphotoitems.h:114:21: warning: unused parameter ‘data’
./serialiser/rsphotoitems.h:114:21: warning: unused parameter ‘size’
make: *** [temp/linux-g++/obj/rsloginhandler.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from rsserver/rsinit.cc:1722:0:
./turtle/p3turtle.h:274:16: warning: unused parameter ‘load’
error: Bad exit status from /home/archie/Temporary/src/tmp/rpm-tmp.CwpZNc (%build)


RPM build errors:
    Bad exit status from /home/archie/Temporary/src/tmp/rpm-tmp.CwpZNc (%build)

So I tried:

Code: [Select]
archie@arevalo.ph SPECS > locate glibconfig.h
/usr/lib64/glib-2.0/include/glibconfig.h
archie@arevalo.ph SPECS > rpm -qf /usr/li
lib/     lib64/   libexec/
archie@arevalo.ph SPECS > rpm -qf /usr/lib64/gli
glib-2.0/   glibmm-2.4/
archie@arevalo.ph SPECS > rpm -qf /usr/lib64/glib-2.0/include/glibconfig.h
lib64glib2.0_0-devel-2.31.0-2pclos2011
archie@arevalo.ph SPECS > rpm -qa lib64glib2.0_0-devel
lib64glib2.0_0-devel-2.31.0-2pclos2011

I have the darn thing installed so ...

The last few lines on rpm-tmp.CwpZNc are as follow:

Code: [Select]
# Strip the binaries to make them smaller (and sexier).
/usr/bin/strip retroshare-gui/src/RetroShare
/usr/bin/strip retroshare-nogui/src/retroshare-nogui


exit 0
« Last Edit: November 29, 2011, 06:52:54 PM by Archie »
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: On building Retroshare-0.5.2 ... errors
« Reply #1 on: November 25, 2011, 06:35:21 AM »
Hello Archie,

please look at this:

http://www.gossamer-threads.com/lists/maemo/developers/19765

the output of pkg-config --libs --cflags glib-2.0 on my (32bit) system is:
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -lglib-2.0

The above are the flags you need to pass to the gcc command while linking glib-2.0 library, the option -I/usr/lib/glib-2.0/include will direct the compiler to search that directory for file headers, where is located glibconfig.h.

How to apply this on the retroshare rpm package is beyond my knowledge, very probably there should be some place where to specify the compiler flags ... and there you will need (approx.) to add something like:
CFLAGS=$CFLAGS" -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include"
or
CFLAGS=$CFLAGS" "`pkg-config  --cflags glib-2.0`

You can safely ignore the other warnings ...

AS

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: On building Retroshare-0.5.2 ... errors
« Reply #2 on: November 26, 2011, 05:10:07 PM »
Hello Archie,

please look at this:

http://www.gossamer-threads.com/lists/maemo/developers/19765

the output of pkg-config --libs --cflags glib-2.0 on my (32bit) system is:
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -lglib-2.0

The above are the flags you need to pass to the gcc command while linking glib-2.0 library, the option -I/usr/lib/glib-2.0/include will direct the compiler to search that directory for file headers, where is located glibconfig.h.

How to apply this on the retroshare rpm package is beyond my knowledge, very probably there should be some place where to specify the compiler flags ... and there you will need (approx.) to add something like:
CFLAGS=$CFLAGS" -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include"
or
CFLAGS=$CFLAGS" "`pkg-config  --cflags glib-2.0`

You can safely ignore the other warnings ...

AS


I will definitely look into this, AS. Although this definitely sounds Italian to me, I will definitely try my best to understand it. ;)

It seems to me that there is nothing wrong with the specfile (yet) and I needed to patch ONE of the 3,102 files on ONE of the 179 folders! Whew!
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: On building Retroshare-0.5.2 ... errors
« Reply #3 on: November 27, 2011, 07:03:41 AM »
I will definitely look into this, AS. Although this definitely sounds Italian to me, I will definitely try my best to understand it. ;)

It seems to me that there is nothing wrong with the specfile (yet) and I needed to patch ONE of the 3,102 files on ONE of the 179 folders! Whew!

One of those file is libretroshare/src/libretroshare.pro, a qmake build system file, at line 212 the include paths for glib-2.0 are actually hardcoded into:
Quote
INCLUDEPATH += /usr/include/glib-2.0/ /usr/lib/glib-2.0/include

this line need to be changed to:
Quote
INCLUDEPATH += $$system(pkg-config --cflags glib-2.0 | sed -e "s/-I//g")

When you will run qmake, it will be expanded to:
INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include,  on PCLinuxOS 32bit system
and to
INCLUDEPATH += /usr/include/glib-2.0 /usr/lib64/glib-2.0/include,  on PCLinuxOS 64bit system

Successfully tested and built on both 32bit and 64bit systems.

AS

EDIT: 3101 files were not relevant to this issue  :D ;D
« Last Edit: November 27, 2011, 07:19:24 AM by as »

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: On building Retroshare-0.5.2 ... errors
« Reply #4 on: November 27, 2011, 08:05:42 AM »
I knew you're the man, AS.

I've already applied the patch of your fix and IT BUILD!

Also, since you already build the SRPM, you can send it to Texstar instead. There's just one minor thing you need to do.

AS, we don't change the source code. We apply a patch. To do this, (one of two ways that I know)

Copy and paste libretroshare.pro ... cd SOURCE ... cp 0.5..2/libretroshare/src/libreretroshare.pro 0.5..2/libretroshare/src/libreretroshare.pro~

On the copy, edit line 209 and add the 64 after the correct lib. <-- such a small thing made a big difference!

Save and note that you are on the parent of 0.5.2 (at SOURCE/) ... the command is

Code: [Select]
diff -uNr 0.5.2/libretroshare/src/libretroshare.pro 0.5.2/libretroshare/src/libretroshare.pro~ > libretroshare.pro.patch
Next the specfile. Add Patch0: libretroshare.pro.patch after the SOURCE line and %patch0 -p1 after the %setup -q line and save.

Build from the specfile using the original source code ... the tar.xz that I sent to you ... and voila!

Don't forget to test it extensively before sending the SRPM.

And, VERY GOOD JOB! I have no doubt you're the one to find the file. ;)

Yeap, the other files were irrelevant ... so tell me how you manage to single out that file? You must teach me this technique.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: On building Retroshare-0.5.2 ... errors
« Reply #5 on: November 27, 2011, 08:09:45 AM »
Our job is only half done ... :(

I'm not sure on the 32-bit but on 64, on Synaptic...

Code: [Select]
retroshare:
 Depends: libgnome-keyring0  but it is not installable
 Depends: libgpg-error0  but it is not installable
 Depends: libgpgme11  but it is not installable
 Depends: libupnp3  but it is not installable

Which are all available so we need to go back to the specfile again and edit the "lib" on those lines and change it to "%{_lib}". Then build the specfile again.
« Last Edit: November 27, 2011, 08:16:25 AM by Archie »
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: On building Retroshare-0.5.2 ... errors
« Reply #6 on: November 27, 2011, 09:02:01 AM »
Also, since you already build the SRPM,

 ??? never built an SRPM in my life .

Quote
you can send it to Texstar instead.

Would be glad to do, ... but see previous point.

Quote
There's just one minor thing you need to do.

AS, we don't change the source code. We apply a patch. To do this, (one of two ways that I know)

Yes, I know patch command and can provide a patch.

Quote
Copy and paste libretroshare.pro ... cd SOURCE ... cp 0.5..2/libretroshare/src/libreretroshare.pro 0.5..2/libretroshare/src/libreretroshare.pro~

On the copy, edit line 209 and add the 64 after the correct lib. <-- such a small thing made a big difference!

Save and note that you are on the parent of 0.5.2 (at SOURCE/) ... the command is

Code: [Select]
diff -uNr 0.5.2/libretroshare/src/libretroshare.pro 0.5.2/libretroshare/src/libretroshare.pro~ > libretroshare.pro.patch

I believe that the correct patch should be made from the whole retroshare-0.5.2 tree, something like:
Code: [Select]
diff -uNr 0.5.2/    0.5.2-modified/ > retroshare.0.5.2-pclinuxos.patch
(some filename could be used in several place inside the tree)  ;)

Quote

Next the specfile. Add Patch0: libretroshare.pro.patch after the SOURCE line and %patch0 -p1 after the %setup -q line and save.

Build from the specfile using the original source code ... the tar.xz that I sent to you ... and voila!

Nope!  I'm simply not ready to do that sorry :(, but will try  ;)

Quote
Don't forget to test it extensively before sending the SRPM.

... mmmh ... may be  ;)

Quote
And, VERY GOOD JOB! I have no doubt you're the one to find the file. ;)

Yeap, the other files were irrelevant ... so tell me how you manage to single out that file? You must teach me this technique.

very easy   ;D :

grep -r glib2.0 (from 0.5.2 dir):
Quote
./libretroshare/src/libretroshare.pro:  INCLUDEPATH *= /usr/lib/x86_64-linux-gnu/glib-2.0/include/
./libretroshare/src/libretroshare.pro:  INCLUDEPATH *= /usr/lib/i386-linux-gnu/glib-2.0/include/
./libretroshare/src/libretroshare.pro:  INCLUDEPATH += /usr/include/glib-2.0/ /usr/lib/glib-2.0/include

 :D ;D

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: On building Retroshare-0.5.2 ... errors
« Reply #7 on: November 27, 2011, 09:05:43 AM »
very easy   ;D :

grep -r glib2.0 (from 0.5.2 dir):
Quote
./libretroshare/src/libretroshare.pro:  INCLUDEPATH *= /usr/lib/x86_64-linux-gnu/glib-2.0/include/
./libretroshare/src/libretroshare.pro:  INCLUDEPATH *= /usr/lib/i386-linux-gnu/glib-2.0/include/
./libretroshare/src/libretroshare.pro:  INCLUDEPATH += /usr/include/glib-2.0/ /usr/lib/glib-2.0/include

 :D ;D

That was sneaky! Thanks for the pointer.   ;D   :D
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: On building Retroshare-0.5.2 ... errors
« Reply #8 on: November 27, 2011, 09:10:45 AM »
Our job is only half done ... :(

I'm not sure on the 32-bit but on 64, on Synaptic...

Code: [Select]
retroshare:
 Depends: libgnome-keyring0  but it is not installable
 Depends: libgpg-error0  but it is not installable
 Depends: libgpgme11  but it is not installable
 Depends: libupnp3  but it is not installable

Which are all available so we need to go back to the specfile again and edit the "lib" on those lines and change it to "%{_lib}". Then build the specfile again.

those on PCLinuxOS 64bit will be:

lib64-gnome-keyring0
lib64-gpg-error0
lib64-gpgme11
lib64-upnp3

 :)

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: On building Retroshare-0.5.2 ... errors
« Reply #9 on: November 27, 2011, 09:16:11 AM »
Yeap but without the dashes. Better just change to %{_lib} ... I have this notion that with such, the specfile can be use on both 32 and 64.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: On building Retroshare-0.5.2 ... errors
« Reply #10 on: November 27, 2011, 09:18:22 AM »
Yeap but without the dashes. Better just change to %{_lib} ... I have this notion that with such, the specfile can be use on both 32 and 64.

I told you that I'm not ready to do packaging  :D