I'm posting this to provide information to others that might be interested on how to setup the development environment in Mac OS X 10.6.2 for aMSN 2 with the Cocoa User Interface.
Here it goes:
First what I did was the usual github fork plus my local repo and work copy.
Then I followed basically what is in "amsn2/amsn2/ui/front_ends/cocoa/readme.txt" with a few changes.
Mac OS X 10.6.2 already comes with Python 2.6.1, but in order to more easily install the necessary libraries I decided to install the macports version of Python 2.6.4.
If you need help with macports installation, follow this link http://www.macports.org/install.php
- Installing macports Python 2.6.4
sudo port install python26
sudo port install python_select
sudo python_select python26
be aware that this takes a lot of time ( at least for me in a Macbook Pro 13" with 2gb or ram.I had to logout from by terminal session and log in again for the python change to take effect. You can check if 2.6.4 is running by simply running on the console.
Python 2.6.4 (r264:75706, Jan 22 2010, 23:31:13)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
- Then you will need to install the following libraries:
sudo port install py26-openssl
sudo port install py26-gobject
sudo port install py26-crypto
sudo port install py26-pil
sudo port install py26-pyobjc2-cocoa
Hashlib listed in the readme.txt is not needed anymore since is built-in in python.
- Now comes the tricky part, from what I read, the py2app library and macholib need to be a special version in order to work correctly in a 64bit enviroment, and 64bit compiled python.
What I did was using both libraries from this source:http://hg.hardcoded.net/py2apphttp://hg.hardcoded.net/macholib
There is a "get source" link, where you can download a .tar.gz version of the libraries, unpack them and run the usual
python setup.py install
After that, I had to modify some code in amsn2 to make it work.
Basically in "amsn2/amsn2/core/amsn2.py":
- add the "import sys" statemente in the importing definitions
- modify "exit(0)" call with "sys.exit(0)"
- rename the method "login_" to only "login"
- fix the path to the *.nib files from "../gui/.." to "../ui/.."
here is the git diff of the changes:
From 027c65fccc8a22a45a350dc240f0c229b399f3dd Mon Sep 17 00:00:00 2001
From: Giovanni Degani <giovanni@Giovannis-Macbook.local>
Date: Sat, 23 Jan 2010 01:10:26 -0200
Subject: [PATCH] Updating in order to work with pyobjc
amsn2/core/amsn.py | 4 ++--
amsn2/ui/front_ends/cocoa/nibs/CocoaLoginView.py | 2 +-
setupCocoa.py | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
mode change 100644 => 100755 setupCocoa.py
diff --git a/amsn2/core/amsn.py b/amsn2/core/amsn.py
index c7bf92b..bb5acf2 100644
@@ -29,7 +29,7 @@ from theme_manager import *
from personalinfo_manager import *
from event_manager import *
from userinterface_manager import *
@@ -196,7 +196,7 @@ class aMSNCore(object):
menu = MenuView()
diff --git a/amsn2/ui/front_ends/cocoa/nibs/CocoaLoginView.py b/amsn2/ui/front_ends/cocoa/nibs/CocoaLoginView.py
index 5171bcd..6ae2772 100644
@@ -26,7 +26,7 @@ class aMSNCocoaLoginView(NSView):
def setParent(self, parent):
self.parent = parent
- def login_(self):
+ def login(self):
username = str(self.usernameField.stringValue())
password = str(self.passwordField.stringValue())
diff --git a/setupCocoa.py b/setupCocoa.py
old mode 100644
new mode 100755
@@ -8,8 +8,8 @@ from dircache import listdir
files = ['amsn2', 'papyon']
# Nibs need to be appened individually because they they need to be in the root of the bundle.
-for f in listdir('amsn2/gui/front_ends/cocoa/nibs/files/'):
- files.append('amsn2/gui/front_ends/cocoa/nibs/files/' + f)
+for f in listdir('amsn2/ui/front_ends/cocoa/nibs/files/'):
+ files.append('amsn2/ui/front_ends/cocoa/nibs/files/' + f)
name = 'aMSN2',
After applying the patch, was a simple matter of running the setupCocoa.py like stated on the readme.txt:
python setupCocoa.py py2app -A
This will generate the file "amsn2/dist/aMSN2.app", I had to navigate into "amsn2/dist/aMSN2.app/Contents/MacOS/" and run the command
./aMSN2 -f cocoa
This gets me to the "Loading..." screen, not the login screen that I expected, but I will continue to work and post results here to see where it takes me.
I hope this helps someone.