Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 428112 - media-libs/mesa-8.1 expects GNU dialect of indent
Summary: media-libs/mesa-8.1 expects GNU dialect of indent
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: NeedPatch, REGRESSION
: 435498 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-25 22:15 UTC by Chí-Thanh Christopher Nguyễn
Modified: 2012-11-11 00:49 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chí-Thanh Christopher Nguyễn gentoo-dev 2012-07-25 22:15:48 UTC
From bug 427952 comment 4:

sys-freebsd/freebsd-ubin provides /usr/bin/indent. dev-util/indent is a GNU fork of the original indent, which is used in *BSD. The original indent supports all of the flags used by mesa 8.1, with the exception of -bls:

http://cgit.freedesktop.org/mesa/mesa/commit/configure.ac?id=2224fb6047dd96cbc11d7f2093319e5eb49c0b6b

In the original indent, -bl/-br determine brace placement for both statements and declarations. GNU ident redefined -bl/-br to only apply to statements. GNU indent then implemented -bls/-brs and -blf/-brf to apply to struct declarations and function declarations respectively.

The ~x86-fbsd keyword never should have been in dev-util/indent. It has been dropped from the ebuild.

Instead of keywording dev-util/indent, we could modify autotools to distinguish between GNU ident and the original indent, using appropriate options for each. A quicker way of doing this would be to just patch -brs out of the current autotools check when userland_BSD is set, but that is a hack.
Comment 1 wojtek 2012-07-30 10:50:17 UTC
i probably don't understand the problem but dev-util/indent adds a lot of dependencies.

why this dependency is needed?

"check for it in configure.ac and fall back to 'cat' if it's not available"

why not use 'cat' default?
Comment 2 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-07-30 10:53:01 UTC
This bug is dealing with mesa trying to use BSD indent if available, and failing because passing unsupported options to it.

This is independent of the question whether indent should be a hard dependency or automagic.
Comment 3 Richard Yao (RETIRED) gentoo-dev 2012-07-30 11:22:06 UTC
(In reply to comment #2)
> This bug is dealing with mesa trying to use BSD indent if available, and
> failing because passing unsupported options to it.
> 
> This is independent of the question whether indent should be a hard
> dependency or automagic.

Maybe a USE flag would be appropriate. Anyway, the flag being used was introduced by the GNU project after redefining one of the existing flags to only cover a subset of its previous functionality. Omitting it on BSD platforms should produce the same output that is produced with the GNU indent.
Comment 4 Matt Turner gentoo-dev 2012-08-01 02:02:12 UTC
(In reply to comment #3)
> Maybe a USE flag would be appropriate.

No. That's an awful idea.

> Anyway, the flag being used was
> introduced by the GNU project after redefining one of the existing flags to
> only cover a subset of its previous functionality. Omitting it on BSD
> platforms should produce the same output that is produced with the GNU
> indent.

Test it and find out?
Comment 5 hiyuh 2012-08-03 08:16:33 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Maybe a USE flag would be appropriate.
> 
> No. That's an awful idea.

all user should emerge new 30 perl for just updating mesa-8.1?
only for generated code's readability?
please stop hard deps...

# emerge --oneshot --deep --newuse --update --with-bdeps=y media-libs/mesa -ptv

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild     U  ] media-libs/mesa-8.1_rc1_pre20120724 [8.0.4] USE="classic egl gallium gbm gles1 gles2 nptl openvg shared-glapi xa -bindist (-d3d) -debug -g3dvl (-llvm) (-osmesa) -pax_kernel -pic -r600-llvm-compiler% (-selinux) (-vdpau) (-wayland) -xorg% (-xvmc) (-shared-dricore%*)" VIDEO_CARDS="r200 radeon (-i915) (-i965) (-intel) -nouveau -r100 -r300 -r600 -radeonsi% (-vmware)" 4,758 kB
[ebuild  N     ]  dev-util/indent-2.2.11-r1  USE="nls" LINGUAS="ja -ca -da -de -eo -et -fi -fr -gl -hu -it -ko -nl -pl -pt_BR -ru -sk -sv -tr -zh_TW" 761 kB
[ebuild  N     ]   app-text/texi2html-5.0-r1  USE="unicode" 15,037 kB
[ebuild  N     ]    dev-perl/Unicode-EastAsianWidth-1.320.0  29 kB
[nomerge       ] perl-core/CPAN-Meta-2.120.921
[nomerge       ]  virtual/perl-ExtUtils-MakeMaker-6.620.0
[nomerge       ]   perl-core/ExtUtils-MakeMaker-6.620.0-r1
[ebuild  N     ]    virtual/perl-CPAN-Meta-2.120.921  0 kB
[ebuild  N     ]     perl-core/CPAN-Meta-2.120.921  75 kB
[ebuild  N     ]      virtual/perl-ExtUtils-MakeMaker-6.620.0  0 kB
[ebuild  N     ]       perl-core/ExtUtils-MakeMaker-6.620.0-r1  406 kB
[nomerge       ] x11-base/xorg-server-1.12.3  USE="nptl udev xorg -dmx -doc -ipv6 -kdrive -minimal (-selinux) -static-libs -tslib -xnest -xvfb"
[nomerge       ]  x11-base/xorg-drivers-1.12  INPUT_DEVICES="evdev keyboard mouse -acecad -aiptek -elographics -fpit -hyperpen -joystick -mutouch -penmount -synaptics -tslib (-vmmouse) -void -wacom" VIDEO_CARDS="fbdev radeon (-apm) (-ark) (-ast) -cirrus -dummy -epson (-fglrx) (-geode) -glint (-i128) (-i740) (-intel) -mach64 -mga -modesetting (-neomagic) (-newport) -nouveau -nv (-nvidia) (-omapfb) (-qxl) -r128 -s3 -s3virge -savage (-siliconmotion) (-sis) (-sunbw2) (-suncg14) (-suncg3) (-suncg6) (-sunffb) (-sunleo) (-suntcx) -tdfx (-tga) -trident -v4l (-vesa) (-via) (-virtualbox) (-vmware) (-voodoo)"
[nomerge       ]   x11-drivers/xf86-video-ati-6.14.4-r1
[ebuild     U  ]    x11-libs/libdrm-2.4.37 [2.4.33] USE="libkms -static-libs" VIDEO_CARDS="radeon (-exynos) (-intel) -nouveau (-omap) (-vmware)" 493 kB
[nomerge       ] perl-core/ExtUtils-MakeMaker-6.620.0-r1
[ebuild  N     ]  virtual/perl-ExtUtils-Command-1.170.0-r3  0 kB
[ebuild  N     ]  virtual/perl-ExtUtils-Install-1.54  0 kB
[ebuild  N     ]   perl-core/ExtUtils-Install-1.54  66 kB
[ebuild  N     ]  virtual/perl-ExtUtils-Manifest-1.600.0  0 kB
[ebuild  N     ]   perl-core/ExtUtils-Manifest-1.600.0  28 kB
[nomerge       ] perl-core/CPAN-Meta-2.120.921
[ebuild  N     ]  virtual/perl-File-Temp-0.220.0-r2  0 kB
[ebuild  N     ]  virtual/perl-IO-1.25  0 kB
[ebuild  N     ]   perl-core/IO-1.25  52 kB
[ebuild  N     ]  virtual/perl-Test-Simple-0.980.0-r2  0 kB
[ebuild  N     ]  virtual/perl-CPAN-Meta-Requirements-2.122.0  0 kB
[ebuild  N     ]   perl-core/CPAN-Meta-Requirements-2.122.0  21 kB
[ebuild  N     ]    virtual/perl-Scalar-List-Utils-1.250.0  0 kB
[ebuild  N     ]     perl-core/Scalar-List-Utils-1.250.0  66 kB
[ebuild  N     ]  virtual/perl-Parse-CPAN-Meta-1.440.400  0 kB
[ebuild  N     ]   perl-core/Parse-CPAN-Meta-1.440.400  8 kB
[ebuild  N     ]    virtual/perl-CPAN-Meta-YAML-0.8.0  0 kB
[ebuild  N     ]     perl-core/CPAN-Meta-YAML-0.8.0  31 kB
[ebuild  N     ]  virtual/perl-File-Spec-3.330.0-r1  0 kB
[ebuild  N     ]   perl-core/File-Spec-3.330.0  132 kB
[nomerge       ] app-text/texi2html-5.0-r1  USE="unicode"
[ebuild  N     ]  dev-perl/libintl-perl-1.200.0  489 kB
[ebuild  N     ]  dev-perl/Text-Unidecode-0.40.0  101 kB
[nomerge       ] perl-core/CPAN-Meta-2.120.921
[ebuild  N     ]  virtual/perl-version-0.990.0-r1  0 kB
[ebuild  N     ]  virtual/perl-JSON-PP-2.272.0-r1  0 kB

Total: 32 packages (2 upgrades, 30 new), Size of downloads: 22,545 kB
Comment 6 Matt Turner gentoo-dev 2012-08-03 21:56:02 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Maybe a USE flag would be appropriate.
> > 
> > No. That's an awful idea.
> 
> all user should emerge new 30 perl for just updating mesa-8.1?
> only for generated code's readability?
> please stop hard deps...

I didn't claim a hard dep was the right thing to do. Re-read what I said.
Comment 7 Matt Turner gentoo-dev 2012-08-11 17:59:59 UTC
indent dependency removed, since it only indents compiled code and not installed headers.

Still have the problem of bsd indent not handling -bls.
Comment 8 Richard Yao (RETIRED) gentoo-dev 2012-08-12 01:45:29 UTC
(In reply to comment #7)
> indent dependency removed, since it only indents compiled code and not
> installed headers.
> 
> Still have the problem of bsd indent not handling -bls.

The version of indent in FreeBSD is a standard utility that is available across a wide range of UNIX platforms. In the original indent, -bs implies the GNU -bls. GNU ident requires -bls when -bs is specified to make it behave like the original. The FreeBSD developers think that packages using -bls should be patched to only pass it when GNU indent is used.
Comment 9 Matt Turner gentoo-dev 2012-08-12 04:01:31 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > indent dependency removed, since it only indents compiled code and not
> > installed headers.
> > 
> > Still have the problem of bsd indent not handling -bls.
> 
> The version of indent in FreeBSD is a standard utility that is available
> across a wide range of UNIX platforms. In the original indent, -bs implies
> the GNU -bls. GNU ident requires -bls when -bs is specified to make it
> behave like the original. The FreeBSD developers think that packages using
> -bls should be patched to only pass it when GNU indent is used.

Okay, let me explain. The code is generated by some python scripts and run through indent so that it may be readable when packaged into the release tarballs.

It's not important for the build. It's not important to make it work on *BSD since no one doing the packaging will care about packing *on* BSD.

All you need to do is put 'INDENT=cat' before the configure invocation to avoid using BSD indent.
Comment 10 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-09-19 11:09:43 UTC
*** Bug 435498 has been marked as a duplicate of this bug. ***
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2012-09-25 03:46:35 UTC
(In reply to comment #9)
> All you need to do is put 'INDENT=cat' before the configure invocation to
> avoid using BSD indent.

Agreed. Or at a greater cost:

--- configure.ac.org    2012-08-14 19:54:39.000000000 +0200
+++ configure.ac        2012-09-25 05:45:06.507808646 +0200
@@ -64,7 +64,7 @@
 
 AC_PATH_PROG([PERL], [perl])
 
-AC_CHECK_PROG(INDENT, indent, indent, cat)
+AC_CHECK_PROG(INDENT, cat, cat, cat)
 if test "x$INDENT" != "xcat"; then
     AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool')
 fi

:)
Comment 12 Naohiro Aota gentoo-dev 2012-10-03 11:12:24 UTC
I'm considering to add this patch to the ebuilds for a workaround...:

diff --git a/media-libs/mesa/mesa-9.0_pre20120918.ebuild b/media-libs/mesa/mesa-9.0_pre20120918.ebuild
index 3034e41..9464eff 100644
--- a/media-libs/mesa/mesa-9.0_pre20120918.ebuild
+++ b/media-libs/mesa/mesa-9.0_pre20120918.ebuild
@@ -250,6 +250,8 @@ src_configure() {
                "
        fi
 
+       use userland_GNU || export INDENT=cat
+
        econf \
                --enable-dri \
                --enable-glx \
Comment 13 Matt Turner gentoo-dev 2012-10-03 17:12:45 UTC
(In reply to comment #12)
> I'm considering to add this patch to the ebuilds for a workaround...:
> 
> diff --git a/media-libs/mesa/mesa-9.0_pre20120918.ebuild
> b/media-libs/mesa/mesa-9.0_pre20120918.ebuild
> index 3034e41..9464eff 100644
> --- a/media-libs/mesa/mesa-9.0_pre20120918.ebuild
> +++ b/media-libs/mesa/mesa-9.0_pre20120918.ebuild
> @@ -250,6 +250,8 @@ src_configure() {
>                 "
>         fi
>  
> +       use userland_GNU || export INDENT=cat
> +
>         econf \
>                 --enable-dri \
>                 --enable-glx \

That seems perfectly fine. Feel free to commit this (and make sure to commit to the x11 overlay or have someone commit it for you)
Comment 14 Naohiro Aota gentoo-dev 2012-10-05 06:11:14 UTC
(In reply to comment #13)
> That seems perfectly fine. Feel free to commit this (and make sure to commit
> to the x11 overlay or have someone commit it for you)

Thanks. I've modified the ebuild to use cat for INDENT in the main tree. Since I don't have permission to change x11 overlay, could you commit to the x11 tree please?
Comment 15 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-11-11 00:49:30 UTC
Fix pushed to x11 overlay.