sveinbjornt / Platypus

Create native Mac applications from command line scripts.
https://sveinbjorn.org/platypus
BSD 3-Clause "New" or "Revised" License
2.84k stars 171 forks source link

[Feature Req] Option to include scripting language interpreters, libraries etc in bundles #217

Open andrewcrook opened 2 years ago

andrewcrook commented 2 years ago

Apple is planning on removing scripting languages by default from future versions MacOS. This would require the user to install them or developers to package the tools as a part of their products.

A depreciation notice was added to macOS Catalina’s developer documentation since its beta

Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages. If your software depends on scripting languages, it’s recommended that you bundle the runtime within the app.

https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes#3318257

It doesn’t appear to be enforced yet, now on Monterey, but I believe it is going ahead. Whether or not it will be gradual I don't know. I have seen a notice dialogue saying that"this application will no longer work on future versions of macOS” in a few applications which I believe is for the removal of Python 2 which I have now confirmed.

Use of Python 2.7 isn’t recommended as this version is included in macOS for compatibility with legacy software. Future versions of macOS won’t include Python 2.7. Instead, it’s recommended that you run python3 from within Terminal.

https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes#3318257

I think it will be good to have an option to build in runtimes etc No doubt some users will want the option to have their systems share a global runtime installation as well.

cedrickp32 commented 2 years ago

+1 for this. PHP is already removed in the latest OS. My apps are not working anymore, and having every user install php from the terminal is not an option. We need a way to embed the interpreter in the app.

michaelherger commented 2 years ago

While that would be great, it's unlikely this is ever going to happen. In the meantime you could build your own and include it. I'm working on something like that to bring Perl up to date. The main script then wouldn't be the Perl script, but some small wrapper shell script telling Platypus where to find the interpreter and the actual script. But it makes for a rather fat app...

michaelherger commented 7 months ago

FWIW: with the latest Platypus I've been able to use the Perl script directly giving platypus the path to the Perl shipped with the bundle:

--interpreter ./bin/perl

where bin is a folder in the root of the bundle. This way I no longer need the wrapper script.