aMSN Forums
January 19, 2018, 08:26:33 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: My Mac OS X 10.6.2 Development environment setup ( With support for Cocoa UI )  (Read 17563 times)
tiefox
Newbie

Offline Offline

Posts: 3


View Profile
« on: January 23, 2010, 04:19:20 am »

Hello All,

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
Code:
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.
Code:
$ python
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:
Code:
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/py2app
http://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
Code:
python setup.py install
for each.

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)"

in "amsn2/ui/front_ends/cocoa/nibs/CocoaLoginView.py":
- rename the method "login_" to only "login"

in "setupCocoa.py"
- fix the path to the *.nib files from "../gui/.." to "../ui/.."

here is the git diff of the changes:
Code:
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
--- a/amsn2/core/amsn.py
+++ b/amsn2/core/amsn.py
@@ -29,7 +29,7 @@ from theme_manager import *
 from personalinfo_manager import *
 from event_manager import *
 from userinterface_manager import *
-
+import sys
 import papyon
 import logging
 
@@ -196,7 +196,7 @@ class aMSNCore(object):
         if self._loop:
             self._loop.quit()
         logging.shutdown()
-        exit(0)
+        sys.exit(0)
 
     def createMainMenuView(self):
         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
--- a/amsn2/ui/front_ends/cocoa/nibs/CocoaLoginView.py
+++ b/amsn2/ui/front_ends/cocoa/nibs/CocoaLoginView.py
@@ -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())
         self.parent.login(username, password)
diff --git a/setupCocoa.py b/setupCocoa.py
old mode 100644
new mode 100755
index d9e7fd3..6d46ee0
--- a/setupCocoa.py
+++ b/setupCocoa.py
@@ -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)
 
 setup(
     name = 'aMSN2',
--
1.6.4.4


After applying the patch, was a simple matter of running the setupCocoa.py like stated on the readme.txt:
Code:
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
Code:
./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.
« Last Edit: January 23, 2010, 04:21:45 am by tiefox » Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #1 on: January 23, 2010, 04:42:48 am »

Hi tiefox!
Awesome first post, thanks a lot for the help you're providing here!
I will apply your patch to amsn2.
If you wish to participate in the development of amsn2, you can join us, github makes it easy! We currently don't have a mac maintainer, so if you want to take up that task of making sure the cocoa front end is correctly working, you're welcome to do so! Smiley
Thanks again!
Logged

KaKaRoTo
tiefox
Newbie

Offline Offline

Posts: 3


View Profile
« Reply #2 on: January 23, 2010, 04:49:22 am »

Hello Kakaroto,

Thanks for the welcome,

Well, I'm very interested into helping out, but I have little experience with python ( I'm more of a Ruby guy  Grin), but I want to learn it, also my cocoa experience is from some little playgrounding with iPhone apps. But I can do my best to try to help out,
If you want I can send a pull request to you with my patch from my github fork.
Smiley
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #3 on: January 23, 2010, 12:34:36 pm »

cool Smiley At least you know how to code! Once you learn one language, then they're all the same! python shouldn't be too hard to get used to...
We unfortunately don't have a lot of devs interested in mac development.. most mac users are just that : users, not developers.. so, yeah, definitely the mac portion needs to receive some love!
I've pulled from your fork already, no need to send a pull request through github!
Thanks! Smiley

p.s: saw you in the channel, too bad noone was online at that time.. hope to see you dropping by more often Smiley
Logged

KaKaRoTo
eyko
Newbie

Offline Offline

Posts: 3


View Profile
« Reply #4 on: January 23, 2010, 02:58:48 pm »

Well you just needed to ask, I don't have much python experience but it's just a matter of learning the lang... anyway:

I tried building python 2.6 on Snow Leopard but it fails building Tk. There's a ticket opened for Tk +quartz on 64-bit, http://trac.macports.org/ticket/20799 but I haven't been able to solve that. I've tried with three patches on the ticket and each encounter a different error (some times dependencies).

I'll try working around the portfile to see if I can finish building python2.6. In any case, did you run into any problems building on snow leopard? (@tiefox)
Logged
tiefox
Newbie

Offline Offline

Posts: 3


View Profile
« Reply #5 on: January 23, 2010, 03:10:50 pm »

Hello eyko,

When installing python26, I notice that macports downloaded, compiled and installed tk automatically. I did not had any issues.
Logged
eyko
Newbie

Offline Offline

Posts: 3


View Profile
« Reply #6 on: January 24, 2010, 09:56:48 am »

Hi there...

Well I finally found a solution to this problem (#20586) in case anybody runs into the same problem. Weekend's almost over now, daah... work week ahead...
Logged
Liam128
Newbie

Offline Offline

Posts: 1


View Profile
« Reply #7 on: July 24, 2010, 06:36:40 pm »

Hi,

I decided to build aMSN2 from svn with my mac, just to see how it looked like, test it a little, and maybe see if I can be of some help (I can't really code but I consider myself a power-user after all), and, well, it works... almost.

Basically, following every tips given and installing everything, I was able to build and launch aMSN. My problem is : it only works with qt4 frontend. I would have loved to see how it looked like and if it kinda worked with the cocoa frontend, but aMSN will not allow me to pass -f cocoa as an argument.
Basically, I guess my aMSN2 is built with no cocoa support (and no efl, gtk, etc., only qt4, web and curses), and I wonder how can I activate the support for the other front-ends.

Of course I know it won't really work anyway, as, from what I understand, cocoa front-end is mostly broken. But I'm still curious... and maybe I could get the gtk front-end working by building gtk+ for Mac OS X. Curious about that too.

Anyway, I tried the qt4 frontend and although it won't go very far, it stil looks promising. Much less bloated and slow than 0.98.3.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!