Scrivener is a wonderful software and it is a chance for the community to get it running on the Linux system in the best way.
To help users who got some difficulties installing the speller I’ve updated the procedure of edf
and add improvements allowing me to install the spelling. Here the procedure works for ubuntu/debian systems (.deb package).
With this procedure :
There is no need to install another instance of ubuntu in 32bits
nor create a chrooted 32bits environment to installed scrivener in it.
This procedure is based on the detailed previous one, but I’ve encounter issues that
I’ve solved here adding the improvements and provide more details to help
the users to understand their issues.
To get the speller working with ubuntu 12.04 to 13.10 in 64 bits mode :
The procedure :
Install scrivener with the ia32 dependencies (in my case I’ve installed skype
with synaptic, it adds automatically the 32 bits dependencies) :
Download the .deb package and install it with dpkg :
cd /tmp
wget http://www.literatureandlatte.com/scrivenerforlinux/scrivener-1.6.1.1-beta.deb
sudo dpkg -i scrivener-1.6.1.1-beta.deb
Post scrivener installation to allow the access from your user account (replace fred by your user name) :
sudo chown -R root:fred /usr/share/scrivener
sudo chmod -R 771 /usr/share/scrivener
Now we need to get the missing dependencies in 32 bits :
Download the aspell packages with the shared library:
http://packages.ubuntu.com/precise/i386/aspell/download
http://packages.ubuntu.com/precise/i386/libaspell15/download
Download two other missing shared libraries :
http://packages.ubuntu.com/precise/i386/libncursesw5/download
http://packages.ubuntu.com/fr/precise/i386/libtinfo5/download
[code]cd /tmp
mkdir aspell libaspell libncursesw5 libtinfo5
dpkg -x ~downloads/aspell*_i386.deb aspell
dpkg -x ~downloads/libaspell15*_i386.deb libaspell
dpkg -x ~downloads/libncursesw5_5.9-4_i386.deb libncursesw5
dpkg -x ~downloads/libtinfo5_5.9-4_i386.deb libtinfo5
cp -r /usr/lib/aspell /usr/share/scrivener/lib
sudo cp -i aspell/usr/bin/* /usr/share/scrivener/bin/
sudo cp -r libaspell/usr/lib/aspell/* /usr/share/scrivener/lib/aspell/
sudo cp libaspell/usr/lib/libaspell.so.15.2.0 libaspell/usr/lib/libpspell.so.15.2.0 /usr/share/scrivener/lib
sudo cp libncursesw5/lib/i386-linux-gnu/libncursesw.so.5.9 /usr/share/scrivener/lib/
sudo cp libtinfo5/lib/i386-linux-gnu/libtinfo.so.5.9 /usr/share/scrivener/lib/[/code]
Creation of the symbolic links :
[code]# get root
sudo su
cd /usr/share/scrivener/lib
ln -s libaspell.so.15.2.0 libaspell.so
ln -s libaspell.so.15.2.0 libaspell.so.15
ln -s libpspell.so.15.2.0 libpspell.so
ln -s libpspell.so.15.2.0 libpspell.so.15
ln -s libtinfo.so.5.9 libtinfo.so
ln -s libtinfo.so.5.9 libtinfo.so.5
ln -s libncursesw.so.5.9 libncursesw.so
ln -s libncursesw.so.5.9 libncursesw.so.5
rm /usr/share/scrivener/lib/aspell/.rws
cp /var/lib/aspell/.rws /usr/share/scrivener/lib/aspell/
exit[/code]
The new scripts add some variables to the previous one :
echo '#!/bin/sh' > /tmp/gen_32_aspell_dicts.sh
echo "ASPELL_CONF='prefix /usr/share/scrivener'" >> /tmp/gen_32_aspell_dicts.sh
echo 'PATH="/usr/share/scrivener/bin:$PATH"' >> /tmp/gen_32_aspell_dicts.sh
echo 'LD_LIBRARY_PATH="/usr/share/scrivener/lib:$LD_LIBRARY_PATH"' >> /tmp/gen_32_aspell_dicts.sh
echo 'AC_CONF="/usr/share/scrivener"' >> /tmp/gen_32_aspell_dicts.sh
echo export ASPELL_CONF PATH LD_LIBRARY_PATH >> /tmp/gen_32_aspell_dicts.sh
chmod +x /tmp/gen_32_aspell_dicts.sh
sudo /usr/sbin/aspell-autobuildhash --dry-run --force 2>&1 | grep zcat | sed -e 's/var\/lib/usr\/share\/scrivener\/lib/' -e 's/usr\/lib/usr\/share\/scrivener\/lib/' >> /tmp/gen_32_aspell_dicts.sh
It creates a new script which look like that (this is my example do not execute it) :
[code]#!/bin/sh
ASPELL_CONF=‘prefix /usr/share/scrivener’
PATH="/usr/share/scrivener/bin:$PATH"
LD_LIBRARY_PATH="/usr/share/scrivener/lib:$LD_LIBRARY_PATH"
AC_CONF="/usr/share/scrivener"
export ASPELL_CONF PATH LD_LIBRARY_PATH
zcat /usr/share/aspell/en-common.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-common.rws
zcat /usr/share/aspell/en-variant_0.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-variant_0.rws
zcat /usr/share/aspell/en-variant_1.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-variant_1.rws
zcat /usr/share/aspell/en-variant_2.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-variant_2.rws
zcat /usr/share/aspell/en-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-w_accents-only.rws
zcat /usr/share/aspell/en-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-wo_accents-only.rws
zcat /usr/share/aspell/en_CA-variant_0.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_CA-variant_0.rws
zcat /usr/share/aspell/en_CA-variant_1.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_CA-variant_1.rws
zcat /usr/share/aspell/en_CA-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_CA-w_accents-only.rws
zcat /usr/share/aspell/en_CA-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_CA-wo_accents-only.rws
zcat /usr/share/aspell/en_GB-ise-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-ise-w_accents-only.rws
zcat /usr/share/aspell/en_GB-ise-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-ise-wo_accents-only.rws
zcat /usr/share/aspell/en_GB-ize-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-ize-w_accents-only.rws
zcat /usr/share/aspell/en_GB-ize-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-ize-wo_accents-only.rws
zcat /usr/share/aspell/en_GB-variant_0.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-variant_0.rws
zcat /usr/share/aspell/en_GB-variant_1.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-variant_1.rws
zcat /usr/share/aspell/en_US-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_US-w_accents-only.rws
zcat /usr/share/aspell/en_US-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_US-wo_accents-only.rws
zcat /usr/share/aspell/fr-40-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=fr create master /usr/share/scrivener/lib/aspell/fr-40-only.rws
zcat /usr/share/aspell/fr-60-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=fr create master /usr/share/scrivener/lib/aspell/fr-60-only.rws
zcat /usr/share/aspell/fr-80-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=fr create master /usr/share/scrivener/lib/aspell/fr-80-only.rws
zcat /usr/share/aspell/fr_CH-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=fr create master /usr/share/scrivener/lib/aspell/fr_CH-only.rws[/code]
Lanch the generated script :
sudo sh /tmp/gen_32_aspell_dicts.sh
I’ve made some modifications on the previous scripts to add path to the shared libraries
in order to solved the error : wrong ELF class: ELFCLASS64
If you already have the ELFCLASS64 error (which means that a 32 bits program try to load a 64 bits shared library), verify there is no missing dependencies with the load libraries command :
ASPELL_CONF='prefix /usr/share/scrivener'
PATH="/usr/share/scrivener/bin:$PATH"
LD_LIBRARY_PATH="/usr/share/scrivener/lib:$LD_LIBRARY_PATH"
AC_CONF="/usr/share/scrivener"
export ASPELL_CONF PATH LD_LIBRARY_PATH
ldd /usr/share/scrivener/bin/aspell
You must get something like that :
linux-gate.so.1 => (0xf7725000)
libaspell.so.15 => /usr/share/scrivener/lib/libaspell.so.15 (0xf766e000)
libncursesw.so.5 => /usr/share/scrivener/lib/libncursesw.so.5 (0xf763e000)
libtinfo.so.5 => /usr/share/scrivener/lib/libtinfo.so.5 (0xf761e000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf751a000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7366000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7361000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf731e000)
/lib/ld-linux.so.2 (0xf7726000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7300000)
No dependencies are missing as we can see in my example.
We know have to update the launch script of scrivener :
Add at the beginning of the script /usr/share/scrivener/bin/scrivener.sh (after #! /bin/sh) :
ASPELL_CONF='prefix /usr/share/scrivener'
PATH="/usr/share/scrivener/bin:$PATH"
export ASPELL_CONF PATH
You must get something like that :
[code]#! /bin/sh
ASPELL_CONF=‘prefix /usr/share/scrivener’
PATH="/usr/share/scrivener/bin:$PATH"
export ASPELL_CONF PATH
makeAbsolut() {
case $1 in
/*)
# already absolute, return it
echo "$1"
;;
*)
# relative, prepend $2 made absolute
echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,'
;;
esac
}
me=which "$0"
# Search $PATH if necessary
if test -L “$me”; then
# Try readlink(1)
readlink=type readlink 2>/dev/null
|| readlink=
if test -n “$readlink”; then
# We have readlink(1), so we can use it. Assuming GNU readlink (for -f).
me=readlink -nf "$me"
else
# No readlink(1), so let’s try ls -l
me=ls -l "$me" | sed 's/^.*-> //'
base=dirname "$me"
me=makeAbsolute "$me" "$base"
fi
fi
bindir=dirname "$me"
libdir=cd "$bindir/../lib" ; pwd
LD_LIBRARY_PATH=$libdir
export LD_LIBRARY_PATH
unset QT_PLUGIN_PATH
exec “$bindir/Scrivener” ${1+"$@"}[/code]
To get it definitively work, a last chown is needed to restaure the rights to the user :
(replace fred by your user name)
sudo chown -R root:fred /usr/share/scrivener
Launch scrivener, and your spelling is now fully working you just have to manage it in the options.
Have fun !
Fred