amule-project / amule

'All-platform' P2P client based on eMule
996 stars 218 forks source link

Can't compile on mac OS (Big Sur and Catalina) #234

Open jaimeiniesta opened 3 years ago

jaimeiniesta commented 3 years ago

Hello! I've tried to compile aMule following the instructions on BUILDING_MAC_OSX.txt, both on Big Sur and Catalina, but it's not working. Where can i find a more up to date guide or updated binaries?

Here's the log for Big Sur:

jaime@holly ~/Downloads/amule-master
➔ mkdir Build

jaime@holly ~/Downloads/amule-master
➔ cd Build/

jaime@holly ~/Downloads/amule-master/Build
➔ WXVERSION=svn WXPORT=cocoa MULECLEAN=YES ../src/utils/scripts/MacOSX/full_build.sh
-- Begin global def section --
    SVN repository has not been specified, using detected local sources at "/Users/jaime/Downloads/amule-master"
    Automatically setting build folder to /Users/jaime/Downloads/amule-master/build/ - set BUILD_FOLDER to your preferred folder to change this setting.
    Build root absolute path is /Users/jaime/Downloads/amule-master/build
    Automatically setting SDK to 10.6 (Snow Leopard) - set SDKNUMBER to your preferred SDK if you want to target it (10.4, 10.5, 10.6, 10.7) or "default" for the default SDK.
    Using 10.6 SDK
    Automatically disabling universal (i386 and ppc) build. Default architecture will be used. Set UNIVERSAL=YES to build a binary compatible with the ppc architecture.
    Disabling universal build
    Errors will be redirected to /Users/jaime/Downloads/amule-master/build/error_output, normal build output to /Users/jaime/Downloads/amule-master/build/build_output
-- End global def section --
-- Begin wxWidgets def section --
    Using wxWidgets svn
    Using wxWidgets cocoa port.
    Automatically selecting full wx compilation. Set SLIMWX to YES to compile only parts used by the application, which can result in a smaller binary (but can fail if the script hasn't been updated after adding new class usage)
    Using full wxWidgets compilation.
-- End wxWidgets def section --
Save configuration commandline to /Users/jaime/Downloads/amule-master/build/repeat.sh - execute that script to repeat this compilation with the same options.
Starting build...
    Getting aMule sources...
        aMule sources at " /Users/jaime/Downloads/amule-master " are not from SVN checkout, so not updating.
    Done
    Getting wxWidgets sources...
    First checkout.
../src/utils/scripts/MacOSX/full_build.sh: line 100: pushd: wxWidgets: No such file or directory
    Applying patches.
        Appying "/Users/jaime/Downloads/amule-master/src/utils/patches/wxWidgets/*.patch"
../src/utils/scripts/MacOSX/full_build.sh: line 104: /Users/jaime/Downloads/amule-master/src/utils/patches/wxWidgets/*.patch: No such file or directory
    Done
    Configuring wxWidgets...
../src/utils/scripts/MacOSX/full_build.sh: line 112: pushd: wxWidgets: No such file or directory
        Configured.
        Done
    Compiling wxWidgets...
    Done
../src/utils/scripts/MacOSX/full_build.sh: line 145: popd: directory stack empty
    Getting cryptopp sources...
        Appying "/Users/jaime/Downloads/amule-master/src/utils/patches/cryptopp/mac_build.patch"
        Compiling cryptopp...
    Done
    Getting gettext sources...
        Compiling gettext...
    Done.
    Getting libupnp sources...
        Compiling libupnp...
    Done.
    Getting GeoIP sources...
        Compiling GeoIP...
    Done.
    Getting pkg-config sources...
        Compiling pkg-config...
 ERROR: check output /Users/jaime/Downloads/amule-master/build/build_output and /Users/jaime/Downloads/amule-master/build/error_output for details.
    Done.
    FINALLY compiling aMule and aMuleGUI ...
        Good: intl folder already exists.
        Running configure
        Cleaning compilation
        Compiling aMule
    Done.
        Faking install
    Done.
Getting application bundle and packaging
Copying i18n files...
cp: directory aMule.app/Contents/SharedSupport does not exist
cp: directory aMuleGUI.app/Contents/SharedSupport does not exist
Done.
All Done
../src/utils/scripts/MacOSX/full_build.sh: line 390: popd: directory stack empty
Vollstrecker commented 3 years ago

Could you test the cmake branch on Mac. I'm just working at the last pieces to throw it into master this week. It's not tested on Mac at all, but maybe it works out of the box.

jaimeiniesta commented 3 years ago

Sure, I just did and it fails in a similar way:

jaime@holly ~/code/amule (cmake)
➔ mkdir Build

jaime@holly ~/code/amule (cmake)
➔ cd Build/

jaime@holly ~/code/amule/Build (cmake)
➔ WXVERSION=svn WXPORT=cocoa MULECLEAN=YES ../src/utils/scripts/MacOSX/full_build.sh
-- Begin global def section --
    SVN repository has not been specified, using detected local sources at "/Users/jaime/code/amule"
    Automatically setting build folder to /Users/jaime/code/amule/build/ - set BUILD_FOLDER to your preferred folder to change this setting.
    Build root absolute path is /Users/jaime/code/amule/build
    Automatically setting SDK to 10.6 (Snow Leopard) - set SDKNUMBER to your preferred SDK if you want to target it (10.4, 10.5, 10.6, 10.7) or "default" for the default SDK.
    Using 10.6 SDK
    Automatically disabling universal (i386 and ppc) build. Default architecture will be used. Set UNIVERSAL=YES to build a binary compatible with the ppc architecture.
    Disabling universal build
    Errors will be redirected to /Users/jaime/code/amule/build/error_output, normal build output to /Users/jaime/code/amule/build/build_output
-- End global def section --
-- Begin wxWidgets def section --
    Using wxWidgets svn
    Using wxWidgets cocoa port.
    Automatically selecting full wx compilation. Set SLIMWX to YES to compile only parts used by the application, which can result in a smaller binary (but can fail if the script hasn't been updated after adding new class usage)
    Using full wxWidgets compilation.
-- End wxWidgets def section --
Save configuration commandline to /Users/jaime/code/amule/build/repeat.sh - execute that script to repeat this compilation with the same options.
Starting build...
    Getting aMule sources...
        aMule sources at " /Users/jaime/code/amule " are not from SVN checkout, so not updating.
    Done
    Getting wxWidgets sources...
    First checkout.
../src/utils/scripts/MacOSX/full_build.sh: line 100: pushd: wxWidgets: No such file or directory
    Applying patches.
        Appying "/Users/jaime/code/amule/src/utils/patches/wxWidgets/*.patch"
../src/utils/scripts/MacOSX/full_build.sh: line 104: /Users/jaime/code/amule/src/utils/patches/wxWidgets/*.patch: No such file or directory
    Done
    Configuring wxWidgets...
../src/utils/scripts/MacOSX/full_build.sh: line 112: pushd: wxWidgets: No such file or directory
        Configured.
        Done
    Compiling wxWidgets...
    Done
../src/utils/scripts/MacOSX/full_build.sh: line 145: popd: directory stack empty
    Getting cryptopp sources...
        Appying "/Users/jaime/code/amule/src/utils/patches/cryptopp/mac_build.patch"
        Compiling cryptopp...
    Done
    Getting gettext sources...
        Compiling gettext...
    Done.
    Getting libupnp sources...
        Compiling libupnp...
    Done.
    Getting GeoIP sources...
        Compiling GeoIP...
    Done.
    Getting pkg-config sources...
        Compiling pkg-config...
 ERROR: check output /Users/jaime/code/amule/build/build_output and /Users/jaime/code/amule/build/error_output for details.
    Done.
    FINALLY compiling aMule and aMuleGUI ...
        Running configure
        Cleaning compilation
        Compiling aMule
    Done.
        Faking install
    Done.
Getting application bundle and packaging
Copying i18n files...
cp: directory aMule.app/Contents/SharedSupport does not exist
cp: directory aMuleGUI.app/Contents/SharedSupport does not exist
Done.
All Done
../src/utils/scripts/MacOSX/full_build.sh: line 390: popd: directory stack empty

Maybe I should not follow the instructions on BUILDING_MACOSX.txt?

Vollstrecker commented 3 years ago

That's what I meant. full_build.sh is 9 years old. The informations in BUILDING_MACOSX.txt aren't younger.

Workflow should be:

mkdir build cd build cmake-gui ../

There you choose your options and what output should be generated (Makefiles, XCode, whatever you preffer of the offered options), then you start the build like the always (for your choice of system).

And yes, I tested it only on Linux and Windows so far, so it most likely will fail, the question is only how hard.

mauromereu commented 3 years ago

Hi, I have compiled and run aMule on OSX Catalina. Follow this steps: $ ./autogen.sh $ ./configure $ make -j

Then run
$ src/amule

To build the app you should run $ src/utils/scripts/MacOSX/application_packager.sh

The packager script linked some libs that didn't work for me, so I changed the libs linked to the executable by using otool. To show the linked libs of your amule just run $ otool -L src/amule

They are probably different than the packaged aMule exec, you can check just running $ otool -L aMule.app/Contents/MacOS/amule

Greetings

jaimeiniesta commented 3 years ago

Thanks for your help! I'm trying on Big Sur but it looks like I have to install crypto++ first. I get this when I run ./configure:

checking for crypto++ version >= 5.5... no
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).

Any idea how I can install crypto++?

mauromereu commented 3 years ago

Hi, I have crypto++ installed from Homebrew long ago

$ brew info cryptopp

cryptopp: stable 8.1.0
Free C++ class library of cryptographic schemes
https://www.cryptopp.com/
/usr/local/Cellar/cryptopp/8.1.0 (329 files, 36.9MB) *
Built from source on 2019-11-22 at 17:58:30
From: /usr/local/opt/cryptopp/.brew/cryptopp.rb

but it seems not available anymore with brew, you can try on your system.

If you have Homebrew, time to spend and patience you could try to make your own formula with brew create following the official instructions https://brew.sh/

Ensure to check the cryptopp install instructions https://github.com/weidai11/cryptopp/blob/master/Install.txt

Mattoje commented 3 years ago

I'm trying to compile on big SUR with cmake-gui (and some handwork), can you add CRYPTOPP_DIR and also WXWIDGET_DIR as options ? If i use CRYPTOPP_INCLUDE_PREFIX it will correctly find the headers but it will not find the library

Vollstrecker commented 3 years ago

You mean like in https://github.com/amule-project/amule/blob/master/cmake/search-dirs.cmake?

To be honest, mac build is on the list. I started with amule, but then switched to pupnp to get that in shape, for that I did pthreadf4win, now I getting to cryptopp. This all (beside linux) for building on win. When I have all the deps ready, then I can start on mac, so for now I just hope it works out-of-the-box (which I really wouldn't believe) and have to admit that it's fully untestet there.

Mattoje commented 3 years ago

yes thanks that helped

BTW there are a couple of typos in https://github.com/amule-project/amule/blob/master/cmake/search-dirs.cmake

CRYTOPP_LIB_SEARCH_PATH should be CRYPTOPP_LIB_SEARCH_PATH also CRYTOPP_HEADER_PATH should be CRYPTOPP_HEADER_PATH

Anyway just fyi the only way (at least on mac) to get cmake recognize cryptopp is to set those 2 variables: CRYPTOPP_INCLUDE_PREFIX CRYPTOPP_LIBRARY

Vollstrecker commented 3 years ago

BTW there are a couple of typos in

I know, but I want to get rid of them anyways, and correcting them there would mean correcting them everywhere.

Anyway just fyi the only way (at least on mac) to get cmake recognize cryptopp is to set those 2 variables:

Not when I'm done with cryptopp