Gentoo Archives: gentoo-amd64

From: Mike Arthur <mike@×××××××××××××.uk>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] 32-bit Netscape Plugins in Konqueror
Date: Wed, 29 Mar 2006 18:07:55
Message-Id: 200603291900.28741.mike@mikearthur.co.uk
In Reply to: Re: [gentoo-amd64] 64-bit or 32-bit? by Simon Stelling
Thought I'd cross-post this from the forums, it's a script that lets Konqueror 
run 32-bit netcape plugins.

I'm thinking of writing an ebuild that will download the actual sources needed 
for this and compile them nicely. 
 Currently, the following libraries are needed, for KDE 3.5.2 and not provided 
by some emul-* package. 
 These can be obtained from me here: http://1f2.myby.co.uk/nsplugin32.tar.bz2
 libart_lgpl_2.so.2 
 libDCOP.so.4 
 libidn.so.11 
 libkdecore.so.4 
 libkdefx.so.4 
 libkdesu.so.4 
 libkdeui.so.4 
 libkio.so.4 
 libkparts.so.2 
 libkwalletclient.so.1 
 libXdmcp.so.6 
 
 
Code:

 #!/bin/bash 
 # 32-bit netscape plugin support for KDE on AMD64 
 CHROOT32="/emul/chroot" 
 NSPLUGIN32="/root/nsplugin32" 
 KDEDIR="/usr/kde/3.5" 
 
 function setup { 
   echo 
   echo "================ nsplugin32.sh ===================" 
   echo "Setting up 32-bit netscape plugin support..." 
   echo "==================================================" 
   echo 
   echo "Copying needed 32bit netscape plugin libraries..." 
   echo 
   mkdir -p $NSPLUGIN32/bin32/ 
   mkdir -p $NSPLUGIN32/lib32/ 
   cd $CHROOT32$KDEDIR/bin 
   cp -v nspluginscan nspluginviewer $NSPLUGIN32/bin32/ 
   cd $CHROOT32$KDEDIR/lib 
   cp -v libDCOP.so.4 libkdecore.so.4 libkdefx.so.4 libkdesu.so.4 
libkdeui.so.4 libkio.so.4 libkparts.so.2 libkwalletclient.so.1 
$NSPLUGIN32/lib32/ 
   cd $CHROOT32/usr/lib/ 
   cp -v libart_lgpl_2.so.2 libidn.so.11 libXdmcp.so.6 $NSPLUGIN32/lib32/ 
   cd $NSPLUGIN32/lib32/ 
   cp -v libart_lgpl_2.so.2 libDCOP.so.4 libidn.so.11 libkdecore.so.4 
libkdefx.so.4 libkdesu.so.4 libkdeui.so.4 libkio.so.4 libkparts.so.2 
libkwalletclient.so.1 libXdmcp.so.6 /usr/lib32/ 
   cp -v $NSPLUGIN32/bin32/* $KDEDIR/bin/ 
   if [ ! -e $NSPLUGIN32/bin64/ ]; then 
     echo 
     echo "Backing up 64bit KDE netscape plugin handlers..." 
     echo 
     mkdir -p $NSPLUGIN32/bin64/ 
     cd $KDEDIR/bin 
     mv -v nspluginscan nspluginviewer $NSPLUGIN32/bin64/ 
   fi 
   echo 
   echo "Copying 32bit KDE netscape plugin handlers..." 
   echo 
   cp -v $NSPLUGIN32/bin32/* $KDEDIR/bin/ 
   echo 
   echo "Running ldconfig..." 
   echo 
   ldconfig 
   echo 
   ldd $KDEDIR/bin/nspluginviewer | grep "not found" 
   if [ $? -ne 0 ]; then 
     echo "Done." 
     echo 
     echo "You may now open Konqueror's plugin settings and " 
     echo "scan for available plugins. There seems to be a " 
     echo "problem with the ARTS routing and 32bit plugins, " 
     echo "so make sure to disable it in the plugin settings!" 
   else 
     echo "Not all needed libraries found, restoring 64-bit netscape" 
     echo "plugin support..." 
     restore &> /dev/null 
         echo "Find missing libraries and retry" 
   fi 
 } 
 
 function restore { 
   echo 
   echo "================ nsplugin32.sh ===================" 
   echo "Restoring 64-bit netscape plugin support..." 
   echo "==================================================" 
   echo 
   echo "Removing needed 32bit libraries..." 
   echo 
   cd /usr/lib32/ 
   rm -v libart_lgpl_2.so.2 libDCOP.so.4 libidn.so.11 libkdecore.so.4 
libkdefx.so.4 libkdesu.so.4 libkdeui.so.4 libkio.so.4 libkparts.so.2 
libkwalletclient.so.1 libXdmcp.so.6 
   echo 
   echo "Removing 32bit KDE netscape plugin handlers..." 
   echo 
   rm -v $KDEDIR/bin/nspluginscan $KDEDIR/bin/nspluginviewer 
   echo 
   echo "Restoring 64bit KDE netscape plugin handlers..." 
   echo 
   cd $NSPLUGIN32/bin64/ 
   cp -v nspluginscan nspluginviewer $KDEDIR/bin/ 
   cd $NSPLUGIN32/ 
   rm -rv bin64/ 
   echo 
   echo "Running ldconfig..." 
   echo  ldconfig 
   echo 
   echo "Done" 
   echo 
 } 
 
 if [ "$1" == "setup" ]; then 
   setup 
   exit 
 elif [ "$1" == "restore" ]; then 
   restore 
   exit 
 else 
   echo "================ nsplugin32.sh ===================" 
   echo "32-bit netscape plugin support for KDE on AMD64" 
   echo "You must specify an argument: 'setup' or 'restore'" 
   echo "==================================================" 
   exit 1 
 fi 
-- 
gentoo-amd64@g.o mailing list