How to create FileZilla distributable from source for Linux?

Moderator: Project members

Post Reply
Message
Author
test
150 Opening data channel
Posts: 55
Joined: 2020-03-24 06:36

How to create FileZilla distributable from source for Linux?

#1 Post by test » 2020-04-30 16:32

Hi!

I have successfully compiled FileZIlla source code on Ubuntu 18.04.4 by following https://wiki.filezilla-project.org/wiki ... s_on_Linux

The filezilla binary was installed in ~/prefix/bin directory & runs by ./filezilla command successfully.

I was figuring out if there was a way to create FileZilla distributable for Linux, similar to what is mentioned for Windows at https://wiki.filezilla-project.org/Comp ... er_Windows. But, I could not find any proper tutorial for that.

I tried one method as follows:

I created a zip file of the ~/prefix directory from the system in which it was compiled (Let's call that System1), copied that .zip to another Ubuntu system (Let's call that System2).
Then, I extracted the prefix directory from that .zip to $HOME directory in the System2.

Then, I tried executing the filezilla binary in ~/prefix/bin directory as follows:

Code: Select all

cd ~/prefix/bin
./filezilla
On executing that, I got the following error message:

Code: Select all

./filezilla: error while loading shared libraries: libwx_gtk2u_html-3.0.so.0: cannot open shared object file: No such file or directory

However, when I executed the following commands, I was able to successfully run FileZilla on System2 without any recompilation:

Code: Select all

export PATH="$HOME/prefix/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
cd ~/prefix/bin
./filezilla
Is my method an appropriate one or is there any standard method for any Linux or only Ubuntu distributable?

Kindly help
Thanks

User avatar
botg
Site Admin
Posts: 35491
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: How to create FileZilla distributable from source for Linux?

#2 Post by botg » 2020-05-01 09:02

It's a common approach to use the environment variables like this.

There exists another solution as well by patching a different rpath relative to the binary location into all the shipped binaries.

test
150 Opening data channel
Posts: 55
Joined: 2020-03-24 06:36

Re: How to create FileZilla distributable from source for Linux?

#3 Post by test » 2020-05-01 10:54

Thanks a lot! :D :D :D

test
150 Opening data channel
Posts: 55
Joined: 2020-03-24 06:36

Re: How to create FileZilla distributable from source for Linux?

#4 Post by test » 2020-05-09 08:42

There is one more issue.

The filezilla distributable, which I created by making a .zip of the prefix folder, is around 110 MB, whereas the Linux 64-bit binary size as seen from https://filezilla-project.org/download.php?show_all=1 official downloads webpage is around 9-10 MB for the same version 3.48.0.

When I had tried the steps mentioned in https://wiki.filezilla-project.org/wiki ... s_on_Linux, I had got a lot of errors one after another, as follows:

i) On compiling filezilla version 3.48.0 source code, it displayed error: libfilezilla version required is >= 0.21.0 currently it is 0.15.1

ii) On compiling libfilezilla 0.21.0, it showed compilation error which was occuring due to missing gnutls dependency

iii) Then, the gnutls dependency further showed error Libnettle 3.4.1 was not found., which was occuring due to missing nettle dependency. Then I compiled nettle successfully

iv) On compiling gnutls dependency, it then showed error: gmp-support not enabled for nettle. I resolved that by recompiling nettle with gmp-support enabled & then recompiling gnutls

After all these errors were resolved, the libfilezilla dependency & filezilla(3.48.0) source code was successfully compiled on Ubuntu 18.04

(I had tried all the compilation steps in a newly installed Ubuntu Virtual Machine instance so as to check if any extra dependencies need to be installed besides those mentioned in the official compilation instructions)

Probably this is the reason why my distributable size is 110 MB, even in .zip format.

I just saw that the Linux compilation instructions were last updated on Feb 2019 & correspond to older version i.e. v3.40. So, it seems that they need to be updated

I don't know how to reduce the size of distributable

Kindly help
Thanks again!

User avatar
botg
Site Admin
Posts: 35491
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: How to create FileZilla distributable from source for Linux?

#5 Post by botg » 2020-05-11 07:15

I had got a lot of errors one after another
Transitive dependencies, makes one appreciate how deep the rabbit hole goes if doing it manually as opposed to using a package manager.
Ubuntu 18.04
Quite old, I cannot recommend using this ancient distribution.

Probably this is the reason why my distributable size is 110 MB, even in .zip format.
You likely still have debug information in all the binaries. Try stripping it away.

test
150 Opening data channel
Posts: 55
Joined: 2020-03-24 06:36

Re: How to create FileZilla distributable from source for Linux?

#6 Post by test » 2020-05-14 17:57

I tried strip --strip-debug command & the distributable size got compressed to around 25% of the original size.

Thanks

Post Reply