git: d53f8e237782 - main - math/giacxcas: Update 1.6.0-7 -> 1.9.0-21

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Fri, 23 Sep 2022 06:51:13 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d53f8e2377829d0cc9fa237e942481a763289e11

commit d53f8e2377829d0cc9fa237e942481a763289e11
Author:     Thierry Thomas <thierry@freebsd.org>
AuthorDate: 2022-09-23 06:47:30 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-09-23 06:51:10 +0000

    math/giacxcas: Update 1.6.0-7 -> 1.9.0-21
    
    The newly introduced bundled dependency micropython-1.12 causes
    SEGV and it was disabled.
---
 math/giacxcas/Makefile                             | 18 +++++++++++----
 math/giacxcas/distinfo                             |  6 ++---
 .../files/patch-micropython-1.12_py_dynruntime.mk  | 20 ++++++++++++++++
 .../files/patch-micropython-1.12_py_mkenv.mk       | 27 ++++++++++++++++++++++
 .../files/patch-micropython-1.12_xcas_Makefile     | 15 ++++++++++++
 math/giacxcas/files/patch-src_Editeur.cc           | 11 +++++++++
 math/giacxcas/files/patch-src_Makefile.in          | 11 +++++++++
 math/giacxcas/files/patch-src_icas.cc              | 12 ++++++++++
 math/giacxcas/files/patch-src_qjsgiac.c            | 11 +++++++++
 math/giacxcas/files/patch-src_quickjs-libc.c       | 24 +++++++++++++++++++
 math/giacxcas/files/patch-src_quickjs.c            | 11 +++++++++
 math/giacxcas/pkg-plist                            | 16 +++++++++++++
 12 files changed, 175 insertions(+), 7 deletions(-)

diff --git a/math/giacxcas/Makefile b/math/giacxcas/Makefile
index e801cd49834f..c38026301124 100644
--- a/math/giacxcas/Makefile
+++ b/math/giacxcas/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	giacxcas
-DISTVERSION=	1.6.0-7
-PORTREVISION=	4
+DISTVERSION=	1.9.0-21
 CATEGORIES=	math
 MASTER_SITES=	http://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/:giac \
 		http://cocoa.dima.unige.it/cocoalib/tgz/:cocoa \
@@ -34,12 +33,14 @@ LIB_DEPENDS=	libao.so:audio/libao \
 		libmpfi.so:math/mpfi \
 		libpari.so:math/pari \
 		libpng.so:graphics/png \
+		libnauty.so:math/nauty \
+		libcliquer.so:math/cliquer \
 		libsamplerate.so:audio/libsamplerate
 RUN_DEPENDS=	xdg-open:devel/xdg-utils
 
 USES=		blaslapack compiler:c++14-lang desktop-file-utils fortran \
 		gettext gl gmake gnome jpeg libtool localbase ncurses perl5 \
-		readline shebangfix xorg
+		python readline shebangfix xorg
 GNU_CONFIGURE=	yes
 USE_GL=		gl
 USE_XORG=	x11 xcursor xext xft xi xinerama
@@ -54,7 +55,8 @@ CONFIGURE_ENV=	ac_cv_lib_X11_main=yes \
 		ac_cv_lib_fltk_main=yes \
 		ac_cv_lib_fltk_images_main=yes \
 		ac_cv_lib_jpeg_main=yes
-SHEBANG_FILES=	src/pgiac
+SHEBANG_FILES=	src/pgiac micropython-1.12/docs/conf.py
+
 INSTALL_TARGET=	install-strip
 
 COCOA_LIB_VERSION=	0.99700
@@ -81,6 +83,7 @@ OPTIONS_DEFINE=	DOCS EXAMPLES
 #NB: built of giacxcas with USE_GCC and nlt is successfull if the ntl port is also
 #    installed  with USE_GCC
 CONFIGURE_ARGS+=	--disable-ntl
+CONFIGURE_ARGS+=	--disable-micropy # it causes SEGV in xcas in the nlr_push call from execute_from_lexer@main.c
 
 PORTDOCS=	*
 PORTEXAMPLES=	*
@@ -122,6 +125,13 @@ pre-configure:
 .endfor
 	${FIND} ${WRKSRC}/doc -type f | ${XARGS} ${GREP} -l 'share/giac/doc' | \
 		${XARGS} ${REINPLACE_CMD} -e 's|/usr/local/share/giac/doc|${DOCSDIR}|'
+	${FIND} ${WRKSRC}/micropython-1.12 -type f | ${XARGS}	\
+		${GREP} -l "/usr/bin/env python3" | ${XARGS}	\
+		${REINPLACE_CMD} -e 's|/usr/bin/env python3|${PYTHON_CMD}|'
+	${FIND} ${WRKSRC}/micropython-1.12 -type f | ${XARGS}	\
+		${GREP} -l "python3 \|'python3'\|= python3\|^python3" | ${XARGS}	\
+		${REINPLACE_CMD} -e "s|python3 |${PYTHON_CMD} |;s|'python3'|'${PYTHON_CMD}'|"	\
+			-e "s|= python3|= ${PYTHON_CMD}|;s|^python3|${PYTHON_CMD}|"
 	@(cd ${COCOALIB-GIAC} && ${SETENV} ${CONFIGURE_ENV} ./configure \
 		--with-cxx="${CXX}")
 	@(cd ${FLTKDEV-GIAC} && ${SETENV} ${CONFIGURE_ENV} ./configure \
diff --git a/math/giacxcas/distinfo b/math/giacxcas/distinfo
index 807597ca8920..f9aa7979bfef 100644
--- a/math/giacxcas/distinfo
+++ b/math/giacxcas/distinfo
@@ -1,6 +1,6 @@
-TIMESTAMP = 1594838401
-SHA256 (giacxcas/giac_1.6.0-7.tar.gz) = 77d8df21e814c28c11bca41f15ceb9eed0ea7a0f4406dbe0ca80b27f46b86fdf
-SIZE (giacxcas/giac_1.6.0-7.tar.gz) = 77157868
+TIMESTAMP = 1663844960
+SHA256 (giacxcas/giac_1.9.0-21.tar.gz) = 120cd16f2e033817302d2a03a22bd413dc1d85df8b225ba4f76b93a7805b07fe
+SIZE (giacxcas/giac_1.9.0-21.tar.gz) = 103871108
 SHA256 (giacxcas/CoCoALib-0.99700.tgz) = e9de0f4859946c8882414fc9f3756d5995961b0fcf6b477ac8e27636b41ca002
 SIZE (giacxcas/CoCoALib-0.99700.tgz) = 5431651
 SHA256 (giacxcas/fltk-giac.tar.gz) = 538243c536a62e562bc26dec1c54454f54ce614cc540371f5ccfe71d8ed27cf7
diff --git a/math/giacxcas/files/patch-micropython-1.12_py_dynruntime.mk b/math/giacxcas/files/patch-micropython-1.12_py_dynruntime.mk
new file mode 100644
index 000000000000..66f09b1c0b30
--- /dev/null
+++ b/math/giacxcas/files/patch-micropython-1.12_py_dynruntime.mk
@@ -0,0 +1,20 @@
+--- micropython-1.12/py/dynruntime.mk.orig	2020-04-13 05:21:17 UTC
++++ micropython-1.12/py/dynruntime.mk
+@@ -24,8 +24,6 @@ CFLAGS += -std=c99
+ 
+ CFLAGS += -I. -I$(MPY_DIR)
+ CFLAGS += -std=c99
+-CFLAGS += -Os
+-CFLAGS += -Wall -Werror -DNDEBUG
+ CFLAGS += -DNO_QSTR
+ CFLAGS += -DMP_CONFIGFILE='<$(CONFIG_H)>'
+ CFLAGS += -fpic -fno-common
+@@ -126,7 +124,7 @@ $(BUILD)/%.o: %.c $(CONFIG_H) Makefile
+ # Build .o from .c source files
+ $(BUILD)/%.o: %.c $(CONFIG_H) Makefile
+ 	$(ECHO) "CC $<"
+-	$(Q)$(CROSS)gcc $(CFLAGS) -o $@ -c $<
++	$(Q)$(CC) $(CFLAGS) -o $@ -c $<
+ 
+ # Build .mpy from .py source files
+ $(BUILD)/%.mpy: %.py
diff --git a/math/giacxcas/files/patch-micropython-1.12_py_mkenv.mk b/math/giacxcas/files/patch-micropython-1.12_py_mkenv.mk
new file mode 100644
index 000000000000..f2598ec00531
--- /dev/null
+++ b/math/giacxcas/files/patch-micropython-1.12_py_mkenv.mk
@@ -0,0 +1,27 @@
+--- micropython-1.12/py/mkenv.mk.orig	2020-04-13 05:21:17 UTC
++++ micropython-1.12/py/mkenv.mk
+@@ -46,15 +46,15 @@ PYTHON = python3
+ TOUCH = touch
+ PYTHON = python3
+ 
+-AS = $(CROSS_COMPILE)as
+-CC = $(CROSS_COMPILE)gcc
+-CXX = $(CROSS_COMPILE)g++
+-GDB = $(CROSS_COMPILE)gdb
+-LD = $(CROSS_COMPILE)ld
+-OBJCOPY = $(CROSS_COMPILE)objcopy
+-SIZE = $(CROSS_COMPILE)size
+-STRIP = $(CROSS_COMPILE)strip
+-AR = $(CROSS_COMPILE)ar
++#AS = $(CROSS_COMPILE)as
++#CC = $(CROSS_COMPILE)gcc
++#CXX = $(CROSS_COMPILE)g++
++#GDB = $(CROSS_COMPILE)gdb
++#LD = $(CROSS_COMPILE)ld
++#OBJCOPY = $(CROSS_COMPILE)objcopy
++#SIZE = $(CROSS_COMPILE)size
++#STRIP = $(CROSS_COMPILE)strip
++#AR = $(CROSS_COMPILE)ar
+ ifeq ($(MICROPY_FORCE_32BIT),1)
+ CC += -m32
+ CXX += -m32
diff --git a/math/giacxcas/files/patch-micropython-1.12_xcas_Makefile b/math/giacxcas/files/patch-micropython-1.12_xcas_Makefile
new file mode 100644
index 000000000000..016f0ef3a2b8
--- /dev/null
+++ b/math/giacxcas/files/patch-micropython-1.12_xcas_Makefile
@@ -0,0 +1,15 @@
+--- micropython-1.12/xcas/Makefile.orig	2022-04-11 07:52:40 UTC
++++ micropython-1.12/xcas/Makefile
+@@ -3,9 +3,9 @@ -include mpconfigport.mk
+ -include mpconfigport.mk
+ 
+ #PREFIX=/usr/bin/
+-CC = $(PREFIX)gcc # gcc-4.7 works if gcc is gcc-4.4 
+-CXX = $(PREFIX)g++
+-LD = $(PREFIX)ld 
++#CC = $(PREFIX)gcc # gcc-4.7 works if gcc is gcc-4.4 
++#CXX = $(PREFIX)g++
++#LD = $(PREFIX)ld 
+ 
+ # define main target
+ PROG = libmicropython.a
diff --git a/math/giacxcas/files/patch-src_Editeur.cc b/math/giacxcas/files/patch-src_Editeur.cc
new file mode 100644
index 000000000000..767730070f9d
--- /dev/null
+++ b/math/giacxcas/files/patch-src_Editeur.cc
@@ -0,0 +1,11 @@
+--- src/Editeur.cc.orig	2022-03-09 17:34:39 UTC
++++ src/Editeur.cc
+@@ -2924,7 +2924,7 @@ namespace xcas {
+     Fl_Text_Buffer * b = new Fl_Text_Buffer;
+     editor=new Xcas_Text_Editor(x,y+L,w,h-L,b,l);
+     editor->Fl_Text_Display::textsize(labelsize());
+-    editor->Fl_Text_Display::linenumber_width(3*labelsize());
++    // editor->Fl_Text_Display::linenumber_width(3*labelsize());
+     editor->labelsize(labelsize());
+     log = 0;
+     if (logo){
diff --git a/math/giacxcas/files/patch-src_Makefile.in b/math/giacxcas/files/patch-src_Makefile.in
new file mode 100644
index 000000000000..426f193d3f31
--- /dev/null
+++ b/math/giacxcas/files/patch-src_Makefile.in
@@ -0,0 +1,11 @@
+--- src/Makefile.in.orig	2022-04-11 07:52:40 UTC
++++ src/Makefile.in
+@@ -283,7 +283,7 @@ LIBOBJS = @LIBOBJS@
+ LIBICONV = @LIBICONV@
+ LIBINTL = @LIBINTL@
+ LIBOBJS = @LIBOBJS@
+-LIBS = @LIBS@
++LIBS = @LIBS@ @LIBINTL@
+ LIBTERMCAP = @LIBTERMCAP@
+ LIBTOOL = @LIBTOOL@
+ LIPO = @LIPO@
diff --git a/math/giacxcas/files/patch-src_icas.cc b/math/giacxcas/files/patch-src_icas.cc
new file mode 100644
index 000000000000..8a6b89ec23b9
--- /dev/null
+++ b/math/giacxcas/files/patch-src_icas.cc
@@ -0,0 +1,12 @@
+--- src/icas.cc.orig	2022-04-11 07:52:40 UTC
++++ src/icas.cc
+@@ -47,6 +47,9 @@ using namespace std;
+ //#include <unistd.h> // For reading arguments from file
+ #include <fcntl.h>
+ #include <cstdlib>
++#if defined(__FreeBSD__)
++#include <sys/wait.h>
++#endif
+ #include "gen.h"
+ #include "index.h"
+ #include "sym2poly.h"
diff --git a/math/giacxcas/files/patch-src_qjsgiac.c b/math/giacxcas/files/patch-src_qjsgiac.c
new file mode 100644
index 000000000000..12b21992bc60
--- /dev/null
+++ b/math/giacxcas/files/patch-src_qjsgiac.c
@@ -0,0 +1,11 @@
+--- src/qjsgiac.c.orig	2021-03-20 11:09:33 UTC
++++ src/qjsgiac.c
+@@ -41,6 +41,8 @@
+ #include <malloc/malloc.h>
+ #elif defined(__linux__)
+ #include <malloc.h>
++#elif defined(__FreeBSD__)
++#include <malloc_np.h>
+ #endif
+ 
+ #ifdef NSPIRE_NEWLIB
diff --git a/math/giacxcas/files/patch-src_quickjs-libc.c b/math/giacxcas/files/patch-src_quickjs-libc.c
new file mode 100644
index 000000000000..34ba89847a41
--- /dev/null
+++ b/math/giacxcas/files/patch-src_quickjs-libc.c
@@ -0,0 +1,24 @@
+--- src/quickjs-libc.c.orig	2021-03-20 11:09:33 UTC
++++ src/quickjs-libc.c
+@@ -58,8 +58,11 @@ char ** environ=&ptr;
+ char ** environ=&ptr;
+ #endif
+ 
+-#if defined(__APPLE__)
++#if defined(__APPLE__) || defined(__FreeBSD__)
++extern char **environ;
+ typedef sig_t sighandler_t;
++#endif
++#if defined(__APPLE__)
+ #if !defined(environ)
+ #include <crt_externs.h>
+ #define environ (*_NSGetEnviron())
+@@ -3613,6 +3616,8 @@ void js_std_set_worker_new_context_func(JSContext *(*f
+ #define OS_PLATFORM "darwin"
+ #elif defined(EMSCRIPTEN)
+ #define OS_PLATFORM "js"
++#elif defined(__FreeBSD__)
++#define OS_PLATFORM "freebsd"
+ #else
+ #define OS_PLATFORM "linux"
+ #endif
diff --git a/math/giacxcas/files/patch-src_quickjs.c b/math/giacxcas/files/patch-src_quickjs.c
new file mode 100644
index 000000000000..c330699c7c28
--- /dev/null
+++ b/math/giacxcas/files/patch-src_quickjs.c
@@ -0,0 +1,11 @@
+--- src/quickjs.c.orig	2021-03-23 12:33:15 UTC
++++ src/quickjs.c
+@@ -41,6 +41,8 @@
+ #include <malloc/malloc.h>
+ #elif defined(__linux__)
+ #include <malloc.h>
++#elif defined(__FreeBSD__)
++#include <malloc_np.h>
+ #endif
+ 
+ #ifdef EMCC
diff --git a/math/giacxcas/pkg-plist b/math/giacxcas/pkg-plist
index b734ed2d5c3e..31ee349bc0e6 100644
--- a/math/giacxcas/pkg-plist
+++ b/math/giacxcas/pkg-plist
@@ -9,13 +9,16 @@ bin/pgiac
 bin/xcas
 bin/xcasnew
 include/giac/alg_ext.h
+include/giac/bf2gmp.h
 include/giac/cocoa.h
 include/giac/config.h
 include/giac/csturm.h
+include/giac/cutils.h
 include/giac/derive.h
 include/giac/desolve.h
 include/giac/dispatch.h
 include/giac/ezgcd.h
+include/giac/fenv.h
 include/giac/first.h
 include/giac/fraction.h
 include/giac/gauss.h
@@ -37,11 +40,18 @@ include/giac/input_parser.h
 include/giac/intg.h
 include/giac/intgab.h
 include/giac/isom.h
+include/giac/js.h
 include/giac/k_csdk.h
 include/giac/k_defs.h
 include/giac/kdisplay.h
 include/giac/lexer_tab_int.h
+include/giac/libbf.h
+include/giac/libregexp-opcode.h
+include/giac/libregexp.h
+include/giac/libunicode-table.h
+include/giac/libunicode.h
 include/giac/lin.h
+include/giac/list.h
 include/giac/lpsolve.h
 include/giac/maple.h
 include/giac/markup.h
@@ -60,7 +70,12 @@ include/giac/plot.h
 include/giac/plot3d.h
 include/giac/poly.h
 include/giac/prog.h
+include/giac/qjsgiac.h
 include/giac/quater.h
+include/giac/quickjs-atom.h
+include/giac/quickjs-libc.h
+include/giac/quickjs-opcode.h
+include/giac/quickjs.h
 include/giac/risch.h
 include/giac/rpn.h
 include/giac/series.h
@@ -109,4 +124,5 @@ share/locale/fr/LC_MESSAGES/giac.mo
 share/locale/it/LC_MESSAGES/giac.mo
 share/locale/pt/LC_MESSAGES/giac.mo
 share/locale/zh/LC_MESSAGES/giac.mo
+share/metainfo/xcas.metainfo.xml
 share/pixmaps/xcas.xpm