记录在fedora37上编译安装下载工具amule
参考
http://wiki.amule.org/t/index.php?title=Compilation_Installation-cn#.E5.8F.96.E6.B6.88_GUI
amule是个ed2k下载工具。
我的os里已经有gcc/g++等工具,所以以下没有记录安装过程,如果需要gcc等工具,直接dnf安装即可
下载amule源代码
https://sourceforge.net/projects/amule/files/aMule/
解压后直接尝试编译
# kun @ Fedora in ~/Downloads/aMule-2.3.3 [10:37:18]
$ ls
ABOUT-NLS amule.desktop amule.png automake config.guess configure install-sh missing src
acinclude.m4 aMuleGUI.app amule.rc BUILDING_MACOSX.txt config.h.cm configure.ac intl mkinstalldirs test-driver
aclocal.m4 amulegui.desktop aMule.spec cmake config.h.in convert.ico m4 platforms unittests
aMule.app amulegui.xpm amule.xpm CMakeLists.txt config.rpath depcomp Makefile.am po version.rc.in
amule_build_install.sh amule.ico autogen.sh compile config.sub docs Makefile.in README.md
# kun @ Fedora in ~/Downloads/aMule-2.3.3 [10:37:20]
$ ./configure --disable-debug --enable-optimize
...
configure: error:
wxWidgets must be installed on your system but wx-config
script couldn't be found. Please check that wx-config is
in path or specified by --with-wx-config=path flag, the
directory where wxWidgets libraries are installed (returned
by 'wx-config --libs' command) is in LD_LIBRARY_PATH or
equivalent variable and wxWidgets version is 2.8.12 or above.
出现错误,需要wxWidgets
下载wxWidgets
https://www.wxwidgets.org
https://sourceforge.net/projects/wxwindows/files/
alume wiki上用的是2.8.10,而我下载了sourceforge上最新的3.0.2
# kun @ Fedora in ~/Downloads/wxWidgets-3.0.2 [10:40:44]
$ ls
acinclude.m4 autogen.sh config.sub descrip.mms install-sh Makefile.in setup.h.in utils wxwin.m4
aclocal.m4 build configure distrib interface misc setup.h_vms version-script.in
art BuildSVN.txt configure.in docs lib regen src wx-config.in
autoconf_inc.m4 config.guess demos include locale samples tests wx-config-inplace.in
# kun @ Fedora in ~/Downloads/wxWidgets-3.0.2 [10:40:45]
$ ./configure --enable-unicode --enable-optimise
...
configure: error:
The development files for GTK+ were not found. For GTK+ 2, please
ensure that pkg-config is in the path and that gtk+-2.0.pc is
installed. For GTK+ 1.2 please check that gtk-config is in the path,
and that the version is 1.2.3 or above. Also check that the
libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
--libs' are in the LD_LIBRARY_PATH or equivalent.
出现错误,需要gtk+2
# kun @ Fedora in ~/Downloads/wxWidgets-3.0.2 [10:42:38]
$ sudo dnf install gtk2-devel.x86_64
然后重新执行配置
# kun @ Fedora in ~/Downloads/wxWidgets-3.0.2 [10:40:45]
$ ./configure --enable-unicode --enable-optimise
...
Configured wxWidgets 3.0.2 for `x86_64-unknown-linux-gnu'
Which GUI toolkit should wxWidgets use? GTK+ 2 with support for GTK+ printing libnotify
Should wxWidgets be compiled into single library? no
Should wxWidgets be linked as a shared library? yes
Should wxWidgets support Unicode? yes (using wchar_t)
What level of wxWidgets compatibility should be enabled?
wxWidgets 2.6 no
wxWidgets 2.8 yes
Which libraries should wxWidgets use?
STL no
jpeg sys
png sys
regex builtin
tiff sys
zlib sys
expat builtin
libmspack no
sdl no
配置成功,编译
# kun @ Fedora in ~/Downloads/wxWidgets-3.0.2 [10:48:10]
$ make
...
# kun @ Fedora in ~/Downloads/wxWidgets-3.0.2 [10:57:00] C:130
$ sudo make install
...
------------------------------------------------------
The installation of wxWidgets is finished. On certain
platforms (e.g. Linux) you'll now have to run ldconfig
if you installed a shared library and also modify the
LD_LIBRARY_PATH (or equivalent) environment variable.
wxWidgets comes with no guarantees and doesn't claim
to be suitable for any purpose.
Read the wxWindows Licence on licencing conditions.
------------------------------------------------------
# kun @ Fedora in ~/Downloads/wxWidgets-3.0.2 [10:57:37]
$ sudo ldconfig
这样wxWidgets就安装完成了,下面去重新配置amule
重新配置amule
# kun @ Fedora in ~/Downloads/aMule-2.3.3 [10:58:56]
$ ./configure --disable-debug --enable-optimize
...
configure: error:
Could not find crypto++ installation or sources.
Please try again with --with-crypto-prefix=/my_crypto_prefix
(replace /my_crypto_prefix with a valid path to your crypto++
installation or source directory).
仍然错误,缺少crypto++,dnf 中搜到了cryptopp-devel和crypto-devel,安装crypto-devel后重新配置amule失败,和上面一样的错误信息,而安装cryptopp-devel之后重新配置amule就可以通过了
# kun @ Fedora in ~/Downloads/aMule-2.3.3 [11:09:03] C:1
$ ./configure --disable-debug --enable-optimize
...
Configure script has finished system check.
Configured aMule 2.3.3 for 'x86_64-pc-linux-gnu'.
aMule enabled options:
**** aMule Core ****
Prefix where aMule should be installed? /usr/local
Should aMule be compiled with i18n support? yes
Should aMule be compiled in debug mode? no
Should aMule be compiled with profiling? no
Should aMule be compiled with optimizations? yes
Should aMule be compiled with UPnP support? disabled
Should aMule be compiled with IP2country support? no
Should aMule monolithic application be built? yes
Should aMule daemon version be built? no
Should aMule remote gui be built? no
**** aMule TextClient ****
Should aMule Command Line Client be built? no
**** aMule WebServer ****
Should aMule WebServer be built? no
**** aMule ED2K Links Handler ****
Should aMule ED2K Links Handler be built? yes
**** aMuleLinkCreator ****
Should aMuleLinkCreator GUI version (alc) be built? no
Should aMuleLinkCreator for console (alcc) be built? no
**** aMule Statistics ****
Should C aMule Statistics (CAS) be built? no
Should aMule GUI Statistics (wxCas) be built? no
Should xas XChat2 plugin be installed? no
Should plasmaMule plasma-applet be built? no
**** General Libraries and Tools ****
Should ccache support be enabled? no
Should aMule file viewer for console be built? no
Libraries aMule will use to build:
wxWidgets 3.0.2 (gtk2,shared)
crypto++ 8.6 (in /usr)
libintl system
zlib 1.2.12
*** Warnings during configuration ***
* UPnP code has been disabled because libupnp >= 1.6.6 not found (try to use --with-libupnp-prefix=PREFIX).
* bfd.h not found or unusable, please install binutils development package if
you are a developer or want to help testing aMule
然后编译:
# kun @ Fedora in ~/Downloads/aMule-2.3.3 [11:09:43]
$ make
...
Compiling Statistics.cpp
Compiling StatTree.cpp
Compiling UserEvents.cpp
Linking amule
Compiling ED2KLinkParser.cpp
Compiling MagnetURI.cpp
Compiling MuleCollection.cpp
Linking ed2k
最后安装:
sudo make install
...
Installing /usr/local/share/man/tr/man1/ed2k.1
Installing /usr/local/share/man/zh_TW/man1/ed2k.1
/usr/bin/mkdir -p '/usr/local/share/doc/amule'
Installing /usr/local/share/doc/amule
/usr/bin/mkdir -p '/usr/local/share/amule/skins'
Installing /usr/local/share/amule/skins
/usr/bin/mkdir -p '/usr/local/bin'
Installing /usr/local/bin
/usr/bin/mkdir -p '/usr/local/share/pixmaps'
Installing /usr/local/share/pixmaps
/usr/bin/mkdir -p '/usr/local/share/applications'
Installing /usr/local/share/applications
启动
# kun @ Fedora in /usr/local/bin [11:29:36]
$ ./amule
./amule: error while loading shared libraries: libwx_gtk2u_adv-3.0.so.0: cannot open shared object file: No such file or director
找不到so库,实际上wx已经安装在/usr/local/lib,这个目录不在搜索路径上导致的,修复方法如下:
添加路径/usr/local/lib
到/etc/ld/so.conf
文件即可
# kun @ Fedora in /usr/lib [11:40:29]
$ sudo vi /etc/ld.so.conf
# kun @ Fedora in /usr/lib [11:40:47]
$ cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
#生效修改
# kun @ Fedora in /usr/lib [11:40:44]
$ sudo ldconfig
#然后就可以启动了
# kun @ Fedora in /usr/local/bin [11:39:52]
$ ./amule
Gtk-Message: 11:40:52.058: Failed to load module "pk-gtk-module"
2023-04-14 11:40:52: Initialising aMule 2.3.3 compiled with wxGTK2 v3.0.2
2023-04-14 11:40:52: Checking if there is an instance already running...
2023-04-14 11:40:52: No other instances are running.
2023-04-14 11:40:52: 监听Socket: Ok.
2023-04-14 11:40:52: 从 /home/kun/.aMule/Temp 载入临时文件。
2023-04-14 11:40:52: 所有 PartFile 已经载入。
2023-04-14 11:40:56: 现在,正在退出主程序...
2023-04-14 11:40:56: aMule 正在退出:中止内核。
2023-04-14 11:40:56: aMule 已经关闭。
# kun @ Fedora in /usr/local/bin [11:44:25]
$ ./amule --version
Gtk-Message: 11:45:45.000: Failed to load module "pk-gtk-module"
aMule 2.3.3 compiled with wxGTK2 v3.0.2 (OS: Linux)
开始菜单里也可以用的
可以下载windows镜像,然后虚拟机里用迅雷了hhhhhh