Re: porting apps from NextStep to Cocoa
Re: porting apps from NextStep to Cocoa
- Subject: Re: porting apps from NextStep to Cocoa
- From: Karl Kraft <email@hidden>
- Date: Mon, 6 Jan 2003 16:43:03 -0600
On Monday, January 6, 2003, at 11:31 AM, Mike Ferris wrote:
If you have hardware that can run NeXTStep 4.2, that's probably the
easiest. Port to OpenStep using a 4.2 box. Then going to Cocoa from
there is mostly a recompile (and possibly changes to take advantage of
new stuff if you want).
Having just gone through this, I would have to disagree. Finding
hardware that works with OpenStep is tough, and the hardware you do
find is going to be limited and have poor performance, making your job
as a developer tougher. If I was going to do a port today, I would go
straight from NeXTSTEP for OSX, using OpenStep only for the nib
conversion. Others have mentioned getting OpenStep running on VPC and
VMWARE, and even if it is 640x480 2 bit gray, it's good endough to do
the one part that I think can only be done on OpenStep, and that is the
nib conversion.
Also, the tools are full of bugs. Another developer on this project
asked "How come project builder crashes when I press arrow keys, and
how can I stop it from happening" Answer: Don't press arrow keys.
Doing a find will crash if you click before it is done, windows end up
frozen and don't flush to screen. I don't expect fixes anytime soon :-)
The whole thing is painful, when you compare it to working on OSX.
The underlying conversion tool (tops) is still shipped with OS X (and
is a cool little code transformation tool). But the NextStep ->
OpenStep conversion scripts and all the intermediate header files are
not shipped.
If you do the all out 6 stage conversion, you don't need the header
files, only the conversions scripts and the shell/utility scripts to
make it work.
It might be possible to simply grab all that stuff from an OpenStep
box and throw it onto OS X, but you'll almost certainly have to do
some creative changes to the instructions for porting, especially when
it comes to the dev env aspects.
I took a break from working on Java stuff today to look into this for
mere amusement / change of pace.
I grabbed a random program off peak, and the tops scripts from an
openstep box, and here is the tale:
The scripts mostly work. Some paths for sed and the like were hard
coded (/bin/sed) and need to be changed (/usr/bin).
A binary program called oneline can be be replaced with a tr command.
The usage of sort was 'interesting'
The diffs file is 166 lines, attached at the end.
The only files I had to modify were:
OpenStepConversion/UtilityScripts/shellscripts/runScripts
OpenStepConversion/UtilityScripts/shellscripts/preprocess
I was then able to run the scripts directly on OSX. The result wasn't
source ready to compile. It has warnings and errors, but that was
pretty much the same experience I got running on OpenStep :-)
It was a ~500 line program, with < 10 lines of pswrap code. All told
it took about 30 minutes to do the conversion and fix all the warnings
and errors (27 errors, 66 warnings, 12 #warnings, 3 #errors). Hardest
part was that the file format used NXMapFile,NXScanf and friends, so I
changed that to a NSDictionary property list.
Work was slow becsause the app had zero comments, and was not written
in a "friendly" style.
I left it as I found it :-)
[demime removed a uuencoded section named diffs.gz which was 26 lines]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.