LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-01-2009, 06:17 PM   #1
GazL
Senior Member
 
Registered: May 2008
Posts: 3,323

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Opera10 64bit Java fix for SBO slackbuild.


I was just trying out the slackbuilds.org build for Opera10 and found that it wouldn't run any java on my Slack64 13.0 box.

I used this page to test it. (Sun's example 'Clock' applet)


Anyway, I tracked the issue down and came up with a patch which I'll throw up here in case anyone else is interested.

Code:
# diff -u opera.SlackBuild.orig opera.SlackBuild
--- opera.SlackBuild.orig       2009-10-01 20:10:38.901539774 +0100
+++ opera.SlackBuild    2009-10-01 23:46:03.836031043 +0100
@@ -27,7 +27,7 @@
 VERSION=10.00
 ARCH=${ARCH:-x86_64}
 
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
 TAG=${TAG:-_SBo}
 
 CWD=$(pwd)
@@ -76,7 +76,13 @@
 # recreates the directory and does some unknown havoc.  It may very well be
 # completely safe and unexploitable and I'm just being Chicken Little here,
 # but it's easy enough to fix and I'd rather be safe than sorry.  --rworkman
-sed -i "s%$TMP/$TOPDIR%/usr/bin/%g" $PKG/usr/bin/opera
+sed -i "s%$TMP/$TOPDIR\$0%\$PWD/\${0#./}%g" $PKG/usr/bin/opera
+
+#  /usr/bin/opera doesn't look in the right places for 64bit java. Fix it.
+if [ "$ARCH" = "x86_64" ]; then
+sed -i -e "/PREFIXES=\"/,/\/opt\"/ s:/usr/lib:/usr/lib64:" \
+       -e "s:i386:amd64:" $PKG/usr/bin/opera
+fi
 
 # Include config files
 mv etc $PKG
It also fixes a potential problem with the OPERA_SCRIPT_PATH, that no one was really likely to trigger anyway, but it sort of caught my interest so I fixed that too.

If you don't want to rebuild, then adding
export OPERA_JAVA_DIR="/usr/lib64/java/lib/amd64" to your bash profile will also resolve the issue.

Hope someone finds this useful.

G.
 
Old 10-01-2009, 08:23 PM   #2
meetscott
Samhain Slackbuild Maintainer
 
Registered: Sep 2004
Location: Phoenix, AZ, USA
Distribution: Slackware
Posts: 407

Rep: Reputation: 42
Let the maintainer know!

You ought to email Robby Workman, as he is the maintainer of this build. I noticed the same thing yesterday and I've been using this Slackbuild since it was submitted, before it was generally available.

When I updated the script, for Opera 10 on Slackware 12.2, I let him know. They normally do not maintain the older versions, only current versions because of their work load. However, I posted the script on the mailing list and on my web site:

http://raescott.net

My point being... I found Robby to be very friendly and open about the whole thing and I'm sure he'd be more than happy to include your fix for this. He had told me that Opera was not his primary browser so I'm sure he was not aware of the problem. Opera *is* my primary browser and I only discovered this yesterday! Applets aren't on very many sites anymore.

My discovery was when I visited http://time.gov
 
Old 10-02-2009, 05:15 AM   #3
GazL
Senior Member
 
Registered: May 2008
Posts: 3,323

Original Poster
Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Yep, I'll drop him a note when I'm happy with it. I still need to check a few other things, like the spellchecking which doesn't seem to be working, so there may be further changes.
 
Old 10-02-2009, 06:38 AM   #4
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,229

Rep: Reputation: 286Reputation: 286Reputation: 286
As luck would have it, I just compiled opera 10 from slackbuilds.org about an hour before I saw this thread. So I added:
export OPERA_JAVA_DIR="/usr/lib64/java/lib/AMD64" to my .bash_profile and it worked like a charm.
Now time.gov works again, thanks.
Hopefully Rob W will add this patch to his slackbuild.

Last edited by tommcd; 10-02-2009 at 07:23 AM.
 
Old 10-10-2009, 07:57 PM   #5
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,912

Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
Code:
@@ -76,7 +76,13 @@
 # recreates the directory and does some unknown havoc.  It may very well be
 # completely safe and unexploitable and I'm just being Chicken Little here,
 # but it's easy enough to fix and I'd rather be safe than sorry.  --rworkman
-sed -i "s%$TMP/$TOPDIR%/usr/bin/%g" $PKG/usr/bin/opera
+sed -i "s%$TMP/$TOPDIR\$0%\$PWD/\${0#./}%g" $PKG/usr/bin/opera
Is this the intended output?

-case $0 in /*) OPERA_SCRIPT_PATH=$0;; *) OPERA_SCRIPT_PATH=/tmp/SBo/opera-10.00-4585.gcc4-qt4.x86_64/$0;; esac
+case $0 in /*) OPERA_SCRIPT_PATH=$0;; *) OPERA_SCRIPT_PATH=$PWD/${0#./};; esac

Last edited by rworkman; 10-10-2009 at 08:00 PM.
 
Old 10-11-2009, 12:07 AM   #6
grissiom
Member
 
Registered: Apr 2008
Location: China, Beijing
Distribution: Slackware
Posts: 419

Rep: Reputation: 45
Doing sed -i -e "s:i386:amd64:" $PKG/usr/bin/opera is enough for opera running java on my box.

Last edited by grissiom; 10-11-2009 at 12:14 AM.
 
Old 10-11-2009, 06:04 AM   #7
GazL
Senior Member
 
Registered: May 2008
Posts: 3,323

Original Poster
Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Quote:
Originally Posted by rworkman View Post
Is this the intended output?

-case $0 in /*) OPERA_SCRIPT_PATH=$0;; *) OPERA_SCRIPT_PATH=/tmp/SBo/opera-10.00-4585.gcc4-qt4.x86_64/$0;; esac
+case $0 in /*) OPERA_SCRIPT_PATH=$0;; *) OPERA_SCRIPT_PATH=$PWD/${0#./};; esac
Yep, that's as intended Robby.


Since then I've tracked the original problem back to what Opera actually did wrong. They forgot to escape some backquotes in the part of install.sh that generates the /usr/bin/opera wrapper file. They meant to insert a literal `/bin/pwd` but instead insert the pwd of the build directory.

To follow their intentions, the correct fix to include in the slackbuild should probably be...
Code:
# Fix a bug in install.sh that resulted in the build directory being included in /usr/bin/opera
#   (they forgot to escape some back-quotes).
sed -i -e "/OPERA_SCRIPT_PATH=/ s:\`/bin/pwd\`:\\\\\`/bin/pwd\\\\\`:" install.sh
... prior to calling the install.sh from the slackbuild, rather than fixing it after the fact in /usr/bin/opera.
( P.S. figuring out all those escapes was a right pain. )


I think my first solution is actually cleaner than theirs as theirs results in OPERA_SCRIPT_PATH=/usr/bin/./opera when the wrapper is run with ./opera where as mine strips the ./ off and avoids an unnecessary external call to /bin/pwd. However, for the purpose of the slackbuild, it's probably better to stick as closely to their intentions as possible, so you might prefer to use this second approach.


I still haven't gotten to the bottom of the opera spell checker not working on my system.
 
Old 10-11-2009, 01:27 PM   #8
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,912

Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
Yep, that's as intended Robby.

Since then I've tracked the original problem back to what Opera actually did wrong. They forgot to escape some backquotes in the part of install.sh that generates the /usr/bin/opera wrapper file. They meant to insert a literal `/bin/pwd` but instead insert the pwd of the build directory.

To follow their intentions, the correct fix to include in the slackbuild should probably be...
Code:
# Fix a bug in install.sh that resulted in the build directory being included in /usr/bin/opera
#   (they forgot to escape some back-quotes).
sed -i -e "/OPERA_SCRIPT_PATH=/ s:\`/bin/pwd\`:\\\\\`/bin/pwd\\\\\`:" install.sh
... prior to calling the install.sh from the slackbuild, rather than fixing it after the fact in /usr/bin/opera.
( P.S. figuring out all those escapes was a right pain. )


I think my first solution is actually cleaner than theirs as theirs results in OPERA_SCRIPT_PATH=/usr/bin/./opera when the wrapper is run with ./opera where as mine strips the ./ off and avoids an unnecessary external call to /bin/pwd. However, for the purpose of the slackbuild, it's probably better to stick as closely to their intentions as possible, so you might prefer to use this second approach.
Nope, I like yours better. :-)

Just for the sake of completeness, have you reported this to the opera folks? I'd like to see both of these issues fixed in their next release...

Quote:
I still haven't gotten to the bottom of the opera spell checker not working on my system.
No idea on that :/
 
Old 10-11-2009, 06:32 PM   #9
GazL
Senior Member
 
Registered: May 2008
Posts: 3,323

Original Poster
Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
I've reported the extract/build-directory getting hard coded bug to Opera via their bug report wizard thingy.

I've not reported the Java path, as to be honest, I didn't feel qualified enough to say whether it's an opera bug or just a side effect of where Slackware installs the JRE.
 
Old 10-13-2009, 08:38 AM   #10
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,912

Rep: Reputation: Disabled
Okay, I just pushed this changeset out to our repo.
I suspect that our java installation is correct and thus the Java PATH issue is an upstream problem too, especially since "i386" is hardcoded in the 64bit builds - IOW, that's probably worth at least mentioning to them.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LimeWire (from SlackBuild) won't start, path points to rm-ed java directory in /usr. Dennola4 Slackware 8 07-28-2009 02:14 AM
Kmymoney2 Slackware64 Sbo Slackbuild Error AlleyTrotter Slackware 4 07-05-2009 10:10 PM
Java 64bit plugin not working business_kid Linux - Software 12 05-18-2009 03:44 AM
Ubuntu 7.10 64bit - how to set java path to/redirect java to libjvm.so ? Thane Ubuntu 1 03-25-2008 05:52 PM
Gentoo 64bit - Aptana (Java) nutnut Linux - Software 1 08-07-2007 07:59 PM


All times are GMT -5. The time now is 05:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration