New user registration is currently disabled due to spam abuse / Регистрация новых пользователей в настоящее время приостановлена из-за злоупотреблений спаммерами

GoldenDict for Linux: Changing config location

General discussion

GoldenDict for Linux: Changing config location

Postby makszigaz » Fri Apr 20, 2012 11:59 am

Hi! I've managed to compile GD under Linux Mint 11. I'd like to make it portable by changing the location of the configuration files. Is it possible?
makszigaz
 
Posts: 6
Joined: Wed Mar 21, 2012 3:47 pm

Re: GoldenDict for Linux: Changing config location

Postby chulai » Mon Apr 23, 2012 8:39 pm

There is a Windows portable version. But as far as I know any version can be converted into portable if you create a "portable" directory inside the application directory.

If GD version is made portable then is going to look for:
* a folder "content" inside the application directory where you should store your dictionaries.
* a folder "morphology" inside "content" where you should store your morphologies.

I guess this way you can prevent GD to create a ".goldendict" folder inside your home directory. The settings (index files, config, history, icons, css files) will/should be stored in the "portable" folder.

On a side note, you need still to have Qt and other libraries installed for GD to work.

Give it a try.
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: GoldenDict for Linux: Changing config location

Postby ikm » Tue Apr 24, 2012 2:50 am

GD will become portable if the 'portable' dir is created in the same dir the executable is in. The type of the OS doesn't matter.
ikm
Автор GoldenDict
 
Posts: 1595
Joined: Wed Feb 04, 2009 10:40 am

Re: GoldenDict for Linux: Changing config location

Postby makszigaz » Wed Apr 25, 2012 9:28 am

Thanks for the replies!

Yes, chulai, the prerequisites are probably a problem in case of public computers, which I was going to try GD out on in the first place, but I can't install any packages on any of them. But at least I can find and backup the configuration files more easily at home. So thanks again!
makszigaz
 
Posts: 6
Joined: Wed Mar 21, 2012 3:47 pm

Re: GoldenDict for Linux: Changing config location

Postby chulai » Wed Apr 25, 2012 4:25 pm

Yes, but bear in mind that's not a GD limitation. It's how Unix (and Linux) systems work: they rely heavily on shared libraries. You have 2 options at least:

1) Statically link all dependencies. You will need to compile QT statically first before being able to build them with GoldenDict. This probably is NOT an option because Qt libraries can not be statically linked as it goes against the LGPL licence. You might need to have a commercial licence for that and again I'm not sure if that's even possible because GoldenDict has a GPLv3 licence. Please read about that here http://blog.qt.nokia.com/2009/11/30/qt- ... -decision/ and here http://qt-project.org/doc/qt-5.0/deployment.html or google it. Maybe you can do it for personal use and if you don't distribute the program. I'm not a lawyer :)

2) Create a shell scripts that modify the LD_LIBRARY_PATH environment variable used by the dynamic linker. This way you can temporarilly change a library for another located on the same directory as GoldenDict. This settings exist while GoldenDict is running. It can have issues with existing installed program. If you want to know all GoldenDict dependencies you have to run $ ldd /path/to/executable/goldendict on a terminal. This is my output:

linux-gate.so.1 => (0x00557000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0x00110000)
libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00a08000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0x00125000)
libXtst.so.6 => /usr/lib/libXtst.so.6 (0x00f3f000)
libvorbisfile.so.3 => /usr/lib/i386-linux-gnu/libvorbisfile.so.3 (0x00edc000)
libhunspell-1.2.so.0 => /usr/lib/libhunspell-1.2.so.0 (0x0025b000)
libQtWebKit.so.4 => /usr/lib/i386-linux-gnu/libQtWebKit.so.4 (0x00f46000)
libphonon.so.4 => /usr/lib/libphonon.so.4 (0x00562000)
libQtXml.so.4 => /usr/lib/i386-linux-gnu/libQtXml.so.4 (0x00959000)
libQtGui.so.4 => /usr/lib/i386-linux-gnu/libQtGui.so.4 (0x1ab5a000)
libQtNetwork.so.4 => /usr/lib/i386-linux-gnu/libQtNetwork.so.4 (0x002b1000)
libQtCore.so.4 => /usr/lib/i386-linux-gnu/libQtCore.so.4 (0x00a19000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x00855000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0x003ed000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x00897000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0x004d8000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00d46000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0x004f6000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00515000)
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0x0051a000)
libvorbis.so.0 => /usr/lib/i386-linux-gnu/libvorbis.so.0 (0x005cf000)
libogg.so.0 => /usr/lib/i386-linux-gnu/libogg.so.0 (0x0052d000)
libsqlite3.so.0 => /usr/lib/i386-linux-gnu/libsqlite3.so.0 (0x005fa000)
libXrender.so.1 => /usr/lib/i386-linux-gnu/libXrender.so.1 (0x007d4000)
libgstapp-0.10.so.0 => /usr/lib/libgstapp-0.10.so.0 (0x00535000)
libgstinterfaces-0.10.so.0 => /usr/lib/libgstinterfaces-0.10.so.0 (0x00542000)
libgstpbutils-0.10.so.0 => /usr/lib/libgstpbutils-0.10.so.0 (0x0069c000)
libgstvideo-0.10.so.0 => /usr/lib/libgstvideo-0.10.so.0 (0x006bc000)
libgstbase-0.10.so.0 => /usr/lib/libgstbase-0.10.so.0 (0x006c9000)
libgstreamer-0.10.so.0 => /usr/lib/libgstreamer-0.10.so.0 (0x1cbe5000)
libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0x00722000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0x1cf96000)
libpulse.so.0 => /usr/lib/i386-linux-gnu/libpulse.so.0 (0x00771000)
libpulse-mainloop-glib.so.0 => /usr/lib/i386-linux-gnu/libpulse-mainloop-glib.so.0 (0x00558000)
libQtDBus.so.4 => /usr/lib/i386-linux-gnu/libQtDBus.so.4 (0x008c1000)
libfontconfig.so.1 => /usr/lib/i386-linux-gnu/libfontconfig.so.1 (0x007df000)
libaudio.so.2 => /usr/lib/i386-linux-gnu/libaudio.so.2 (0x00814000)
libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0x0099a000)
libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0x1c3dd000)
libSM.so.6 => /usr/lib/i386-linux-gnu/libSM.so.6 (0x007bf000)
libICE.so.6 => /usr/lib/i386-linux-gnu/libICE.so.6 (0x00870000)
libXi.so.6 => /usr/lib/i386-linux-gnu/libXi.so.6 (0x0093b000)
libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0x007c8000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0x0088a000)
/lib/ld-linux.so.2 (0x00834000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0x0055e000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0x0094b000)
libgmodule-2.0.so.0 => /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0 (0x007ce000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x0269d000)
libffi.so.6 => /usr/lib/i386-linux-gnu/libffi.so.6 (0x00952000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0x009c4000)
libjson.so.0 => /usr/lib/i386-linux-gnu/libjson.so.0 (0x00cba000)
libpulsecommon-1.0.so => /usr/lib/i386-linux-gnu/libpulsecommon-1.0.so (0x00cc2000)
libdbus-1.so.3 => /lib/i386-linux-gnu/libdbus-1.so.3 (0x00ee6000)
libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0x1271a000)
libXt.so.6 => /usr/lib/i386-linux-gnu/libXt.so.6 (0x1bcc4000)
libuuid.so.1 => /lib/i386-linux-gnu/libuuid.so.1 (0x0082e000)
libwrap.so.0 => /lib/i386-linux-gnu/libwrap.so.0 (0x00d27000)
libsndfile.so.1 => /usr/lib/i386-linux-gnu/libsndfile.so.1 (0x19d2b000)
libasyncns.so.0 => /usr/lib/i386-linux-gnu/libasyncns.so.0 (0x00d31000)
libnsl.so.1 => /lib/i386-linux-gnu/libnsl.so.1 (0x08f93000)
libFLAC.so.8 => /usr/lib/i386-linux-gnu/libFLAC.so.8 (0x027ea000)
libvorbisenc.so.2 => /usr/lib/i386-linux-gnu/libvorbisenc.so.2 (0x02e5b000)
libresolv.so.2 => /lib/i386-linux-gnu/libresolv.so.2 (0x00ec4000)

Then you can have a mixed of both options or check on google for other ways to create portable linux apps. I have found this link that covers several solutions: http://hacktolive.org/wiki/Methods_for_ ... s_on_Linux

Creating a 100% standalone portable app that work on all Linux systems from a pen drive might be an impossible task.

Hope this makes any sense,

Chulai
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: GoldenDict for Linux: Changing config location

Postby makszigaz » Wed Apr 25, 2012 5:04 pm

Thanks for the further explanation, chulai!

I have 2 more questions.

So, if I choose the 2nd option, then all I have to do is find out which libraries are being used with the command you mentioned, copy them to somewhere else, let's say, on my pendrive, and create a script that tells GD to use the ones in the specified location, right?

Plus, how shall I use the LD_LIBRARY_PATH? I found many pages by searching the web, but they are too complex to me.

By the way, I don't think I really know anything about scripting on Linux. :)
makszigaz
 
Posts: 6
Joined: Wed Mar 21, 2012 3:47 pm

Re: GoldenDict for Linux: Changing config location

Postby chulai » Wed Apr 25, 2012 6:17 pm

makszigaz wrote:Thanks for the further explanation, chulai!

I have 2 more questions.

So, if I choose the 2nd option, then all I have to do is find out which libraries are being used with the command you mentioned, copy them to somewhere else, let's say, on my pendrive, and create a script that tells GD to use the ones in the specified location, right?



Correct. Depending on your system the dependencies might vary. You will have to find out what is the common ground you need for other Linux distributions. It's a lot of trial & error I guess.

makszigaz wrote:
Plus, how shall I use the LD_LIBRARY_PATH? I found many pages by searching the web, but they are too complex to me.

By the way, I don't think I really know anything about scripting on Linux. :)


If you don't have scripting/programming experience I would suggest you to not go ahead with this. You would get into troubles. As I said before changing the LD_LIBRARY_PATH env variable can affect other programs in the system.

Regards,

Chulai
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: GoldenDict for Linux: Changing config location

Postby makszigaz » Thu Apr 26, 2012 12:03 pm

Well, I think I won't go ahead with it then. :)

Anyway, I checked out AppImages on the list of methods to make portable Linux applications, led to by the link that you included in one of your posts, and found that GD is among the available apps. It can be downloaded here: http://portablelinuxapps.org/office/goldendict

I have also just tried it and it works flawlessly on two public computers. The only limitation is that the latest available version is 0.9 and everything is put in a single read-only file. So I may try to make a appimage of a newer version that is pre-configured or make a request on their website.
makszigaz
 
Posts: 6
Joined: Wed Mar 21, 2012 3:47 pm

Re: GoldenDict for Linux: Changing config location

Postby chulai » Sun Jun 17, 2012 11:35 pm

Hi makszigaz,
I finally created a GoldenDict Portable Linux Version with AppImageKit. It has the last changes as of 2012-05-20. Give it a try here.


makszigaz wrote:Well, I think I won't go ahead with it then. :)

Anyway, I checked out AppImages on the list of methods to make portable Linux applications, led to by the link that you included in one of your posts, and found that GD is among the available apps. It can be downloaded here: http://portablelinuxapps.org/office/goldendict

I have also just tried it and it works flawlessly on two public computers. The only limitation is that the latest available version is 0.9 and everything is put in a single read-only file. So I may try to make a appimage of a newer version that is pre-configured or make a request on their website.
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: GoldenDict for Linux: Changing config location

Postby makszigaz » Sat Jun 23, 2012 6:27 pm

chulai wrote:Hi makszigaz,
I finally created a GoldenDict Portable Linux Version with AppImageKit. It has the last changes as of 2012-05-20. Give it a try here.


makszigaz wrote:Well, I think I won't go ahead with it then. :)

Anyway, I checked out AppImages on the list of methods to make portable Linux applications, led to by the link that you included in one of your posts, and found that GD is among the available apps. It can be downloaded here: http://portablelinuxapps.org/office/goldendict

I have also just tried it and it works flawlessly on two public computers. The only limitation is that the latest available version is 0.9 and everything is put in a single read-only file. So I may try to make a appimage of a newer version that is pre-configured or make a request on their website.


Thanks for the creation and letting me know about it! I'll try it soon and write in the thread you created in case I run in into any problems.
makszigaz
 
Posts: 6
Joined: Wed Mar 21, 2012 3:47 pm


Return to General

Who is online

Users browsing this forum: No registered users and 44 guests