You are not logged in.

#1 2010-02-02 00:26:37

davidm
Member
Registered: 2009-04-25
Posts: 371

[Solved?] Installing multiple versions of Firefox at the same time

I would like to install the normal Firefox in the repositories and also firefox-pgo-minefield-smp from the AUR so that I may use either one as desired. 

Looking at the current PKGBUILD from http://aur.archlinux.org/packages.php?ID=33506 (pkgbuild @ http://aur.archlinux.org/packages/firef … p/PKGBUILD ) I am thinking that perhaps I would modify this line:

export LDFLAGS="-Wl,-rpath,/usr/lib/firefox-$_prever -Wl,-O1,--sort-common,--hash-style=gnu,--as-needed"

to reflect the path where I would like to install it like so:

export LDFLAGS="-Wl,-rpath,/opt/firefox-$_prever -Wl,-O1,--sort-common,--hash-style=gnu,--as-needed"

And then presumably fix my symlink at /usr/bin/firefox to point back to /usr/lib/firefox-2.6 again. (and also fix the menu links and I realize I would have to use an ugly 'pacman -U tarball --force' to install it -- there's got to be a better way as that is very ugly and wrong surely???? Perhaps modify the pkgname as well as conflicts and provides so I could install it more normally?)

Correct?  Would I also need to modify a prefix or such besides this and if so where in the pkgbuild (ideally) or source would you recommend (must I change the actual makefile or does my modification in the PKGBUILD take care of this?  Would you in your experience recommend another approach for this?

I thought it wise to ask here before hacking away with this stuff and possibly hosing my system in unforeseen ways. smile  Please forgive my greenness.  I have spent a few hours researching this but still am not quite sure thus I ask. While I think I could do it with a straight compile with a modified configure I'm unsure of how to do it best using the arch tools...

Thanks for your time.

Last edited by davidm (2010-02-08 14:51:21)

Offline

#2 2010-02-02 12:10:22

PirateJonno
Forum Fellow
From: New Zealand
Registered: 2009-04-13
Posts: 372

Re: [Solved?] Installing multiple versions of Firefox at the same time

good idea for asking, there are more things that need changing. LDFLAGS is actually only relevant to the optimization of the package, not where anything is installed (but change it anyway).

first you should edit the file 'mozconfig' that comes with it, changing the third line to whatever directories you want (there are others besides prefix and libdir, for example sysconfdir is usually /etc - but I'll leave that up to you to find the relevant ones. do pacman -Ql firefox to work out which directories it actually uses).

then further down in the PKGBUILD, you'll need to modify some more paths. for example, change /usr/share/pixmaps/firefox.png to /usr/share/pixmaps/firefox-pgo.png or something similar (or just remove it entirely, I'm sure you can use the same icon for both packages). You'll probably also want to change the Exec= line of the .desktop files so it points to the right version of firefox.

Not sure if that is absolutely everything, but run makepkg without installing and then do 'tar -ztf *.pkg.tar.gz', which will tell you where all the files in the package will go. hope this is enough information for you.

P.S. don't use --force when installing as it could get messy - better to do it with no conflicts at all. you might also want to force the new version to use a different firefox profile (though if you keep both versions in sync it should be ok)

Last edited by PirateJonno (2010-02-02 12:12:19)


"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page

Offline

#3 2010-02-02 12:17:57

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [Solved?] Installing multiple versions of Firefox at the same time

you need to change prefix as well


Give what you have. To someone, it may be better than you dare to think.

Offline

#4 2010-02-02 16:10:19

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: [Solved?] Installing multiple versions of Firefox at the same time

Valuable tips, thank you both very much. smile

Offline

#5 2010-02-08 14:43:44

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: [Solved?] Installing multiple versions of Firefox at the same time

Basically solved but not yet mastered. smile

So I've figured out how to do this, it works, but not yet optimally and I am unsure about some things.  Namely:

[david@arch-desktop opt]$ ls -l /opt/bin
total 0
lrwxrwxrwx 1 root root 33 Feb  8 07:27 firefox -> /opt/lib/firefox-3.7a1pre/firefox
[david@arch-desktop opt]$ ls -l /opt/lib
total 8
drwxr-xr-x 12 root root 4096 Feb  8 07:27 firefox-3.7a1pre
drwxr-xr-x  3 root root 4096 Feb  8 07:27 firefox-devel-3.7a1pre
[david@arch-desktop opt]$ ls -l /opt/lib/firefox-devel-3.7a1pre
total 8
lrwxrwxrwx 1 root root   25 Feb  8 07:27 bin -> /opt/lib/firefox-3.7a1pre
lrwxrwxrwx 1 root root   31 Feb  8 07:27 idl -> /opt/share/idl/firefox-3.7a1pre
lrwxrwxrwx 1 root root   29 Feb  8 07:27 include -> /opt/include/firefox-3.7a1pre
lrwxrwxrwx 1 root root   39 Feb  8 07:27 lib -> /opt/lib/firefox-devel-3.7a1pre/sdk/lib
drwxr-xr-x 3 root root 4096 Feb  8 07:27 sdk
-rw-r--r-- 1 root root 2082 Feb  8 05:06 xpcom-config.h
[david@arch-desktop lib]$ ls -l /opt/lib/firefox-3.7a1pre
total 17428
-rw-r--r-- 1 root root     2102 Feb  8 07:27 application.ini
-rw-r--r-- 1 root root     2531 Feb  8 07:27 blocklist.xml
-rw-r--r-- 1 root root      232 Feb  8 07:27 browserconfig.properties
drwxr-xr-x 3 root root     4096 Feb  8 07:27 chrome
drwxr-xr-x 2 root root     4096 Feb  8 07:27 components
drwxr-xr-x 5 root root     4096 Feb  8 07:27 defaults
-rw-r--r-- 1 root root      139 Feb  8 07:27 dependentlibs.list
drwxr-xr-x 2 root root     4096 Feb  8 07:27 dictionaries
drwxr-xr-x 3 root root     4096 Feb  8 07:27 extensions
-rwxr-xr-x 1 root root     3913 Feb  8 07:27 firefox
-rwxr-xr-x 1 root root    56788 Feb  8 07:27 firefox-bin
-rw-r--r-- 1 root root    76888 Feb  8 07:27 greprefs.js
drwxr-xr-x 2 root root     4096 Feb  8 07:27 icons
-rwxr-xr-x 1 root root  1846520 Feb  8 07:27 libmozjs.so
-rwxr-xr-x 1 root root   900176 Feb  8 07:27 libmozsqlite3.so
-rwxr-xr-x 1 root root    11540 Feb  8 07:27 libxpcom.so
-rwxr-xr-x 1 root root 14796800 Feb  8 07:27 libxul.so
-rw-r--r-- 1 root root    30826 Feb  8 07:27 LICENSE
drwxr-xr-x 2 root root     4096 Feb  8 07:27 modules
-rwxr-xr-x 1 root root     3108 Feb  8 07:27 mozilla-runtime
-rwxr-xr-x 1 root root    10720 Feb  8 07:27 mozilla-xremote-client
-rw-r--r-- 1 root root      154 Feb  8 07:27 platform.ini
drwxr-xr-x 2 root root     4096 Feb  8 07:27 plugins
-rw-r--r-- 1 root root      177 Feb  8 07:27 README.txt
-rw-r--r-- 1 root root    16712 Feb  8 07:27 removed-files
drwxr-xr-x 6 root root     4096 Feb  8 07:27 res
-rwxr-xr-x 1 root root    10370 Feb  8 07:27 run-mozilla.sh
drwxr-xr-x 2 root root     4096 Feb  8 07:27 searchplugins
[david@arch-desktop include]$ ls -l /opt/include
total 80
drwxr-xr-x 11 root root 77824 Feb  8 07:27 firefox-3.7a1pre

It seems as though it is a bit messy, as if I have more than I need installed. Especially the two entries in /opt/lib/.  Do I really need all this?

PKGBUILD:

# Maintainer: Devin Cofer <ranguvar{AT]archlinux[DOT}us>
# Contributor: blasse <koralik(at)gmail(dot)com>
# PKGBUILD MODIFIED The above info does not apply. Modified by davidm for personal use, not intended for distribution.
# This package is not a normal -hg package.  I manually bump $_workingrev every now and again when
# a revision of Firefox passes all of the Linux tests on http://bit.ly/1O4siz

pkgname=firefox-electrolysis-nightly-opt
pkgver=999901
pkgrel=1
_prever=3.7a1pre
_workingrev='d2bed0c20e89'
_mozver=central
pkgdesc="Mozilla Firefox customizable web browser Electrolysis Nightly installed in opt (XULRunner independent, PGO optimized, 64-bit TraceMonkey, Dev tree, Multithreaded)"
url="http://www.mozilla.org/projects/firefox"
arch=('i686' 'x86_64')
license=('MPL' 'GPL' 'LGPL')

_soundsystem='alsa-lib'  # 'alsa-lib' for ALSA, 'oss' for OSS

makedepends=('mercurial' 'autoconf-compat' 'gcc>=4.4' 'zip' 'pkgconfig'
             'diffutils' 'libgnomeui>=2.24.1' 'python' 'wireless_tools')
depends=('gtk2>=2.18.0' 'gcc-libs>=4.4' 'libidl2>=0.8.13' 'mozilla-common'
         'nss>=3.12.4' 'libxt' 'hunspell>=1.2.8' 'startup-notification>=0.10'
         'libnotify>=0.4' 'mime-types' 'dbus-glib>=0.82' 'desktop-file-utils'
         'cairo' ${_soundsystem})
#provides=("firefox-electrolysis-nightly-opt=$_pkgver")
#conflicts=('firefox-electrolysis-nightly-opt')

install=$pkgname.install
source=('mozconfig'
        'firefox-minefield-smp.desktop'
        'firefox-safe-minefield-smp.desktop'
        'fix-mozilla-launcher.patch'
        'mozilla-firefox-1.0-lang.patch'
        'ldflags-namespec.patch'
        'jemalloc-enable-pgo.patch'
        'potential-pgo-fix.patch')
#Original hashes
# sha256sums=('8d08ee111b88473a53e8c0852d463971af7a827f796a94d3fe74ca2eed76ca0b'
#            '21722965bb0bab05e3fbd2f584dbcaeb9f0726ed755f59bbf6fb26a7f964e6ec'
#            '00641e2d7ba45a607522a621aa86c21e13b2951ebca920b1e0b538b0e1188445'
#            'd4948cc5878b2100b4d19b0fbc09119c34377593c5847678d5788db2b4e0fe43'
#            '0ca095ff2af57297f615877a7e79ddc84d1a3f62509a8af6ca50aad7a8671f6a'
#            '0e9631fdad5efa3fd7a95b59171f5d15420d10aa61748b920cc994ee9227915c'
#            'e6b8345215eb0c595cadfd6b1abb3a12a1cad8b8b1f3528e6affc58900695215'
#            'bf53a9712aada73dbecb45516bf932b52e7b8debf25cf19294adbfcc54d80028')
#
#My MODIFIED HAshes
md5sums=('ee857ec52fe3c7a047a282cfc5587d07'
         '68cf02788491c6e846729b2f2913bf79'
         '5e68cabfcf3c021806b326f664ac505e'
         '63eee2d1da3b43c9d604f2253f242f40'
         'bd5db57c23c72a02a489592644f18995'
         '9e461e5fc73b241d68d08be908405a5e'
         'df6fde73c9fdb38245f50b9b5bb09024'
         '9587e0e6da42c883e34a46ee35cc3b7d')


# Don't use normal _hgroot/_hgrepo, we don't want Pacman automagically changing the pkgver.
_ff_hgroot="http://hg.mozilla.org/projects/electrolysis"


build() {
    msg "* Note: If the build fails, try again, try without jemalloc PGO, and try     *"
    msg "* without PGO at all. Also, try with 'potential-pgo-fix.patch'. PGO can be   *"
    msg "* temperamental -- it can sometimes take two or three builds before you'll   *"
    msg "* get a good one.                                                            *"
    sleep 15

    cd "$srcdir"
    # It can take a long time to re-fetch the Mozilla source...
    # The commented lines are for use by experienced users who build often.
    hg clone "$_ff_hgroot/mozilla-$_mozver" "mozilla-$_mozver" || return 1
#    tar xf "$startdir/mozilla-$_mozver.tar.gz" || return 1
    cd "mozilla-$_mozver"
#    hg pull || return 1
#    hg update || return 1
#    cd ..
#    tar czf "$startdir/mozilla-$_mozver.tar.gz" "mozilla-$_mozver" || return 1
#    cd "mozilla-$_mozver"
#    hg up "$_workingrev" || return 1  # Comment out this line to use the untested latest source.

    cp "$srcdir/mozconfig" .mozconfig || return 1
    # Don't strip if the user doesn't want to... ;p
    if [ "$(check_option strip)" = "n" ]; then
        sed -i 's/--enable-strip/--disable-strip/' \
            .mozconfig || return 1
        sed -i 's/--enable-install-strip/--disable-install-strip/' \
            .mozconfig || return 1
    fi

    if [ "$_soundsystem" = "oss" ]; then
        msg "Using OSS instead of ALSA."
        sed -i 's/sydney_audio_alsa/sydney_audio_oss/' \
               media/libsydneyaudio/src/Makefile.in || return 1
        # Get rid of ALSA config system stuff (requires autoconf rerun)
        sed -i '/alsa\//d' config/system-headers || return 1
        sed -i '/alsa\//d' js/src/config/system-headers || return 1
        sed -i '/LIB(asound/d' configure.in || return 1
    fi


    msg "Patching source."
    msg "Patches from main Arch xulrunner/firefox packages..."
    # Fix stub launcher - Arch
    patch -Np0 -i "$srcdir"/fix-mozilla-launcher.patch || return 1
    # Use LANG environment variable to choose locale
    patch -Np1 -i "$srcdir"/mozilla-firefox-1.0-lang.patch || return 1


    msg "Patches from this package..."
    # PGO compilation LDFLAGS fix
    patch -Np1 -i "$srcdir"/ldflags-namespec.patch || return 1
    # Enable experimental PGO for jemalloc (speed).
    # See Mozilla bugs #418866 and #419470.
    patch -Np0 -i "$srcdir"/jemalloc-enable-pgo.patch || return 1

    # Sometimes necessary for PGO build to work, especially when PGO compile
    # aborts with an error about control sum mismatch (thx to methuselah!)
#    patch -Np1 -i "$srcdir/potential-pgo-fix.patch" || return 1


    msg "Setting up build."
    # Changing the user's optimization flags is justified, because this is
    # a package specifically for an optimized software build, and because of
    # the official branding, binaries can't be redistributed anyways.
    # These flags just set guidelines for the build, they are overridden in
    # most compile job pieces by Firefox's better judgement.
    #export CFLAGS="-march=native -O2 -pipe"
    #export CXXFLAGS="-march=native -O2 -pipe"
        export CFLAGS="-march=i686 -mtune=pentium4 -O2 -pipe -fomit-frame-pointer"
        export CXXFLAGS="-march=i686 -mtune=pentium4 -O2 -pipe -fomit-frame-pointer"
    # The hash-style and as-needed flags are in Arch defaults anyways,
    # and the other optimization falgs are almost definitely safe.
    export LDFLAGS="-Wl,-rpath,/opt/lib/firefox-$_prever -Wl,-O1,--sort-common,--hash-style=gnu,--as-needed"

    autoconf-2.13 || return 1


    msg "Actual build."
    # Yes, all this is SMP. MOZ_MAKE_FLAGS takes care of it.
    # Compile a non-PGO build first to reduce chance of error in PGO build.
    make -j1 -f client.mk build MOZ_MAKE_FLAGS="$MAKEFLAGS" || return 1
    # Comment out remaining lines for a non-PGO build.
    msg "Profiled build now."
    # Don't let PGO disrupt the user, use a virtual framebuffer.
    LD_PRELOAD="" /usr/bin/Xvfb -nolisten tcp -extension GLX :99 &
    XPID=$!
    DISPLAY=:99 LD_PRELOAD="" make -j1 -f client.mk profiledbuild \
        MOZ_MAKE_FLAGS="$MAKEFLAGS" || return 1
    kill -9 $XPID
}
package() {
    cd "$srcdir/mozilla-$_mozver"

    make -j1 DESTDIR="$pkgdir" -C ff-pgo install || return 1

#    install -Dm644   "$srcdir/mozilla-$_mozver/other-licenses/branding/firefox/mozicon128.png" \
#                     "$pkgdir/usr/share/pixmaps/firefox.png" || return 1
#    install -Dm644   "$srcdir/firefox--minefield-smp.desktop" \
#                     "$pkgdir/usr/share/applications/firefox-minefield-smp.desktop" || return 1
#    install -Dm644   "$srcdir/firefox-safe-minefield-smp.desktop" \
#                         "$pkgdir/usr/share/applications/firefox-safe-minefield-smp.desktop" \
#             || return 1


    # Remove devel stuff.
    rm -rf "$pkgdir/usr/include/"
    rm -rf "$pkgdir/usr/lib/firefox-devel-$_prever/"
    rm -rf "$pkgdir/usr/share/idl/"
}

mozconfig:

ac_add_options --enable-application=browser
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --prefix=/opt --libdir=/opt/lib

## System libs are preferred
ac_add_options --with-system-nss --with-system-jpeg --with-pthread
ac_add_options --with-system-zlib --with-system-libpng --with-system-bz2
ac_add_options --enable-system-cairo --with-system-hunspell --with-system-sqlite
ac_add_options --with-system-nspr

## GNU/Linux stuff
ac_add_options --disable-installer --disable-updater
ac_add_options --enable-official-branding
ac_add_options --enable-startup-notification

## Optimize
ac_add_options --disable-pedantic --enable-jemalloc --enable-xterm-updates
### Reverse these lines (enable vs disable) for a debug build
ac_add_options --enable-optimize --disable-debug --disable-tests
ac_add_options --enable-profile-guided-optimization
ac_add_options --enable-strip --enable-install-strip
###

## Edit these as you see fit
ac_add_options --disable-crashreporter --disable-parental-controls 
ac_add_options --enable-printing --enable-xinerama
# Sane settings include cairo-gtk2-df, cairo-gtk2, and cairo-qt.
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-places --enable-svg --enable-pango --enable-canvas
ac_add_options --enable-smil --disable-java-xpcom --enable-canvas3d
# This is disabled in order to speed Firefox up, it prevents checking Google
# for every single URL Firefox processes.  If you're using this package, it's likely you already
# know enough to be safe online, or are paranoid (perhaps with reason) about
# Google getting your URLs.  Also, this is GNU/Linux, we have somewhat less to fear ;-)
ac_add_options --disable-safe-browsing


mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-pgo
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1

# Want to change the compiler?
#export CC='gcc-4.5'
#export CXX='g++-4.5'

^ A dirty hack to download the latest nightly of the electrolysis tree, pgo optimized for an intel i686 P4 (not native to get around the seg fault bug). I just commented out the .desktop files as well as the icon for now. Also the conflicts and provides section have merely been commented out. The goal is to have this work independently from the standard firefox allowing me to run both on the system at the same time.

Anyone see anything that I have missed and could fix as far as doing the separate install in /opt using makepkg and the pkgbuild?   I've been using arch less than a month and this is the first I've really hacked with a PKGBUILD and mozconfig so I feel I could really use the help. Any insight appreciated greatly.

Last edited by davidm (2010-02-08 15:25:49)

Offline

Board footer

Powered by FluxBB