[opensuse] AArgh! rpmbuild is so stupid at times... How to tell it gtk.h is really there?

Listmates, Building sawfish from src.rpm and all goes well until it needs gtk/gtk.h and then the build bombs: /usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.lai -> ./.libexec/sawfish/wm/util/x.lai /usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.o -> ./.libexec/sawfish/wm/util/x.o /usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.so -> ./.libexec/sawfish/wm/util/x.so gcc -DHAVE_CONFIG_H -DSAWFISH -D__STRICT_ANSI__ -I. -I.. -o gtk-style gtk-style.c -lnsl gtk-style.c:23:21: error: gtk/gtk.h: No such file or directory gtk-style.c:30: error: expected ‘)’ before ‘*’ token gtk-style.c:36: error: expected declaration specifiers or ‘...’ before ‘GdkColor’ gtk-style.c: In function ‘print_colors’: gtk-style.c:43: error: ‘x’ undeclared (first use in this function) The header is present and accounted for: [01:39 alchemy:/usr/src/packages/SPECS] # l /usr/include/gtk-2.0/gtk/gtk.h -rw-r--r-- 1 root root 7381 2009-10-11 11:10 /usr/include/gtk-2.0/gtk/gtk.h The source calls the header as such: #include <stdio.h> #include "gtk/gtk.h" Umm... Why isn't it found? How to fix? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org

HI, do you have the matching *-devel packages installed? HTH, Martin ----- Original Message ----
From: David C. Rankin <drankinatty@suddenlinkmail.com> To: suse <opensuse@opensuse.org> Sent: Wed, February 24, 2010 8:43:34 AM Subject: [opensuse] AArgh! rpmbuild is so stupid at times... How to tell it gtk.h is really there?
Listmates,
Building sawfish from src.rpm and all goes well until it needs gtk/gtk.h and then the build bombs:
/usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.lai -> ./.libexec/sawfish/wm/util/x.lai /usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.o -> ./.libexec/sawfish/wm/util/x.o /usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.so -> ./.libexec/sawfish/wm/util/x.so gcc -DHAVE_CONFIG_H -DSAWFISH -D__STRICT_ANSI__ -I. -I.. -o gtk-style gtk-style.c -lnsl gtk-style.c:23:21: error: gtk/gtk.h: No such file or directory gtk-style.c:30: error: expected ‘)’ before ‘*’ token gtk-style.c:36: error: expected declaration specifiers or ‘...’ before ‘GdkColor’ gtk-style.c: In function ‘print_colors’: gtk-style.c:43: error: ‘x’ undeclared (first use in this function)
The header is present and accounted for:
[01:39 alchemy:/usr/src/packages/SPECS] # l /usr/include/gtk-2.0/gtk/gtk.h -rw-r--r-- 1 root root 7381 2009-10-11 11:10 /usr/include/gtk-2.0/gtk/gtk.h
The source calls the header as such:
#include #include "gtk/gtk.h"
Umm... Why isn't it found? How to fix?
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org

Listmates,
Building sawfish from src.rpm and all goes well until it needs gtk/gtk.h and then the build bombs:
/usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.lai -> ./.libexec/sawfish/wm/util/x.lai /usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.o -> ./.libexec/sawfish/wm/util/x.o /usr/src/packages/BUILD/sawfish-1.3.5.3/src/.libs/x.so -> ./.libexec/sawfish/wm/util/x.so gcc -DHAVE_CONFIG_H -DSAWFISH -D__STRICT_ANSI__ -I. -I.. -o gtk-style gtk-style.c -lnsl gtk-style.c:23:21: error: gtk/gtk.h: No such file or directory gtk-style.c:30: error: expected ‘)’ before ‘*’ token gtk-style.c:36: error: expected declaration specifiers or ‘...’ before ‘GdkColor’ gtk-style.c: In function ‘print_colors’: gtk-style.c:43: error: ‘x’ undeclared (first use in this function)
The header is present and accounted for:
[01:39 alchemy:/usr/src/packages/SPECS] # l /usr/include/gtk-2.0/gtk/gtk.h -rw-r--r-- 1 root root 7381 2009-10-11 11:10 /usr/include/gtk-2.0/gtk/gtk.h
The source calls the header as such:
#include <stdio.h> #include "gtk/gtk.h"
Umm... Why isn't it found? How to fix?
Because "gtk/gtk.h" is searched only in /usr/include unless there is a -I flag in the compiler command line which adds another path. However I'am not sure how to fix it. Might it be that this version of sawfish needs to be build against gtk-1 ? Then you have to install the gtk-1 development stuff , which should provide /usr/include/gtk/gtk.h. Why do you want to build sawfish-1.3.5 ? There is 1.6.1 in the repos ( Use <http://software.opensuse.org/search> to find it) If you really need to build 1.35 and it builds against gtk-2 the proper fix is to modify the src.rpm so that it adds a -I /usr/include/gtk-2.0 at the the compiler command line. As quick and dirty workaround you could try a link /usr/include/gtk->/usr/include/gtk-2.0/gtk. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org

On 02/24/2010 02:47 AM, "Markus Koßmann" wrote:
Because "gtk/gtk.h" is searched only in /usr/include unless there is a -I flag in the compiler command line which adds another path.
However I'am not sure how to fix it. Might it be that this version of sawfish needs to be build against gtk-1 ? Then you have to install the gtk-1 development stuff , which should provide /usr/include/gtk/gtk.h.
Why do you want to build sawfish-1.3.5 ? There is 1.6.1 in the repos ( Use <http://software.opensuse.org/search> to find it)
If you really need to build 1.35 and it builds against gtk-2 the proper fix is to modify the src.rpm so that it adds a -I /usr/include/gtk-2.0 at the the compiler command line. As quick and dirty workaround you could try a link /usr/include/gtk->/usr/include/gtk-2.0/gtk.
dh and I are working on a current sawfish in OBS, after testing the 1.6.1 x86_64 rpm build from the sources we collected (they bombed), I was rebuilding my working setup. I just had the 1.3.5 src.rpms handy :p 1.3.5 is a gtk-2.0 app. I agree, the problem is simple to fix, I just need -I /usr/include/gtk-2.0 at the compile line, but where do I tell rpmbuild to include it? I have tried to edit the #include "gtk/gtk.h" to "/usr/include/gtk-2.0/gtk/gtk.h", but I can't copy the modified source back into the BUILD directory at a time that prevents it from being overwritten by rpmbuild extracting the original sources again. (I guess I could repackage the source, but that seems like a cludge). I can pass configure options to rpmbuild, so I guess that's the next try. Thanks. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org

On 24/02/10 12:48, David C. Rankin wrote:
e, but where do I tell rpmbuild to include it? I have tried to edit the #include "gtk/gtk.h" to "/usr/include/gtk-2.0/gtk/gtk.h", but I can't copy the modified source back into the BUILD directory at a time that prevents it from being overwritten by rpmbuild extracting the original sources again. (I guess I could repackage the source, but that seems like a cludge).
In neither of those ways, ;) either patch the makefiles or use export CFLAGS="-I.... %optflags" argh, users are so stupid at times... ;P -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org

Hello, On Wed, 24 Feb 2010, David C. Rankin wrote:
dh and I are working on a current sawfish in OBS, after testing the 1.6.1 x86_64 rpm build from the sources we collected (they bombed), I was rebuilding my working setup. I just had the 1.3.5 src.rpms handy :p
Our sawfish-1.6.1-2.2.x86_64 works under my 11.2... (haven't used it much though).
1.3.5 is a gtk-2.0 app. I agree, the problem is simple to fix, I just need -I /usr/include/gtk-2.0 at the compile line, [..]
export CFLAGS="%{optflags} $(pkg-config --cflags gtk+-2.0)" export LDFLAGS="$(pkg-config --libs gtk+-2.0)" %configure ... (not quite sure if the configure/Makefiles honour LDFLAGS, though.) HTH, -dnh -- "Powered-up hardware and sweat do not mix." -- Simon Cozens -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org

"David C. Rankin" <drankinatty@suddenlinkmail.com> writes:
Building sawfish from src.rpm and all goes well until it needs gtk/gtk.h and then the build bombs:
...
The header is present and accounted for:
[01:39 alchemy:/usr/src/packages/SPECS] # l /usr/include/gtk-2.0/gtk/gtk.h -rw-r--r-- 1 root root 7381 2009-10-11 11:10 /usr/include/gtk-2.0/gtk/gtk.h
Strange, where did you get the srpm from? I have no problems compiling the version from the GNOME Community repo: http://download.opensuse.org/repositories/GNOME:/Community/openSUSE_11.2/src... If all else fails, try changing the line: ,---- | %__make %{?jobs:-j%jobs} `---- to ,---- | %__make -I /usr/include/gtk-2.0 %{?jobs:-j%jobs} `---- in the spec file. Charles -- "Are [Linux users] lemmings collectively jumping off of the cliff of reliable, well-engineered commercial software?" (By Matt Welsh)

David C. Rankin wrote:
Listmates,
Building sawfish from src.rpm and all goes well until it needs gtk/gtk.h and then the build bombs:
Hmm, might be related to this one: from /usr/share/doc/packages/gtk2/README.SuSE: README for bi-architecture 64 bit platforms users ================================================= Current version of GTK+ has a problem running 32 and 64 version on single machine. See http://bugzilla.gnome.org/show_bug.cgi?id=129540 and http://bugzilla.gnome.org/show_bug.cgi?id=153848 for more information. ..... This can cause problems during self-compilation of packages. Else it might be a problem of an (too old) configure script that asks for a wrong name in pkg-config and so doesn't get the right include flags.... Pit -- Dr. Peter "Pit" Suetterlin http://www.astro.su.se/~pit Institute for Solar Physics Tel.: +34 922 405 590 (Spain) P.Suetterlin@royac.iac.es +46 8 5537 8507 (Sweden) Peter.Suetterlin@astro.su.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (7)
-
"Markus Koßmann"
-
Charles Philip Chan
-
Cristian Rodríguez
-
David C. Rankin
-
David Haller
-
Martin Mielke
-
Peter Suetterlin