Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 290410 - x11-libs/libXaw3d: switch from imake to autotools
Summary: x11-libs/libXaw3d: switch from imake to autotools
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Matt Turner
URL:
Whiteboard: x11 overlay
Keywords: InOverlay
Depends on:
Blocks: 221417 289296
  Show dependency tree
 
Reported: 2009-10-24 21:10 UTC by David Leverton
Modified: 2012-01-22 01:49 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
configure.ac (configure.ac,213 bytes, text/plain)
2009-10-24 21:11 UTC, David Leverton
Details
Makefile.am (Makefile.am,2.95 KB, text/plain)
2009-10-24 21:13 UTC, David Leverton
Details
Xaw3d-1.5-r1.ebuild.patch (Xaw3d-1.5-r1.ebuild.patch,1.79 KB, patch)
2009-10-24 21:18 UTC, David Leverton
Details | Diff
patch for lexer/parser (lexer-parser.patch,1.74 KB, patch)
2009-10-25 01:52 UTC, Rafał Mużyło
Details | Diff
my configure.ac (Xaw3d-configure.ac,673 bytes, text/plain)
2009-10-25 01:55 UTC, Rafał Mużyło
Details
my Makefile.am (Xaw3d-Makefile.am,1.77 KB, text/plain)
2009-10-25 02:34 UTC, Rafał Mużyło
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Leverton 2009-10-24 21:10:39 UTC
imake will be removed, according to bug 289296
Comment 1 David Leverton 2009-10-24 21:11:18 UTC
Created attachment 208157 [details]
configure.ac
Comment 2 David Leverton 2009-10-24 21:13:30 UTC
Created attachment 208158 [details]
Makefile.am

The huge long list of -D flags is to replace the sed usage in the Imakefile, to change yy* identifiers to LayYY* (I only changed the ones that show up as visible symbols in the final library).  If anyone knows a nicer way to do this in autotools, let me know.
Comment 3 David Leverton 2009-10-24 21:18:35 UTC
Created attachment 208160 [details, diff]
Xaw3d-1.5-r1.ebuild.patch

Ebuild patch (some of the deps are gone because they're not actually used, they were just pulled in by imake because it's stupid)
Comment 4 David Leverton 2009-10-24 21:19:37 UTC
The ebuild patch also adds the proper flex dependency, per bug 221417
Comment 5 Rafał Mużyło 2009-10-25 01:49:00 UTC
(In reply to comment #2)
> The huge long list of -D flags is to replace the sed usage in the Imakefile, to
> change yy* identifiers to LayYY* (I only changed the ones that show up as
> visible symbols in the final library).  If anyone knows a nicer way to do this
> in autotools, let me know.
> 
You're right, plain ugly.
I don't know much about flex/bison, but following files/changes seem to work for me.
Consider those: AFAICT, it should produce a lib with a nearly same output,
as far as defined symbols go.
Comment 6 Rafał Mużyło 2009-10-25 01:52:22 UTC
Created attachment 208166 [details, diff]
patch for lexer/parser

This adds prefix and ansifies those two files
(most of X gone through ansifying, so it shouldn't be a problem).
Comment 7 Rafał Mużyło 2009-10-25 01:55:30 UTC
Created attachment 208168 [details]
my configure.ac

More or less the same.
Comment 8 Rafał Mużyło 2009-10-25 02:34:50 UTC
Created attachment 208170 [details]
my Makefile.am

As you may see in this file, configure.ac need bit more work
- probably a modified check for wchar.h, so that extra define can leave
Makefile.am.
Comment 9 Rafał Mużyło 2009-10-25 02:37:09 UTC
And la file needs to be removed, of course.
Comment 10 Rémi Cardona (RETIRED) gentoo-dev 2009-10-25 07:38:51 UTC
Officially, this is x11 but to be honest, I have no interest in Xaw3d as it's not even part of X.org. I'd be more than happy to hand over maintainership so that you guys can make the modifications that you want.

Just make sure that users of Xaw3d (emacs comes to mind) still work with that.

I would suggest you import the current Xaw3d code into a git repo and work on that instead. Then I suggest applying for a FreeDesktop account to host it closer to X.org.

Cheers
Comment 11 Rémi Cardona (RETIRED) gentoo-dev 2009-10-25 07:50:37 UTC
Now on to the patches themselves :

configure.ac:
 PKG_CHECK_MODULES(X11, [x11, xt, xmu]) should be PKG_CHECK_MODULES(X11, [x11 xt xmu]) (no comas in the second argument)

Makefile.am:
 -DHAS_WCHAR_H <= should be defined by configure.ac
 ${X11_LIBS} is wrong, it should be $(X11_LIBS) or @X11_LIBS@

Cheers
Comment 12 Rémi Cardona (RETIRED) gentoo-dev 2009-10-25 07:54:49 UTC
Reassigning :)
Comment 13 David Leverton 2009-10-25 10:42:44 UTC
(In reply to comment #6)
> This adds prefix and ansifies those two files
> (most of X gone through ansifying, so it shouldn't be a problem).

I was trying to keep my changes to the build system, but yeah, if there's no way to do it just in automake, this is probably a better approach.  It does seem to miss a lot, though (seemingly the ones defined by the lexer):

[dleverton@shiny-one ~] $ nm -D /usr/lib64/libXaw3d.so | grep -i yy
0000000000257cc0 B LayYYchar
0000000000042110 T LayYYerror
                 U LayYYlex
0000000000257cd0 B LayYYlval
0000000000257ce8 B LayYYnerrs
00000000000413a0 T LayYYparse
0000000000041390 T LayYYsetdest
0000000000042100 T LayYYsetsource
0000000000041380 T LayYYwrap
00000000000428a0 T yy_create_buffer
0000000000042200 T yy_delete_buffer
0000000000257c60 B yy_flex_debug
0000000000041fd0 T yy_flush_buffer
0000000000042670 T yy_scan_buffer
0000000000042730 T yy_scan_bytes
00000000000427d0 T yy_scan_string
00000000000425c0 T yy_switch_to_buffer
00000000000423f0 T yyalloc
00000000000421f0 T yyfree
00000000000420e0 T yyget_debug
0000000000042070 T yyget_in
0000000000042090 T yyget_leng
0000000000042060 T yyget_lineno
0000000000042080 T yyget_out
00000000000420a0 T yyget_text
0000000000257c50 B yyin
0000000000257cf0 B yyleng
0000000000042a20 T yylex
0000000000042320 T yylex_destroy
00000000002579f4 D yylineno
0000000000257c58 B yyout
0000000000042270 T yypop_buffer_state
0000000000042500 T yypush_buffer_state
00000000000423e0 T yyrealloc
0000000000042930 T yyrestart
00000000000420f0 T yyset_debug
00000000000420c0 T yyset_in
00000000000420b0 T yyset_lineno
00000000000420d0 T yyset_out
0000000000257cf8 B yytext
                 U yywrap

> +%name-prefix "LayYY"

Needs a = there, at least for bison 2.3

(In reply to comment #7)
> AC_CONFIG_MACRO_DIR([m4])

I don't see the point of that, and it makes aclocal fail unless the directory is created beforehand.

> AC_CHECK_HEADERS([stdlib.h string.h wchar.h wctype.h])
> AC_CHECK_FUNCS([bzero isascii memmove strchr strerror])

Are any of these checks actually used by the code?  A quick grep for HAVE_ reveals nothing.

(In reply to comment #8)
> libXaw3d_la_CPPFLAGS = -I. -DARROW_SCROLLBAR -DUSEGRAY -DHAS_WCHAR_H

Is -I. necessary?

> libXaw3d_la_LDFLAGS = -version-info 8:0

-version-number is possibly better when trying to match the existing library versioning, but in this case it works out the same.

> libXaw3d_ladir = $(includedir)/X11/Xaw3d

That variable name is quite confusing....

> ACLOCAL_AMFLAGS = -I m4

See above, although it doesn't seem to break anything this time.

(In reply to comment #11)
> configure.ac:
>  PKG_CHECK_MODULES(X11, [x11, xt, xmu]) should be PKG_CHECK_MODULES(X11, [x11
> xt xmu]) (no comas in the second argument)

Oops.

> Makefile.am:
>  -DHAS_WCHAR_H <= should be defined by configure.ac

That's not part of mine (probably because I forgot it, not because I don't think it should be there), but I was trying for the minimal autotools usage to make it build from the ebuild.  Doing it "properly" would take a bit more work.

>  ${X11_LIBS} is wrong, it should be $(X11_LIBS) or @X11_LIBS@

${} is legal in Makefiles, although $() is more common.

Another problem I just noticed is that this fails on a fresh install, because it tries to include its own headers as X11/Xaw3d/....  I'll try and come up with a fix for that.
Comment 14 David Leverton 2009-10-25 10:59:47 UTC
(In reply to comment #13)
> Another problem I just noticed is that this fails on a fresh install, because
> it tries to include its own headers as X11/Xaw3d/....  I'll try and come up
> with a fix for that.

Adapted slightly from the current ebuild, I added
    mkdir X11 || die "mkdir failed"
    ln -s .. X11/Xaw3d || die "ln failed"

Also, dependencies on libXext and xproto should be added to RDEPEND (xproto in RDEPEND because some of Xaw3d's headers include Xfuntproto.h) and xextproto to DEPEND, plus the appropriate pkgconfig invocation in configure.ac

(In reply to comment #9)
> And la file needs to be removed, of course.

I don't think it's worth going to any effort for this, it's not hurting anything in any way.
Comment 15 Rafał Mużyło 2009-10-25 14:34:36 UTC
As for the missing symbols, I was getting better matches 
with '%option prefix="LayYY"' in laylex.l, but that didn't work well with ylwrap.
Anyway, those symbols should not be exported anyway,
but it was probably to hard to do with imake, that's why LayYY came up.

'%name-prefix "LayYY"' doesn't need '=' in 2.4.1.

As for la file, if there was none before, there's no need for it now.
Other packages tend to remove them.

'-I.' will be needed for that link hack, so it includes those from
sources, not system.

'-DHAS_WCHAR_H' was in Makefile created by imake (on my system),
but yes, should be an autoconf check.
Comment 16 Matt Turner gentoo-dev 2011-07-30 05:19:51 UTC
I've pushed this to

http://cgit.freedesktop.org/~mattst88/libXaw3d/

from where I hope to make it an official project on freedesktop.org.
Comment 17 Matt Turner gentoo-dev 2011-08-02 04:57:56 UTC
(In reply to comment #16)
> I've pushed this to
> 
> http://cgit.freedesktop.org/~mattst88/libXaw3d/
> 
> from where I hope to make it an official project on freedesktop.org.

Based on this, I've added a libXaw3d-9999.ebuild to the X11 overlay. I'll rename Xaw3d in the tree to libXaw3d as well to fit with the other x11-libs/.
Comment 18 Matt Turner gentoo-dev 2011-08-02 06:13:38 UTC
Renamed from Xaw3d to libXaw3d.
Comment 19 Matt Turner gentoo-dev 2012-01-22 01:49:54 UTC
I released libXaw3d-1.6 upstream and bumped it in portage.

This is finally fixed!

Thanks a lot!