pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/editors/TeXmacs support maxima-5.10, from a post to th...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bb5025458331
branches:  trunk
changeset: 520559:bb5025458331
user:      drochner <drochner%pkgsrc.org@localhost>
date:      Mon Oct 23 09:42:23 2006 +0000

description:
support maxima-5.10, from a post to the maxima mailing list
by Andrey Grozin
bump PKGREVISION

diffstat:

 editors/TeXmacs/Makefile                         |    9 +-
 editors/TeXmacs/PLIST                            |    3 +-
 editors/TeXmacs/distinfo                         |    3 +-
 editors/TeXmacs/files/texmacs-maxima-5.10.0.lisp |  150 +++++++++++++++++++++++
 editors/TeXmacs/patches/patch-aj                 |   14 ++
 5 files changed, 176 insertions(+), 3 deletions(-)

diffs (229 lines):

diff -r be4939eb4a89 -r bb5025458331 editors/TeXmacs/Makefile
--- a/editors/TeXmacs/Makefile  Mon Oct 23 09:20:20 2006 +0000
+++ b/editors/TeXmacs/Makefile  Mon Oct 23 09:42:23 2006 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.61 2006/08/11 18:05:12 drochner Exp $
+# $NetBSD: Makefile,v 1.62 2006/10/23 09:42:23 drochner Exp $
 
 DISTNAME=              TeXmacs-1.0.6.5-src
 PKGNAME=               ${DISTNAME:S/-src//}
+PKGREVISION=           1
 CATEGORIES=            editors
 MASTER_SITES=          ftp://ftp.texmacs.org/pub/TeXmacs/targz/
 MASTER_SITES+=         http://www.texmacs.org/Download/ftp/targz/
@@ -40,6 +41,12 @@
 REPLACE_FILES.bash+=   plugins/reduce/bin/tm_reduce
 REPLACE_FILES.bash+=   plugins/xypic/bin/tm_xypic
 
+# temporary to support maxima-5.10
+# can probably go away on next TeXmacs update
+post-extract:
+       ${CP} ${FILESDIR}/texmacs-maxima-5.10.0.lisp \
+               ${WRKSRC}/plugins/maxima/lisp
+
 pre-install:
        ${RM} -f ${WRKSRC}/TeXmacs/doc/devel/format/.log
        ${FIND} ${WRKSRC}/plugins/ -name '*.orig' | ${XARGS} ${RM}
diff -r be4939eb4a89 -r bb5025458331 editors/TeXmacs/PLIST
--- a/editors/TeXmacs/PLIST     Mon Oct 23 09:20:20 2006 +0000
+++ b/editors/TeXmacs/PLIST     Mon Oct 23 09:42:23 2006 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.30 2006/08/11 18:05:12 drochner Exp $
+@comment $NetBSD: PLIST,v 1.31 2006/10/23 09:42:23 drochner Exp $
 bin/fig2ps
 bin/texmacs
 include/TeXmacs.h
@@ -1925,6 +1925,7 @@
 share/TeXmacs/plugins/matlab/code/tmrepl.m
 share/TeXmacs/plugins/matlab/code/typeinfo.m
 share/TeXmacs/plugins/matlab/progs/init-matlab.scm
+share/TeXmacs/plugins/maxima/lisp/texmacs-maxima-5.10.0.lisp
 share/TeXmacs/plugins/maxima/lisp/texmacs-maxima-5.6.lisp
 share/TeXmacs/plugins/maxima/lisp/texmacs-maxima-5.9.0.lisp
 share/TeXmacs/plugins/maxima/lisp/texmacs-maxima-5.9.1.lisp
diff -r be4939eb4a89 -r bb5025458331 editors/TeXmacs/distinfo
--- a/editors/TeXmacs/distinfo  Mon Oct 23 09:20:20 2006 +0000
+++ b/editors/TeXmacs/distinfo  Mon Oct 23 09:42:23 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.39 2006/09/19 22:03:54 joerg Exp $
+$NetBSD: distinfo,v 1.40 2006/10/23 09:42:23 drochner Exp $
 
 SHA1 (TeXmacs-1.0.6.5-src.tar.gz) = 7f8d8e7f67ef7cffddc53cd39419ea04422fe3c6
 RMD160 (TeXmacs-1.0.6.5-src.tar.gz) = 4d83e98072cee30e06119d401cc01c942c4cb5b9
@@ -9,3 +9,4 @@
 SHA1 (patch-ae) = c313a19db160d9f1c0dc950a1eb465869cec777f
 SHA1 (patch-ag) = 2b1c0ce4aa0f6b824f08f05a95beacbb1722436b
 SHA1 (patch-ai) = 10c6e74b4b1b9b38a5da071f0ad00780ae8aa419
+SHA1 (patch-aj) = 0c3c75066f25c118869157a03d6f9fbf9695276d
diff -r be4939eb4a89 -r bb5025458331 editors/TeXmacs/files/texmacs-maxima-5.10.0.lisp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/editors/TeXmacs/files/texmacs-maxima-5.10.0.lisp  Mon Oct 23 09:42:23 2006 +0000
@@ -0,0 +1,150 @@
+; $NetBSD: texmacs-maxima-5.10.0.lisp,v 1.1 2006/10/23 09:42:23 drochner Exp $
+
+(in-package :maxima)
+#+clisp (defvar *old-suppress-check-redefinition* 
+             custom:*suppress-check-redefinition*)
+#+clisp (setf custom:*suppress-check-redefinition* t)
+(setf *alt-display2d* 'texmacs)
+(setf *prompt-prefix* "channel:promptlatex:\\red ")
+(setf *prompt-suffix* "\\black")
+;(setf *general-display-prefix* "verbatim:")
+(setf *maxima-prolog* "verbatim:")
+(setf *maxima-epilog* "latex:\\red The end\\black")
+#-gcl(setf *debug-io* (make-two-way-stream *standard-input* *standard-output*))
+#+(or cmu sbcl scl)
+(setf *terminal-io* (make-two-way-stream *standard-input* *standard-output*))
+
+;; Small changes to mactex.lisp for interfacing with TeXmacs
+;; Andrey Grozin, 2001-2005
+
+(defun main-prompt ()
+  (format () "~A(~A~D) ~A" *prompt-prefix* 
+    (tex-stripdollar $inchar) $linenum *prompt-suffix*))
+
+(declare-top
+        (special lop rop ccol $gcprint $inchar)
+        (*expr tex-lbp tex-rbp))
+(defconstant texport *standard-output*)
+
+(defun tex-stripdollar (x)
+  (let ((s (quote-% (maybe-invert-string-case (symbol-name (stripdollar x))))))
+    (if (> (length s) 1)
+      (concatenate 'string "\\mathrm{" s "}")
+      s)))
+
+(defprop mtimes "\\*" texsym)
+
+(defun texmacs (x)
+  (let ((ccol 1))
+    (mapc #'myprinc
+        (tex x '("latex:$\\displaystyle ") '("$
+") 'mparen 'mparen))))
+
+;; In order to allow cut-and-paste from output to input,
+;; we should output \sin(x), not \sin x.
+
+(map 'list #'(lambda (f) (remprop f 'tex) (remprop f 'tex-rbp))
+  '(%sin %cos %tan %cot %sec %csc %sinh %cosh %tanh %coth %asin %acos %atan %exp %log))
+
+(remprop '$pi 'texword)
+(remprop '$gamma 'texword)
+(setf (get '$%i 'texword) "\\mathi")
+(setf (get '$%e 'texword) "\\mathe")
+
+;; Also, we should output f(x)^2, not f^2(x)
+
+(defun tex-mexpt (x l r)
+  (let((nc (eq (caar x) 'mncexpt)))    ; true if a^^b rather than a^b
+    (setq l (if (and (numberp (cadr x)) (numneedsparen (cadr x)))
+                (tex (cadr x) (cons "\\left(" l) '("\\right)") lop (caar x))
+               (tex (cadr x) l nil lop (caar x)))
+          r (if (mmminusp (setq x (nformat (caddr x))))
+               ;; the change in base-line makes parens unnecessary
+               (if nc
+                   (tex (cadr x) '("^ {-\\langle ")(cons "\\rangle }" r) 'mparen 'mparen)
+                   (tex (cadr x) '("^ {- ")(cons " }" r) 'mminus 'mparen))
+               (if nc
+                   (tex x (list "^{\\langle ")(cons "\\rangle}" r) 'mparen 'mparen)
+                   (if (and (integerp x) (< x 10))
+                       (tex x (list "^")(cons "" r) 'mparen 'mparen)
+                       (tex x (list "^{")(cons "}" r) 'mparen 'mparen)))))
+    (append l r)))
+
+;; binomial coefficients
+
+(defun tex-choose (x l r)
+  `(,@l
+    "\\binom{"
+    ,@(tex (cadr x) nil nil 'mparen 'mparen)
+    "}{"
+    ,@(tex (caddr x) nil nil 'mparen 'mparen)
+    "}"
+    ,@r))
+
+;; Integrals, sums, products
+
+(defun tex-int (x l r)
+  (let ((s1 (tex (cadr x) nil nil 'mparen 'mparen)) ;;integrand delims / & d
+       (var (tex (caddr x) nil nil 'mparen rop))) ;; variable
+    (cond((= (length x) 3)
+         (append l `("\\int {" ,@s1 "}{\\;\\mathd\\;" ,@var "}\\big.") r))
+        (t ;; presumably length 5
+         (let ((low (tex (nth 3 x) nil nil 'mparen 'mparen))
+               ;; 1st item is 0
+               (hi (tex (nth 4 x) nil nil 'mparen 'mparen)))
+           (append l `("\\int_{" ,@low "}^{" ,@hi "}{" ,@s1 "\\;\\mathd\\;" ,@var "}\\big.") r))))))
+
+(defun tex-sum(x l r)
+  (let ((op (cond ((eq (caar x) '%sum) "\\sum_{")
+                 ((eq (caar x) '%product) "\\prod_{")
+                 ;; extend here
+                 ))
+       ;; gotta be one of those above
+       (s1 (tex (cadr x) nil nil 'mparen rop)) ;; summand
+       (index ;; "index = lowerlimit"
+        (tex `((mequal simp) ,(caddr x),(cadddr x)) nil nil 'mparen 'mparen))
+       (toplim (tex (car(cddddr x)) nil nil 'mparen 'mparen)))
+    (append l `( ,op ,@index "}^{" ,@toplim "}{" ,@s1 "}\\big.") r)))
+
+(defun tex-lsum(x l r)
+  (let ((op (cond ((eq (caar x) '%lsum) "\\sum_{")
+                 ;; extend here
+                 ))
+       ;; gotta be one of those above 
+       (s1 (tex (cadr x) nil nil 'mparen rop)) ;; summand
+       (index ;; "index = lowerlimit"
+        (tex `((min simp) , (caddr x), (cadddr x))  nil nil 'mparen 'mparen)))
+    (append l `( ,op ,@index "}}{" ,@s1 "}\\big.") r)))
+
+;; This is a hack for math input of integrals, sums, products
+
+(defmfun $tmint (a b f x) ($integrate f x a b))
+
+(defmspec $tmsum (l) (setq l (cdr l))
+  (if (= (length l) 3)
+      (dosum (caddr l) (cadar l) (meval (caddar l)) (meval (cadr l)) t)
+      (wna-err '$tmsum)))
+
+(defmspec $tmlsum (l) (setq l (cdr l))
+  (or (= (length l) 2) (wna-err '$tmlsum))
+  (let ((form (cadr l))
+        (ind (cadar l))
+        (lis (meval (caddar l)))
+        (ans 0))
+       (or (symbolp ind) (merror "Second argument not a variable ~M" ind))
+       (cond (($listp lis)
+              (loop for v in (cdr lis)
+                    with lind = (cons ind nil)
+                    for w = (cons v nil)
+                    do
+                    (setq ans (add* ans  (mbinding (lind w) (meval form)))))
+                   ans)
+           (t `((%lsum) ,form ,ind ,lis)))))
+
+(defmspec $tmprod (l) (setq l (cdr l))
+  (if (= (length l) 3)
+      (dosum (caddr l) (cadar l) (meval (caddar l)) (meval (cadr l)) nil)
+      (wna-err '$tmprod)))
+
+#+clisp (setf custom:*suppress-check-redefinition*
+             *old-suppress-check-redefinition*)
diff -r be4939eb4a89 -r bb5025458331 editors/TeXmacs/patches/patch-aj
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/editors/TeXmacs/patches/patch-aj  Mon Oct 23 09:42:23 2006 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-aj,v 1.1 2006/10/23 09:42:23 drochner Exp $
+
+--- plugins/maxima/bin/tm_maxima.orig  2006-10-21 21:37:11.000000000 +0200
++++ plugins/maxima/bin/tm_maxima
+@@ -18,7 +18,8 @@ case $1 in
+   5.9.0) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.9.0.lisp" \
+       | maxima_filter;;
+   5.9.1) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.9.1.lisp";;
+-  5.9.1.1* | 5.9.2* | 5.9.3) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.9.2.lisp";;
++  5.9.1.1* | 5.9.2* | 5.9.3*) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.9.2.lisp";;
++  5.10.*) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.10.0.lisp";;
+   cygwin)
+     CYGWIN_ROOT="C:\cygwin"
+     CYGWIN_TEXMACS_HOME=`echo $TEXMACS_HOME_PATH | sed 's|/|\\\\|g'`



Home | Main Index | Thread Index | Old Index