1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
From: Ole Streicher <olebole@debian.org>
Date: Mon, 26 Mar 2018 17:13:33 +0200
Subject: [Pow] Create and "package require" the POW package.
---
tcltk/pow/Makefile.in | 12 ++++++------
tcltk/pow/POWplot.tcl | 4 ++--
tcltk/pow/PowInit.c | 12 +++++++-----
tcltk/pow/pkgIndex.tcl | 2 ++
4 files changed, 17 insertions(+), 13 deletions(-)
create mode 100644 tcltk/pow/pkgIndex.tcl
diff --git a/tcltk/pow/Makefile.in b/tcltk/pow/Makefile.in
index 3afd5bc..3e58582 100644
--- a/tcltk/pow/Makefile.in
+++ b/tcltk/pow/Makefile.in
@@ -82,16 +82,16 @@ shared: ${SHARED_OBJ}
${SHLIB_LD} ${LD_FLAGS} ${SHARED_OBJ} ${SHLIB_LD_LIBS} -o ${SHARED_LIB}
install:
- @if [ ! -d ${INSTALLDIR}/lib/tcltk/POW ]; then \
- echo "mkdir ${INSTALLDIR}/lib/tcltk/POW"; \
- mkdir -p ${INSTALLDIR}/lib/tcltk/POW; \
+ @if [ ! -d ${INSTALLDIR}/lib/tcltk/${DEB_HOST_MULTIARCH}/POW ]; then \
+ echo "mkdir ${INSTALLDIR}/lib/tcltk/${DEB_HOST_MULTIARCH}/POW"; \
+ mkdir -p ${INSTALLDIR}/lib/tcltk/${DEB_HOST_MULTIARCH}/POW; \
fi
@if [ "x${C_LIB_OPTION}" = xstatic ]; then \
echo "cp ${STATIC_LIB} ${INSTALLDIR}/lib/"; \
cp ${STATIC_LIB} ${INSTALLDIR}/lib/; \
else \
- echo "cp ${SHARED_LIB} ${INSTALLDIR}/lib/tcltk/POW/"; \
- cp ${SHARED_LIB} ${INSTALLDIR}/lib/tcltk/POW/; \
+ echo "cp ${SHARED_LIB} ${INSTALLDIR}/lib/tcltk/${DEB_HOST_MULTIARCH}/POW/"; \
+ cp ${SHARED_LIB} pkgIndex.tcl ${INSTALLDIR}/lib/tcltk/${DEB_HOST_MULTIARCH}/POW/; \
fi
mkdir -p ${INSTALLDIR}/bin
@for file in ${SCRIPTS}; do \
@@ -104,7 +104,7 @@ install:
cp $$file ${INSTALLDIR}/include/; \
done
mkdir -p ${INSTALLDIR}/share/ftools/POW
- @for file in ${TCLFILES}; do \
+ @for file in ${TCLFILES} tclIndex; do \
echo "cp $$file ${INSTALLDIR}/share/ftools/POW/"; \
cp $$file ${INSTALLDIR}/share/ftools/POW/; \
done
diff --git a/tcltk/pow/POWplot.tcl b/tcltk/pow/POWplot.tcl
index 29b6971..dc49080 100644
--- a/tcltk/pow/POWplot.tcl
+++ b/tcltk/pow/POWplot.tcl
@@ -421,8 +421,8 @@ package require Itcl
package require Itk
package require Iwidgets
-load [glob $POWLIB/libfitstcl.{s\[ol\]*,dylib}]
-load [glob $POWLIB/libpow.{s\[ol\]*,dylib}]
+package require fitsTcl
+package require POW
# Look for client/server flag
diff --git a/tcltk/pow/PowInit.c b/tcltk/pow/PowInit.c
index d241a1c..a851c8f 100644
--- a/tcltk/pow/PowInit.c
+++ b/tcltk/pow/PowInit.c
@@ -108,6 +108,8 @@ int Pow_Init(Tcl_Interp *interp_instance) {
return TCL_ERROR;
}
+ Tcl_PkgRequire(interp, "Itcl", "3.0", 0);
+
#if defined(MAC_TCL) && defined(PLUGIN)
@@ -127,12 +129,9 @@ int Pow_Init(Tcl_Interp *interp_instance) {
charptr = Tcl_GetVar2(interp,"env", "POW_LIBRARY", TCL_GLOBAL_ONLY);
if( charptr == NULL ) {
- puts("Could not find defaults.");
- puts(" Set your POW_LIBRARY environment variable.");
- return TCL_ERROR;
- } else {
- Tcl_DStringAppend(&pow_env,charptr, -1);
+ charptr = "/usr/share/ftools/POW";
}
+ Tcl_DStringAppend(&pow_env,charptr, -1);
/* Brackets needed around %s to prevent Windows-style paths */
/* ... eg, c:\fv... from getting converted to control chars */
@@ -216,6 +215,9 @@ int Pow_Init(Tcl_Interp *interp_instance) {
Pow_CreateCommands(interp);
Tk_CreateItemType(&tkPowCurveType);
+
+ Tcl_PkgProvide(interp, "POW", "3.0");
+
return TCL_OK;
}
diff --git a/tcltk/pow/pkgIndex.tcl b/tcltk/pow/pkgIndex.tcl
new file mode 100644
index 0000000..0dd301a
--- /dev/null
+++ b/tcltk/pow/pkgIndex.tcl
@@ -0,0 +1,2 @@
+package ifneeded POW 3.0 [list load [file join $dir libpow.so]]
+
|