summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2008-11-05 22:20:07 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2008-11-05 22:20:07 +0000
commit6c5b4fab5eb69c7e4c0c77f95cd9a2ac84adc455 (patch)
treeb4acf669d71d59250339f5e49e32dd9e8322e64c /sci-astronomy
parentInitial import (diff)
downloadgentoo-2-6c5b4fab5eb69c7e4c0c77f95cd9a2ac84adc455.tar.gz
gentoo-2-6c5b4fab5eb69c7e4c0c77f95cd9a2ac84adc455.tar.bz2
gentoo-2-6c5b4fab5eb69c7e4c0c77f95cd9a2ac84adc455.zip
Version bump. Added a bunch of patches to allow using system libs.
(Portage version: 2.2_rc11/cvs/Linux 2.6.25-gentoo-r7 x86_64)
Diffstat (limited to 'sci-astronomy')
-rw-r--r--sci-astronomy/ds9/ChangeLog13
-rw-r--r--sci-astronomy/ds9/ds9-5.1.ebuild70
-rw-r--r--sci-astronomy/ds9/ds9-5.4.ebuild59
-rw-r--r--sci-astronomy/ds9/files/ds9-5.1-Makefile.patch30
-rw-r--r--sci-astronomy/ds9/files/ds9-5.1-tk-gif.patch15
-rw-r--r--sci-astronomy/ds9/files/ds9-5.4-fitsy.patch13
-rw-r--r--sci-astronomy/ds9/files/ds9-5.4-gcc43.patch100
-rw-r--r--sci-astronomy/ds9/files/ds9-5.4-htmlwidget.patch46
-rw-r--r--sci-astronomy/ds9/files/ds9-5.4-main.patch226
-rw-r--r--sci-astronomy/ds9/files/ds9-5.4-makefile.patch26
-rw-r--r--sci-astronomy/ds9/files/ds9-5.4-saotk.patch155
-rw-r--r--sci-astronomy/ds9/files/ds9-5.4-src.patch51
-rw-r--r--sci-astronomy/ds9/files/make.gentoo9
13 files changed, 697 insertions, 116 deletions
diff --git a/sci-astronomy/ds9/ChangeLog b/sci-astronomy/ds9/ChangeLog
index d48c6d33890b..a1eed69116c5 100644
--- a/sci-astronomy/ds9/ChangeLog
+++ b/sci-astronomy/ds9/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for sci-astronomy/ds9
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/ds9/ChangeLog,v 1.11 2008/04/22 11:04:17 bicatali Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/ds9/ChangeLog,v 1.12 2008/11/05 22:20:07 bicatali Exp $
+
+*ds9-5.4 (05 Nov 2008)
+
+ 05 Nov 2008; Sébastien Fabbro <bicatali@gentoo.org>
+ -files/ds9-5.1-Makefile.patch, -files/ds9-5.1-tk-gif.patch,
+ +files/ds9-5.4-fitsy.patch, +files/ds9-5.4-gcc43.patch,
+ +files/ds9-5.4-htmlwidget.patch, +files/ds9-5.4-main.patch,
+ +files/ds9-5.4-makefile.patch, +files/ds9-5.4-saotk.patch,
+ +files/ds9-5.4-src.patch, +files/make.gentoo, -ds9-5.1.ebuild,
+ +ds9-5.4.ebuild:
+ Version bump. Added a bunch of patches to allow using system libs.
22 Apr 2008; Sébastien Fabbro <bicatali@gentoo.org> ds9-5.2.ebuild:
Fixed patch location for x86 and a sed function
diff --git a/sci-astronomy/ds9/ds9-5.1.ebuild b/sci-astronomy/ds9/ds9-5.1.ebuild
deleted file mode 100644
index 72f3c7647996..000000000000
--- a/sci-astronomy/ds9/ds9-5.1.ebuild
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/ds9/ds9-5.1.ebuild,v 1.4 2008/04/16 16:13:55 bicatali Exp $
-
-inherit flag-o-matic eutils toolchain-funcs
-
-DESCRIPTION="Data visualization application for astronomical FITS images"
-HOMEPAGE="http://hea-www.harvard.edu/RD/ds9"
-SRC_URI="http://hea-www.harvard.edu/saord/download/${PN}/source/${PN}.${PV}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="doc"
-RDEPEND="x11-libs/libX11
- x11-libs/libXdmcp
- x11-libs/libXau"
-DEPEND="${RDEPEND}
- app-arch/zip"
-
-RESTRICT="strip test mirror"
-
-S="${WORKDIR}/sao${PN}"
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- # patch to speed up compilation (no man pages generation)
- epatch "${FILESDIR}"/${P}-Makefile.patch
-
- # fix stack smashing on x86 with gcc-4.2
- if [[ "${ARCH}" == "x86" ]]; then
- epatch "${FILESDIR}"/${P}-gcc4.2-x86.patch
- fi
- # security fix in embedded tk (bug #208464)
- epatch "${FILESDIR}"/${P}-tk-gif.patch
-
- # remove build-time dependency on etags (i.e. emacs or xemacs)
- sed -i -e '/^all/s/TAGS//' saotk/*/Makefile || die "sed failed"
-}
-
-src_compile() {
- local ds9arch
- case ${ARCH} in
- x86) ds9arch=linux ;;
- amd64) ds9arch=linux64 ;;
- ppc) ds9arch=linuxppc ;;
- x86-fbsd) ds9arch=freebsd ;;
- *) die "ds9 not supported upstream for this architecture";;
- esac
- ln -s make.${ds9arch} make.include
-
- # This is a long and fragile compilation
- # which recompiles tcl/tk, tkimg, blt, funtools,
- # and a lot of other packages
- emake -j1 \
- CC="$(tc-getCC)" \
- CXX="$(tc-getCXX)" \
- OPTS="${CXXFLAGS}" \
- || die "emake failed"
-}
-
-src_install () {
- dobin bin/ds9 || die "failed installing ds9 binary"
- dobin bin/xpa* || die "failed installing xpa* binaries"
- doman man/man?/xpa* || die " failed installing man pages"
- dodoc README acknowledgement || die "failed installing basic doc"
- if use doc; then
- dohtml -r doc/* || die "failed installing html doc"
- fi
-}
diff --git a/sci-astronomy/ds9/ds9-5.4.ebuild b/sci-astronomy/ds9/ds9-5.4.ebuild
new file mode 100644
index 000000000000..86c2e20b25fd
--- /dev/null
+++ b/sci-astronomy/ds9/ds9-5.4.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/ds9/ds9-5.4.ebuild,v 1.1 2008/11/05 22:20:07 bicatali Exp $
+
+EAPI=2
+inherit eutils
+
+DESCRIPTION="Data visualization application for astronomical FITS images"
+HOMEPAGE="http://hea-www.harvard.edu/RD/ds9"
+SRC_URI="http://hea-www.harvard.edu/saord/download/${PN}/source/${PN}.${PV}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RDEPEND="dev-tcltk/blt
+ >=dev-tcltk/tcllib-1.10
+ >=dev-tcltk/tclxml-3.1
+ dev-tcltk/tkcon
+ >=dev-tcltk/tkimg-1.3.1
+ dev-tcltk/tktable
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ sci-astronomy/ast
+ sci-astronomy/funtools"
+
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig"
+
+S="${WORKDIR}/sao${PN}"
+
+src_prepare() {
+ # some patches are adapted from fedora
+ # most of them are to use system libraries instead of bundled-ones
+ epatch "${FILESDIR}"/${P}-saotk.patch
+ epatch "${FILESDIR}"/${P}-htmlwidget.patch
+ epatch "${FILESDIR}"/${P}-main.patch
+ epatch "${FILESDIR}"/${P}-src.patch
+ epatch "${FILESDIR}"/${P}-makefile.patch
+ epatch "${FILESDIR}"/${P}-gcc43.patch
+
+ # remove build-time dependency on etags (i.e. emacs or xemacs)
+ sed -i -e '/^all/s/TAGS//' saotk/*/Makefile || die "sed failed"
+
+ cp "${FILESDIR}"/make.gentoo make.include
+ use amd64 && \
+ export EXTRA_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
+ export OPTS="${CXXFLAGS}"
+}
+
+src_install () {
+ dobin bin/ds9 || die "failed installing ds9 binary"
+ insinto /usr/share/${PN}
+ doins -r ds9/zipdir/zvfsmntpt/* || die
+ dodoc README acknowledgement || die "failed installing basic doc"
+ dosym ../../${PN}/doc /usr/share/doc/${PF}/html
+ doicon doc/sun.gif
+ make_desktop_entry ds9 "SAOImage DS9" sun.gif
+}
diff --git a/sci-astronomy/ds9/files/ds9-5.1-Makefile.patch b/sci-astronomy/ds9/files/ds9-5.1-Makefile.patch
deleted file mode 100644
index 6e1d6a8b15aa..000000000000
--- a/sci-astronomy/ds9/files/ds9-5.1-Makefile.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- Makefile.orig 2008-01-15 15:19:48.367764731 +0000
-+++ Makefile 2008-01-15 16:04:54.805517099 +0000
-@@ -235,23 +235,23 @@
- tcl : FORCE
- @echo "Installing Tcl..."
- cd $(TCLDIRDIR); CC='$(CC)' CFLAGS='$(OPTS) $(TCLOPTS)' LDFLAGS='$(LIBS)' ./configure $(TCLFLAGS) --disable-shared
-- cd $(TCLDIRDIR); $(MAKE) install
-+ cd $(TCLDIRDIR); $(MAKE) install-binaries install-libraries
-
- tk : FORCE
- @echo "Installing Tk..."
- cd $(TKDIRDIR); CC='$(CC)' CFLAGS='$(OPTS) $(TCLOPTS)' LDFLAGS='$(LIBS)' ./configure $(TCLFLAGS) --disable-shared
-- cd $(TKDIRDIR); $(MAKE) install
-+ cd $(TKDIRDIR); $(MAKE) install-binaries install-libraries
- $(RM) -r lib/$(TKVER)/demos
-
- tktable : FORCE
- @echo "Installing TkTable..."
- cd $(TKTABLEDIR); CC='$(CC)' CFLAGS='$(OPTS)' LDFLAGS='$(LIBS)' ./configure $(TKTABLEFLAGS) --disable-shared
-- cd $(TKTABLEDIR); $(MAKE); $(MAKE) install
-+ cd $(TKTABLEDIR); $(MAKE); $(MAKE) install-binaries install-libraries
-
- tcllib : FORCE
- @echo "Installing TCLLIB..."
- cd $(TCLLIBDIR); ./configure $(TCLLIBFLAGS)
-- cd $(TCLLIBDIR); $(MAKE) install
-+ cd $(TCLLIBDIR); $(MAKE) install-libraries
-
- ifeq ($(OS),macosx)
- blt : optincl
diff --git a/sci-astronomy/ds9/files/ds9-5.1-tk-gif.patch b/sci-astronomy/ds9/files/ds9-5.1-tk-gif.patch
deleted file mode 100644
index 4649a561594b..000000000000
--- a/sci-astronomy/ds9/files/ds9-5.1-tk-gif.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- tk8.4.17/generic/tkImgGIF.c.orig 2008-02-14 23:20:53.683962654 +0000
-+++ tk8.4.17/generic/tkImgGIF.c 2008-02-14 23:21:42.762759495 +0000
-@@ -826,6 +826,12 @@
- Tcl_PosixError(interp), (char *) NULL);
- return TCL_ERROR;
- }
-+
-+ if (initialCodeSize > MAX_LWZ_BITS) {
-+ Tcl_SetResult(interp, "malformed image", TCL_STATIC);
-+ return TCL_ERROR;
-+ }
-+
- if (transparent != -1) {
- cmap[transparent][CM_RED] = 0;
- cmap[transparent][CM_GREEN] = 0;
diff --git a/sci-astronomy/ds9/files/ds9-5.4-fitsy.patch b/sci-astronomy/ds9/files/ds9-5.4-fitsy.patch
new file mode 100644
index 000000000000..4440aa86536e
--- /dev/null
+++ b/sci-astronomy/ds9/files/ds9-5.4-fitsy.patch
@@ -0,0 +1,13 @@
+--- saods9.orig/saotk/fitsy++/Makefile 2007-12-28 22:07:11.000000000 +0000
++++ saods9/saotk/fitsy++/Makefile 2008-11-03 23:06:28.000000000 +0000
+@@ -3,8 +3,8 @@
+
+ CXXFLAGS = $(CXXOPT) -I. -I.. -I../vector -I../util \
+ -I../../include -I$(X11INCLUDE) \
+- -I../../$(FUNTOOLSDIR)/filter -I../../$(FUNTOOLSDIR)/fitsy \
+- -I../../$(FUNTOOLSDIR)/util
++ -I/usr/include/funtools/filter -I/usr/include/funtools/fitsy \
++ -I/usr/include/funtools/util -I/usr/include/wcs
+
+ SS = \
+ alloc.C \
diff --git a/sci-astronomy/ds9/files/ds9-5.4-gcc43.patch b/sci-astronomy/ds9/files/ds9-5.4-gcc43.patch
new file mode 100644
index 000000000000..06d6ef5c5a17
--- /dev/null
+++ b/sci-astronomy/ds9/files/ds9-5.4-gcc43.patch
@@ -0,0 +1,100 @@
+diff -Nur saods9.orig/ds9/ds9.C saods9/ds9/ds9.C
+--- saods9.orig/ds9/ds9.C 2008-10-08 20:36:37.000000000 +0100
++++ saods9/ds9/ds9.C 2008-11-04 11:46:44.000000000 +0000
+@@ -1,5 +1,7 @@
+ #include <iostream>
+ #include <sstream>
++#include <cstring>
++#include <cstdlib>
+ using namespace std;
+
+ #include <tcl.h>
+diff -Nur saods9.orig/iis/iistcl.C saods9/iis/iistcl.C
+--- saods9.orig/iis/iistcl.C 2008-06-02 22:27:50.000000000 +0100
++++ saods9/iis/iistcl.C 2008-11-04 11:45:29.000000000 +0000
+@@ -7,6 +7,7 @@
+
+ #include <iostream>
+ #include <sstream>
++#include <cstdlib>
+ using namespace std;
+
+ #include <tcl.h>
+diff -Nur saods9.orig/saotk/fitsy++/card.C saods9/saotk/fitsy++/card.C
+--- saods9.orig/saotk/fitsy++/card.C 2008-01-04 17:29:24.000000000 +0000
++++ saods9/saotk/fitsy++/card.C 2008-11-04 11:45:29.000000000 +0000
+@@ -3,6 +3,7 @@
+ // For conditions of distribution and use, see copyright notice in "copyright"
+
+ #include "card.h"
++#include <string.h>
+
+ FitsCard::FitsCard()
+ {
+diff -Nur saods9.orig/saotk/fitsy++/compress.C saods9/saotk/fitsy++/compress.C
+--- saods9.orig/saotk/fitsy++/compress.C 2008-06-05 21:37:51.000000000 +0100
++++ saods9/saotk/fitsy++/compress.C 2008-11-04 11:45:29.000000000 +0000
+@@ -6,6 +6,7 @@
+ #include "head.h"
+ #include "util.h"
+ #include "NaN.h"
++#include <string.h>
+
+ FitsCompress::FitsCompress(FitsFile* fits)
+ {
+diff -Nur saods9.orig/saotk/fitsy++/file.C saods9/saotk/fitsy++/file.C
+--- saods9.orig/saotk/fitsy++/file.C 2008-06-03 15:46:25.000000000 +0100
++++ saods9/saotk/fitsy++/file.C 2008-11-04 11:45:29.000000000 +0000
+@@ -6,6 +6,7 @@
+ #include <sstream>
+ #include <iomanip>
+ using namespace std;
++#include <string.h>
+
+ #include "file.h"
+ #include "util.h"
+diff -Nur saods9.orig/saotk/fitsy++/iis.C saods9/saotk/fitsy++/iis.C
+--- saods9.orig/saotk/fitsy++/iis.C 2008-01-04 17:29:24.000000000 +0000
++++ saods9/saotk/fitsy++/iis.C 2008-11-04 11:45:29.000000000 +0000
+@@ -3,6 +3,7 @@
+ // For conditions of distribution and use, see copyright notice in "copyright"
+
+ #include "iis.h"
++#include <string.h>
+
+ FitsIIS::FitsIIS(int width, int height)
+ {
+diff -Nur saods9.orig/saotk/frame/frscale.C saods9/saotk/frame/frscale.C
+--- saods9.orig/saotk/frame/frscale.C 2008-01-04 17:29:26.000000000 +0000
++++ saods9/saotk/frame/frscale.C 2008-11-04 11:45:37.000000000 +0000
+@@ -3,6 +3,7 @@
+ // For conditions of distribution and use, see copyright notice in "copyright"
+
+ #include <string.h>
++#include <stdlib.h>
+
+ #include "frscale.h"
+
+diff -Nur saods9.orig/saotk/widget/ps.C saods9/saotk/widget/ps.C
+--- saods9.orig/saotk/widget/ps.C 2008-06-03 15:46:25.000000000 +0100
++++ saods9/saotk/widget/ps.C 2008-11-04 11:52:06.000000000 +0000
+@@ -4,7 +4,8 @@
+
+ #include "ps.h"
+ #include "util.h"
+-#include "string.h"
++#include <cstring>
++using std::memcpy;
+
+ Filter::Filter()
+ {
+--- saods9.orig/saotk/colorbar/colorbarbase.C 2008-09-26 22:54:36.000000000 +0100
++++ saods9/saotk/colorbar/colorbarbase.C 2008-11-04 18:10:13.000000000 +0000
+@@ -10,6 +10,7 @@
+
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
++#include <cstdlib>
+
+ #include "parser.H"
+
diff --git a/sci-astronomy/ds9/files/ds9-5.4-htmlwidget.patch b/sci-astronomy/ds9/files/ds9-5.4-htmlwidget.patch
new file mode 100644
index 000000000000..98eb17a500e7
--- /dev/null
+++ b/sci-astronomy/ds9/files/ds9-5.4-htmlwidget.patch
@@ -0,0 +1,46 @@
+--- saods9.orig/htmlwidget/configure 2006-05-01 19:47:09.000000000 +0200
++++ saods9/htmlwidget/configure 2008-03-08 16:36:40.000000000 +0100
+@@ -1052,11 +1052,11 @@
+ echo "$ac_t""$BUILD_TCLSH" 1>&6
+ else
+ if test "$with_tcl" != ""; then
+- if test -x "$with_tcl/$tclsubdir/tclsh"; then
+- BUILD_TCLSH=$with_tcl/$tclsubdir/tclsh
++ if test -x "$with_tcl/tclsh"; then
++ BUILD_TCLSH=$with_tcl/tclsh
+ else
+- if test -x "$with_tcl/$tclsubdir/tclsh8.0"; then
+- BUILD_TCLSH=$with_tcl/$tclsubdir/tclsh8.0
++ if test -x "$with_tcl/tclsh8.0"; then
++ BUILD_TCLSH=$with_tcl/tclsh8.0
+ fi
+ fi
+ fi
+@@ -1137,7 +1137,7 @@
+ if test "$enable_shared" = "yes"; then
+ ok=0
+ if test "$with_tcl" != ""; then
+- tclconf=$with_tcl/unix/tclConfig.sh
++ tclconf=$with_tcl/tclConfig.sh
+
+ ac_safe=`echo "$tclconf" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $tclconf""... $ac_c" 1>&6
+@@ -1494,7 +1494,7 @@
+ TARGET_TCL_LIBS="$config_TARGET_TCL_LIBS"
+ else
+ if test "$with_tcl" != ""; then
+- extra=`echo $with_tcl/$tclsubdir/libtcl8*.a`
++ extra=`echo -ltcl`
+ fi
+ CC=$TARGET_CC
+ echo $ac_n "checking for sin""... $ac_c" 1>&6
+--- saods9.orig/htmlwidget/src/htmlcmd.c 2002-06-20 22:19:33.000000000 +0100
++++ saods9/htmlwidget/src/htmlcmd.c 2008-11-05 12:31:11.000000000 +0000
+@@ -23,6 +23,7 @@
+ ** drh@acm.org
+ ** http://www.hwaci.com/drh/
+ */
++#include <string.h>
+ #include <tk.h>
+ #include <stdlib.h>
+ #include "htmlcmd.h"
diff --git a/sci-astronomy/ds9/files/ds9-5.4-main.patch b/sci-astronomy/ds9/files/ds9-5.4-main.patch
new file mode 100644
index 000000000000..9b016a43f3cf
--- /dev/null
+++ b/sci-astronomy/ds9/files/ds9-5.4-main.patch
@@ -0,0 +1,226 @@
+diff -Nur saods9.orig/ds9/ds9.C saods9/ds9/ds9.C
+--- saods9.orig/ds9/ds9.C 2008-10-08 20:36:37.000000000 +0100
++++ saods9/ds9/ds9.C 2008-11-05 11:03:36.000000000 +0000
+@@ -11,8 +11,8 @@
+
+ void TclSetStartupScriptFileName(const char*);
+
+- int Zvfs_Init(Tcl_Interp*);
+- int Zvfs_Mount(Tcl_Interp*, char*, char *);
++/* int Zvfs_Init(Tcl_Interp*);
++ int Zvfs_Mount(Tcl_Interp*, char*, char *);*/
+
+ int Blt_Init(Tcl_Interp*);
+ int Tktable_Init(Tcl_Interp*);
+@@ -64,15 +64,15 @@
+ appname = dupstr(argv[0]);
+
+ // set default encoding dir
+- Tcl_SetDefaultEncodingDir("./zvfsmntpt/tcl8.4");
++ //Tcl_SetDefaultEncodingDir("./zvfsmntpt/tcl8.4");
+
+ // so that tcl and tk know where to find their libs
+ // we do it here before InitLibraryPath is called
+- putenv((char*)"TCL_LIBRARY=./zvfsmntpt/tcl8.4");
+- putenv((char*)"TK_LIBRARY=./zvfsmntpt/tk8.4");
++ //putenv((char*)"TCL_LIBRARY=./zvfsmntpt/tcl8.4");
++ //putenv((char*)"TK_LIBRARY=./zvfsmntpt/tk8.4");
+
+ // invoke startup script
+- TclSetStartupScriptFileName("./zvfsmntpt/src/ds9.tcl");
++ TclSetStartupScriptFileName("/usr/share/ds9/src/ds9.tcl");
+ }
+
+ Tcl_Interp *global_interp;
+@@ -91,13 +91,13 @@
+ // We have to initialize the virtual filesystem before calling
+ // Tcl_Init(). Otherwise, Tcl_Init() will not be able to find
+ // its startup script files.
+- if (Zvfs_Init(interp) == TCL_ERROR)
++/* if (Zvfs_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "zvfs", Zvfs_Init,
+ (Tcl_PackageInitProc*)NULL);
+-
++*/
+ // find current working directory, and set as mount point
+- {
++/* {
+ Tcl_DString pwd;
+ Tcl_DStringInit(&pwd);
+ Tcl_GetCwd(interp, &pwd);
+@@ -113,7 +113,7 @@
+ #endif
+ Tcl_DStringFree(&pwd);
+ }
+-
++*/
+ // Initialize Tcl and Tk
+ if (Tcl_Init(interp))
+ return TCL_ERROR;
+@@ -121,7 +121,7 @@
+ // Tk
+ if (Tk_Init(interp))
+ return TCL_ERROR;
+- Tcl_StaticPackage(interp,"Tk", Tk_Init, Tk_SafeInit);
++ //Tcl_StaticPackage(interp,"Tk", Tk_Init, Tk_SafeInit);
+
+ {
+ Tcl_DString pwd;
+@@ -131,7 +131,7 @@
+ }
+
+ // Blt
+- if (Blt_Init(interp) == TCL_ERROR)
++ /*if (Blt_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "BLT", Blt_Init,
+ (Tcl_PackageInitProc*)NULL);
+@@ -140,7 +140,7 @@
+ if (Tktable_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tktable", Tktable_Init,
+- (Tcl_PackageInitProc*)NULL);
++ (Tcl_PackageInitProc*)NULL); */
+
+ // Checkdns
+ if (Checkdns_Init(interp) == TCL_ERROR)
+@@ -161,10 +161,10 @@
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclxpa
+- if (Tclxpa_Init(interp) == TCL_ERROR)
++/* if (Tclxpa_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tclxpa", Tclxpa_Init,
+- (Tcl_PackageInitProc*)NULL);
++ (Tcl_PackageInitProc*)NULL);*/
+
+ // IIS
+ if (Iis_Init(interp) == TCL_ERROR)
+@@ -179,7 +179,7 @@
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimg
+- if (Tkimg_Init(interp) == TCL_ERROR)
++/* if (Tkimg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "img",
+ Tkimg_Init,(Tcl_PackageInitProc*)NULL);
+@@ -254,7 +254,7 @@
+ if (Tkimgwindow_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "window", Tkimgwindow_Init,
+- (Tcl_PackageInitProc*)NULL);
++ (Tcl_PackageInitProc*)NULL);*/
+
+ #ifdef _MACOSX
+ if (Tkmacosx_Init(interp) == TCL_ERROR)
+@@ -271,11 +271,11 @@
+ #endif
+
+ // Variables
+- Tcl_SetVar(interp, "auto_path", "./zvfsmntpt/tcl8.4 ./zvfsmntpt/tk8.4 ./zvfsmntpt/blt2.4 ./zvfsmntpt/tcllib1.6 ./zvfsmntpt/src", TCL_GLOBAL_ONLY);
++/* Tcl_SetVar(interp, "auto_path", "./zvfsmntpt/tcl8.4 ./zvfsmntpt/tk8.4 ./zvfsmntpt/blt2.4 ./zvfsmntpt/tcllib1.6 ./zvfsmntpt/src", TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp, "tcl_libPath", "./zvfsmntpt/tcl8.4", TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp, "blt_library", "./zvfsmntpt/blt2.4", TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp, "blt_libPath", "./zvfsmntpt/blt2.4", TCL_GLOBAL_ONLY);
+- Tcl_SetVar2(interp, "env", "TK_TABLE_LIBRARY", "", TCL_GLOBAL_ONLY);
++ Tcl_SetVar2(interp, "env", "TK_TABLE_LIBRARY", "", TCL_GLOBAL_ONLY);*/
+
+ //Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
+
+diff -Nur saods9.orig/ds9/Makefile saods9/ds9/Makefile
+--- saods9.orig/ds9/Makefile 2008-10-08 20:36:37.000000000 +0100
++++ saods9/ds9/Makefile 2008-11-05 11:13:15.000000000 +0000
+@@ -4,12 +4,7 @@
+ #--------------------------defines
+
+ ZDIR = zipdir/zvfsmntpt
+-FILES = $(ZDIR)/$(TCLVER) \
+- $(ZDIR)/$(TKVER) \
+- $(ZDIR)/$(BLTVER) \
+- $(ZDIR)/$(TCLLIBVER) \
+- $(ZDIR)/$(TKCONVER) \
+- $(ZDIR)/src \
++FILES = $(ZDIR)/src \
+ $(ZDIR)/msgs \
+ $(ZDIR)/doc \
+ $(ZDIR)/template
+@@ -22,37 +17,13 @@
+ ../lib/libsaotk.a \
+ ../lib/libtkhtml.a \
+ ../lib/libtkmpeg.a \
+- ../lib/$(TKIMGVER)/libtkimgwindow1.3.a \
+- ../lib/$(TKIMGVER)/libtkimgjpeg1.3.a \
+- ../lib/$(TKIMGVER)/libjpegtcl1.0.a \
+- ../lib/$(TKIMGVER)/libtkimgtiff1.3.a \
+- ../lib/$(TKIMGVER)/libtifftcl3.6.1.a \
+- ../lib/$(TKIMGVER)/libtkimgpng1.3.a \
+- ../lib/$(TKIMGVER)/libpngtcl1.2.6.a \
+- ../lib/$(TKIMGVER)/libtkimgppm1.3.a \
+- ../lib/$(TKIMGVER)/libtkimggif1.3.a \
+- ../lib/$(TKIMGVER)/libtkimgbmp1.3.a \
+- ../lib/$(TKIMGVER)/libtkimgxbm1.3.a \
+- ../lib/$(TKIMGVER)/libzlibtcl1.2.1.a \
+- ../lib/$(TKIMGVER)/libtkimg1.3.a \
+- ../lib/$(TKTABLEVER)/libTktable2.9.a \
+- ../lib/libfuntools.a \
+ ../lib/librice.a \
+ ../lib/libhcomp.a \
+ ../lib/libplio.a \
+- ../lib/libast.a \
+ ../lib/libsaotk.a \
+- ../lib/libwcs.a \
+ ../lib/libsla.a \
+- ../lib/libzvfs.a \
+- ../lib/libzip.a \
+- ../lib/libz.a \
+- ../lib/libxpa.a \
+ ../lib/libiis.a \
+- ../lib/libcheckdns.a \
+- ../lib/libBLT24.a \
+- ../lib/libtk8.4.a \
+- ../lib/libtcl8.4.a
++ ../lib/libcheckdns.a
+ endif
+
+ ifeq ($(OS),windows)
+@@ -167,14 +138,9 @@
+ ds9.zip : $(FILES)
+ cd zipdir; zip -r9 ../ds9.zip *
+ else
+-ds9 : null.zip ds9Base $(FILES)
++ds9 : ds9Base $(FILES)
+ $(RM) $@
+- cp ds9Base ds9.zip
+- $(STRIP) ds9.zip
+- cat null.zip >> ds9.zip
+- cd zipdir; zip -rA9 ../ds9.zip *
+- mv ds9.zip ds9
+- cp ds9 ../bin/.
++ cp ds9Base ../bin/ds9
+
+ debug : null.zip ds9Base $(FILES)
+ $(RM) $@
+@@ -366,6 +332,20 @@
+ rm -f libstdc++.a
+ endif
+
++# For gentoo
++ifeq ($(ARCH),gentoo)
++ds9Base : $(OBJS) $(LIBS)
++ $(RM) $@
++ $(CXX) ${OPTS} \
++ -o $@ $(OBJS) $(LIBS)\
++ -L$(X11LIB) -lX11 \
++ -ldl -lpthread \
++ -ltk -ltcl -lBLT24 \
++ -lfuntools `pkg-config --libs wcstools` -lz \
++ `ast_link`
++endif
++
++
+ #--------------------------linux
+
+ ifneq (,$(findstring linux,$(ARCH)))
diff --git a/sci-astronomy/ds9/files/ds9-5.4-makefile.patch b/sci-astronomy/ds9/files/ds9-5.4-makefile.patch
new file mode 100644
index 000000000000..25763cf75a01
--- /dev/null
+++ b/sci-astronomy/ds9/files/ds9-5.4-makefile.patch
@@ -0,0 +1,26 @@
+--- saods9.orig/Makefile 2008-10-08 20:53:46.000000000 +0100
++++ saods9/Makefile 2008-11-04 10:30:52.000000000 +0000
+@@ -35,8 +35,7 @@
+ --with-tk=$(root)/$(TKDIRDIR) $(XFLAGS)
+ XPAFLAGS = --prefix $(root) --with-tcl=$(root)/$(TCLDIRDIR) \
+ $(XFLAGS)
+- HTMLFLAGS = --prefix $(root) --with-tcl=$(root)/$(TCLDIR) \
+- --with-tk=$(root)/$(TKDIR) $(XFLAGS)
++ HTMLFLAGS = --prefix $(root) $(XFLAGS)
+ FUNTOOLSFLAGS = --prefix $(root) --with-zlib=../../lib/libz.a \
+ --with-wcslib=../lib/libwcs.a --enable-mainlib
+ endif
+@@ -199,11 +198,8 @@
+ all : build
+
+ build : dirs \
+- tcl tk \
+- tktable tcllib tkcon blt \
+- zlib \
+- tkimg tkmpeg html xpa iis checkdns \
+- funtools sla ast wcssubs rice hcompress plio $(OPTDIR) saotk zip zvfs ds9
++ tkmpeg html iis checkdns \
++ sla rice hcompress plio $(OPTDIR) saotk ds9
+
+ doc : FORCE
+ @echo "Making Documentation..."
diff --git a/sci-astronomy/ds9/files/ds9-5.4-saotk.patch b/sci-astronomy/ds9/files/ds9-5.4-saotk.patch
new file mode 100644
index 000000000000..e7a97a26cd1c
--- /dev/null
+++ b/sci-astronomy/ds9/files/ds9-5.4-saotk.patch
@@ -0,0 +1,155 @@
+diff -Nur saods9.orig/saotk/fitsy++/Makefile saods9/saotk/fitsy++/Makefile
+--- saods9.orig/saotk/fitsy++/Makefile 2007-12-28 22:07:11.000000000 +0000
++++ saods9/saotk/fitsy++/Makefile 2008-11-03 23:06:28.000000000 +0000
+@@ -3,8 +3,8 @@
+
+ CXXFLAGS = $(CXXOPT) -I. -I.. -I../vector -I../util \
+ -I../../include -I$(X11INCLUDE) \
+- -I../../$(FUNTOOLSDIR)/filter -I../../$(FUNTOOLSDIR)/fitsy \
+- -I../../$(FUNTOOLSDIR)/util
++ -I/usr/include/funtools/filter -I/usr/include/funtools/fitsy \
++ -I/usr/include/funtools/util -I/usr/include/wcs
+
+ SS = \
+ alloc.C \
+diff -Nur saods9.orig/saotk/frame/Makefile saods9/saotk/frame/Makefile
+--- saods9.orig/saotk/frame/Makefile 2008-09-23 20:47:09.000000000 +0100
++++ saods9/saotk/frame/Makefile 2008-11-03 23:11:01.000000000 +0000
+@@ -4,8 +4,7 @@
+ CXXFLAGS = $(CXXOPT) -w \
+ -I. -I.. -I../widget -I../vector -I../list -I../fitsy++ -I../util \
+ -I../../include -I$(X11INCLUDE) \
+- -I../../$(FUNTOOLSDIR)/util \
+- -I../../$(ASTDIR)
++ -I/usr/include/funtools/util
+
+ SS = \
+ annulus.C \
+diff -Nur saods9.orig/saotk/util/tkpostscript.h saods9/saotk/util/tkpostscript.h
+--- saods9.orig/saotk/util/tkpostscript.h 2008-02-20 22:26:21.000000000 +0000
++++ saods9/saotk/util/tkpostscript.h 2008-11-04 09:58:00.000000000 +0000
+@@ -4,7 +4,7 @@
+
+ // this is copied from tkCanvPs.c
+
+-#include "../../tk8.4.18/generic/tkCanvas.h"
++#include </usr/lib/tk8.4/include/generic/tkCanvas.h>
+
+ typedef struct TkPostscriptInfo {
+ int x, y, width, height; /* Area to print, in canvas pixel
+diff -Nur saods9.orig/saotk/widget/ps.h saods9/saotk/widget/ps.h
+--- saods9.orig/saotk/widget/ps.h 2008-01-04 17:29:27.000000000 +0000
++++ saods9/saotk/widget/ps.h 2008-11-04 09:59:00.000000000 +0000
+@@ -13,7 +13,7 @@
+ #include "zlib.h"
+ extern int DebugGZ;
+
+-#if defined( __alpha) || defined(__mips64) || defined(__sparcv9) || defined(__M64)
++#if defined( __alpha) || defined(__mips64) || defined(__sparcv9) || defined(__M64) || defined(__LP64__)
+ #define BIT32 int
+ #else
+ #define BIT32 long
+diff -ur saods9.orig/saotk/frame/fitsimage.C saods9/saotk/frame/fitsimage.C
+--- saods9.orig/saotk/frame/fitsimage.C 2007-05-22 20:36:50.000000000 +0200
++++ saods9/saotk/frame/fitsimage.C 2008-11-04 16:36:40.000000000 +0100
+@@ -31,7 +31,99 @@
+ // this is kluge to speed up doug minks wcssubs 'ksearch' routine
+ extern "C" {
+ FitsHead* wcshead = NULL;
+- char* ksearchh(char*, char*);
++ char* ksearchh(char* hstring, char* keyword)
++ {
++/* Find entry for keyword keyword in FITS header string hstring.
++ (the keyword may have a maximum of eight letters)
++ NULL is returned if the keyword is not found */
++
++/* char *hstring; character string containing fits-style header
++ information in the format <keyword>= <value> {/ <comment>}
++ the default is that each entry is 80 characters long;
++ however, lines may be of arbitrary length terminated by
++ nulls, carriage returns or linefeeds, if packed is true. */
++/*char *keyword; character string containing the name of the variable
++ to be returned. ksearch searches for a line beginning
++ with this string. The string may be a character
++ literal or a character variable terminated by a null
++ or '$'. it is truncated to 8 characters. */
++{
++ char *loc, *headnext, *headlast, *pval, *lc, *line;
++ int icol, nextchar, lkey, nleft, lhead, lmax;
++
++#ifdef USE_SAOLIB
++ int iel=1, ip=1, nel, np, ier;
++ char *get_fits_head_str();
++
++ if( !use_saolib ){
++#endif
++
++ pval = 0;
++static int lhead0 = 0;
++/* Find current length of header string */
++ if (lhead0)
++ lmax = lhead0;
++ else
++ lmax = 256000;
++ for (lhead = 0; lhead < lmax; lhead++) {
++ if (hstring[lhead] == (char) 0)
++ break;
++ }
++
++/* Search header string for variable name */
++ headlast = hstring + lhead;
++ headnext = hstring;
++ pval = NULL;
++ while (headnext < headlast) {
++ nleft = headlast - headnext;
++ loc = strncsrch (headnext, keyword, nleft);
++
++ /* Exit if keyword is not found */
++ if (loc == NULL) {
++ break;
++ }
++
++ icol = (loc - hstring) % 80;
++ lkey = strlen (keyword);
++ nextchar = (int) *(loc + lkey);
++
++ /* If this is not in the first 8 characters of a line, keep searching */
++ if (icol > 7)
++ headnext = loc + 1;
++
++ /* If parameter name in header is longer, keep searching */
++ else if (nextchar != 61 && nextchar > 32 && nextchar < 127)
++ headnext = loc + 1;
++
++ /* If preceeding characters in line are not blanks, keep searching */
++ else {
++ line = loc - icol;
++ for (lc = line; lc < loc; lc++) {
++ if (*lc != ' ')
++ headnext = loc + 1;
++ }
++
++ /* Return pointer to start of line if match */
++ if (loc >= headnext) {
++ pval = line;
++ break;
++ }
++ }
++ }
++/* Return pointer to calling program */
++ return (pval);
++
++#ifdef USE_SAOLIB
++ }
++ else {
++ if (get_fits_head_str(keyword,iel,ip,&nel,&np,&ier,hstring) != NULL)
++ return(hstring);
++ else
++ return(NULL);
++ }
++#endif
++}
++}
+
+ char* findit(char* cards, char* key)
+ {
diff --git a/sci-astronomy/ds9/files/ds9-5.4-src.patch b/sci-astronomy/ds9/files/ds9-5.4-src.patch
new file mode 100644
index 000000000000..fea3edd1fd3d
--- /dev/null
+++ b/sci-astronomy/ds9/files/ds9-5.4-src.patch
@@ -0,0 +1,51 @@
+diff -Nur saods9.orig/src/ds9.tcl saods9/src/ds9.tcl
+--- saods9/src/ds9.tcl 2008-04-09 17:35:48.000000000 +0200
++++ saods9.new/src/ds9.tcl 2008-11-03 16:13:55.000000000 +0200
+@@ -68,24 +68,34 @@
+ # initialize, depending on how we are running: choices are zvfs, or wish
+ # for now, its not possible to change the current work directory since
+ # all of the paths are relative
+-if {![catch {package present zvfs}]} {
+- set ds9(root) "zvfsmntpt"
++if {![catch {package present checkdns}]} {
++ set ds9(root) "/usr/share/ds9"
+
+- source $ds9(root)/tcl8.4/msgcat1.3/msgcat.tcl
+- source $ds9(root)/tcl8.4/http2.5/http.tcl
++ package require msgcat
++ package require http
+
+- source $ds9(root)/tk8.4/tearoff.tcl
++
+
+- source $ds9(root)/tcllib1.10/base64/base64.tcl
+- source $ds9(root)/tcllib1.10/log/log.tcl
+- source $ds9(root)/tcllib1.10/ftp/ftp.tcl
+- source $ds9(root)/tcllib1.10/textutil/repeat.tcl
+- source $ds9(root)/tcllib1.10/textutil/tabify.tcl
++ package require base64
++ package require log
++ package require ftp
++ package require textutil::repeat
++ package require textutil::tabify
+
+- source $ds9(root)/tkcon2.5/tkcon.tcl
++ package require tkcon
+
+- source $ds9(root)/blt2.4/graph.tcl
+- source $ds9(root)/blt2.4/tabset.tcl
++ package require BLT
++ package require Tktable
++ package require tclxpa
++ package require img::base
++ package require img::jpeg
++ package require img::tiff
++ package require img::png
++ package require img::gif
++ package require img::ppm
++ package require img::bmp
++ package require img::xbm
++ package require img::window
+
+ source $ds9(root)/src/source.tcl
+
diff --git a/sci-astronomy/ds9/files/make.gentoo b/sci-astronomy/ds9/files/make.gentoo
new file mode 100644
index 000000000000..4ca14484285f
--- /dev/null
+++ b/sci-astronomy/ds9/files/make.gentoo
@@ -0,0 +1,9 @@
+OS = unix
+ARCH = gentoo
+
+X11INCLUDE=/usr/include
+X11LIB = $(LIBDIR)
+MYLIBDIR = $(LIBDIR)
+
+CXXOPT = ${OPTS} -fPIC -DHAVE_SYS_UN_H -DHAVE_SYS_SHM_H ${EXTRA_CPPFLAGS}
+CCOPT = ${OPTS} -fPIC -DHAVE_SYS_UN_H -DHAVE_SYS_SHM_H ${EXTRA_CPPFLAGS}