summaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/gcalctool/Makefile7
-rw-r--r--math/gcalctool/distinfo4
-rw-r--r--math/gcalctool/files/patch-gcalctool_ce_parser.h16
-rw-r--r--math/gcalctool/files/patch-gcalctool_ce_parser.y86
-rw-r--r--math/gcalctool/files/patch-gcalctool_functions.c60
-rw-r--r--math/gcalctool/files/patch-gcalctool_gtk.c32
-rw-r--r--math/gcalctool/files/patch-gcalctool_lr_parser.y74
-rw-r--r--math/gcalctool/files/patch-gcalctool_mpmath.c24
8 files changed, 298 insertions, 5 deletions
diff --git a/math/gcalctool/Makefile b/math/gcalctool/Makefile
index e2342d369..48112a92b 100644
--- a/math/gcalctool/Makefile
+++ b/math/gcalctool/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= gcalctool
-PORTVERSION= 4.4.8
+PORTVERSION= 5.5.0
PORTEPOCH= 1
CATEGORIES= math gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
@@ -17,11 +17,12 @@ MAINTAINER= gnome@FreeBSD.org
COMMENT= A GNOME 2 calculator tool based on the old calctool for OpenWindows
USE_BZIP2= yes
+USE_BISON= yes
USE_X_PREFIX= yes
USE_GMAKE= yes
-USE_LIBTOOL_VER=13
+USE_LIBTOOL_VER=15
USE_REINPLACE= yes
-USE_GNOME= gnomeprefix gnomehack lthack intlhack libgnomeui
+USE_GNOME= gnomeprefix gnomehack intlhack libgnomeui
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
diff --git a/math/gcalctool/distinfo b/math/gcalctool/distinfo
index b69094217..b8ba0bea4 100644
--- a/math/gcalctool/distinfo
+++ b/math/gcalctool/distinfo
@@ -1,2 +1,2 @@
-MD5 (gnome2/gcalctool-4.4.8.tar.bz2) = c1adea7f8d1348a33c0734a0dfd8c643
-SIZE (gnome2/gcalctool-4.4.8.tar.bz2) = 882531
+MD5 (gnome2/gcalctool-5.5.0.tar.bz2) = b0391a744e09918e2953580963e0124c
+SIZE (gnome2/gcalctool-5.5.0.tar.bz2) = 944570
diff --git a/math/gcalctool/files/patch-gcalctool_ce_parser.h b/math/gcalctool/files/patch-gcalctool_ce_parser.h
new file mode 100644
index 000000000..660d59f3b
--- /dev/null
+++ b/math/gcalctool/files/patch-gcalctool_ce_parser.h
@@ -0,0 +1,16 @@
+--- gcalctool/ce_parser.h.orig Mon Jul 26 22:11:59 2004
++++ gcalctool/ce_parser.h Mon Jul 26 22:12:20 2004
+@@ -48,11 +48,12 @@
+ static inline char *
+ ce_strndup(char *str, int len)
+ {
++ char *dup;
+ if (len < 1) {
+ return(NULL);
+ }
+
+- char *dup = malloc(len+1);
++ dup = malloc(len+1);
+ memset(dup, 0, len+1);
+ strncpy(dup, str, len);
+
diff --git a/math/gcalctool/files/patch-gcalctool_ce_parser.y b/math/gcalctool/files/patch-gcalctool_ce_parser.y
new file mode 100644
index 000000000..9988661bf
--- /dev/null
+++ b/math/gcalctool/files/patch-gcalctool_ce_parser.y
@@ -0,0 +1,86 @@
+--- gcalctool/ce_parser.y.orig Mon Jul 26 22:19:27 2004
++++ gcalctool/ce_parser.y Mon Jul 26 22:25:49 2004
+@@ -111,10 +111,12 @@
+ parser_state.error = EINVAL;
+ YYABORT;
+ }
++;
+
+ seq:
+ udf
+ | seq udf
++;
+
+ udf:
+ value '=' {
+@@ -135,10 +137,12 @@
+ initialise();
+ show_display(v->MPdisp_val);
+ }
++;
+
+ value:
+ lexp {cp($1, $$);}
+ | exp {cp($1, $$);}
++;
+
+ lexp:
+ tINUMBER {cp($1, $$);}
+@@ -147,6 +151,7 @@
+ | lexp tXNOR lexp {calc_xnor($$, $1, $3);}
+ | lexp tXOR lexp {calc_xor($$, $1, $3);}
+ | '~' lexp {calc_not($2, $$);}
++;
+
+ exp:
+ term {cp($1, $$);}
+@@ -155,6 +160,7 @@
+
+ | exp '+' exp {mpadd($1, $3, $$);}
+ | exp '-' exp {mpsub($1, $3, $$);}
++;
+
+ term:
+ number {cp($1, $$);}
+@@ -171,15 +177,18 @@
+
+ | parenthesis {cp($1, $$);}
+ | constant {cp($1, $$);}
++;
+
+ parenthesis:
+ '(' exp ')' {cp($2, $$);}
++ ;
+
+ reg:
+- tREG {do_rcl_reg($1, $$)};
++ tREG {do_rcl_reg($1, $$);};
+
+ constant:
+ 'e' {do_e($$);}
++ ;
+
+ func:
+ tLOG10 term %prec HIGH {mplog10($2, $$);}
+@@ -216,6 +225,7 @@
+ | tSLN %prec HIGH {calc_sln($$);}
+ | tSYD %prec HIGH {calc_syd($$);}
+ | tTERM %prec HIGH {calc_term($$);}
++;
+
+ rcl:
+ tRCL '(' tINUMBER ')' {
+@@ -223,11 +233,13 @@
+ mpcmi($3, &val);
+ do_rcl_reg(val, $$);
+ }
++ ;
+
+ number:
+ tINUMBER {cp($1, $$);}
+ | tDNUMBER {cp($1, $$);}
+ | tANS {cp(v->e.ans, $$);}
++;
+
+ %%
+
diff --git a/math/gcalctool/files/patch-gcalctool_functions.c b/math/gcalctool/files/patch-gcalctool_functions.c
new file mode 100644
index 000000000..7c715f063
--- /dev/null
+++ b/math/gcalctool/files/patch-gcalctool_functions.c
@@ -0,0 +1,60 @@
+--- gcalctool/functions.c.orig Mon Jul 26 22:13:14 2004
++++ gcalctool/functions.c Mon Jul 26 22:15:30 2004
+@@ -99,7 +99,6 @@
+
+ char*
+ ch_trig(char *func) {
+- assert(func);
+
+ struct ch {
+ char *orig;
+@@ -130,6 +129,8 @@
+
+ struct ch *ch = NULL;
+
++ assert(func);
++
+ switch (table) {
+ case 0:
+ break;
+@@ -396,6 +397,7 @@
+ int j = i+3;
+ char *prefix = malloc(i+1);
+ char *postfix = malloc(len-j+1);
++ char *print;
+
+ assert(prefix && postfix);
+ memset(prefix, 0, i+1);
+@@ -405,7 +407,7 @@
+
+ ans = make_number(v->e.ans, v->base, TRUE, FALSE);
+ assert(ans);
+- char *print = malloc(strlen(ans)+i+len-j+1);
++ print = malloc(strlen(ans)+i+len-j+1);
+ sprintf(print, "%s%s%s", prefix, ans, postfix);
+ free(prefix);
+ free(postfix);
+@@ -671,7 +673,6 @@
+ int
+ do_tfunc(int s[MP_SIZE], int t[MP_SIZE], enum trig_func tfunc)
+ {
+- if (!v->current) return -EINVAL;
+
+ enum mode {
+ normal = 0,
+@@ -680,8 +681,13 @@
+ invhyp = 3,
+ } mode;
+
+- int inverse = (v->inverse) ? inv : 0;
+- int hyperbolic = (v->hyperbolic) ? hyp : 0;
++ int inverse;
++ int hyperbolic;
++
++ if (!v->current) return -EINVAL;
++
++ inverse = (v->inverse) ? inv : 0;
++ hyperbolic = (v->hyperbolic) ? hyp : 0;
+
+ mode = (inverse | hyperbolic);
+
diff --git a/math/gcalctool/files/patch-gcalctool_gtk.c b/math/gcalctool/files/patch-gcalctool_gtk.c
new file mode 100644
index 000000000..e7d2e301e
--- /dev/null
+++ b/math/gcalctool/files/patch-gcalctool_gtk.c
@@ -0,0 +1,32 @@
+--- gcalctool/gtk.c.orig Mon Jul 26 22:17:31 2004
++++ gcalctool/gtk.c Mon Jul 26 22:18:21 2004
+@@ -441,10 +441,10 @@
+ void
+ update_statusbar(gchar *text, const gchar *imagename)
+ {
+- assert(text);
+- assert(imagename);
+
+ GtkImage *image = GTK_IMAGE(X->status_image);
++ assert(text);
++ assert(imagename);
+ assert(image);
+ gtk_image_set_from_stock(image, imagename, GTK_ICON_SIZE_BUTTON);
+ gtk_statusbar_pop(GTK_STATUSBAR(X->statusbar), 0);
+@@ -1045,6 +1045,7 @@
+ GError *error;
+ GtkWidget *event_box, *view_widget;
+ GtkTextBuffer *buffer;
++ GtkWidget *scrolledwindow;
+
+ v->tool_label = NULL;
+ if (v->titleline == NULL) {
+@@ -1099,7 +1100,7 @@
+ gtk_box_pack_start(GTK_BOX(X->kvbox), X->menubar, FALSE, FALSE, 0);
+
+
+- GtkWidget *scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
++ scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
+ gtk_widget_show(scrolledwindow);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolledwindow),
+ GTK_POLICY_ALWAYS,
diff --git a/math/gcalctool/files/patch-gcalctool_lr_parser.y b/math/gcalctool/files/patch-gcalctool_lr_parser.y
new file mode 100644
index 000000000..1e78125d7
--- /dev/null
+++ b/math/gcalctool/files/patch-gcalctool_lr_parser.y
@@ -0,0 +1,74 @@
+--- gcalctool/lr_parser.y.orig Mon Jul 26 22:23:06 2004
++++ gcalctool/lr_parser.y Mon Jul 26 22:26:34 2004
+@@ -107,10 +107,12 @@
+ parser_state.error = EINVAL;
+ YYABORT;
+ }
++;
+
+ seq:
+ udf
+ | seq udf
++;
+
+ udf:
+ value '=' {
+@@ -131,9 +133,11 @@
+ initialise();
+ show_display(v->MPdisp_val);
+ }
++;
+
+ value:
+ exp {cp($1, $$);}
++ ;
+
+ exp:
+ term {cp($1, $$);}
+@@ -164,10 +168,11 @@
+ | exp '~' {calc_not($1, $$);}
+ | exp ']' {calc_u16($1, $$);}
+ | exp '[' {calc_u32($1, $$);}
+-| exp '}' {calc_tenpowx($1, $$)}
+-| exp '{' {mpexp($1, $$)}
++| exp '}' {calc_tenpowx($1, $$);}
++| exp '{' {mpexp($1, $$);}
+
+ | func {cp($1, $$);}
++;
+
+ func:
+ tLOG10 parenthesis {mplog10($2, $$);}
+@@ -188,9 +193,11 @@
+ | term tCOS {calc_trigfunc(cos_t, $1, $$);}
+ | tTAN parenthesis {calc_trigfunc(tan_t, $2, $$);}
+ | term tTAN {calc_trigfunc(tan_t, $1, $$);}
++;
+
+ parenthesis:
+ '(' exp ')' {cp($2, $$);}
++ ;
+
+ term:
+ number {cp($1, $$);}
+@@ -198,6 +205,7 @@
+ | parenthesis {cp($1, $$);}
+ | '-' term %prec POS {mpneg($2, $$);}
+ | '+' term %prec POS {cp($2, $$);}
++;
+
+ rcl:
+ tRCL '(' tINUMBER ')' {
+@@ -205,10 +213,12 @@
+ mpcmi($3, &val);
+ do_rcl_reg(val, $$);
+ }
++ ;
+
+ number:
+ tINUMBER {cp($1, $$);}
+ | tDNUMBER {cp($1, $$);}
++;
+
+ %%
+
diff --git a/math/gcalctool/files/patch-gcalctool_mpmath.c b/math/gcalctool/files/patch-gcalctool_mpmath.c
new file mode 100644
index 000000000..dd2920e2c
--- /dev/null
+++ b/math/gcalctool/files/patch-gcalctool_mpmath.c
@@ -0,0 +1,24 @@
+--- gcalctool/mpmath.c.orig Mon Jul 26 22:16:10 2004
++++ gcalctool/mpmath.c Mon Jul 26 22:16:46 2004
+@@ -750,17 +750,18 @@
+ * boolean means BINARY representation
+ */
+
+- assert(times >= 0);
+-
+ double dval;
++ BOOLEAN temp;
+ mpcmd(s, &dval);
+- BOOLEAN temp = ibool(dval);
++ temp = ibool(dval);
+
+ /* There is a reason to do shift like this. Reason is that
+ * processors define shift only in a certain range. i386 uses only 5
+ * bits to describe shiftable amount. So, shift 32 times gives original
+ * number. That can cause very strange results (and bugs).
+ */
++
++ assert(times >= 0);
+
+ while (times--) {
+ temp = (dir == right) ? temp >> 1 : temp << 1;