Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: How do I package up a Perl-TK app for macOS?

by starX (Chaplain)
on Nov 14, 2025 at 21:31 UTC ( [id://11166728]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I package up a Perl-TK app for macOS?
in thread How do I package up a Perl-TK app for macOS?

Obligatory disclaimer that I only used it the one time, so there are some gaps in my knowledge on this, but perlbrew lets you build a private perl environment (or multiple private perl environments) separate from your system perl environment, and everything in that environment is essentially its own sandbox, with its own bin/, lib/, and man./ directories. Any modules need to be installed for the perlbrew environment through cpan inside of perlbrew. Perl/Tk is a wrapper around Tcl/Tk and may reference system libraries (i.e. X11 or image libraries) that are not part of perlbrew, and perlbrew does not provide them.

In practice, if you install XQuartz, Perl/Tk build scripts should detect X11 headers and libraries installed in /opt/X11 as normal. I believe XQuartz will install libjpeg for you, but if not, installing those through Homebrew or Macports should work. Modules like Tk will compile against the system libraries that they find -- which is something you might have to be careful about if there are multiple instances of those installed on your system.

The advantage to the perlbrew method was to build an isolated perl environment for the .app bundle that would not rely on the presence of whatever perl environment comes on a mac, which will let you ensure cpan module compatibility for the private environment in your app bundle. But this is why you would want your .app bundle to check for the presence of XQuartz and direct users to install it if they don't have it, as those system resources still need to be installed at the system level.

  • Comment on Re^3: How do I package up a Perl-TK app for macOS?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11166728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2025-12-08 10:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (87 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.