[saods9] 02/02: Use tcl packages instead of direct linking

Ole Streicher olebole at moszumanska.debian.org
Tue Jul 7 08:17:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

olebole pushed a commit to branch experimental
in repository saods9.

commit cabdd82fb879e8c7e8323c70dfc31fc88539fd88
Author: Ole Streicher <olebole at debian.org>
Date:   Tue Jul 7 10:17:41 2015 +0200

    Use tcl packages instead of direct linking
---
 debian/patches/ds9_make_linux.patch        |   2 +-
 debian/patches/ds9_use_external_libs.patch | 236 ++++++++++++++++++++---------
 debian/patches/ds9_use_filesystem.patch    |  10 +-
 debian/rules                               |   2 +-
 debian/saods9-data.install                 |   1 +
 debian/saods9.install                      |   4 +
 6 files changed, 178 insertions(+), 77 deletions(-)

diff --git a/debian/patches/ds9_make_linux.patch b/debian/patches/ds9_make_linux.patch
index cec4b99..2fcff6b 100644
--- a/debian/patches/ds9_make_linux.patch
+++ b/debian/patches/ds9_make_linux.patch
@@ -89,7 +89,7 @@ Description: Set the compile flags according to the Debian environment. We
  
  MAINDIR	= /usr/share/tcltk/tk$(shell . /usr/lib/tkConfig.sh ; echo $$TK_VERSION)
  MAIN	= tkAppInit
-@@ -30,7 +30,7 @@
+@@ -27,7 +27,7 @@
  
  ifneq (,$(findstring linux,$(ARCH)))
  
diff --git a/debian/patches/ds9_use_external_libs.patch b/debian/patches/ds9_use_external_libs.patch
index cd872be..efc0ca1 100644
--- a/debian/patches/ds9_use_external_libs.patch
+++ b/debian/patches/ds9_use_external_libs.patch
@@ -25,12 +25,12 @@ Description: Compile against external libraries of funtools, ast,
  	$(ZDIR)/src \
  	$(ZDIR)/msgs \
  	$(ZDIR)/doc \
-@@ -23,37 +16,11 @@
+@@ -23,37 +16,7 @@
  	$(ZDIR)/template
  
  LIBS	= \
 -	../lib/$(SAOTKVER)/libsaotk1.0.a \
- 	../lib/libtkhtml.a \
+-	../lib/libtkhtml.a \
 -	../lib/$(TKMPEGDIR)/libtkmpeg1.0.a \
 -	../lib/$(TCLXMLVER)/libTclxml3.2.a \
 -	../lib/$(TKTABLEVER)/libTktable2.10.a \
@@ -49,8 +49,7 @@ Description: Compile against external libraries of funtools, ast,
 -	../lib/libast.a \
 -	../lib/libast_err.a \
 -	../lib/libast_pal.a \
-+	../lib/libtkmpeg1.0.a \
- 	../lib/$(SAOTKVER)/libsaotk1.0.a \
+-	../lib/$(SAOTKVER)/libsaotk1.0.a \
 -	../lib/libzvfs.a \
 -	../lib/libxpa.a \
 -	../lib/$(TCLIISDIR)/libtcliis1.0.a \
@@ -61,12 +60,11 @@ Description: Compile against external libraries of funtools, ast,
 -	../lib/libtkstub8.6.a \
 -	../lib/libtcl8.6.a \
 -	../lib/libtclstub8.6.a
-+	../lib/libtcliis1.0.a \
-+	../lib/libtclcheckdns1.1.a
++	../lib/libtkhtml.a
  
  #--------------------------main
  
-@@ -81,11 +48,12 @@
+@@ -81,11 +44,9 @@
  
  ds9Base	: $(OBJS) $(LIBS)
  	$(RM) $@
@@ -76,26 +74,24 @@ Description: Compile against external libraries of funtools, ast,
 -	-lxml2 \
 -	-lz -lpthread 
 +	$(CXX) $(OPTS) $(LDFLAGS) -o $@ ds9.o tkAppInit.o \
-+	-Wl,-Bdynamic -lstarlink_ast -lstarlink_ast_err \
-+	-lstdc++ -Wl,-Bstatic -L../lib/$(SAOTKVER) -l$(SAOTKVER) -L../lib \
-+	-ltcliis1.0 -ltkmpeg1.0 -ltkhtml -ltclcheckdns1.1 -Wl,-Bdynamic \
-+	-lBLT -lwcstools -lfuntools  -ltk -ltcl -lz \
-+	-L/usr/X11R6/lib -lX11 -ldl -lpthread -lxml2 -lXrandr
++	-Wl,-Bstatic -L../lib -ltkhtml -Wl,-Bdynamic -ltk -ltcl \
++	-L/usr/X11R6/lib -lX11
  
  endif
  
 --- a/ds9/ds9.unix
 +++ b/ds9/ds9.unix
-@@ -22,29 +22,13 @@
+@@ -21,41 +21,11 @@
+   int Zvfs_Init(Tcl_Interp*);
    int Zvfs_Mount(Tcl_Interp*, char*, char *);
  
-   int Tkblt_Init(Tcl_Interp*);
+-  int Tkblt_Init(Tcl_Interp*);
 -  int Tktable_Init(Tcl_Interp*);
-   int Tclcheckdns_Init(Tcl_Interp*);
-   int Saotk_Init(Tcl_Interp*);
+-  int Tclcheckdns_Init(Tcl_Interp*);
+-  int Saotk_Init(Tcl_Interp*);
    int Tkhtml_Init(Tcl_Interp*);
-   int Tkmpeg_Init(Tcl_Interp*);
- 
+-  int Tkmpeg_Init(Tcl_Interp*);
+-
 -  int Tkimg_Init(Tcl_Interp*);
 -  int Zlibtcl_Init(Tcl_Interp*);
 -  int Jpegtcl_Init(Tcl_Interp*);
@@ -108,15 +104,26 @@ Description: Compile against external libraries of funtools, ast,
 -  int Tkimgwindow_Init(Tcl_Interp*);
 -
 -  int Tclxpa_Init(Tcl_Interp*);
-   int Tcliis_Init(Tcl_Interp*);
- 
+-  int Tcliis_Init(Tcl_Interp*);
+-
 -  int Tclxml_Init(Tcl_Interp*);
 -  int Tclxml_libxml2_Init(Tcl_Interp*);
 -
-   int Signal_ext_Init(Tcl_Interp*);
+-  int Signal_ext_Init(Tcl_Interp*);
  }
  
-@@ -123,19 +107,6 @@
+ Tcl_Interp *global_interp;
+ 
+-void internalError(const char* msg)
+-{
+-  Tcl_SetVar2(global_interp, "ds9", "msg", msg, TCL_GLOBAL_ONLY);
+-  Tcl_SetVar2(global_interp, "ds9", "msg,level", "error", TCL_GLOBAL_ONLY);
+-}
+-
+ // currently use relative path
+ // using full path with spaces causes problems 
+ // with htmwidget and tcl/tk
+@@ -123,31 +93,6 @@
    // Tk
    if (Tk_Init(interp) == TCL_ERROR)
      return TCL_ERROR;
@@ -133,10 +140,22 @@ Description: Compile against external libraries of funtools, ast,
 -    return TCL_ERROR;
 -  Tcl_StaticPackage (interp, "Tktable", Tktable_Init, 
 -		     (Tcl_PackageInitProc*)NULL);
+-
+-  // Tclcheckdns
+-  if (Tclcheckdns_Init(interp) == TCL_ERROR)
+-    return TCL_ERROR;
+-  Tcl_StaticPackage (interp, "Tclcheckdns", Tclcheckdns_Init, 
+-		     (Tcl_PackageInitProc*)NULL);
+-
+-  // Saotk
+-  if (Saotk_Init(interp) == TCL_ERROR)
+-    return TCL_ERROR;
+-  Tcl_StaticPackage (interp, "saotk", Saotk_Init,
+-  		     (Tcl_PackageInitProc*)NULL);
  
-   // Tclcheckdns
-   if (Tclcheckdns_Init(interp) == TCL_ERROR)
-@@ -155,12 +126,6 @@
+   // Tkhtml
+   if (Tkhtml_Init(interp) == TCL_ERROR)
+@@ -155,93 +100,5 @@
    Tcl_StaticPackage (interp, "tkhtml", Tkhtml_Init,
    		     (Tcl_PackageInitProc*)NULL);
  
@@ -146,13 +165,18 @@ Description: Compile against external libraries of funtools, ast,
 -  Tcl_StaticPackage (interp, "Tclxpa", Tclxpa_Init,
 -		     (Tcl_PackageInitProc*)NULL);
 -
-   // Tcliis
-   if (Tcliis_Init(interp) == TCL_ERROR)
-     return TCL_ERROR;
-@@ -173,75 +138,5 @@
-   Tcl_StaticPackage (interp, "Tkmpeg", Tkmpeg_Init, 
- 		     (Tcl_PackageInitProc*)NULL);
- 
+-  // Tcliis
+-  if (Tcliis_Init(interp) == TCL_ERROR)
+-    return TCL_ERROR;
+-  Tcl_StaticPackage (interp, "Tcliis", Tcliis_Init, 
+-		     (Tcl_PackageInitProc*)NULL);
+-
+-  // Tkmpeg
+-  if (Tkmpeg_Init(interp) == TCL_ERROR)
+-    return TCL_ERROR;
+-  Tcl_StaticPackage (interp, "Tkmpeg", Tkmpeg_Init, 
+-		     (Tcl_PackageInitProc*)NULL);
+-
 -  // Tclxml
 -  if (Tclxml_Init(interp) == TCL_ERROR)
 -    return TCL_ERROR;
@@ -246,6 +270,42 @@ Description: Compile against external libraries of funtools, ast,
  
 --- a/Makefile
 +++ b/Makefile
+@@ -128,7 +128,7 @@
+ 	./configure \
+ 	$(WITHTCL) $(WITHTK) \
+ 	--prefix $(root) --exec-prefix $(root) \
+-	--disable-shared \
++	--enable-shared \
+ 	--enable-symbols
+ 	$(MAKE) -C $(SAOTKDIR) -j $(JOBS) install
+ 
+@@ -142,7 +142,7 @@
+ 	./configure \
+ 	$(WITHTCL) \
+ 	--prefix $(root) --exec-prefix $(root) \
+-	--disable-shared \
++	--enable-shared \
+ 	--enable-symbols
+ 	$(MAKE) -C $(TCLCHECKDNSDIR) -j $(JOBS) install
+ 
+@@ -152,7 +152,7 @@
+ 	./configure \
+ 	$(WITHTCL) \
+ 	--prefix $(root) --exec-prefix $(root) \
+-	--disable-shared \
++	--enable-shared \
+ 	--enable-symbols
+ 	$(MAKE) -C $(TCLIISDIR) -j $(JOBS) install
+ 
+@@ -209,7 +209,7 @@
+ 	./configure \
+ 	$(WITHTCL) $(WITHTK) \
+ 	--prefix $(root) --exec-prefix $(root) \
+-	--disable-shared \
++	--enable-shared \
+ 	--enable-symbols
+ 	$(MAKE) -C $(TKMPEGDIR) -j $(JOBS) install
+ 
 @@ -282,68 +282,21 @@
  	find . -name "*stackdump*" -exec rm {} \;
  endif
@@ -317,7 +377,7 @@ Description: Compile against external libraries of funtools, ast,
  
 --- a/src/ds9.tcl
 +++ b/src/ds9.tcl
-@@ -199,31 +199,34 @@
+@@ -199,31 +199,37 @@
  	# so we can still find our files
  	set ds9(root) [file normalize [file join [pwd] zvfsmntpt]]
  
@@ -358,9 +418,12 @@ Description: Compile against external libraries of funtools, ast,
 +	package require math::fuzzy
 +
 +	package require tkcon
-+	source $ds9(root)/src/xmlrpc.tcl
++	package require xmlrpc
 +	package require BLT
-+
++	package require saotk
++	package require tcliis
++	package require tclcheckdns
++	package require tkmpeg
 +	package require Tktable
 +	package require tclxpa
 +	package require Signal
@@ -377,39 +440,6 @@ Description: Compile against external libraries of funtools, ast,
  
  	source $ds9(root)/src/source.tcl
  
---- a/tcliis1.0/Makefile.in
-+++ b/tcliis1.0/Makefile.in
-@@ -80,7 +80,7 @@
- 
- PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
- pkgdatadir	= $(datadir)/$(PKG_DIR)
--pkglibdir	= $(libdir)/$(PKG_DIR)
-+pkglibdir	= $(libdir)
- pkgincludedir	= $(includedir)/$(PKG_DIR)
- 
- top_builddir	= .
---- a/tclcheckdns1.1/Makefile.in
-+++ b/tclcheckdns1.1/Makefile.in
-@@ -80,7 +80,7 @@
- 
- PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
- pkgdatadir	= $(datadir)/$(PKG_DIR)
--pkglibdir	= $(libdir)/$(PKG_DIR)
-+pkglibdir	= $(libdir)
- pkgincludedir	= $(includedir)/$(PKG_DIR)
- 
- top_builddir	= .
---- a/tkmpeg1.0/Makefile.in
-+++ b/tkmpeg1.0/Makefile.in
-@@ -80,7 +80,7 @@
- 
- PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
- pkgdatadir	= $(datadir)/$(PKG_DIR)
--pkglibdir	= $(libdir)/$(PKG_DIR)
-+pkglibdir	= $(libdir)
- pkgincludedir	= $(includedir)/$(PKG_DIR)
- 
- top_builddir	= .
 --- a/tclcheckdns1.1/configure.in
 +++ b/tclcheckdns1.1/configure.in
 @@ -155,7 +155,7 @@
@@ -447,12 +477,78 @@ Description: Compile against external libraries of funtools, ast,
  #--------------------------------------------------------------------
 --- a/saotk/configure.in
 +++ b/saotk/configure.in
-@@ -375,7 +356,7 @@
+@@ -356,9 +356,9 @@
  # link against the non-stubbed Tcl library.  Add Tk too if necessary.
  #--------------------------------------------------------------------
  
 -AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
 +#AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
  #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
- SHLIB_LD_LIBS='${LIBS} -lstdc++'
+-SHLIB_LD_LIBS='${LIBS} -lstdc++'
++SHLIB_LD_LIBS='${LIBS} -lstdc++ -lstarlink_ast -lstarlink_ast_err -lfuntools -lwcstools -lBLT -lxml2'
  
+ #--------------------------------------------------------------------
+ # This macro generates a line to use when building a library.  It
+--- a/tclcheckdns1.1/checkdns.C
++++ b/tclcheckdns1.1/checkdns.C
+@@ -163,7 +163,7 @@
+ 
+  Tcl_CreateObjCommand(interp, "checkdns", TclcheckdnsCmd,
+ 		      (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+- Tcl_PkgProvide(interp, "Tclcheckdns", "1.1");
++ Tcl_PkgProvide(interp, "tclcheckdns", "1.1");
+ 
+  return TCL_OK;
+ }
+--- a/tcliis1.0/iistcl.C
++++ b/tcliis1.0/iistcl.C
+@@ -49,7 +49,7 @@
+ 
+   // Define Package Name
+ 
+-  if (Tcl_PkgProvide(interp, "Tcliis", "1.0") == TCL_ERROR)
++  if (Tcl_PkgProvide(interp, "tcliis", "1.0") == TCL_ERROR)
+     return TCL_ERROR;
+ 
+   // Commands
+--- a/tkmpeg1.0/tkmpeg.C
++++ b/tkmpeg1.0/tkmpeg.C
+@@ -22,7 +22,7 @@
+ int Tkmpeg_Init(Tcl_Interp* interp) {
+ 
+   // Define Package Name
+-  if (Tcl_PkgProvide(interp, "Tkmpeg", "1.0") == TCL_ERROR)
++  if (Tcl_PkgProvide(interp, "tkmpeg", "1.0") == TCL_ERROR)
+     return TCL_ERROR;
+ 
+   // Commands
+--- a/saotk/util/saotk.C
++++ b/saotk/util/saotk.C
+@@ -27,6 +27,7 @@
+ extern int PannerTrueColor_Init(Tcl_Interp*);
+ 
+ extern int MagnifierTrueColor_Init(Tcl_Interp*);
++static Tcl_Interp *global_interp;
+ 
+ extern "C" {
+   int Saotk_Init(Tcl_Interp* interp);
+@@ -90,6 +91,8 @@
+   if (Tcl_PkgProvide(interp, "saotk", "1.0") == TCL_ERROR)
+     return TCL_ERROR;
+ 
++  global_interp = interp;
++
+   return TCL_OK;
+ }
+ 
+@@ -97,3 +100,10 @@
+ {
+   return TCL_OK;
+ }
++
++void internalError(const char* msg)
++{
++  Tcl_SetVar2(global_interp, "ds9", "msg", msg, TCL_GLOBAL_ONLY);
++  Tcl_SetVar2(global_interp, "ds9", "msg,level", "error", TCL_GLOBAL_ONLY);
++}
++
diff --git a/debian/patches/ds9_use_filesystem.patch b/debian/patches/ds9_use_filesystem.patch
index f4abeb7..7206033 100644
--- a/debian/patches/ds9_use_filesystem.patch
+++ b/debian/patches/ds9_use_filesystem.patch
@@ -8,7 +8,7 @@ Description: Store all files in the usual FHS directories
  ds9, which is used for testing.
 --- a/ds9/Makefile.unix
 +++ b/ds9/Makefile.unix
-@@ -32,13 +32,8 @@
+@@ -29,13 +29,8 @@
  
  CXXFLAGS := $(CXXOPT) -I. -I../include -I$(X11INCLUDE)
  
@@ -36,9 +36,9 @@ Description: Store all files in the usual FHS directories
 -  int Zvfs_Mount(Tcl_Interp*, char*, char *);
 +  void Tcl_SetStartupScript(Tcl_Obj *path, const char *encoding);
  
-   int Tkblt_Init(Tcl_Interp*);
-   int Tclcheckdns_Init(Tcl_Interp*);
-@@ -52,13 +49,15 @@
+   int Tkhtml_Init(Tcl_Interp*);
+ }
+@@ -44,13 +41,15 @@
    // do this first
    Tcl_FindExecutable((*argvPtr)[0]);
  
@@ -60,7 +60,7 @@ Description: Store all files in the usual FHS directories
    Tcl_SetStartupScript(path, NULL);
  
    return TCL_OK;
-@@ -69,37 +68,6 @@
+@@ -61,37 +60,6 @@
    // save interp for cputs function
    global_interp = interp;
  
diff --git a/debian/rules b/debian/rules
index 1a34cb2..a2de778 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,12 +22,12 @@ override_dh_autoreconf:
 
 override_dh_auto_build: make.include
 	dh_auto_build -- $(BUILDPARTS)
-	cp xmlrpc-0.3/xmlrpc.tcl ds9/zipdir/zvfsmntpt/src
 	chmod ugo-x ds9/zipdir/zvfsmntpt/src/*.tcl
 	perl -w debian/generate-man > ds9/ds9.1
 
 override_dh_auto_test:
 	DS9_HOME=ds9/zipdir/zvfsmntpt \
+	TCLLIBPATH=lib/ \
 	xvfb-run --server-args="-screen 0 1024x768x24" \
 	./bin/ds9 -quit
 
diff --git a/debian/saods9-data.install b/debian/saods9-data.install
index 232b4ee..49a1ef7 100644
--- a/debian/saods9-data.install
+++ b/debian/saods9-data.install
@@ -3,3 +3,4 @@ ds9/zipdir/zvfsmntpt/doc/sun.gif /usr/share/saods9
 ds9/zipdir/zvfsmntpt/msgs /usr/share/saods9/
 ds9/zipdir/zvfsmntpt/src /usr/share/saods9/
 ds9/zipdir/zvfsmntpt/template /usr/share/saods9/
+lib/xmlrpc* /usr/lib/tcltk/
diff --git a/debian/saods9.install b/debian/saods9.install
index 49add2e..6b3db3d 100644
--- a/debian/saods9.install
+++ b/debian/saods9.install
@@ -1,3 +1,7 @@
 bin/ds9 usr/bin/
+lib/saotk* /usr/lib/tcltk/
+lib/tclcheckdns* /usr/lib/tcltk/
+lib/tcliis* /usr/lib/tcltk/
+lib/tkmpeg* /usr/lib/tcltk/
 debian/ds9.xpm usr/share/pixmaps
 debian/saods9.desktop usr/share/applications

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/saods9.git



More information about the debian-science-commits mailing list