安装msys2可能会遇到密钥无法信赖的问题(FileZilla客户端源码编译)

 

1。下载源码:https://wiki.filezilla-project.org/

2。安装参照官网步聚:

https://wiki.filezilla-project.org/Compiling_FileZilla_3_under_Windows

3。下载安装msys2.要最新的,不要FileZilla官网提代的2018年的

 

 

竟然还有个错误。。。

       pacman从下载源下载不到东西

[root@BlackGhost zhangy]# pacman -S libldap

提示以下错误

:: Retrieving packages from core...
error: failed retrieving file 'libldap-2.4.22-1-i686.pkg.tar.xz' from ftp.sjtu.edu.cn : Not Found
warning: failed to retrieve some files from core
error: failed to commit transaction (Not Found)
Errors occurred, no packages were upgraded.

 

为什么下载不到东西呢?在我设置的下载源里面,其实是有libldap,但是版本不一样。我要下的是libldap-2.4.22-1-i686.pkg.tar.xz,但是源里面的是libldap-2.4.23-1-i686.pkg.tar.xz。这样就在源里面找不到了。

二,解决方法

1,更新pacman

[root@BlackGhost zhangy]# pacman -S pacman

2,换一下下载源,这种方法不好,你不知道那个网站更新快,哪个网新更新慢。这种方法比较傻

nano /etc/pacman.conf

把[core],[extra],[community]里面的源注释掉加上新源就可以了。

3,手动将要下的数据包下到本地,然后在安装

pacman -Sw 源地址/libldap-2.4.23-1-i686.pkg.tar.xz  -P /var/cache/pacman/pkg/

pacman -U /var/cache/pacman/pkg/libldap-2.4.23-1-i686.pkg.tar.xz

pacman -U 时,遇到以下问题

warning: directory permissions differ on var/
filesystem: 777  package: 755

解决上面的问题是

chmod 755 /var

这种方法比较通用性

转载
作者:海底苍鹰
地址:http://blog.51yip.com/linux/1060.html

使用第一种更新pacman  pacman -s 后 再执行pacman -Syu还是有一个错。有可能 用不着这个东西,先不管了。继续执行下面的

 

 

关闭shell,重新启一下,就好了,上面的错也没有了。

 

 

 

4。执行  pacman -S autoconf automake libtool make mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git svn

有19个相关的工具链,不知道应该 选 哪个,默认都选 了,

继续下载148个相关的包。

 

 

最后仍会有一些错误

 

先不管吧。

继续自动安装

 

 

 

安装完

5.Execute the following to work around some most-annoying bugs in the toolchain

执行[ -f /mingw64/bin/x86_64-w64-mingw32-windres.exe ] || ln -s /mingw64/bin/windres.exe /mingw64/bin/x86_64-w64-mingw32-windres.exe [ -f /mingw32/bin/i686-w64-mingw32-windres.exe ] || ln -s /mingw32/bin/windres.exe /mingw32/bin/i686-w64-mingw32-windres.exe

 

6.

Execute the following commands:

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
echo 'export LC_ALL=C' >> ~/.bash_profile


Restart the MSYS2 MINGW64 shell.

7.Building dependencies

 

Building Nettle

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

Building zlib

cd ~
wget https://zlib.net/zlib-1.2.11.tar.gz
tar xf zlib-1.2.11.tar.gz
cd zlib-1.2.11
LDSHAREDLIBC= ./configure --prefix="$HOME/prefix" -u=GNU
make && make install

Building GnuTLS

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

Building SQLite

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

Building wxWidgets

cd ~
git clone --branch WX_3_0_BRANCH --single-branch https://github.com/wxWidgets/wxWidgets.git wx3
cd wx3
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --enable-unicode --enable-printfposparam --without-libtiff --without-libjpeg --with-expat=builtin --with-libpng=builtin
make && make install

Building libfilezilla

cd ~
svn co https://svn.filezilla-project.org/svn/libfilezilla/trunk libfilezilla
cd libfilezilla
autoreconf -i 
./configure --prefix="$HOME/prefix" --enable-shared --disable-static
make && make install
这一步在configure时提示了 GnuTLS Not Found,(不知道是不是前面光编译,忘了make install呢?)前面也安装了,clean up. 删除之前的gnutls,再重新来一遍。

 重新安装一遍gnutls后还是出现上面的错。

 

仔细看 原来 是需要3.7的,而FileZilla 中给的链接是3.6的,

所以还得重来一遍,可以直接从上面提示的链接打开后下载到本地电脑,再拷备到msys64的/home/OO下即可

这一步也成功了

Building Filezilla

Download FileZilla

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

Building FileZilla

cd ~/filezilla
autoreconf -i
./configure --with-pugixml=builtin
make

Stripping debug symbols

strip src/interface/.libs/filezilla.exe
strip src/putty/.libs/fzsftp.exe
strip src/putty/.libs/fzputtygen.exe
strip src/fzshellext/64/.libs/libfzshellext-0.dll
strip src/fzshellext/32/.libs/libfzshellext-0.dll
strip data/dlls/*.dll (这一步出错,不过这里对执行没影 响)

最后进入src/interface/.libs/执行filezilla.exe,提示:

 把需要的dll都挑出来,最后还有 resource文件夹也挑出来,成功运行

 

下一步,如何在Visual studio中编译运行,

尝试VS2019打开filezilla-3.57.0\src目录下的  sln工程文件,4个项目都加载失败,需要修改一下

修改 Dependencies.props.examples,把examples后缀去掉。再加载,可以加载 engine和FileZilla两个项目,

尝试编译一下,

engine项目编过,

FileZilla需要使用到libFileZilla,于是把sys64环境下编译的libFileZilla拷出来到VS在编译的源码这。

使用VS打开libFileZilla项目 (D:\FileZilla_3.57.0_src\libfilezilla\lib),可以加载到VS中,编译此项目,提示:

 

posted @ 2022-01-14 22:12  伟大的厨师  阅读(0)  评论(0)    收藏  举报