Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make a clean terminal app for MacOS? #404

Open
EasyG0ing1 opened this issue Apr 26, 2024 · 5 comments
Open

How to make a clean terminal app for MacOS? #404

EasyG0ing1 opened this issue Apr 26, 2024 · 5 comments
Labels
question Further information is requested

Comments

@EasyG0ing1
Copy link
Contributor

When I make a .deb file with JP in Ubuntu, and I install it with dpkg, it creates a nicely packaged folder in /opt then it adds the link to the executable in /usr/local/bin and the program works just like any other command line program that one would install via apt etc.

It's tight, clean and it works well.

My question is, how can we build something like that for MacOS? JP seems to only build .app files but what if my program is just a command line utility that I want to package up with the JRE included?

@fvarrui
Copy link
Owner

fvarrui commented Apr 30, 2024

Hi @EasyG0ing1!

I'm not a mac proficient user/developer 😞 ... What's more, the mac I had was borrowed, and I no longer have it 😢

Ok, now let's go to the point. I'm not sure what kind of package JP can generate to do that, it only supports PKG and DMG packages, containing an ".app" in both cases as you said. Maybe you can create an app (distributed in a DMG package), and instead of move it to Applications folder you can run it with elevated privileges and then this app installs your command tools in /user/local/bin?

@fvarrui fvarrui added the question Further information is requested label Apr 30, 2024
@EasyG0ing1
Copy link
Contributor Author

@fvarrui I'll have to look a little deeper into how programs are distributed that are "command line" programs vs. "app" programs wrapped in an app package. I do know that things like the Java SDK as one example, gets installed by a pkg file where it simply extracts the files into the root Library folder where Java SDKs are intended to exist. There is no use of any .app packages in those instances. So I tend to think there should be a way to utilize a tool that creates a PKG installer so that it can be directed to package things in either scenario. The next question would be ... where to unpack a command line program so that it aligns with the way things should be in MacOS ... and I suppose one could follow HomeBrews methods for that where it tends to put programs in /usr/local/bin though it uses shortcuts to its own Cellar folder, I've seen other programs use /usr/local/bin ... such as VirtualBox and others... I think it's a safe place for executables in general since it's always in the default path of any MacOS install.

How does JP create PKG files?

@EasyG0ing1
Copy link
Contributor Author

@fvarrui I am also curious ... when I package a program using Linux and I direct JP to include the JRE and create a single program that just runs, it does a nice job of that... how is that done, exactly? Clearly in the case of MacOS, the process assumes a .app file must be generated, but the same process that you use to create the linux self contained executable could be used in macOS where the option is available in the POM file to package it either as an executable or as an .app file.

@fvarrui
Copy link
Owner

fvarrui commented May 6, 2024

I do know that things like the Java SDK as one example, gets installed by a pkg file where it simply extracts the files into the root Library folder where Java SDKs are intended to exist.

Yep, good point.

The next question would be ... where to unpack a command line program so that it aligns with the way things should be in MacOS

I'm not sure, but as you say, maybe PKG packages are the answer. I'll have a look into it. Maybe JP can install command line apps in Library folder and create a symlink in /usr/local/bin pointing to the binary file in Library folder

@fvarrui
Copy link
Owner

fvarrui commented May 6, 2024

when I package a program using Linux and I direct JP to include the JRE and create a single program that just runs, it does a nice job of that... how is that done, exactly?

JP just concatenates the JAR file to a BASH startup script, and yes, I think we can do the same on macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants