From: Ole Streicher <olebole@debian.org>
Date: Mon, 26 Mar 2018 17:13:33 +0200
Subject: [Fv] Replace the startup script by something simpler

And set the necessary environment.
---
 ftools/guis/fv/fv         | 122 ++--------------------------------------------
 ftools/guis/fv/fvInit.tcl |   3 --
 2 files changed, 4 insertions(+), 121 deletions(-)

diff --git a/ftools/guis/fv/fv b/ftools/guis/fv/fv
index 49afa8e..d6edc4c 100755
--- a/ftools/guis/fv/fv
+++ b/ftools/guis/fv/fv
@@ -1,119 +1,5 @@
 #!/bin/sh
-#
-(if [ "x$FV" = x ] ; then \
-     FV=$FTOOLS; \
-     export FV;
-fi; \
-FITSVIEWER_LIBRARY=$FV/lib/fv; \
-LD_LIBRARY_PATH=$FV/lib:$LD_LIBRARY_PATH ;\
-if [ "x$DYLD_LIBRARY_PATH" = x ] ; then \
-     DYLD_LIBRARY_PATH=$FV/lib; \
-else \
-     DYLD_LIBRARY_PATH=$FV/lib:$DYLD_LIBRARY_PATH; \
-fi; \
-export DYLD_LIBRARY_PATH; \
-export FITSVIEWER_LIBRARY; \
-export LD_LIBRARY_PATH;\
-unset TCL_LIBRARY; unset TK_LIBRARY; unset TCLLIBPATH; \
-unset ITCL_LIBRARY; unset ITK_LIBRARY; \
-if [ "$#" -ge 2 -a "$2" = "hera" ] ; then \
-  XPA_ACL=false; \
-  export XPA_ACL;
-  fi; \
-$FV/bin/wish $FITSVIEWER_LIBRARY/fvInit.tcl -- "$@")
-#
-# Revision 1.26  2004/05/24 15:45:43  irby
-# Define and export DYLD_LIBRARY_PATH (Darwin).
-#
-# Revision 1.25  2001/02/05 21:55:04  ngan
-# Automatically setting the enviroment XPA_ACL for hera module.
-#
-# Revision 1.24  2000/08/28 20:13:23  pwilson
-# Move fv back to startup with wish... for updated itcl
-#
-# Revision 1.23  1999/12/16 22:20:37  pwilson
-# Rename startup script to fvInit.tcl
-#
-# Revision 1.22  1999/11/09 16:55:32  pwilson
-# Run itkwish3.1
-#
-# Revision 1.21  1999/11/02 20:43:34  pwilson
-# Restore the 'unset's of xxx_LIBRARY variables
-#
-# Revision 1.20  1999/04/14 19:01:50  pwilson
-# Improve some environment variable handling, some 1D image problems,
-# and an FTP file selection update problem... and a few other things
-#
-# Revision 1.19  1998/12/29 23:30:27  pwilson
-# Modify fv startup scripts to run under itkwish instead of wish... avoids
-# linker problems under SunOS 4.
-#
-# Revision 1.18  1998/08/07  18:07:23  jxu
-# dynamically load itcl and itk
-#
-# Revision 1.17  1998/08/07  17:52:56  elwin
-# Changed itkwish to itkwish3.0
-#
-# Revision 1.16  1998/08/06  18:27:41  jxu
-# FV using itcl3.0
-#
-# Revision 1.15  1998/01/16  18:18:49  peachey
-# Set POW_LIBRARY environment variable
-#
-# Revision 1.14  1997/12/04 22:07:59  jxu
-# Added a WCS switch in fv
-# Added a command line help option
-# Make a graph bigger 700x700
-#
-# Revision 1.13  1997/10/22 19:58:06  jxu
-# add user option of -cmap {0 1 2 3}
-#
-# Revision 1.12  1997/10/08  19:44:23  jxu
-# add larry's color map scheme.
-# I found set free_cells to 2 is the best for me at least on my Linux box
-#
-# Revision 1.11  1997/09/04  18:24:26  jxu
-# bug fixes and some enhancement
-#
-# Revision 1.10  1997/04/03  20:19:27  jxu
-# take out the SYSPFILES variable
-#
-# Revision 1.9  1997/03/26 21:15:20  jxu
-# Add echo "loading fv ... "
-#
-# Revision 1.8  1997/03/20 15:11:25  jxu
-# Add in undo in header windows.
-# Speed up the starting process
-# Wrote new file dialog for speed
-# Update the help files
-#
-# Revision 1.7  1997/03/14 20:05:49  elwin
-# Changing fv for the new regime
-#
-# Revision 1.6  1996/12/06 13:30:49  oneel
-# More changes to conform to the current regeim
-#
-# Revision 1.5  1996/10/31  21:48:24  elwin
-# unset some variables to fix things for people with TCL variables
-# already set.
-#
-# Revision 1.3.2.1  1996/10/15 20:45:18  elwin
-# added itcl directory to LD_LIB_PATH variable
-#
-# Revision 1.4  1996/10/15  20:43:33  elwin
-# added itcl directory to LD_LIBRARY_PATH
-#
-# Revision 1.3  1996/09/03  21:01:41  jxu
-# *** empty log message ***
-#
-# Revision 1.2  1996/07/23  15:35:11  oneel
-# itcl 2.1 updates to fv
-#
-# Revision 1.1  1996/07/16  19:35:28  jxu
-# Get rid of the starting window
-#
-# Revision 1.1  1996/06/13  14:01:17  oneel
-# itcl2 additions
-#
-# Revision 1.1  1996/06/11  19:35:36  oneel
-# Fitsviewer install
+export FITSVIEWER_LIBRARY=/usr/share/ftools/fv
+export FV_HELPDIR=/usr/share/doc/ftools-fv/doc
+export XLIB_SKIP_ARGB_VISUALS=1
+exec wish $FITSVIEWER_LIBRARY/fvInit.tcl -- "$@"
diff --git a/ftools/guis/fv/fvInit.tcl b/ftools/guis/fv/fvInit.tcl
index 413d1bf..fc4e3e5 100644
--- a/ftools/guis/fv/fvInit.tcl
+++ b/ftools/guis/fv/fvInit.tcl
@@ -12,8 +12,5 @@ if {$tcl_platform(platform) == "windows"} {
 # Add auto_load path
 lappend auto_path [file join "$env(FITSVIEWER_LIBRARY)" class]    
 
-# Add pathes for help files.
-set env(FV_HELPDIR) [file join "$env(FITSVIEWER_LIBRARY)" doc]
-
 eval fvInit $argv
 
