[ARCH] Portable GoldenDict without Phonon and PulseAudio

OSS specific Linux discussion (x86/amd64)

Moderators: hannu, dev, cesium, kodachi

[ARCH] Portable GoldenDict without Phonon and PulseAudio

Postby igorzwx » Wed Dec 01, 2010 10:25 am

It is suggested that you have the Arch Build System installed. If not, it is easy to install.
http://wiki.archlinux.org/index.php/ABS

Step 1: Install the Arch Build System

Code: Select all
# pacman -Syy
# pacman -Syu
# pacman -S abs
# pacman -S base-devel


Step 2: Download the ABS tree

Code: Select all
# abs


Step 3: Download and unpack "goldendict-git-without-phonon.tar.bz2" (in the Attachment)

Code: Select all
$ tar -xf goldendict-git-without-phonon.tar.bz2

$ cd goldendict-git-without-phonon


Step 4: Run makepkg (as ordinary user)

Code: Select all
$ makepkg


The result should look like this:

Code: Select all
$ ls
goldendict-git-without-phonon-20101201-1-i686.pkg.tar.xz 
goldendict-paths.diff 
goldendict-phonon-disable.diff 
pkg 
PKGBUILD 
src


"goldendict-git-without-phonon-20101201-1-i686.pkg.tar.xz" (752.1 KB) is Arch package (it can be installed as usual, but it is not necessary)

"./pkg/usr/bin/goldendict" (1.9 MB) is executable (portable)

"./pkg/usr/share/pixmaps/goldendict.png" (1.1 KB) is icon for Gnome menu

Everything is portable and can be used as is.

Step 5: Run portable GoldenDict (as ordinary user):

Code: Select all
$ ./pkg/usr/bin/goldendict


Config-files are stored in the hidden folder: ~/.goldendict
You can always remove it.

The free English-Russian-English Dictionary with sound (English word pronunciations) can be downloaded here:
http://goldendict.org/download.php
En-Ru-En content, 62MB
http://downloads.sourceforge.net/golden ... .1.tar.bz2

Unpack it somewhere, then GoldenDict → Edit → Dictionaries → Files → Add
Add path to folder, e.g. .../enruen-content-1.1

Check sound settings: GoldenDict → Edit → Preferences → Audio → Phonon
You may select "Phonon", and sound will be played (through MPlayer), even if Phonon is not installed.

There is a lot of MPlayers in Arch Repositories (they were not infected with PulseAudio few days ago, and they are not likely to be infected in the near future).

Code: Select all
$ yaourt mplayer-svn
1 adslgr32/mplayer-svn 32623-1 (video-playback-svn video-encoding-svn)
    A movie player for linux
2 adslgr32/smplayer-svn 3591-1 (video-playback-svn)
    A complete front-end for MPlayer
3 archstuff/mplayer-svn 32524-1
    A movie player for linux
4 archstuff/smplayer-svn 3565-1
    A complete front-end for MPlayer
5 nightly/mplayer-svn 31826-1
    A movie player for linux
8 aur/mplayer-svn 32399-1 (202)
    A movie player for linux
11 aur/smplayer-svn 3515-1 (254)
    A complete front-end for MPlayer
==> Enter n° of packages to be installed (ex: 1 2 3 or 1-3)
==> -------------------------------------------------------
==>


Installation of GoldenDict is not necessary, but if you want, you can:

Code: Select all
$ sudo pacman -U goldendict-git-without-phonon-20101201-1-i686.pkg.tar.xz
Password:
resolving dependencies...
looking for inter-conflicts...

Targets (1): goldendict-git-without-phonon-20101201-1

Total Download Size:    0.00 MB
Total Installed Size:   2.41 MB

Proceed with installation? [Y/n] y
checking package integrity...
(1/1) checking for file conflicts                  [######################################################] 100%
(1/1) installing goldendict-git-without-phonon     [######################################################] 100%


Read more: http://en.wikipedia.org/wiki/GoldenDict

In the Attachment: goldendict-git-without-phonon.tar.bz2
Code: Select all
md5sum:
7cfbe55db24bb0f8e81de428f0320f0c  goldendict-git-without-phonon.tar.bz2
Attachments
goldendict-git-without-phonon.tar.bz2
md5sum: 7cfbe55db24bb0f8e81de428f0320f0c
(3.17 KiB) Downloaded 497 times
igorzwx
Moderator
 
Posts: 1005
Joined: Sun Jun 28, 2009 9:31 pm

Re: [ARCH] Portable GoldenDict without Phonon and PulseAudio

Postby igorzwx » Wed Dec 08, 2010 1:21 am

Update for "goldendict-git-without-phonon"

CHANGES: minor improvements in PKGBUILD

This is the difference:

Code: Select all
#  Pathing... !!! instead of "patch", SED commands are used !!!
#  patch -Np0 -i ${srcdir}/goldendict-paths.diff || return 1

msg "SED: Patching paths ..."
# Patching paths in "./src/goldendict-build/goldendict.pro"
# SED commands are applied instead of "goldendict-paths.diff"
# The first command removes "/local" in the path
sed -i.bak -e 's|usr/local|usr|g' $srcdir/$_gitname-build/goldendict.pro
# The second command removes "apps/" in the path
sed -i.bak -e 's|apps/goldendict|goldendict|g' $srcdir/$_gitname-build/goldendict.pro
msg2 "Done SED Patching paths !"


This innovation may make the "patch for paths" more durable.

NOTE: This "patch for paths" is specific for Arch Linux and, perhaps, other BSD-like distros. You may not need this patch for Ubuntu/Debian

In any case, a small correction of paths in a configuration file can be easily made with SED.

Note: If you need only to change one or two lines in a file (ie: a Makefile), you may be better off investigating the properties of sed instead. https://wiki.archlinux.org/index.php/Patching_in_ABS


The current git-version of GoldenDict is 1.0.1-4-gf71c0ac-dirty. It seems to perform better than previous versions, largely because, perhaps, some bugs were removed. But it is still terribly slow in comparison with StarDict. Another possible reason for troubles is that GoldenDict is ill-designed. Why do they need Phonon, if all sounds are played through MPlayer? Phonon appears to be used on MS Windows (see "./src/goldendict-build/articleview.cc"). Why not disable it on Linux with a kind of "if"? Because the code is not documented (as it should), and, therefore, it might be difficult to modify it. The worry is that they are likely to use PulseAudio for the same purpose (through Phonon and libpulse).

CONCLUSION: GoldenDict makes sense for those, who want to learn "patching". If you need dictionary, you may better try StarDict. It is easy to install, and you do not need to compile anything.

StarDict is available in the official repository:

Code: Select all
$ yaourt stardict
1 extra/stardict 3.0.1-3 [installed]
    A powerful international dictionary written in Gtk2.


It can be installed with one command:

Code: Select all
# pacman -S stardict

In the Attachment:
goldendict-git-without-phonon-v2.tar.bz2
Code: Select all
md5sum: 16d8f4519dd6ad7ec7f690ce77179b3e 

Installation instructions are in the first post.
Attachments
goldendict-git-without-phonon-v2.tar.bz2
md5sum: 16d8f4519dd6ad7ec7f690ce77179b3e
(3.37 KiB) Downloaded 509 times
igorzwx
Moderator
 
Posts: 1005
Joined: Sun Jun 28, 2009 9:31 pm


Return to Linux

Who is online

Users browsing this forum: Google [Bot] and 1 guest