Skip to main content
Typos...
Source Link
jaume
  • 15.6k
  • 4
  • 59
  • 74

Generally speaking, you can only relocate a package (that is, install it into a different directory) that has been was built with relocation in mind.

    $ cd /Volumes/DISK2GO/usr/local/bin/
    $ ./wishtclsh8.6
    dyld: Library not loaded:
    /Library/Frameworks/TkTcl.framework/Versions/8.6/TkTcl
      Referenced from: /Volumes/DISK2GO/usr/local/bin/./../../../Library/Frameworks/Tk.framework/Versions/8tclsh8.6/Resources/Wish.app/Contents/MacOS/Wish
      Reason: image not found
    ./wish: line 2:  1291 Trace/BPT trap: 5       "$(dirname $0)/../../../Library/Frameworks/Tk.framework/Versions/8.6/Resources/Wish.app/Contents/MacOS/Wish" "$@"
    $  ./tclselect 
    -bash: ./tclselect: /usr/local/bin/tclsh: bad interpreter: No such file or directory

The reason is that pathsscripts and compiled tools use and are linked to /Library/Frameworks and /usr/local are hardcoded in some scripts, etc. There is a chance that you can make it work grepping and substituting existing paths to your new installation path, but it will be a maintenance nightmare.:

$ cd /Volumes/DISK2GO/usr/local/bin/
$ otool -L tclsh8.6 
 tclsh8.6:
 /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl (compatibility version 8.6.0, current version 8.6.0)
(...)
$ grep Library tclselect 
#  /Library/Frameworks
# installation. I.e. a Tcl installed in '/Library/Frameworks' and
return /Library/Frameworks/Tcl.framework/Versions
  • OS X own frameworks areframework is installed in /System/Library/Frameworks/Tk.framework/ and, some binaries in /usr/bin.

  • ActiveState's Tcl installs in /Library/Frameworks/Tcl.framework, /Library/Frameworks/Tk.framework, /Library/Tcl and /usr/local/bin (for a full listing, double click the pkg file and select File>ShowFiles).

Generally speaking, you can only relocate a package (that is, install it into a different directory) that has been was built with relocation in mind.

    $ cd /Volumes/DISK2GO/usr/local/bin/
    $ ./wish
    dyld: Library not loaded: /Library/Frameworks/Tk.framework/Versions/8.6/Tk
     Referenced from: /Volumes/DISK2GO/usr/local/bin/./../../../Library/Frameworks/Tk.framework/Versions/8.6/Resources/Wish.app/Contents/MacOS/Wish
     Reason: image not found
    ./wish: line 2:  1291 Trace/BPT trap: 5       "$(dirname $0)/../../../Library/Frameworks/Tk.framework/Versions/8.6/Resources/Wish.app/Contents/MacOS/Wish" "$@"
    $  ./tclselect 
    -bash: ./tclselect: /usr/local/bin/tclsh: bad interpreter: No such file or directory

The reason is that paths /Library/Frameworks and /usr/local are hardcoded in some scripts, etc. There is a chance that you can make it work grepping and substituting existing paths to your new installation path, but it will be a maintenance nightmare.

  • OS X own frameworks are installed in /System/Library/Frameworks/Tk.framework/ and /usr/bin

  • ActiveState's Tcl installs in /Library/Frameworks/Tcl.framework, /Library/Frameworks/Tk.framework, /Library/Tcl and /usr/local/bin (for a full listing, double click the pkg file and select File>ShowFiles).

Generally speaking, you can only relocate a package (that is, install it into a different directory) that has been built with relocation in mind.

    $ cd /Volumes/DISK2GO/usr/local/bin/
    $ ./tclsh8.6
    dyld: Library not loaded:
    /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl
      Referenced from: /Volumes/DISK2GO/usr/local/bin/./tclsh8.6
      Reason: image not found
    Trace/BPT trap: 5
    $  ./tclselect 
    -bash: ./tclselect: /usr/local/bin/tclsh: bad interpreter: No such file or directory

The reason is that scripts and compiled tools use and are linked to /Library/Frameworks:

$ cd /Volumes/DISK2GO/usr/local/bin/
$ otool -L tclsh8.6 
 tclsh8.6:
 /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl (compatibility version 8.6.0, current version 8.6.0)
(...)
$ grep Library tclselect 
#  /Library/Frameworks
# installation. I.e. a Tcl installed in '/Library/Frameworks' and
return /Library/Frameworks/Tcl.framework/Versions
  • OS X own framework is installed in /System/Library/Frameworks/Tk.framework/, some binaries in /usr/bin.

  • ActiveState's Tcl installs in /Library/Frameworks/Tcl.framework, /Library/Frameworks/Tk.framework, /Library/Tcl and /usr/local/bin (for a full listing, double click the pkg file and select File>ShowFiles).

Source Link
jaume
  • 15.6k
  • 4
  • 59
  • 74

Generally speaking, you can only relocate a package (that is, install it into a different directory) that has been was built with relocation in mind.

If the package supports it, it can be relocated with the command line equivalent of Installer.app, conveniently called installer, with option -target (from man installer):

The target volume is specified with the -target parameter (-tgt is accepted as a synonym).

The argument to -target is:

  1. A volume mount point (/Volumes/HDD), device node (/dev/disk0s5) or volume UUID (376C4046-083E-334F-AF08-62FAFBC4E352), for example:

    installer -pkg InstallMe.pkg -target /

  2. Any of the values returned by -dominfo (LocalSystem or CurrentUserHomeDirectory), for example:

    installer -pkg InstallMe.pkg -target CurrentUserHomeDirectory

(As you see, the latter command looks very promising. It would install InstallMe.pkg in the hierarchy of the home directory of the current user.)

In our specific case, unfortunately, ActiveState's Tcl package wasn't designed to be relocated:

  • It doesn't return any information for -dominfo:

     $ installer -verbose -dominfo -pkg ActiveTcl-8.6.pkg
     Domain information:
     NoDomainsAvailable
    
  • Although the pkg file can be successfully installed on another volume:

     $ sudo installer -verbose -pkg ActiveTcl-8.6.pkg -target /Volumes/DISK2GO/
     installer: Package name is ActiveState ActiveTcl 8.6.0.0.296563
     installer: Installing at base path /Volumes/DISK2GO
     (...)   
     #
     installer: Writing files….....
     (...)
     installer: The software was successfully installed......
     installer: The install was successful.
     #
    

as can be seen here:

enter image description here

it doesn't work:

    $ cd /Volumes/DISK2GO/usr/local/bin/
    $ ./wish
    dyld: Library not loaded: /Library/Frameworks/Tk.framework/Versions/8.6/Tk
     Referenced from: /Volumes/DISK2GO/usr/local/bin/./../../../Library/Frameworks/Tk.framework/Versions/8.6/Resources/Wish.app/Contents/MacOS/Wish
     Reason: image not found
    ./wish: line 2:  1291 Trace/BPT trap: 5       "$(dirname $0)/../../../Library/Frameworks/Tk.framework/Versions/8.6/Resources/Wish.app/Contents/MacOS/Wish" "$@"
    $  ./tclselect 
    -bash: ./tclselect: /usr/local/bin/tclsh: bad interpreter: No such file or directory

The reason is that paths /Library/Frameworks and /usr/local are hardcoded in some scripts, etc. There is a chance that you can make it work grepping and substituting existing paths to your new installation path, but it will be a maintenance nightmare.

If you wish to use ActiveState's Tcl you must install the package in its default location.

And as far as I can tell, it won't conflict with the installed Tcl framework:

  • OS X own frameworks are installed in /System/Library/Frameworks/Tk.framework/ and /usr/bin

  • ActiveState's Tcl installs in /Library/Frameworks/Tcl.framework, /Library/Frameworks/Tk.framework, /Library/Tcl and /usr/local/bin (for a full listing, double click the pkg file and select File>ShowFiles).