LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-08-2012, 07:29 PM   #1
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 946

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Problems building Firefox 13.0 from source under -current


Hello everyone, I'm trying to compile Firefox 13.0 from source under -current, but I've run into this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=736961

Anybody have any tips how to modify the SlackBuild-script to successfully build Firefox 13.0 or Thunderbird 13.0 or Seamonkey 2.10 for that matter.

Regards,
Mats Tegner
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-09-2012, 12:17 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,110

Rep: Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180
you have to modify the sources like this (second to last comment in the bug): because I'm a noob and need some clue on how to apply patches in the format generated by mercurial, I recreated them to apply with the usual
Code:
patch -p1 < $CWD/whatever.patch
the seamonkey one works fine also for thunderbird.

everything seems to work, but to say the truth I'm not sure anymore if it's the best solution, see last comment, that points to another bug (but I doubt it should apply here, we don't build firefox over xulrunner).

Last edited by ponce; 06-09-2012 at 12:30 AM.
 
1 members found this post helpful.
Old 06-09-2012, 02:18 AM   #3
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,110

Rep: Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180
Aah, I feel a little less noob now.

To apply directly the mercurial raw patches, we need only to pass an additional -F 7 parameter to the patch command: see patch man page, context in mercurial defaults to 8 lines.

Last edited by ponce; 06-09-2012 at 02:25 AM.
 
Old 06-09-2012, 04:11 AM   #4
Pixxt
Member
 
Registered: May 2008
Distribution: Slackware, Debian,
Posts: 288

Rep: Reputation: 186Reputation: 186
I would suggest not compiling at all. Unless you do PGO, since Firefox binary tarballs are PGO compiled for Linux it is much faster than the Firefox you compile yourself.

i.e for years I have had the 100% cpu firefox bug since I have like 6 windows open and about 200 tabs and thats with flashblock and adblock enabled. But since switching to the Mozilla.org beta tarballs with PGO I have not had that problem. Firefox is finally faster under Slack than Windows 7, its been while since I could say that like the Firefox 3 days.

I would love to see Pat do PGO for the whole mozilla suite of programs, it makes a big difference.
 
Old 06-09-2012, 08:38 AM   #5
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 946

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by Pixxt View Post
I would suggest not compiling at all. Unless you do PGO, since Firefox binary tarballs are PGO compiled for Linux it is much faster than the Firefox you compile yourself.

i.e for years I have had the 100% cpu firefox bug since I have like 6 windows open and about 200 tabs and thats with flashblock and adblock enabled. But since switching to the Mozilla.org beta tarballs with PGO I have not had that problem. Firefox is finally faster under Slack than Windows 7, its been while since I could say that like the Firefox 3 days.

I would love to see Pat do PGO for the whole mozilla suite of programs, it makes a big difference.
Do you have any tips how to repackage an official Mozilla binary into a Slackware package?
 
Old 06-09-2012, 10:02 AM   #6
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Rep: Reputation: 19
I use this script to update Firefox.
It downloads the latest Firefox version, builds a package, then I use upgradepkg <package_full_path_file_name> and it is done!
Save the script bellow as latest-firefox.sh
Before run the script, change the line FFLANG=${FFLANG:-en-US} to your language and it will download the proper non english firefox version.
Eg: FLANG=${FFLANG:-sv-SE} (for Sweden language)

Quote:
#!/bin/bash
# This script will find the latest Firefox binary package, download it
# and repackage it into Slackware format.

# I don't use Firefox for regular browsing but it is handy for
# comparative tests against Opera. :P

# Copyright 2011 Ruarí Ødegaard, Olso, Norway
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Use the architecture of the current machine or whatever the user has
# set externally
ARCH=${ARCH:-$(uname -m)}

if [ "$ARCH" = "x86_64" ]; then
LIBDIRSUFFIX="64"
else
LIBDIRSUFFIX=""
fi

# This defines the language of the downloaded package
FFLANG=${FFLANG:-en-US}

# Work out the latest stable Firefox if VERSION is unset
VERSION=${VERSION:-$(wget -qO- http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-$ARCH/$FFLANG/ | sed -nr 's|.*>firefox-(.*)\.tar\.bz2</a>.*|\1|p')}

# Error out if $VERISON is unset, e.g. because previous wget command
# failed
if [ -z $VERSION ]; then
echo "Could not work out the latest version; exiting"
exit 1
fi

# Don't start repackaging if the same version is already installed
if /bin/ls /var/log/packages/mozilla-firefox-$VERSION-* >/dev/null 2>&1 ; then
echo "Firefox ($VERSION) is already installed; exiting"
exit 0
fi

TMP=${TMP:-/tmp}
OUTPUT=${OUTPUT:-/tmp}
TAG=1ro
PKGTYPE=${PKGTYPE:-tgz}

# Set compressor type based on package extension
if [ "$PKGTYPE" = "tgz" ]; then
COMPRESSOR="gzip -9c"
elif [ "$PKGTYPE" = "txz" ]; then
COMPRESSOR="xz -c"
elif [ "$PKGTYPE" = "tlz" ]; then
COMPRESSOR="lzma -c"
elif [ "$PKGTYPE" = "tbz" ]; then
COMPRESSOR="bzip2 -c"
else
echo "$PKGTYPE is not a valid package type; exiting"
exit 1
fi

PACKAGE="$OUTPUT/mozilla-firefox-$VERSION-$ARCH-$TAG.$PKGTYPE"

# If the package was made previously, no need to make it again.
if [ -e "$PACKAGE" ]; then
echo "$PACKAGE already exists; exiting"
exit 0
fi

REPACKDIR=$TMP/repackage-mozilla-firefox

# Three sources are needed, here is where to find them if they are not
# already in the directory this script was started from.
FIREFOXPKG=http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$VERSION/linux-$ARCH/$FFLANG/firefox-$VERSION.tar.bz2
DESKTOPFILE=ftp://ftp.osuosl.org/pub/slackware/slackware-current/source/xap/mozilla-firefox/mozilla-firefox.desktop
SCRIPT=${0/*\//}

# Since packaging is about to begin errors become more important now,
# so exit if things fail.
set -eu

# If the repackage is already present from the past, clear it down
# and re-create it.
if [ -d "$REPACKDIR" ]; then
rm -fr "$REPACKDIR"
fi

mkdir -p "$REPACKDIR"/{pkg,src}

# Check if the current directory contains mozilla-firefox.desktop. If
# not try /usr/share/applications/, otherwise download it.
if [ -e mozilla-firefox.desktop ]; then
cp mozilla-firefox.desktop "$REPACKDIR/src/"
elif [ -e /usr/share/applications/mozilla-firefox.desktop ]; then
cp /usr/share/applications/mozilla-firefox.desktop "$REPACKDIR/src/"
else
wget -P "$REPACKDIR/src" $DESKTOPFILE
fi

# Save a copy if this script but remove execute persmissions as it will
# larer be moved into the doc directory.
install -m 644 "${0}" "$REPACKDIR/src/$SCRIPT"

# Check if the current directory contains the Firefox binary package,
# otherwise download it.
if [ -e firefox-$VERSION.tar.bz2 ]; then
cp firefox-$VERSION.tar.bz2 "$REPACKDIR/src/"
else
wget -P "$REPACKDIR/src" $FIREFOXPKG
fi

# Now we have all the sources in place, switch to the package directory
# and start setting things up.
cd "$REPACKDIR/pkg"

# Create the basic directory structure for files and post-install
# symlinks.
mkdir -p install
mkdir -p usr/bin
mkdir -p usr/doc/mozilla-firefox-$VERSION
mkdir -p usr/share/applications
mkdir -p usr/share/icons/hicolor/{16x16,32x32,48x48,128x128}/apps
mkdir -p usr/lib$LIBDIRSUFFIX/mozilla
mkdir -p usr/lib$LIBDIRSUFFIX/firefox-$VERSION

# Copy the desktop file in place
cp ../src/mozilla-firefox.desktop usr/share/applications/

# Copy this script into the doc directory
cp ../src/$SCRIPT usr/doc/mozilla-firefox-$VERSION/$SCRIPT

# Extract the contents of the binary Firefox package into an
# appropriately named lib directory.
tar -xf ../src/firefox-$VERSION.tar.bz2 --strip 1 -C usr/lib$LIBDIRSUFFIX/firefox-$VERSION

# If present, move the readme or any other similar text files to the
# doc directory.
find usr/lib$LIBDIRSUFFIX/firefox-$VERSION -iname "*.txt" -maxdepth 1 -exec mv {} usr/doc/mozilla-firefox-$VERSION/ \;

# If a plugins folder was present move it to the mozilla lib directory.
# Otherwise just create a directory in mozilla so that there is
# definately somthing to symlink to later on in the post-install.
if [ -d usr/lib$LIBDIRSUFFIX/firefox-$VERSION/plugins ]; then
mv usr/lib$LIBDIRSUFFIX/firefox-$VERSION/plugins usr/lib$LIBDIRSUFFIX/mozilla/
else
mkdir usr/lib$LIBDIRSUFFIX/mozilla/plugins
fi

# The doinst.sh is going to create symlinks. Therefore it is necessary
# to check that the files that will be linked are actually present, so
# that the post-install goes smoothly.
checkfile ()
{
if [ ! -e $1 ]; then
echo "$1 not found, so symlink in post install will fail; exiting"
exit 1
fi
}

checkfile usr/lib$LIBDIRSUFFIX/firefox-$VERSION/firefox
checkfile usr/lib$LIBDIRSUFFIX/firefox-$VERSION/chrome/icons/default/default16.png
checkfile usr/lib$LIBDIRSUFFIX/firefox-$VERSION/chrome/icons/default/default32.png
checkfile usr/lib$LIBDIRSUFFIX/firefox-$VERSION/chrome/icons/default/default48.png
checkfile usr/lib$LIBDIRSUFFIX/firefox-$VERSION/icons/mozicon128.png

# Also check that there are no symlinks already present as these are
# not allowed in Slackware packages.
if find usr -type l -print | grep . >/dev/null; then
echo "unexpected symlink(s) found; exiting"
exit 1
fi

# Now create the post-install to setup the symlinks and register the
# desktop file and icons.
cat <<EOS > install/doinst.sh
( cd usr/bin ; rm -rf firefox )
( cd usr/bin ; ln -sf ../lib$LIBDIRSUFFIX/firefox-$VERSION/firefox firefox )
( cd usr/lib$LIBDIRSUFFIX/firefox-$VERSION ; rm -rf plugins )
( cd usr/lib$LIBDIRSUFFIX/firefox-$VERSION ; ln -sf ../mozilla/plugins plugins )
( cd usr/share/icons/hicolor/16x16/apps ; rm -rf firefox.png )
( cd usr/share/icons/hicolor/16x16/apps ; ln -sf ../../../../../lib$LIBDIRSUFFIX/firefox-$VERSION/chrome/icons/default/default16.png firefox.png )
( cd usr/share/icons/hicolor/32x32/apps ; rm -rf firefox.png )
( cd usr/share/icons/hicolor/32x32/apps ; ln -sf ../../../../../lib$LIBDIRSUFFIX/firefox-$VERSION/chrome/icons/default/default32.png firefox.png )
( cd usr/share/icons/hicolor/48x48/apps ; rm -rf firefox.png )
( cd usr/share/icons/hicolor/48x48/apps ; ln -sf ../../../../../lib$LIBDIRSUFFIX/firefox-$VERSION/chrome/icons/default/default48.png firefox.png )
( cd usr/share/icons/hicolor/128x128/apps ; rm -rf firefox.png )
( cd usr/share/icons/hicolor/128x128/apps ; ln -sf ../../../../../lib$LIBDIRSUFFIX/firefox-$VERSION/icons/mozicon128.png firefox.png )

# Setup menu entries
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database -q usr/share/applications
fi

# Setup icons
touch -c usr/share/icons/hicolor
if command -v gtk-update-icon-cache >/dev/null 2>&1; then
gtk-update-icon-cache -tq usr/share/icons/hicolor
fi
EOS

# Create a description file inside the package.
cat <<EOD > install/slack-desc
|-----handy-ruler------------------------------------------------------|
mozilla-firefox: mozilla-firefox (Mozilla Firefox Web browser)
mozilla-firefox:
mozilla-firefox: This project is a redesign of the Mozilla browser component written
mozilla-firefox: using the XUL user interface language. Firefox delivers safe, easy web
mozilla-firefox: browsing.
mozilla-firefox:
mozilla-firefox: Visit the Mozilla Firefox project online:
mozilla-firefox: http://www.mozilla.org/projects/firefox/
mozilla-firefox:
mozilla-firefox:
mozilla-firefox:
EOD

# Make sure the file permissions are ok
chmod -R u+w,go+r-w,a-s .

# Use tar version 1.13 if available, if not (e.g. packaging was done on
# a non Slackware machine) force modern tar into formatting its
# directory structure just like tar 1.13 because this is what pkgtools
# expect. Also use options to set ownership of all files to root:root.
if [ -x /bin/tar-1.13 ]; then
/bin/tar-1.13 --owner 0 --group 0 -cvvf- . | $COMPRESSOR > "$PACKAGE"
else
find ./ -print | sed -r 's|^\./(.)|\1|' | tar --owner 0 --group 0 --no-recursion -T- -cvvf- | $COMPRESSOR > "$PACKAGE"
fi

# Tell the user we are done!
echo -e "\nCreated: $PACKAGE"
PS: Thanks to ruario (Ruarí Ødegaard, Olso, Norway)!

Last edited by neymac; 06-09-2012 at 10:32 AM. Reason: Some typos errors
 
2 members found this post helpful.
Old 06-09-2012, 11:40 AM   #7
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 946

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Thanks for that script. I think I will use it for Thunderbird and Seamonkey as well.

Edit 2012-06-14: I compiled Firefox, Seamonkey and Thunderbird last night using the patches supplied by ponce. Everything seems to work. I've kept Ruari's script as a backup.

Last edited by mats_b_tegner; 06-14-2012 at 06:45 AM.
 
Old 06-11-2012, 09:05 AM   #8
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
neymac --

Thanks a ton for sharing this script.

I made one change for Slackware-13.37.

Thanjs again
-- kjh

Code:
# insert this at line 32 after the ARCH= Setting:

OSVER=${OSVER:-13.37}

# replace this line:
# DESKTOPFILE=ftp://ftp.osuosl.org/pub/slackware/slackware-current/source/xap/mozilla-firefox/mozilla-firefox.desktop
# with this line:
DESKTOPFILE=ftp://ftp.osuosl.org/pub/slackware/slackware-${OSVER}/source/xap/mozilla-firefox/mozilla-firefox.desktop
Thanks again !

-- kjh

PS: And thanks to ruario (Ruarí Ødegaard, Olso, Norway)!
 
Old 06-12-2012, 06:08 AM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
You are welcome!

P.S. The original script is here, along with one for Chrome. I actually haven't made quite the same thing for Opera. Instead I host Slackware-native Opera packages (along with a SlackBuild).
 
1 members found this post helpful.
Old 06-12-2012, 06:15 AM   #10
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by neymac View Post
Save the script bellow as latest-firefox.sh
Before run the script, change the line FFLANG=${FFLANG:-en-US} to your language and it will download the proper non english firefox version.
Eg: FLANG=${FFLANG:-sv-SE} (for Sweden language)
Or just run it like this:
Code:
$ FLANG=sv-SE ./latest-firefox.sh
@kjhambrick The desktop file changes very rarely. All that happens is that new translations are added. It doesn't therefore really matter if you just pull it from -current. Anyway it the script won't even attempt to fetch it if you already have Firefox installed. It will just reuse the one already present.

Last edited by ruario; 06-12-2012 at 06:17 AM. Reason: added comment to kjhambrick
 
2 members found this post helpful.
Old 06-14-2012, 07:51 PM   #11
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 946

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Updated Firefox, Seamonkey and Thunderbird packages are now available according to the latest ChangeLog.

Update 2012-06-15: The cache-dir patches are still needed when compiling Firefox/Thunderbird 13.0.1.

Update 2012-06-16: And now Firefox/Thunderbird 13.0.1 packages are available...

Last edited by mats_b_tegner; 06-16-2012 at 07:48 PM.
 
Old 11-16-2012, 03:46 PM   #12
astanton
Member
 
Registered: Nov 2010
Distribution: Slackware64 -current
Posts: 82

Rep: Reputation: 5
Exclamation

Quote:
Originally Posted by ruario View Post
You are welcome!

P.S. The original script is here, along with one for Chrome. I actually haven't made quite the same thing for Opera. Instead I host Slackware-native Opera packages (along with a SlackBuild).
I liked the simpliciy with which this script seemed to work. The download link changed, so I corrected that and all was well until I ran installpkg <package>. It seemed to install just fine in /usr/lib64/ with a symlink to that target from /usr/bin/firefox. There was also a firefox-bin executable in the/usr/lib64 dir tree, but no matter what I tried I kept getting file no found errors when invoking from either the gui/menu or /usr/bin/firefox & or /usr/lib64/.../firefox-bin or just firefox.

Really kind of weird. I would like to try this out but it doesn't seem to be working. the files are chmod'd to 755 like any others too. it's shows up on ls's, and everything - even cut/paste shows no file by that name.

Odd....

In the meantime I just compiled firefox-17.0b6 from Alien's SlackBuild and installed that resulting package. All seems good, but I was interested in seeing how the binaries do that a lot of people say so many good things about.

Any suggestions?

And what are supposed to be some of the other benefits of using the precompiled binary version? Speed was mentioned, and of course packaging is done in a few seconds as opposed to a lengthy compile, but I'm interested in understanding some of the advantages (and drawbacks) of using the precompiled binary.
 
Old 01-10-2013, 10:07 AM   #13
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,110

Rep: Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180Reputation: 4180
Quote:
Originally Posted by Pixxt View Post
I would love to see Pat do PGO for the whole mozilla suite of programs, it makes a big difference.
PGO seems firefox-only: since today the Slackware firefox build script supports PGO builds and the x86_64 package is done with that.
 
  


Reply



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
Makefiles, building source from another folder with obj files > subfolder of current? Funkster Programming 1 11-11-2011 06:29 AM
[SOLVED] Help building mumble 1.2.2 on Slackware -current 64 D1ver Slackware 12 01-10-2011 09:33 PM
problems building fakenes from source frieza Linux - Software 2 08-28-2010 04:02 PM
LXer: Make Firefox fly: building from a minefield of source LXer Syndicated Linux News 0 06-30-2008 05:10 PM
Building Mozilla or FireFox from source complete Programming 4 09-15-2005 10:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:36 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration