Difference between revisions of "HowTo compile on Mac"
Line 6: | Line 6: | ||
This HowTo is written to compile and install [[aMule]] 2.0.0-rc8. It will not work for older versions. Please note that you should always download the latest [[aMule]] version available. | This HowTo is written to compile and install [[aMule]] 2.0.0-rc8. It will not work for older versions. Please note that you should always download the latest [[aMule]] version available. | ||
− | ''' | + | '''NOTE:''' This document explains how to download files using [http://curl.haxx.se curl]. However, [http://curl.haxx.se curl] might not be installed on your system: either install it (you can use [http://fink.sourceforge.net Fink] to instal it) or download the files with whatever application you want (maybe your web browser), but place them in the directory that's being used on each part of the guide, otherwise the commands that are shown here will not work. |
− | + | == Setting up the required environment == | |
− | + | These steps are one-time-only steps necessary for the steps in the following sections to work properly. | |
− | # Install [http://developer.apple.com/tools/xcode Xcode Tools] from http://developer.apple.com/tools/download | + | # Xcode |
− | # "Getting ADC ID"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install" | + | ## Install [http://developer.apple.com/tools/xcode Xcode Tools] from http://developer.apple.com/tools/download |
− | # Install (or verify installation if already installed) [http://fink.sourceforge.net Fink] | + | ## "Getting ADC ID"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install" |
− | # | + | # Fink |
− | # | + | ## Install (or verify installation if already installed) [http://fink.sourceforge.net Fink] from http://fink.sourceforge.net/download |
− | # Make ''amule'' dir in your home directory: ''mkdir ~/amule'' | + | # gettext |
− | # | + | ## Using [http://fink.sourceforge.net Fink], install [http://www.gnu.org/software/gettext gettext]. Read [http://fink.sourceforge.net/download Fink's installation guide] to learn how to install applications through [http://fink.sourceforge.net Fink] (the [http://www.gnu.org/software/gettext gettext] package is ''gettext''). |
− | + | # Working directories | |
− | + | ## Make ''amule'' dir in your home directory: ''mkdir ~/amule'' | |
− | + | ## Make ''wxmac'' dir in your home directory: ''mkdir ~/wxmac'' | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | == | + | == Obtaining [[wxMac]] sources == |
− | + | '''ATTENTION:''' [[wxMac]] 2.5.3 has a couple of bugs which cause [[aMule]] 2.0.0-rc8 to crash. One bug causes [[aMule]] to crash just after starting up, the other causes it to crash at a random later time :-(. The only work-around is to pull the wxWidgets sources from CVS and patch them! | |
− | + | You have two options, downloading a CVS snapshot or performing a checkout through the wxWidgets CVS server. The snapshot may be faster to download; the CVS server will give you the most up-to-date sources and the most flexibility if you need sources from a previous day (for example, to avoid bugs that may crop up in the ever-changing source). On the other hand, the sources from the snapshot, once extracted, take nearly 6 times as much disk space as those checked out from the CVS server because they include files not necessary for compiling on Mac OS X. | |
− | # Enter | + | |
− | # | + | === '''Option 1:''' Obtaining [[wxMac]] sources from CVS snapshot === |
− | # Extract | + | |
− | # Enter the | + | These instructions were adapted from http://wxwidgets.org/cvs.htm |
+ | |||
+ | # Enter the ''wxmac'' directory: ''cd ~/wxmac'' | ||
+ | # Get the [[wxMac]] CVS snapshot (found at [http://wxwindows.sourceforge.net/snapshots/ http://wxwindows.sourceforge.net/snapshots/] as ''wx-cvs.tar.bz2'') and place it in your ''~/wxmac'' directory: ''curl -O http://biolpc22.york.ac.uk/pub/CVS_HEAD/wx-cvs.tar.bz2'' | ||
+ | # Extract it: ''tar -xjf wx-cvs.tar.bz2'' | ||
+ | # '''Optional:''' You may delete the archive after extracting its contents: ''rm wx-cvs.tar.bz2'' | ||
+ | |||
+ | === '''Option 2:''' Obtaining [[wxMac]] sources from CVS server === | ||
+ | |||
+ | These instructions were adapted from http://wxwidgets.org/cvs.htm | ||
+ | |||
+ | # Enter the ''wxmac'' directory: ''cd ~/wxmac'' | ||
+ | # Login (anonymously) to the wxWidgets CVS server (when prompted, enter ''anoncvs'' as the password): ''cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login'' | ||
+ | # Checkout the [[wxMac]] sources from CVS: ''cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxMac'' | ||
+ | |||
+ | == Patching the [[wxMac]] sources == | ||
+ | |||
+ | The [[wxMac]] sources still contain some bugs which affect aMule. One causes aMule to crash at random times. Others cause aMule to leak memory. Patches to fix [[wxMac]] have been submitted to the wxWidgets team. These patches have not yet been approved by the wxWidgets developers and so should be considered experimental and approached with caution. However, since the crashing bug seriously hampers the use of aMule, and several Mac aMule users have successfully tested the patch, you are strongly encouraged to apply it. You should exercise judgment in applying the other patches. | ||
+ | |||
+ | # Enter the ''wxmac'' directory: ''cd ~/wxmac'' | ||
+ | # Patch the crashing bug in [[wxMac]] | ||
+ | ## Download the patch file: ''curl "http://sourceforge.net/tracker/download.php?group_id=9863&atid=309863&file_id=114017&aid=1093852" -o doublefree.patch'' | ||
+ | ## Apply the patch to the sources: ''patch -d wxWidgets -p0 <doublefree.patch'' | ||
+ | # '''Optional:''' Patch some memory leaks in [[wxMac]]. | ||
+ | ## Download the patch files: ''curl "http://sourceforge.net/tracker/download.php?group_id=9863&atid=309863&file_id=112952&aid=1088052" -o ctable.patch "http://sourceforge.net/tracker/download.php?group_id=9863&atid=309863&file_id=112949&aid=1088038" -o bitmap.patch'' | ||
+ | ## Apply the patches: ''cat ctable.patch bitmap.patch | patch -p0 -d wxWidgets'' | ||
+ | |||
+ | == Installing [[wxMac]] from sources == | ||
+ | |||
+ | # Enter the directory containing the [[wxMac]] sources: ''cd ~/wxmac/wxWidgets'' | ||
# Directory ''build'' should already be there. If not, create it with: ''mkdir build'' | # Directory ''build'' should already be there. If not, create it with: ''mkdir build'' | ||
# Now enter ''build'' directory: ''cd build'' | # Now enter ''build'' directory: ''cd build'' | ||
Line 47: | Line 67: | ||
# Now install [[wxMac]] compilation: ''sudo make install'' | # Now install [[wxMac]] compilation: ''sudo make install'' | ||
# Get back to your home directory, you're done: ''cd ~'' | # Get back to your home directory, you're done: ''cd ~'' | ||
− | # If everything went ok, you can safely remove: | + | # '''Optional:''' If everything went ok, you can safely remove the [[wxMac]] sources (not recommended, since you might want to compile it again someday): ''rm -r ~/wxmac |
− | ## [[ | + | |
− | ## Optionally remove the extracted [[ | + | == Compiling and installing [[aMule]] == |
+ | |||
+ | # Enter the ''amule'' directory: ''cd ~/amule'' | ||
+ | # Get [[aMule]]'s latest source code (aMule 2.0.0-rc8 sourcecode: [http://download.berlios.de/amule/aMule-2.0.0rc8.tar.bz2 http://download.berlios.de/amule/aMule-2.0.0rc8.tar.bz2]) and place it in your ''~/amule'' directory: ''curl -O http://download.berlios.de/amule/aMule-2.0.0rc8.tar.bz2'' | ||
+ | # Extract it: ''tar -xjf aMule-2.0.0rc8.tar.bz2'' | ||
+ | # Enter [[aMule]]'s sources directory: ''cd aMule-2.0.0rc8'' | ||
+ | # Prepare the compilation (thanks to '''one_2_one''' and '''Babboia''' for his test&fix): ''./configure --disable-systray --disable-gtk --with-wx-config=/usr/local/bin/wx-config'' | ||
+ | # And compile it: ''make'' | ||
+ | # '''Optional:''' You can reduce the size of [[aMule]] from 44MB to 3MB by doing the following (anyway, this will make the [[aMule]] binary lose debug info, so you'll be unable to report problems to the [[aMule devs|aMule Team]] to make [[aMule]] a better program; so, it is not recommended): ''strip src/amule'' | ||
+ | # Copy the ''amule'' binary to the app-Container directory: ''cp src/amule amule.app/Contents/MacOS/'' ('''NOTE:''' If the ''MacOS'' directory is missing in ''amule.app'', create it by typing ''mkdir amule.app/Contents/MacOS'' before executing the previous command. Thanks to '''dan''' for the tip) | ||
+ | # And copy ''amule.app'' directory to your Applications folder: ''cp -R amule.app /Applications'' | ||
+ | # Get back to your home directory, you're done: ''cd ~'' | ||
+ | # If everything went OK, you can safely remove the downloaded packages: | ||
+ | ## Remove [[aMule]]'s sources package: ''rm ~/amule/aMule-2.0.0rc8.tar.bz2'' | ||
+ | ## Optionally remove the extracted [[aMule]] sources (not recommended, since you might want to compile it again someday): ''rm -r ~/amule'' | ||
− | |||
== Problems and solutions == | == Problems and solutions == |
Revision as of 02:24, 15 January 2005
The following steps will lead you to install aMule in your MacOS X box.
You can get also the most recent binnary of aMule for MacOS X dowloading this: http://download.berlios.de/amule/aMule.zip
This HowTo is written to compile and install aMule 2.0.0-rc8. It will not work for older versions. Please note that you should always download the latest aMule version available.
NOTE: This document explains how to download files using curl. However, curl might not be installed on your system: either install it (you can use Fink to instal it) or download the files with whatever application you want (maybe your web browser), but place them in the directory that's being used on each part of the guide, otherwise the commands that are shown here will not work.
Contents
Setting up the required environment
These steps are one-time-only steps necessary for the steps in the following sections to work properly.
- Xcode
- Install Xcode Tools from http://developer.apple.com/tools/download
- "Getting ADC ID"->"Log In"->"Download Software"->"Developer Tools"->"Download Xcode Tools last release">"Install"
- Fink
- Install (or verify installation if already installed) Fink from http://fink.sourceforge.net/download
- gettext
- Using Fink, install gettext. Read Fink's installation guide to learn how to install applications through Fink (the gettext package is gettext).
- Working directories
- Make amule dir in your home directory: mkdir ~/amule
- Make wxmac dir in your home directory: mkdir ~/wxmac
Obtaining wxMac sources
ATTENTION: wxMac 2.5.3 has a couple of bugs which cause aMule 2.0.0-rc8 to crash. One bug causes aMule to crash just after starting up, the other causes it to crash at a random later time :-(. The only work-around is to pull the wxWidgets sources from CVS and patch them!
You have two options, downloading a CVS snapshot or performing a checkout through the wxWidgets CVS server. The snapshot may be faster to download; the CVS server will give you the most up-to-date sources and the most flexibility if you need sources from a previous day (for example, to avoid bugs that may crop up in the ever-changing source). On the other hand, the sources from the snapshot, once extracted, take nearly 6 times as much disk space as those checked out from the CVS server because they include files not necessary for compiling on Mac OS X.
Option 1: Obtaining wxMac sources from CVS snapshot
These instructions were adapted from http://wxwidgets.org/cvs.htm
- Enter the wxmac directory: cd ~/wxmac
- Get the wxMac CVS snapshot (found at http://wxwindows.sourceforge.net/snapshots/ as wx-cvs.tar.bz2) and place it in your ~/wxmac directory: curl -O http://biolpc22.york.ac.uk/pub/CVS_HEAD/wx-cvs.tar.bz2
- Extract it: tar -xjf wx-cvs.tar.bz2
- Optional: You may delete the archive after extracting its contents: rm wx-cvs.tar.bz2
Option 2: Obtaining wxMac sources from CVS server
These instructions were adapted from http://wxwidgets.org/cvs.htm
- Enter the wxmac directory: cd ~/wxmac
- Login (anonymously) to the wxWidgets CVS server (when prompted, enter anoncvs as the password): cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
- Checkout the wxMac sources from CVS: cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxMac
Patching the wxMac sources
The wxMac sources still contain some bugs which affect aMule. One causes aMule to crash at random times. Others cause aMule to leak memory. Patches to fix wxMac have been submitted to the wxWidgets team. These patches have not yet been approved by the wxWidgets developers and so should be considered experimental and approached with caution. However, since the crashing bug seriously hampers the use of aMule, and several Mac aMule users have successfully tested the patch, you are strongly encouraged to apply it. You should exercise judgment in applying the other patches.
- Enter the wxmac directory: cd ~/wxmac
- Patch the crashing bug in wxMac
- Download the patch file: curl "http://sourceforge.net/tracker/download.php?group_id=9863&atid=309863&file_id=114017&aid=1093852" -o doublefree.patch
- Apply the patch to the sources: patch -d wxWidgets -p0 <doublefree.patch
- Optional: Patch some memory leaks in wxMac.
- Download the patch files: curl "http://sourceforge.net/tracker/download.php?group_id=9863&atid=309863&file_id=112952&aid=1088052" -o ctable.patch "http://sourceforge.net/tracker/download.php?group_id=9863&atid=309863&file_id=112949&aid=1088038" -o bitmap.patch
- Apply the patches: cat ctable.patch bitmap.patch | patch -p0 -d wxWidgets
Installing wxMac from sources
- Enter the directory containing the wxMac sources: cd ~/wxmac/wxWidgets
- Directory build should already be there. If not, create it with: mkdir build
- Now enter build directory: cd build
- Prepare the compilation: ../configure
- And compile: make
- Now install wxMac compilation: sudo make install
- Get back to your home directory, you're done: cd ~
- Optional: If everything went ok, you can safely remove the wxMac sources (not recommended, since you might want to compile it again someday): rm -r ~/wxmac
Compiling and installing aMule
- Enter the amule directory: cd ~/amule
- Get aMule's latest source code (aMule 2.0.0-rc8 sourcecode: http://download.berlios.de/amule/aMule-2.0.0rc8.tar.bz2) and place it in your ~/amule directory: curl -O http://download.berlios.de/amule/aMule-2.0.0rc8.tar.bz2
- Extract it: tar -xjf aMule-2.0.0rc8.tar.bz2
- Enter aMule's sources directory: cd aMule-2.0.0rc8
- Prepare the compilation (thanks to one_2_one and Babboia for his test&fix): ./configure --disable-systray --disable-gtk --with-wx-config=/usr/local/bin/wx-config
- And compile it: make
- Optional: You can reduce the size of aMule from 44MB to 3MB by doing the following (anyway, this will make the aMule binary lose debug info, so you'll be unable to report problems to the aMule Team to make aMule a better program; so, it is not recommended): strip src/amule
- Copy the amule binary to the app-Container directory: cp src/amule amule.app/Contents/MacOS/ (NOTE: If the MacOS directory is missing in amule.app, create it by typing mkdir amule.app/Contents/MacOS before executing the previous command. Thanks to dan for the tip)
- And copy amule.app directory to your Applications folder: cp -R amule.app /Applications
- Get back to your home directory, you're done: cd ~
- If everything went OK, you can safely remove the downloaded packages:
Problems and solutions
- If Fink reports something like: After unpacking 11.2GB will be freed, don't be afraid. Fink has evolved into a different way of managing packet's size and some old ("old": at least some months old) packages' sizes aren't handled correctly on the output. If this is your case, devide the number by 1024. So, what the above example really means is: After unpacking 11.2MB will be freed.
- If you get an error like this: You cannot open the application "amule" because it may be damaged or incomplete, right click on amule, then click on Show Packages Contents, go to "Contents">"MacOS"> and double click on amule. Next time you start from amule.app it will run fine. If you still get the same error, move amule.app to the desktop and run it from there.
Older releases
In older releases (aMule 2.0.0-rc7 and earlier), the app container wasn't included with the sources. If you are compiling any of this older releases and do not whish to upgrade (remember it is strongly recommended to upgrade to the latest release), you can:
- Download the latest aMule sources and get the app container from there (recommended option).
- Download aMule's app-Container: curl -O http://download.berlios.de/amule/aMule-App-Container.tar.bz2
You must extract the app container in your amule directory: possible ~/amule To extract it: tar -xjf aMule-App-Container.tar.bz2
NOTE: If the app-Container failed to extract try running this command instead of the app-Container extraction step: mkdir -p amule.app/Contents/MacOS
Once the installation is finished, you can safely remove the app-Container package: rm aMule-App-Container.tar.bz2