Compiling FileZilla 3 under Windows: Difference between revisions

From FileZilla Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 32: Line 32:
  pacman -S ca-certificates
  pacman -S ca-certificates


=Downloading dependencies=
== Setting up the environment==


==Download GMP==
Execute the following commands:0
mkdir ~/prefix
echo 'export PATH="$HOME/prefix/bin:/mingw64/bin:/mingw32/bin:$PATH"' >> ~/.profile
echo 'export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig"' >> ~/.profile
echo 'export PATH="$HOME/prefix/bin:/mingw64/bin:/mingw32/bin:$PATH"' >> ~/.bash_profile
echo 'export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig"' >> ~/.bash_profile
 
=Building dependencies=
 
==Building GMP==


  cd ~
  cd ~
  curl -O https://gmplib.org/download/gmp/gmp-6.0.0a.tar.xz
  curl -O https://gmplib.org/download/gmp/gmp-6.0.0a.tar.xz
tar xf gmp-6.0.0a.tar.xz
cd gmp-6.0.0a
./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-static --disable-shared --enable-fat
make && make install


==Download Nettle==
==Building Nettle==


  cd ~
  cd ~
  wget http://ftp.gnu.org/gnu/nettle/nettle-3.1.1.tar.gz
  wget http://ftp.gnu.org/gnu/nettle/nettle-3.1.1.tar.gz
tar xf nettle-3.1.1.tar.gz
cd nettle-3.1.1
./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-static --disable-shared --enable-fat
make && make install


==Download GnuTLS==
==Building zlib==
 
cd ~
wget http://zlib.net/zlib-1.2.8.tar.gz
tar xf zlib-1.2.8
cd zlib-1.2.8
./configure --prefix="$HOME/prefix" --static
make && make install
 
==Building GnuTLS==


  cd ~
  cd ~
  wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.4.1.tar.xz
  wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.4.1.tar.xz
tar xf gnutls-3.4.4.1.tar.xz
cd gnutls-3.4.4.1
./configure --prefix="$HOME/prefix" --enable-static --disable-shared --build=x86_64-w64-mingw32 --with-included-libtasn1 --disable-doc --disable-guile --without-p11-kit --enable-local-libopts
make && make install


==Download SQLite==
==Building SQLite==


  cd ~
  cd ~
  wget https://sqlite.org/2015/sqlite-autoconf-3081101.tar.gz
  wget https://sqlite.org/2015/sqlite-autoconf-3081101.tar.gz
tar xf sqlite-autoconf-3081101.tar.gz
cd sqlite-autoconf-3081101
./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-static --disable-shared
make && make install


==Download wxWidgets==
==Building wxWidgets==


  cd ~
  cd ~
  svn co https://github.com/wxWidgets/wxWidgets/branches/WX_3_0_BRANCH wx3
  svn co https://github.com/wxWidgets/wxWidgets/branches/WX_3_0_BRANCH wx3
cd wx3
./configure --prefix="$HOME/prefix" --enable-static --disable-shared --build=x86_64-w64-mingw32 --enable-unicode --without-libtiff
make && make install
=Building  Filezilla=


==Download FileZilla==
==Download FileZilla==
Line 63: Line 102:
  cd ~
  cd ~
  svn co https://svn.filezilla-project.org/svn/FileZilla3/trunk filezilla
  svn co https://svn.filezilla-project.org/svn/FileZilla3/trunk filezilla
=Build Filezilla=


==Fetch patch and build script==
==Fetch patch and build script==

Revision as of 10:03, 11 September 2015

This documentation explains how to setup a build environment for FileZilla 3 and how to compile it under Windows using msys2. Msys2 is a cygwin environment.

It will take some time to get everything working, but you will be able to use the build environment for other programs too.

Note to wiki contributors: Do not change version numbers on your own. The build process is somewhat fragile and does break if you change things

Installing the MSYS2 environment

Download the 64bit MSYS2 installer: msys2-x86_64-20150512.exe

Install MSYS2 to c:\msys64.

Installing the compiler toolchain

FileZilla's shell extension needs to be build both for 32bit as well as 64bit, hence we're going to need compilers for both 32bit and 64bit.

Tools and compiler

First update

Start the MSYS2 shell

pacman -Syu

close MSYS shell, and maybe you will need rebase (Google for details, just run a autorebase.bat in C:\msys64).

Install tools and compiler toolchain

Start MSYS2 shell, execute the following command:

pacman -S base-devel msys2-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain 
pacman -S svn git curl wget
pacman -S ca-certificates

Setting up the environment

Execute the following commands:0

mkdir ~/prefix
echo 'export PATH="$HOME/prefix/bin:/mingw64/bin:/mingw32/bin:$PATH"' >> ~/.profile
echo 'export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig"' >> ~/.profile
echo 'export PATH="$HOME/prefix/bin:/mingw64/bin:/mingw32/bin:$PATH"' >> ~/.bash_profile
echo 'export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig"' >> ~/.bash_profile

Building dependencies

Building GMP

cd ~
curl -O https://gmplib.org/download/gmp/gmp-6.0.0a.tar.xz
tar xf gmp-6.0.0a.tar.xz
cd gmp-6.0.0a
./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-static --disable-shared --enable-fat
make && make install

Building Nettle

cd ~
wget http://ftp.gnu.org/gnu/nettle/nettle-3.1.1.tar.gz
tar xf nettle-3.1.1.tar.gz
cd nettle-3.1.1
./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-static --disable-shared --enable-fat
make && make install

Building zlib

cd ~
wget http://zlib.net/zlib-1.2.8.tar.gz
tar xf zlib-1.2.8
cd zlib-1.2.8
./configure --prefix="$HOME/prefix" --static
make && make install

Building GnuTLS

cd ~
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.4.1.tar.xz
tar xf gnutls-3.4.4.1.tar.xz
cd gnutls-3.4.4.1
./configure --prefix="$HOME/prefix" --enable-static --disable-shared --build=x86_64-w64-mingw32 --with-included-libtasn1 --disable-doc --disable-guile --without-p11-kit --enable-local-libopts
make && make install 

Building SQLite

cd ~
wget https://sqlite.org/2015/sqlite-autoconf-3081101.tar.gz
tar xf sqlite-autoconf-3081101.tar.gz
cd sqlite-autoconf-3081101
./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-static --disable-shared
make && make install

Building wxWidgets

cd ~
svn co https://github.com/wxWidgets/wxWidgets/branches/WX_3_0_BRANCH wx3
cd wx3
./configure --prefix="$HOME/prefix" --enable-static --disable-shared --build=x86_64-w64-mingw32 --enable-unicode --without-libtiff
make && make install

Building Filezilla

Download FileZilla

cd ~
svn co https://svn.filezilla-project.org/svn/FileZilla3/trunk filezilla

Fetch patch and build script

git clone https://github.com/rexdf/build_filezilla_on_msys2.git
cp build_filezilla_on_msys2/*.patch ~
cp build_filezilla_on_msys2/build.sh ~

Build a static only zlib

git clone https://github.com/Alexpux/MINGW-packages.git
cd MINGW-packages
git apply ../mingw-w64-zlib.patch
cd mingw-w64-zlib
makepkg-mingw -sLf
cp mingw-w64-i686-zlib-1.2.8-8-any.pkg.tar.xz ~/

Build dependencies and filezilla

Build

start MinGW-w64 Win32 Shell shell

./build.sh

Generate installer

Installing NSIS

Download and install Unicode NSIS from http://www.scratchpaper.com

Make sure you get the Unicode version and not the ANSI one.

Compile the installer script

Right click compile/data/install.nsi in Explorer and use "Compile NSIS Script" from context menu.

Troubleshooting

If you run into problems, please make sure you've followed each step exactly how it is explained and that you haven't missed any steps along the way.