aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: How to build aMule 2.3.3 on macOS 11 Big Sur  (Read 5139 times)

Lele

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
How to build aMule 2.3.3 on macOS 11 Big Sur
« on: February 14, 2021, 11:33:38 PM »

Hello,

after trying for days, I finally managed to make a working build of aMule on macOS Big Sur. The original guide (http://wiki.amule.org/wiki/HowTo_compile_on_Mac) didn't work for me as-is, so I wrote a new one with a few modifications, which should work out-of-the-box (it does for me, at least) on macOS 11 installed on an Intel-based mac.

DISCLAIMER: I am NOT an aMule/C++/macOS developer. I just barely managed to build aMule after many attempts. This guide may or may not work for you. I take NO RESPONSABILITIES for whatever happens on your mac.

Let's start!

Install Xcode

Install Xcode from the App Store. The download is HUGE (10+ GB), but Xcode is required for building aMule and its dependencies on macOS. Do not proceed to the next step until Xcode is installed.

Install dependencies

The original guide suggests MacPorts for installing dependencies. However, since I already had Homebrew installed and I didn't want to install another package manager, I just used Homebrew. Check Homebrew's homepage (https://brew.sh/) to learn how to install Homebrew.

Then, open a terminal and type:

Code: [Select]
brew install automake binutils flex gettext libpng libiconv gd jpeg libgeoip libupnp pkgconfig
Note that gd2 (as listed in the original  guide) is called gd in Homebrew.

You can uninstall all the dependencies after building aMule, just use the same command replacing install with uninstall.

After installing dependencies, you have to configure your shell. On Big Sur, the default shell is Zsh. Execute in a terminal:

Code: [Select]
touch ~/.zshrc
Code: [Select]
subl ~/.zshrc

In the second command, I assume you have Sublime Text (https://www.sublimetext.com/) installed. If you don't (and the second command fails), you can install it with:

Code: [Select]
brew install sublime-text --cask
Then open a new terminal and try again.

Once you have opened ~/.zshrc with Sublime Text (or any other text editor you like), add the following lines to the file:


Code: [Select]
export LDFLAGS="-L/usr/local/opt/binutils/lib -L/usr/local/opt/flex/lib -L/usr/local/opt/libiconv/lib"
export CPPFLAGS="-I/usr/local/opt/binutils/include -I/usr/local/opt/flex/include -I/usr/local/opt/libiconv/include"

Then save the changes and close the text editor. After that, reload the shell configuration with this command:

Code: [Select]
source  ~/.zshrc
If you are not using Zsh, you will have to replace .zshrc with your shell's configuration file. For example, if you have Bash, the file will be called .bashrc. Zsh is the default on Big Sur, but if you upgraded from Catalina and from Mojave before, you may still have Bash as shell.

The next dependency you need is Crypto++ (called libcryptopp in the original  guide). It is not available in Homebrew, so I had to build it from sources. Download it from https://www.cryptopp.com/ (I used version 8.4.0), then unzip the archive and cd into the unzipped directory. I suppose you downloaded the archive in your Downloads directory:

Code: [Select]
cd ~/Downloads/cryptopp840/
Replace ~/Downloads/cryptopp840/ with whatever path you have chosen for unzipping Crypto++. Then build it (replace 4 with twice the numer of your CPU cores, or just leave 4):

Code: [Select]
make -j4
Code: [Select]
make libcryptopp.a libcryptopp.so cryptest.exe

The last dependency we need is WxWidgets. Homebrew provides an already-built version of WxWidgets, but I was not able to make a working build of aMule with it (aMule built successfully, but just crashed on start). So we are going to build WxWidgets from sources. Download WxWidgets source from https://www.wxwidgets.org. Use version 3.0.5. The latest build (3.1.4 at the time of writing this) didn't work for me.

After downloading, unzip the archive and cd into the unzipped directory. Still assuming it's in your Downloads directory:

Code: [Select]
cd ~/Downloads/wxWidgets-3.0.5/
Now configure WxWidgets:

Code: [Select]
export wxUSE_MACOSX_VERSION_MIN=11.0
Code: [Select]
./configure --disable-shared --enable-unicode --disable-debug --disable-debug_gdb
Then build it (replace 4 with twice the numer of your CPU cores, or just leave 4):

Code: [Select]
make -j4
Now we are ready for building aMule.

Build aMule

Download aMule source from https://sourceforge.net/projects/amule/files/aMule/ or from http://wiki.amule.org/t/index.php?title=AMule_SVN. I used stable version 2.3.3. Then unzip it and cd into the unzipped directory. Still assuming it's in your Downloads directory:

Code: [Select]
cd ~/Downloads/aMule-2.3.3/
Next, configure it:

Code: [Select]
./configure --with-wx-config=/Users/yourusername/Downloads/wxWidgets-3.0.5/wx-config --with-crypto-prefix=/Users/yourusername/Downloads/cryptopp840 --enable-optimize --enable-cas --enable-webserver --enable-wxcas --enable-alc --enable-alcc --enable-amule-daemon --enable-geoip --disable-debug
Important: replace yourusername with you actual user name. If you unzipped Crypto++ or WxWidgets into directories different than Downloads, you must replace the whole paths /Users/yourusername/Downloads/wxWidgets-3.0.5 (for WxWidgets) and /Users/yourusername/Downloads/cryptopp840 (for Crypto++) with the actual paths you used.

Note: I didn't enable aMuleCMD, aMuleGUI, aMule Daemon and aMule WebServer because I didn't need them (and, by the way, the build failed if I did).

You can ignore warnings.

Now, build aMule (replace 4 with twice the numer of your CPU cores, or just leave 4), and hope nothing fails:

Code: [Select]
make -j4
If you get no errors, you're nearly done.

The last step is packaging aMule:

Code: [Select]
./src/utils/scripts/MacOSX/application_packager.sh
Finally, open aMule-2.3.3 directory in Finder:

Code: [Select]
open .
You shoud see a file called aMule (or aMule.app) with the eMule icon. Move that to your Applications folder. You should now be able to see aMule in your Lauchpad. Congratulations!

But we're not done yet. Try to launch aMule by clicking on it. It won't work. MacOS will nag you about the app not being from a certified developer. That's because Apple doesn't trust you and wouldn't like you to run the software you build yourself. Thank you Apple!

However, Apple still allows us to bypass this (at least for now, but I don't know if this will still be possibile on future M1/ARM macs). Just close the nagging alert by clicking Cancel. Then go to System Preferences, Security & Privacy, General and click Allow. aMule should now open. Allow any permission request.

If you use dark mode on macOS, you should force light mode for aMule. Execute in a terminal (thanks to PepitoGrilloOSX):

Code: [Select]
defaults write org.amule.aMule NSRequiresAquaSystemAppearance -bool yes
Then restart aMule.

You can now delete the downloaded archives and the extracted directories.

Done!
Logged

maxime

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: How to build aMule 2.3.3 on macOS 11 Big Sur
« Reply #1 on: February 19, 2021, 02:25:09 PM »

Are you going to release your working 2.3.3 binary for MacOS Big Sur (Intel processor)?
« Last Edit: February 19, 2021, 02:35:44 PM by maxime »
Logged

Lele

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: How to build aMule 2.3.3 on macOS 11 Big Sur
« Reply #2 on: February 25, 2021, 12:14:50 AM »

Hi, here it is:

https://www.dropbox.com/s/1m0fvr031huoc46/aMule233-macOS11-x64.app.zip?dl=1

It's working for me on macOS 11.2.1 on an Intel mac. Just extract the zip and double click on the mule icon.
You still have to do the part after "But we're not done yet" in the first post to be able to launch it, though.
Logged