Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

moore1879

macrumors newbie
Original poster
May 22, 2008
15
0
I have run into this before but never thought to post to a forum. I like open source software, however sometimes it's annoying to install an application and only have it open via command line. This brings me to the question, if I have the source code, what would it take to create a .app from that? Let us assume that there are no dependencies.

A link, a step-by-step walk through, anything like that would be helpful.

I am running 10.4 and have Xcode installed.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
A .app is a GUI application. So if you have code meant for the command line, you would need to figure out how to wrap a GUI around it. And to do that you need to learn Cocoa. Easiest way to get started is Xcode > File > New Project > Cocoa Application. That will give you the essentials but you may want to look into a Cocoa tutorial to go further.
 

moore1879

macrumors newbie
Original poster
May 22, 2008
15
0
Take, for example, GIMP. You can install it using MacPorts. When you do it has a gui that runs using X11. However, you don't get a .app directory for it. So, you must run it using a command line call. How can you take an application like that and turn in into a .app?

For the record, GIMP is just an example. That is not why I want to do this.
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Take, for example, GIMP. You can install it using MacPorts. When you do it has a gui that runs using X11. However, you don't get a .app directory for it. So, you must run it using a command line call. How can you take an application like that and turn in into a .app?

For the record, GIMP is just an example. That is not why I want to do this.

Why do you need too? Just install the command line tool and the write a GUI application that just makes calls to the command line tool. Then all you need to do is run the GUI application and it will handle all the command line stuff for the user.

You don't need to touch the original applications source at all.
 

moore1879

macrumors newbie
Original poster
May 22, 2008
15
0
Because the application already has a GUI. I don't need to create the GUI. The only way to run the application is to type in the name of the application. I can run the application, but it has to be run from the terminal window. I can type in "eric". and it runs the application; however, if I close the terminal window, it kills the application. I can run it from an applescript, but the applescript must continue to run or the application is killed. Why would I write a GUI for an application that already has a GUI?
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Because the application already has a GUI. I don't need to create the GUI. The only way to run the application is to type in the name of the application. I can run the application, but it has to be run from the terminal window. I can type in "eric". and it runs the application; however, if I close the terminal window, it kills the application. I can run it from an applescript, but the applescript must continue to run or the application is killed. Why would I write a GUI for an application that already has a GUI?

Because you didn't state that at the start. If you want someone to give you a solution to a problem, in general it best to describe exactly the problem you have.

In that case if you really want to do it that way, I can only suggest you import the current build files into Xcode and then set the project up to compile a .app for you. You'll probably need to muck around with makefiles depending on the application.
 

cazlar

macrumors 6502
Oct 2, 2003
492
11
Sydney, Australia
So you just want to call the command line to start the app, but not have it via a terminal window. I'd write a tiny shell script to do that, and then save it as "blah.command". IIRC, that will be double-clickable and will auto launch a terminal window and then run your script. If you want to have it do it without a terminal window, make your script launch your "app" in the background (I think you can just put a "&" on the end of the call, not sure). It's been years since I did this, I think the terminal shows up still, but you can close it and your thing will still be running.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.