Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jul 2005 20:25:51 -0400
From:      "Andrew Bernard" <andrew@hobnob.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/83238: New port: math/emacs-calc Arbitrary-precision calculator for Emacs
Message-ID:  <20050711002553.05EB643D45@mx1.FreeBSD.org>
Resent-Message-ID: <200507110030.j6B0UNnq003044@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         83238
>Category:       ports
>Synopsis:       New port: math/emacs-calc Arbitrary-precision calculator for Emacs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 11 00:30:23 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Bernard
>Release:        FreeBSD 5.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD dedalus.neglectgravity.com 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Sun Feb 13 21:04:15 EST 2005 andrew@dedalus.neglectgravity:/usr/src/sys/i386/compile/DEDALUS i386

>Description:
Emacs Calc can do arbitrary precision arithmetic, operations on matrices,
complex numbers, calendar dates and various other types, plus symbolic
algebra and calculus, graphics, and lots more. Calc also comes with an
extensive manual which you can print or read on-line.

>How-To-Repeat:
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	emacs-calc
#	emacs-calc/Makefile
#	emacs-calc/pkg-descr
#	emacs-calc/pkg-plist
#	emacs-calc/files
#	emacs-calc/files/patch-AA-emacs-21.3-PROBLEMS
#	emacs-calc/files/patch-Makefile
#	emacs-calc/files/patch-calc-autoload.el
#	emacs-calc/files/patch-calc.texinfo
#	emacs-calc/distinfo
#
echo c - emacs-calc
mkdir -p emacs-calc > /dev/null 2>&1
echo x - emacs-calc/Makefile
sed 's/^X//' >emacs-calc/Makefile << 'END-of-emacs-calc/Makefile'
X#
X# Ports makefile for:	emacs-calc
X# Date created:		7/10/5
X# Whom:			andrewb@cs.cmu.edu
X#
X# $FreeBSD$
X#
X
XPORTNAME=		emacs-calc
XPORTVERSION=		2.02f
XDISTNAME=		calc-2.02f
XCATEGORIES=		math editors
XMASTER_SITES=		${MASTER_SITE_GNU}
XMASTER_SITE_SUBDIR=	calc
XWRKSRC=			${WRKDIR}/calc-2.02f
X
XMAINTAINER=	andrewb@cs.cmu.edu
XCOMMENT=	Arbitrary-precision calculator for Emacs
X
XRUN_DEPENDS=	emacs:${PORTSDIR}/editors/emacs
XBUILD_DEPENDS=	emacs:${PORTSDIR}/editors/emacs
X
XINFO=		calc
X
X.include <bsd.port.mk>
X
END-of-emacs-calc/Makefile
echo x - emacs-calc/pkg-descr
sed 's/^X//' >emacs-calc/pkg-descr << 'END-of-emacs-calc/pkg-descr'
X
XEmacs Calc can do arbitrary precision arithmetic, operations on matrices,
Xcomplex numbers, calendar dates and various other types, plus symbolic
Xalgebra and calculus, graphics, and lots more. Calc also comes with an
Xextensive manual which you can print or read on-line.
X
X-- the Emacs Calc home page
X
XWWW: http://www.synaptics.com/people/daveg
X
XAdd
X  (load "calc-autoload")
Xto your .emacs file to define autoloads.
X
XMaintainer: Andrew Bernard (andrewb@cs.cmu.edu)
X
END-of-emacs-calc/pkg-descr
echo x - emacs-calc/pkg-plist
sed 's/^X//' >emacs-calc/pkg-plist << 'END-of-emacs-calc/pkg-plist'
Xshare/emacs/site-lisp/calc/INSTALL
Xshare/emacs/site-lisp/calc/README
Xshare/emacs/site-lisp/calc/README.prev
Xshare/emacs/site-lisp/calc/calc.elc
Xshare/emacs/site-lisp/calc/calc-alg-2.elc
Xshare/emacs/site-lisp/calc/calc-autoload.elc
Xshare/emacs/site-lisp/calc/calc-ext.elc
Xshare/emacs/site-lisp/calc/calc-aent.elc
Xshare/emacs/site-lisp/calc/calc-embed.elc
Xshare/emacs/site-lisp/calc/calc-comb.elc
Xshare/emacs/site-lisp/calc/calc-alg-3.elc
Xshare/emacs/site-lisp/calc/calc-alg.elc
Xshare/emacs/site-lisp/calc/calc-arith.elc
Xshare/emacs/site-lisp/calc/calc-bin.elc
Xshare/emacs/site-lisp/calc/calc-comp.elc
Xshare/emacs/site-lisp/calc/calc-cplx.elc
Xshare/emacs/site-lisp/calc/calc-forms.elc
Xshare/emacs/site-lisp/calc/calc-fin.elc
Xshare/emacs/site-lisp/calc/calc-funcs.elc
Xshare/emacs/site-lisp/calc/calc-frac.elc
Xshare/emacs/site-lisp/calc/calc-graph.elc
Xshare/emacs/site-lisp/calc/calc-help.elc
Xshare/emacs/site-lisp/calc/calc-incom.elc
Xshare/emacs/site-lisp/calc/calc-keypd.elc
Xshare/emacs/site-lisp/calc/calc-lang.elc
Xshare/emacs/site-lisp/calc/calc-macs.elc
Xshare/emacs/site-lisp/calc/calc-maint.elc
Xshare/emacs/site-lisp/calc/calc-map.elc
Xshare/emacs/site-lisp/calc/calc-mat.elc
Xshare/emacs/site-lisp/calc/calc-math.elc
Xshare/emacs/site-lisp/calc/calc-misc.elc
Xshare/emacs/site-lisp/calc/calc-mode.elc
Xshare/emacs/site-lisp/calc/calc-poly.elc
Xshare/emacs/site-lisp/calc/calc-prog.elc
Xshare/emacs/site-lisp/calc/calc-rewr.elc
Xshare/emacs/site-lisp/calc/calc-rules.elc
Xshare/emacs/site-lisp/calc/calc-sel-2.elc
Xshare/emacs/site-lisp/calc/calc-sel.elc
Xshare/emacs/site-lisp/calc/calc-stat.elc
Xshare/emacs/site-lisp/calc/calc-store.elc
Xshare/emacs/site-lisp/calc/calc-stuff.elc
Xshare/emacs/site-lisp/calc/calc-trail.elc
Xshare/emacs/site-lisp/calc/calc-undo.elc
Xshare/emacs/site-lisp/calc/calc-units.elc
Xshare/emacs/site-lisp/calc/calc-vec.elc
Xshare/emacs/site-lisp/calc/calc-yank.elc
X@dirrm share/emacs/site-lisp/calc
END-of-emacs-calc/pkg-plist
echo c - emacs-calc/files
mkdir -p emacs-calc/files > /dev/null 2>&1
echo x - emacs-calc/files/patch-AA-emacs-21.3-PROBLEMS
sed 's/^X//' >emacs-calc/files/patch-AA-emacs-21.3-PROBLEMS << 'END-of-emacs-calc/files/patch-AA-emacs-21.3-PROBLEMS'
X# from /usr/local/share/emacs/21.3/etc/PROBLEMS
X--- calc-ext.el.~1~	Sun Apr  3 02:26:34 1994
X+++ calc-ext.el	Wed Sep 18 17:35:01 1996
X@@ -1354,6 +1354,25 @@
X   (calc-fancy-prefix 'calc-inverse-flag "Inverse..." n)
X )
X 
X+(defconst calc-fancy-prefix-map
X+  (let ((map (make-sparse-keymap)))
X+    (define-key map [t] 'calc-fancy-prefix-other-key)
X+    (define-key map (vector meta-prefix-char t) 'calc-fancy-prefix-other-key)
X+    (define-key map [switch-frame] nil)
X+    (define-key map [?\C-u] 'universal-argument)
X+    (define-key map [?0] 'digit-argument)
X+    (define-key map [?1] 'digit-argument)
X+    (define-key map [?2] 'digit-argument)
X+    (define-key map [?3] 'digit-argument)
X+    (define-key map [?4] 'digit-argument)
X+    (define-key map [?5] 'digit-argument)
X+    (define-key map [?6] 'digit-argument)
X+    (define-key map [?7] 'digit-argument)
X+    (define-key map [?8] 'digit-argument)
X+    (define-key map [?9] 'digit-argument)
X+    map)
X+  "Keymap used while processing calc-fancy-prefix.")
X+
X (defun calc-fancy-prefix (flag msg n)
X   (let (prefix)
X     (calc-wrapper
X@@ -1364,6 +1383,8 @@
X      (message (if prefix msg "")))
X     (and prefix
X 	 (not calc-is-keypad-press)
X+	 (if (boundp 'overriding-terminal-local-map)
X+	     (setq overriding-terminal-local-map calc-fancy-prefix-map)
X 	 (let ((event (calc-read-key t)))
X 	   (if (eq (setq last-command-char (car event)) ?\C-u)
X 	       (universal-argument)
X@@ -1376,9 +1397,18 @@
X 	     (if (or (not (integerp last-command-char))
X 		     (eq last-command-char ?-))
X 		 (calc-unread-command)
X-	       (digit-argument n))))))
X+	       (digit-argument n)))))))
X )
X (setq calc-is-keypad-press nil)
X+
X+(defun calc-fancy-prefix-other-key (arg)
X+  (interactive "P")
X+  (if (or (not (integerp last-command-char))
X+	  (and (>= last-command-char 0) (< last-command-char ? )
X+	       (not (eq last-command-char meta-prefix-char))))
X+      (calc-wrapper))  ; clear flags if not a Calc command.
X+  (calc-unread-command)
X+  (setq overriding-terminal-local-map nil))
X 
X (defun calc-invert-func ()
X   (save-excursion
X
XIndex: Makefile
X--- Makefile.~1~	Sun Dec 15 23:50:45 1996
X+++ Makefile	Thu Nov 30 15:09:45 2000
X@@ -41,7 +41,7 @@
X 
X # Other macros.
X EFLAGS   = -batch
X-MAINT	 = -l calc-maint.elc
X+MAINT	 = -l calc-maint.el
X 
X # Control whether intermediate files are kept.
X PURGE	 = -rm -f
X@@ -154,10 +154,7 @@
X 
X 
X # All this because "-l calc-maint" doesn't work.
X-maint: calc-maint.elc
X-calc-maint.elc: calc-maint.el
X-	cp calc-maint.el calc-maint.elc
X-
X+maint: calc-maint.el
X 
X # Create an Emacs TAGS file
X tags: TAGS
X
XIndex: calc-aent.el
X--- calc-aent.el.~1~	Sun Dec 15 23:50:36 1996
X+++ calc-aent.el	Tue Nov 21 18:34:33 2000
X@@ -385,7 +385,7 @@
X 	  (calc-minibuffer-contains
X 	   "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'"))
X       (insert "`")
X-    (setq alg-exp (buffer-string))
X+    (setq alg-exp (field-string))
X     (and (> (length alg-exp) 0) (setq calc-previous-alg-entry alg-exp))
X     (exit-minibuffer))
X )
X@@ -393,14 +393,14 @@
X 
X (defun calcAlg-enter ()
X   (interactive)
X-  (let* ((str (buffer-string))
X+  (let* ((str (field-string))
X 	 (exp (and (> (length str) 0)
X 		   (save-excursion
X 		     (set-buffer calc-buffer)
X 		     (math-read-exprs str)))))
X     (if (eq (car-safe exp) 'error)
X 	(progn
X-	  (goto-char (point-min))
X+	  (goto-char (field-beginning))
X 	  (forward-char (nth 1 exp))
X 	  (beep)
X 	  (calc-temp-minibuffer-message
X@@ -455,14 +455,14 @@
X   (interactive)
X   (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'")
X       (calcDigit-key)
X-    (setq calc-digit-value (buffer-string))
X+    (setq calc-digit-value (field-string))
X     (exit-minibuffer))
X )
X 
X (defun calcDigit-edit ()
X   (interactive)
X   (calc-unread-command)
X-  (setq calc-digit-value (buffer-string))
X+  (setq calc-digit-value (field-string))
X   (exit-minibuffer)
X )
X 
XIndex: calc.el
X--- calc.el.~1~	Sun Dec 15 23:50:47 1996
X+++ calc.el	Wed Nov 22 13:08:49 2000
X@@ -2051,11 +2051,11 @@
X   ;; Exercise for the reader:  Figure out why this is a good precaution!
X   (or (boundp 'calc-buffer)
X       (use-local-map minibuffer-local-map))
X-  (let ((str (buffer-string)))
X+  (let ((str (field-string)))
X     (setq calc-digit-value (save-excursion
X 			     (set-buffer calc-buffer)
X 			     (math-read-number str))))
X-  (if (and (null calc-digit-value) (> (buffer-size) 0))
X+  (if (and (null calc-digit-value) (> (field-end) (field-beginning)))
X       (progn
X 	(beep)
X 	(calc-temp-minibuffer-message " [Bad format]"))
X@@ -2071,7 +2071,7 @@
X 
X (defun calc-minibuffer-contains (rex)
X   (save-excursion
X-    (goto-char (point-min))
X+    (goto-char (field-end (point-min)))
X     (looking-at rex))
X )
X 
X@@ -2158,10 +2158,8 @@
X 					  (upcase last-command-char))))
X 				(and dig
X 				     (< dig radix)))))))
X-	      (save-excursion
X-		(goto-char (point-min))
X-         	(looking-at
X-		 "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9]+\\.?0*[@oh] *\\)?\\([0-9]+\\.?0*['m] *\\)?[0-9]*\\(\\.?[0-9]*\\(e[-+]?[0-3]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\\)?\\|[0-9]:\\([0-9]+:\\)?[0-9]*\\)?[\"s]?\\'")))
X+	      (calc-minibuffer-contains
X+		 "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9]+\\.?0*[@oh] *\\)?\\([0-9]+\\.?0*['m] *\\)?[0-9]*\\(\\.?[0-9]*\\(e[-+]?[0-3]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\\)?\\|[0-9]:\\([0-9]+:\\)?[0-9]*\\)?[\"s]?\\'"))
X 	  (if (and (memq last-command-char '(?@ ?o ?h ?\' ?m))
X 		   (string-match " " calc-hms-format))
X 	      (insert " "))
X@@ -2190,7 +2188,7 @@
X 	((eq last-command 'calcDigit-start)
X 	 (erase-buffer))
X 	(t (backward-delete-char 1)))
X-  (if (= (buffer-size) 0)
X+  (if (= (field-beginning) (field-end))
X       (progn
X 	(setq last-command-char 13)
X 	(calcDigit-nondigit)))
X
X* TeX'ing the Calc manual fails.
X
XThe following patches allow to build the Calc manual using texinfo.tex
Xfrom Emacs 19.34 distribution:
X
X*** calc-maint.e~0	Mon Dec 16 07:11:26 1996
X--- calc-maint.el	Sun Dec 10 14:32:38 2000
X***************
X*** 308,314 ****
X      (insert "@tex\n"
X  	    "\\global\\advance\\appendixno2\n"
X  	    "\\gdef\\xref#1.{See ``#1.''}\n")
X!     (setq midpos (point))
X      (insert "@end tex\n")
X      (insert-buffer-substring srcbuf sumpos endpos)
X      (insert "@bye\n")
X--- 308,314 ----
X      (insert "@tex\n"
X  	    "\\global\\advance\\appendixno2\n"
X  	    "\\gdef\\xref#1.{See ``#1.''}\n")
X!     (setq midpos (point-marker))
X      (insert "@end tex\n")
X      (insert-buffer-substring srcbuf sumpos endpos)
X      (insert "@bye\n")
X*** Makefile.~0	Mon Dec 16 07:11:24 1996
X--- Makefile	Sun Dec 10 14:44:00 2000
X***************
X*** 98,106 ****
X  # Format the Calc manual as one printable volume using TeX.
X  tex:
X  	$(REMOVE) calc.aux
X! 	$(TEX) calc.texinfo
X  	$(TEXINDEX) calc.[cfkptv]?
X! 	$(TEX) calc.texinfo
X  	$(PURGE) calc.cp calc.fn calc.pg calc.tp calc.vr
X  	$(PURGE) calc.cps calc.fns calc.kys calc.pgs calc.tps calc.vrs
X  	$(PURGE) calc.toc
X--- 98,106 ----
X  # Format the Calc manual as one printable volume using TeX.
X  tex:
X  	$(REMOVE) calc.aux
X! 	-$(TEX) calc.texinfo
X  	$(TEXINDEX) calc.[cfkptv]?
X! 	-$(TEX) calc.texinfo
X  	$(PURGE) calc.cp calc.fn calc.pg calc.tp calc.vr
X  	$(PURGE) calc.cps calc.fns calc.kys calc.pgs calc.tps calc.vrs
X  	$(PURGE) calc.toc
X*** calc.texinfo.~1~	Thu Oct 10 18:18:56 1996
X--- calc.texinfo	Mon Dec 11 08:25:00 2000
X***************
X*** 12,17 ****
X--- 12,19 ----
X  % Because makeinfo.c exists, we can't just define new commands.
X  % So instead, we take over little-used existing commands.
X  %
X+ % Suggested by Karl Berry <karl@@freefriends.org>
X+ \gdef\!{\mskip-\thinmuskip}
X  % Redefine @cite{text} to act like $text$ in regular TeX.
X  % Info will typeset this same as @samp{text}.
X  \gdef\goodtex{\tex \let\rm\goodrm \let\t\ttfont \turnoffactive}
X***************
X*** 23686,23692 ****
X  a vector of the actual parameter values, written as equations:
X  @cite{[a = 3, b = 2]}, in case you'd rather read them in a list
X  than pick them out of the formula.  (You can type @kbd{t y}
X! to move this vector to the stack; @pxref{Trail Commands}.)
X  
X  Specifying a different independent variable name will affect the
X  resulting formula: @kbd{a F 1 k RET} produces @kbd{3 + 2 k}.
X--- 23689,23695 ----
X  a vector of the actual parameter values, written as equations:
X  @cite{[a = 3, b = 2]}, in case you'd rather read them in a list
X  than pick them out of the formula.  (You can type @kbd{t y}
X! to move this vector to the stack; see @ref{Trail Commands}.)
X  
X  Specifying a different independent variable name will affect the
X  resulting formula: @kbd{a F 1 k RET} produces @kbd{3 + 2 k}.
END-of-emacs-calc/files/patch-AA-emacs-21.3-PROBLEMS
echo x - emacs-calc/files/patch-Makefile
sed 's/^X//' >emacs-calc/files/patch-Makefile << 'END-of-emacs-calc/files/patch-Makefile'
X--- Makefile.orig	Sun Jul 10 10:59:15 2005
X+++ Makefile	Sun Jul 10 11:24:42 2005
X@@ -52,13 +52,13 @@
X # Do full Calc installation.  (Note that `make' == `make all'.)
X # These are written this way instead of `all: compile private info'
X # to make the steps more explicit while the `make' is in progress.
X-all:
X+all.orig:
X 	$(MAKE) compile
X 	$(MAKE) private
X 	$(MAKE) info
X 	$(ECHO) "Calc is now installed."
X 
X-install:
X+install.orig:
X 	$(MAKE) compile
X 	$(MAKE) public
X 	$(MAKE) info
X@@ -180,4 +180,36 @@
X 	$(REMOVE) calctut.*
X 	$(REMOVE) calcsum.*
X 
X+# FreeBSD installation
X+
X+prefix        = /usr/local
X+infodir       = ${prefix}/info
X+sharedir      = ${prefix}/share
X+emacssharedir = ${sharedir}/emacs
X+emacssitedir  = ${emacssharedir}/site-lisp
X+calcsitedir   = ${emacssitedir}/calc
X+
X+elcfiles  != find . -name '*.elc' -type f
X+infofiles != find . -name 'calc.info*' -type f
X+sitefiles  = INSTALL README README.prev ${elcfiles}
X+
X+installfiles := ${infofiles:%=$(infodir)/%} ${sitefiles:%=$(calcsitedir)/%}
X+
X+all:
X+	$(MAKE) compile
X+	$(MAKE) info
X+
X+install: ${installfiles}
X+	install-info ${infodir}/calc.info ${infodir}/dir
X+
X+.for file in ${infofiles}
X+${infodir}/${file}: ${file}
X+	install -o root -g wheel -m 0444 $? $@
X+.endfor
X+
X+.for file in ${sitefiles}
X+${calcsitedir}/${file}: ${file}
X+	@install -d -o root -g wheel -m 0755 ${@D}
X+	install -o root -g wheel -m 0444 $? $@
X+.endfor
X 
END-of-emacs-calc/files/patch-Makefile
echo x - emacs-calc/files/patch-calc-autoload.el
sed 's/^X//' >emacs-calc/files/patch-calc-autoload.el << 'END-of-emacs-calc/files/patch-calc-autoload.el'
X--- calc-autoload.el.orig	Wed Dec 31 19:00:00 1969
X+++ calc-autoload.el	Sun Jul 10 12:05:24 2005
X@@ -0,0 +1,16 @@
X+
X+(global-set-key '[?\M-# ?c] 'calc)
X+
X+(autoload 'defmath		  "calc" nil                          t t)
X+(autoload 'calc-eval		  "calc" "Use Calculator from Lisp"   )
X+(autoload 'calc-dispatch	  "calc" "Calculator Options"         t)
X+(autoload 'full-calc		  "calc" "Full-screen Calculator"     t)
X+(autoload 'full-calc-keypad	  "calc" "Full-screen X Calculator"   t)
X+(autoload 'calc			  "calc" "Calculator Mode"            t)
X+(autoload 'quick-calc		  "calc" "Quick Calculator"           t)
X+(autoload 'calc-keypad		  "calc" "X windows Calculator"       t)
X+(autoload 'calc-embedded	  "calc" "Use Calc inside any buffer" t)
X+(autoload 'calc-embedded-activate "calc" "Activate =>'s in buffer"    t)
X+(autoload 'calc-grab-region	  "calc" "Grab region of Calc data"   t)
X+(autoload 'calc-grab-rectangle	  "calc" "Grab rectangle of data"     t)
X+
END-of-emacs-calc/files/patch-calc-autoload.el
echo x - emacs-calc/files/patch-calc.texinfo
sed 's/^X//' >emacs-calc/files/patch-calc.texinfo << 'END-of-emacs-calc/files/patch-calc.texinfo'
X--- calc.texinfo.orig	Sun Jul 10 11:30:45 2005
X+++ calc.texinfo	Sun Jul 10 11:33:21 2005
X@@ -172,6 +172,11 @@
X \catcode`\@=0 @catcode`@\=@active
X @end iftex
X 
X+@dircategory The Emacs editor and associated tools
X+@direntry
X+* Calc: (calc).		The Emacs calculator
X+@end direntry
X+
X @ifinfo
X This file documents Calc, the GNU Emacs calculator.
X 
END-of-emacs-calc/files/patch-calc.texinfo
echo x - emacs-calc/distinfo
sed 's/^X//' >emacs-calc/distinfo << 'END-of-emacs-calc/distinfo'
XMD5 (calc-2.02f.tar.gz) = fbeb5535bdc35a8dbca3a8482ea2984a
XSIZE (calc-2.02f.tar.gz) = 831865
END-of-emacs-calc/distinfo
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050711002553.05EB643D45>