Commits
Leo Singer authored 3f19fdc9ba7
1 + | From a702174273e2e04eda32f0e8cbb0a467ea28ca8f Mon Sep 17 00:00:00 2001 |
2 + | From: Leo Singer <leo.singer@ligo.org> |
3 + | Date: Mon, 18 Nov 2019 15:07:35 -0500 |
4 + | Subject: [PATCH 1/3] Use MacPorts share directory instead of zipfs |
5 + | |
6 + | --- |
7 + | ds9/library/ds9.tcl | 2 +- |
8 + | ds9/unix/ds9.C | 22 +++------------------- |
9 + | 2 files changed, 4 insertions(+), 20 deletions(-) |
10 + | |
11 + | diff --git a/ds9/library/ds9.tcl b/ds9/library/ds9.tcl |
12 + | index 8e543dcd..b381c404 100644 |
13 + | --- a/ds9/library/ds9.tcl |
14 + | +++ b/ds9/library/ds9.tcl |
15 + | |
16 + | # pre package load |
17 + | switch $ds9(wm) { |
18 + | x11 { |
19 + | - set ds9(root) "[::tcl::zipfs::root]mntpt" |
20 + | + set ds9(root) "@macports_prefix@/share/ds9" |
21 + | set auto_path [list $ds9(root) $ds9(root)/tcl8.6 $ds9(root)/tk8.6 $ds9(root)/tk8.6/ttk] |
22 + | } |
23 + | aqua { |
24 + | diff --git a/ds9/unix/ds9.C b/ds9/unix/ds9.C |
25 + | index 6642cecc..d3018c50 100644 |
26 + | --- a/ds9/unix/ds9.C |
27 + | +++ b/ds9/unix/ds9.C |
28 + | |
29 + | |
30 + | // so that tcl and tk know where to find their libs |
31 + | // we do it here before InitLibraryPath is called |
32 + | - putenv((char*)"TCL_LIBRARY=zipfs:/mntpt/tcl8.6"); |
33 + | - putenv((char*)"TK_LIBRARY=zipfs:/mntpt/tk8.6"); |
34 + | + putenv((char*)"TCL_LIBRARY=@macports_prefix@/share/ds9/tcl8.6"); |
35 + | + putenv((char*)"TK_LIBRARY=@macports_prefix@/share/ds9/tcl8.6"); |
36 + | |
37 + | // startup script |
38 + | - Tcl_Obj *path = Tcl_NewStringObj("zipfs:/mntpt/library/ds9.tcl",-1); |
39 + | + Tcl_Obj *path = Tcl_NewStringObj("@macports_prefix@/share/ds9/library/ds9.tcl",-1); |
40 + | Tcl_SetStartupScript(path, NULL); |
41 + | |
42 + | return TCL_OK; |
43 + | |
44 + | Tcl_StaticPackage (interp, "zipfs", TclZipfs_Init, |
45 + | (Tcl_PackageInitProc*)NULL); |
46 + | |
47 + | - // find current working directory, and set as mount point |
48 + | - { |
49 + | -#ifdef ZIPFILE |
50 + | - ostringstream str; |
51 + | - str << (char *)Tcl_GetNameOfExecutable() |
52 + | - << ".zip" |
53 + | - << ends; |
54 + | - if(TclZipfs_Mount(interp, "", (const char*)str.str().c_str(), NULL) != TCL_OK ){ |
55 + | - cerr << "ERROR: Unable to open the auxiliary ds9 file 'ds9.zip'. If you moved the ds9 program from its original location, please also move the zip file to the same place." << endl; |
56 + | - exit(1); |
57 + | - } |
58 + | -#else |
59 + | - TclZipfs_Mount(interp, "", (const char *)Tcl_GetNameOfExecutable(), NULL); |
60 + | -#endif |
61 + | - } |
62 + | - |
63 + | // Tcl |
64 + | if (Tcl_Init(interp) == TCL_ERROR) |
65 + | return TCL_ERROR; |
66 + | -- |
67 + | 2.24.0 |
68 + | |