IceCat + zpspell

I got a message from Samed Beyribey, sharing the changes he made to get GNU IceCat working with zpspell for Turkish spell-checking, on Arch GNU/Linux. We are sharing this in hope it can be useful to someone.

Why zpspell? Because "aspell doesn't support Turkish language". For using zpspell, you need to install zemberek-server and zpspell. They're both available in AUR.

The patch used here is made by Pardus developers and they release their patch under the GPL, so this is Free Software :)



PKGBUILD:
# Contributor: Samed Beyribey
# Thanks for Pardus GNU/Linux developers for Spellchecking patch
pkgname=icecat-zemberek
_pkgname=icecat
pkgver=3.0.1g1
_pkgver=3.0.1-g1
pkgrel=1
pkgdesc="GNU version of the Firefox browser."
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/gnuzilla/"
license=('GPL2' 'MPL' 'LGPL')
depends=('gtk2' 'libxt' 'libidl2' 'nss' 'zpspell' 'zemberek-server')
makedepends=('zip' 'tar')
provide=('icecat' 'iceweasel-bin' 'iceweasel' 'firefox' 'mozilla-firefox' \
'mozilla-firebird' 'phoenix' 'swiftweasel' 'swiftfox' \
'icecat-bin' 'icecat-cvs')
conflicts=('icecat' 'icecat-cvs' 'icecat-bin' 'iceweasel-bin')
replaces=()
install=(icecat.install)
source=(ftp://ftp.gnu.org/gnu/gnuzilla/${_pkgver}/${_pkgname}-${_pkgver}.tar.bz2 \
${_pkgname}.desktop \
${_pkgname}-safe.desktop \
${_pkgname}.sh \
${_pkgname}-launcher.sh \
${_pkgname}16.png \
${_pkgname}32.png \
${_pkgname}48.png \
${_pkgname}48.xpm \
icecat_new_files.tar.bz2 \
icecat_icons.tar.gz \
zemberek-firefox3.patch)
md5sums=('c52f5ff97179fa8c5c12f1577e232f9c' \
'2965d6561c4c4473e1e392a20f5e61cb' \
'5c498b31bd52c1f1d92c8d7da27c5d6f' \
'70d93e9755af53ad4d310966a7d55a55' \
'c6ab71d3ed1ee3c767391cd981099a03' \
'ddd0c466cced06ee9f7068a0fc5dda3a' \
'2de250a85719545d3853ebc92240f42a' \
'a04aec7bc8f760f95a3573c641c687e6' \
'df60f7e4f3c6fe3d8b3540f338d4f7fd' \
'1d3e97b290cd4b38a251bffcd10cc9bc' \
'5b3b7e11439e4d3dee52c2f798284e75' \
'43f0783e6284afafbf08d9c1899dfa0a')

#options=('!makeflags')
ICECATDIR="/usr/lib/icecat-${_pkgver}" && export ICECATDIR

build() {
ICECATDIR="/usr/lib/icecat-${_pkgver}" && export ICECATDIR
cd ${startdir}/src/${_pkgname}-${_pkgver}/
#########################################################################
patch -Np1 -i ${srcdir}/zemberek-firefox3.patch

## Temp. solutions: -----------------------------------------------------
tar -zxvf ${startdir}/src/icecat_icons.tar.gz

tar -jxvf ${startdir}/src/icecat_new_files.tar.bz2 || return 1
#unset CFLAGS
#unset CXXFLAGS
#export LDFLAGS="-Wl,-rpath,${ICECATDIR}"
#########################################################################


## Changes in .mozconfig: -----------------------------------------------
## We can just replace whatever .mozconfig given and use our own:
#rm -f ${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig &&
#cp ${startdir}/src/mozconfig \
# ${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig
if [ -f "${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig" ]
then
sed -i 's|--prefix=/usr/local|--prefix=/usr|' \
${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig
else
cp ${startdir}/src/mozconfig \
${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig
echo "ac_add_options --disable-official-branding" \
>>${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig
fi
echo "ac_add_options --with-default-mozilla-five-home=\"${ICECATDIR}\"" \
>>${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig || return 1
##change this to suite your optimization:
if [ "$CARCH" == "i686" ]; then
echo "ac_add_options --enable-optimize=\"${CFLAGS}\"" \
>>${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig || return 1
else
echo "ac_add_options --enable-optimize" \
>>${startdir}/src/${_pkgname}-${_pkgver}/.mozconfig || return 1
fi
export MAKEFLAGS="-j1"
#########################################################################


## configure && make && make install-------------------------------------
./configure --prefix=/usr || return 1
make || return 1
install --directory ${startdir}/pkg
make DESTDIR=${startdir}/pkg install || return 1
#########################################################################


## Final arrangements: --------------------------------------------------
install --directory ${startdir}/pkg/usr/share/applications
install -m644 ${startdir}/src/${_pkgname}.desktop \
${startdir}/pkg/usr/share/applications
install -m644 ${startdir}/src/${_pkgname}-safe.desktop \
${startdir}/pkg/usr/share/applications
install --directory ${startdir}/pkg/usr/share/pixmaps
install -m644 ${startdir}/src/${_pkgname}48.xpm \
${startdir}/pkg/usr/share/pixmaps/${_pkgname}.xpm
install --directory ${startdir}/pkg${ICECATDIR}/chrome/icons/default
rm -f ${startdir}/pkg${ICECATDIR}/chrome/icons/default/default*
install -m644 ${startdir}/src/${_pkgname}16.png \
${startdir}/pkg${ICECATDIR}/chrome/icons/default/default16.png
install -m644 ${startdir}/src/${_pkgname}32.png \
${startdir}/pkg${ICECATDIR}/chrome/icons/default/default32.png
install -m644 ${startdir}/src/${_pkgname}48.png \
${startdir}/pkg${ICECATDIR}/chrome/icons/default/default48.png
install -m644 ${startdir}/src/${_pkgname}48.xpm \
${startdir}/pkg${ICECATDIR}/chrome/icons/default/default.xpm
install --directory ${startdir}/pkg${ICECATDIR}/icons
install -m644 ${startdir}/src/${_pkgname}48.xpm \
${startdir}/pkg${ICECATDIR}/icons/default.xpm
install --directory ${startdir}/pkg/etc/profile.d/
install -m755 ${startdir}/src/${_pkgname}.sh \
${startdir}/pkg/etc/profile.d/
install --directory ${startdir}/pkg/usr/bin/
install -m755 ${startdir}/src/${_pkgname}-launcher.sh \
${startdir}/pkg/usr/bin/${_pkgname}-launcher
cd ${startdir}/pkg${ICECATDIR}
ln -s ${_pkgname} firefox
ln -s ${_pkgname}-bin firefox-bin
# We need to touch tr-TR dictionary files for enabling Turkish dictionary.
touch ${startdir}/pkg${ICECATDIR}/dictionaries/{tr-TR.aff,tr-TR.dic}
}



Here is the zemberek-firefox3.patch.


The rest of the files can be found at: http://aur.archlinux.org/packages/icecat/icecat/

And the PKGBUILD is available on AUR as: icecat-zemberek

Credit: Abdussamed Beyribey (aka ras0ir) + thanks to Pardus GNU/Linux developers for Spellchecking patch.

Create a xpi language extension for IceCat

In the previous post I've explained how to compile IceCat with native support for the language of your choice. Now, I'll explain how to create a xpi language extension to install in IceCat.

Note that the extension gets the name firefox-3.0.1-g1.locale.langpack (for the European Portuguese, the name is firefox-3.0.1-g1.pt-PT.langpack.xpi). I don't know if this is due to the language files, a makefile or something else.

To create a xpi extension, just follow all the steps preceding the compilation of IceCat, like described in the previous post. Then, compile IceCat without the locale flag (just sudo ./configure; sudo make), go to browser/locales inside IceCat's source and execute this command (replacing pt-PT with your locale):

  • sudo make langpack-pt-PT
The xpi extension will be created in dist/install/, in IceCat's source. You'll just have to install it in IceCat in order to have it available in another language.

Compile IceCat with support for your language

Note: This small howto was made using gNewSense. So, in Debian and Ubuntu the procedure will probably be similar, as in other GNU/Linux distributions. I'm assuming that you know which are the dependencies to compile IceCat and have them installed.

I have all my source files in /usr/src, so this will be the "work root".

Open up a terminal, go to /usr/src and run the following commands:

  • sudo cvs -z3 -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk
  • sudo cvs -z3 -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/tools/l10n

After that you will have a mozilla folder. Open it (cd mozilla) and execute the following command to download the locales (don't forget to replate pt-PT with the locale you want):
  • sudo make -f client.mk l10n-checkout MOZ_CO_PROJECT=browser MOZ_CO_LOCALES=pt-PT

When the download is done (that also downloads the mozilla source, but that's how it's explained in http://developer.mozilla.org/en/docs/Patching_a_Localization), a l10n directory will be created in /usr/src, containing the locale you specified. So, go back to /usr/src and enter l10n/pt-PT (remember that pt-PT must be replaced by the locale you downloaded). Now, enter the browser folder in l10n/pt-PT and use the following command:
  • sudo mkdir -p branding/unofficial

Now, without leaving that folder, you will need to copy the brand.dtd and brand.properties files and edit them:
  • sudo cp ../../chrome/branding/brand.*

My brand.dtd and brand.properties files look like this.

I also edit some other files, as you can see in this diff file.

After that, go to icecat's source in /usr/src and compile it with your locale:
  • sudo ./configure --enable-ui-locale=pt-PT; sudo make

User Contributed Packages

So far, we have a source tarball of GNU IceCat 3.0.1-g1, along with i386 binary version for GNU/Linux, and a Debian package as well. Those are the official ones.

Here are more user builds, in hope they will be useful for others, distributed only for the convenience.

WARNING: BY DOWNLOADING AND/OR USING ANY OF THE FOLLOWING, YOU ACCEPT TAKING FULL RESPONSIBILITY.

Arch GNU/Linux:
icecat-bin-3.0.1-3.tar.gz (PKGBUILD for i386 binary)
icecat-3.0g1-3.tar.gz (PKGBUILD)
icecat-3g1-3-i686.pkg.tar.gz (mirror) (binary)
>> md5sum: a7ff1557b886eb6c649a35ffe85c345a
>> sha1sum: 1d90fa098afb0899c29184649b0e9593aeae9f88

icecat-3g1-3-x86_64.pkg.tar.gz (binary) - thanks to Timothy L. (aka Pnevma)
>> compiled with x86_64 CFLAGS "-march-core2 -O2 -pipe"
>> md5sum: eaef0030bf1132631cab6e103787664d
>> sha1sum: ca1d2734c79344092d8cd943f715fb5bc2589fb3

icecat-cvs-20080628-2.tar.gz (PKGBUILD for IceCat 2.0.0.13-g1 from cvs) - thanks to Jan Ježek (aka smaart)

Gentoo GNU/Linux:
(ebuild)


Slackware GNU/Linux:
(slackbuild)