Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Trouble emerging Midori, with proposed solution/workaround
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
run4flat
n00b
n00b


Joined: 11 Dec 2008
Posts: 9

PostPosted: Sun Dec 28, 2008 7:25 am    Post subject: Trouble emerging Midori, with proposed solution/workaround Reply with quote

I had trouble emerging Midori web browser and I hope what I figured out can help others. I didn't find this problem elsewhere on the net, so maybe I had a unique set of issues. Anyway, here was my error:
Code:
WARN: setup
Note: this software is not yet in a too mature status so expect some minor things to break

ERROR: compile

ERROR: www-client/midori-9999 failed.
Call stack:
              ebuild.sh, line   49:  Called src_compile
            environment, line 2146:  Called die
The specific snippet of code:
      ./waf --prefix="/usr/" configure || die "waf configure failed.";
 The die message:
  waf configure failed.

If you need support, post the topmost build error, and the call stack if relevant.
A complete build log is located at '/var/tmp/portage/www-client/midori-9999/temp/build.log'.
The ebuild environment file is located at '/var/tmp/portage/www-client/midori-9999/temp/environment'.


To solve the problem, I also needed the traceback:
Code:
Traceback (most recent call last):
  File "./waf", line 141, in ?
    Scripting.prepare()
  File "/var/tmp/portage/www-client/midori-9999/work/midori-9999/.waf-1.4.4-8fadb97cd069d800c8aee7b24c9ec1ea/wafadmin/Scripting.py", line 168, in prepare
    Utils.set_main_module(os.path.join(candidate,WSCRIPT_FILE))
  File "/var/tmp/portage/www-client/midori-9999/work/midori-9999/.waf-1.4.4-8fadb97cd069d800c8aee7b24c9ec1ea/wafadmin/Utils.py", line 105, in set_main_module
    g_module=load_module(file_path,'wscript_main')
  File "/var/tmp/portage/www-client/midori-9999/work/midori-9999/.waf-1.4.4-8fadb97cd069d800c8aee7b24c9ec1ea/wafadmin/Utils.py", line 98, in load_module
    exec file in module.__dict__
  File "/var/tmp/portage/www-client/midori-9999/work/midori-9999/wscript", line 298
    finally:
          ^
SyntaxError: invalid syntax


This error is caused by a compound try-except-finally construction. It turns out that Python 2.4 (which was my installed version) does not allow try-except-finally compound statements, and the try-except must be wrapped in a try-finally statement. As of the time of this writing, python 2.6 allows such compound statements but gentoo does not have python 2.6 in its main portage tree, only python 2.5.
Edit: Higher versions of python are included in the portage tree, they're just masked. /Edit

As pointed out in the traceback, this gives trouble with the file wscript. To fix this, I applied the included patch (at the end of the post) to the wscript file, located at /var/tmp/portage/www-client/midori-9999/work/midori-9999/wscript and then followed the instructions detailed in the INSTALL file in the same directory to compile and install Midori. In case it's not clear, the patch does precisely what the previous paragraph describes: it wraps the try-except block within a try-finally block.

Hope that helps some.
David

patch.wscript:
Code:
--- wscript   2008-12-28 00:42:39.000000000 -0600
+++ wscript_new   2008-12-28 00:55:24.000000000 -0600
@@ -284,17 +284,18 @@
         pre = open (desktop + '.in')
         after = open (folder + '/' + desktop, 'w')
         try:
-            for line in pre:
-                if line != '':
-                    if line[0] == '_':
-                        after.write (line[1:])
-                    else:
-                        after.write (line)
-            after.close ()
-            Params.pprint ('BLUE', desktop + '.in -> ' + desktop)
-            _install_files ('DATADIR', 'applications', folder + '/' + desktop)
-        except:
-            Params.pprint ('BLUE', 'File ' + desktop + ' not generated')
+            try:
+                for line in pre:
+                    if line != '':
+                        if line[0] == '_':
+                            after.write (line[1:])
+                        else:
+                            after.write (line)
+                after.close ()
+                Params.pprint ('BLUE', desktop + '.in -> ' + desktop)
+                _install_files ('DATADIR', 'applications', folder + '/' + desktop)
+            except:
+                Params.pprint ('BLUE', 'File ' + desktop + ' not generated')
         finally:
             pre.close ()


Last edited by run4flat on Thu Jan 01, 2009 3:29 am; edited 1 time in total
Back to top
View user's profile Send private message
Abraxas
l33t
l33t


Joined: 25 May 2003
Posts: 807

PostPosted: Sun Dec 28, 2008 9:36 pm    Post subject: Reply with quote

What version of webkit-gtk are you using? I just built midori again yesterday against a current version of webkit with python 2.5 and it worked without a hitch.
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Mon Dec 29, 2008 10:44 pm    Post subject: Re: Trouble emerging Midori, with proposed solution/workarou Reply with quote

run4flat wrote:
It turns out that Python 2.4 (which was my installed version) does not allow try-except-finally compound statements, and the try-except must be wrapped in a try-finally statement. As of the time of this writing, python 2.6 allows such compound statements but gentoo does not have python 2.6 in its main portage tree, only python 2.5.

Actually, 2.6.1 is in portage, but it is masked.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
run4flat
n00b
n00b


Joined: 11 Dec 2008
Posts: 9

PostPosted: Thu Jan 01, 2009 3:28 am    Post subject: Reply with quote

@ yngwin - Yep, sorry for the error; it's in the tree, just masked. Thanks for the clarification. (After posting this, I'll correct that statement.)
@ Abraxas - My version of webkit-gtk is 0_p37894. I unmasked the highest available versinon, which might explain why I had trouble. Here's the relevant part of my package.keywords:
Code:
www-client/midori **
net-libs/webkit-gtk **


That may have led to issues.

David
Back to top
View user's profile Send private message
Abraxas
l33t
l33t


Joined: 25 May 2003
Posts: 807

PostPosted: Fri Jan 02, 2009 12:48 am    Post subject: Reply with quote

run4flat wrote:
@ yngwin - Yep, sorry for the error; it's in the tree, just masked. Thanks for the clarification. (After posting this, I'll correct that statement.)
@ Abraxas - My version of webkit-gtk is 0_p37894. I unmasked the highest available versinon, which might explain why I had trouble. Here's the relevant part of my package.keywords:
Code:
www-client/midori **
net-libs/webkit-gtk **


That may have led to issues.

David


I have an ebuild that download the latest source and builds it. You should probably try a newer webkit. The easiest way is to just change the ebuild name to the latest nightly build number available on webkit.org.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum