Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 571734 - media-sound/ardour-4.6: sed fails. configure also fails when Python3 default
Summary: media-sound/ardour-4.6: sed fails. configure also fails when Python3 default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andreas Schürch
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-13 11:43 UTC by wjn
Modified: 2016-01-14 06:20 UTC (History)
2 users (show)

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


Attachments
various_ardour-4.6.ebuild_fixes.patch (file_571734.txt,1.57 KB, patch)
2016-01-13 21:03 UTC, Greg Turner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wjn 2016-01-13 11:43:55 UTC
1. sed fails 

----
$ sudo ebuild ardour-4.6.ebuild prepare
 * ardour-4.6.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                [ ok ]
>>> Unpacking source...
>>> Unpacking ardour-4.6.tar.gz to /var/tmp/portage/media-sound/ardour-4.6/work
>>> Source unpacked in /var/tmp/portage/media-sound/ardour-4.6/work
>>> Preparing source in /var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6 ...
 * Applying ardour-4.x-revision-naming.patch ...                         [ ok ]
sed: -e expression #1, char 41: `s' コマンドが終了していません
 * Fixing shebang in /var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/wscript.
 * Fixing shebang in /var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/waf.
>>> Source prepared.
----

ardour-4.6.ebuild:

>         sed 's/flag_line\ =\ o.*/flag_line\ =\ \": '${OPTFLAGS}' just some place holders\"/' \
>         -i "${S}"/wscript

above is fails.

e.g.

         sed 's/flag_line\ =\ o.*/flag_line\ =\ \": '"${OPTFLAGS}"' just some place holders\"/' \
         -i "${S}"/wscript

will go.
(space charcters should be parsed correctly.)


2. src_configure fails when Python 3.5 is default

> >>> Configuring source in /var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6 ...
> CCFLAGS="-march=native -O3 -pipe -w -fomit-frame-pointer -lboost_system" LINKFLAGS="-march=native -O3 -pipe -w -fomit-frame-pointer -lboost_system -Wl,-O3,--sort-common,--as-needed,-z,now" "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/waf" --prefix=/usr --libdir=/usr/lib64 --destdir=/var/tmp/portage/media-sound/ardour-4.6/image/ --prefix=/usr --configdir=/etc --nls --optimize --with-backends=alsa,jack --lv2 --fpu-optimization configure
> Setting top to                           : /var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6 
> Setting out to                           : /var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/build 
> Checking for 'gcc' (c compiler)          : x86_64-pc-linux-gnu-gcc 
> Checking for 'g++' (c++ compiler)        : x86_64-pc-linux-gnu-g++ 
> 
> Global Configuration 
>  * Install prefix                                    : /usr 
>  * Debuggable build                                  : False 
>  * Build documentation                               : False 
> 
> Ardour Configuration 
>  * Will build against private GTK dependency stack   : no 
>  * Will rely on libintl built into libc              : yes 
>  * Will build against private Ardour dependency stack : no 
> Traceback (most recent call last):
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Scripting.py", line 97, in waf_entry_point
>     run_commands()
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Scripting.py", line 151, in run_commands
>     run_command(cmd_name)
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Scripting.py", line 143, in run_command
>     ctx.execute()
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Configure.py", line 128, in execute
>     super(ConfigurationContext,self).execute()
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Context.py", line 87, in execute
>     self.recurse([os.path.dirname(g_module.root_path)])
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Context.py", line 128, in recurse
>     user_function(self)
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/wscript", line 919, in configure
>     conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL')
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Configure.py", line 221, in fun
>     return f(*k,**kw)
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Tools/c_config.py", line 461, in check_cc
>     return self.check(*k,**kw)
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Configure.py", line 221, in fun
>     return f(*k,**kw)
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Tools/c_config.py", line 366, in check
>     ret=self.run_c_code(*k,**kw)
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Configure.py", line 221, in fun
>     return f(*k,**kw)
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Tools/c_config.py", line 445, in run_c_code
>     bld.compile()
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Build.py", line 188, in compile
>     self.store()
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Utils.py", line 310, in f
>     ret=fun(*k,**kw)
>   File "/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6/.waf3-1.6.11-dd5a1e1fe94b4aa17a652d5945db5927/waflib/Build.py", line 162, in store
>     cPickle.dump(data,f)
> AttributeError: Can't pickle local object 'Context.__init__.<locals>.node_class'
> Checking for function dlopen                         :  * ERROR: media-sound/ardour-4.6::gentoo failed (configure phase):
>  *   configure failed
>  * 
>  * Call stack:
>  *     ebuild.sh, line  133:  Called src_configure
>  *   environment, line 3359:  Called waf-utils_src_configure '--destdir=/var/tmp/portage/media-sound/ardour-4.6/image/' '--prefix=/usr' '--configdir=/etc' '--nls' '--optimize' '--with-backends=alsa,jack' '--lv2' '--fpu-optimization'
>  *   environment, line 4125:  Called die
>  * The specific snippet of code:
>  *           CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}" "${WAF_BINARY}" "--prefix=${EPREFIX}/usr" "${libdir}" "$@" configure || die "configure failed";
>  * 
>  * If you need support, post the output of `emerge --info '=media-sound/ardour-4.6::gentoo'`,
>  * the complete build log and the output of `emerge -pqv '=media-sound/ardour-4.6::gentoo'`.
>  * The complete build log is located at '/var/tmp/portage/media-sound/ardour-4.6/temp/build.log'.
>  * The ebuild environment file is located at '/var/tmp/portage/media-sound/ardour-4.6/temp/environment'.
>  * Working directory: '/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6'
>  * S: '/var/tmp/portage/media-sound/ardour-4.6/work/ardour-4.6'


I think shebangs of "${S}/waf" and "${S}/wscript" should be fixed.

e.g. 

EPYTHON='python2.7'

 -- ( snip ) --

python_fix_shebang "${S}"/wscript
python_fix_shebang "${S}"/waf


Reproducible: Always
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-01-13 12:02:13 UTC
@ proaudio project: please add "|| die" to each sed command. This is qa relevant.
Comment 2 Andreas Schürch gentoo-dev 2016-01-13 16:40:56 UTC
Thanks for reporting wjn!
1)
It looks like that $OPTFLAGS variable got some nice cultural influence from Japan! :-)
Have you set something in CPU_FLAGS_X86 in make.conf?
Do you get better results if you just set CPU_FLAGS_X86="sse"?
Can you please also post the output of "emerge --info"?
...I guess it will be enough to just set OPTFLAGS="" at the start of src_prepare(). But to get sure please post the above output anyway...
2)
I can't reproduce it atm, as I don't have python-3.5 around yet...
But your proposal sounds good imho, as that would also work around Bug #566866
I will have a look at it.

Thanks also for the input Lars! :-)
Comment 3 Greg Turner 2016-01-13 20:37:36 UTC
(In reply to wjn from comment #0)
> 1. sed fails 

Thanks for tracking this down!
 
> 2. src_configure fails when Python 3.5 is default

To be clear, this occurs when python35 is eselect-python-ed.

This ebuild doesn't get the magic PYTHON_TARGETS USE_EXPAND behavior that otherp python-any-r1 ebuilds do because the magic happens in python-any-r1_pkg_setup but the ebuild implement that to and never calls the overridden inherited* implementation.

So, even if it's not strictly orthogonal to issue #1, I'd strongly opine that the following patch should be applied in addition to the fix described by OP:

--- media-sound/ardour/ardour-4.6.ebuild.orig   2016-01-13 12:13:45.833062068 -0800
+++ media-sound/ardour/ardour-4.6.ebuild        2016-01-13 12:12:29.333885416 -0800
@@ -73,6 +73,7 @@ pkg_setup() {
        if has_version \>=dev-libs/libsigc++-2.6 ; then
                append-cxxflags -std=c++11
        fi
+       python-any-r1_pkg_setup
 }
 
 src_prepare(){

--------------------------

* fairly pointless TLDR terminologico-anal digression: OOP terminology like "overridden" arguably do not apply to eclasses because they are not classes.  But, they are called eclasses and the word "inherit" is used to establish the relationship I am describing... so what is the right word for the implementation we blew away with this function?  IMO it's fine, so long as we all remember we are speaking metaphorically, and that the key to not overextending this particular metaphor is to never ask: "if these are the 'eclasses,' where are the 'eobjects?'"
Comment 4 Greg Turner 2016-01-13 21:03:31 UTC
Created attachment 422836 [details, diff]
various_ardour-4.6.ebuild_fixes.patch

(In reply to Andreas Schürch from comment #2)
> Thanks for reporting wjn!
> 1)
> It looks like that $OPTFLAGS variable got some nice cultural influence from
> Japan! :-)

I don't think that's it.  Unless I got some sort of anime virus :)

The actual problem reported is unterminated sed command @ character 41, for me.

My OPTFLAGS="sse mmx" at that point in the ebuild (I added an ewarn to be sure) so thats...
                                         V
0123456789.11.14.17.20.23.26.29.32.35.38.41
s/flag_line\ =\ o.*/flag_line\ =\ \": sse mmx just some place holders\"

uhh... *blink*... *ponder*

Ooooh, haha.  We are just paying the standard bash word-splitting sanity-tax on this one.

Once we dequote we never re-quote so "mmx" is the beginning of a new argument to sed.... so here's a patch with that fixed, and my patch, plus everyone else's ideas (they all LGTM), put together.
Comment 5 Andreas Schürch gentoo-dev 2016-01-14 06:20:47 UTC
Ok, I've seen the things now and committed the fixes in the 4.6 and 9999 ebuilds.
Thanks all!