summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorJakub Kądziołka <kuba@kadziolka.net>2020-06-17 02:08:04 +0200
committerJakub Kądziołka <kuba@kadziolka.net>2020-07-10 23:03:41 +0200
commit5b9822cf43f0e568fc42a0a60a7ed4d77e5e9832 (patch)
tree71e82f22ca8fd7c51c9ac1f95c6d999ae36515f9 /gnu/packages/patches
parent71153712a2499d0425a709e9bc57dd3f917567ea (diff)
gnu: Add ECL 16.1.3 for Sage.
* gnu/packages/sagemath.scm (ecl-16): New variable. * gnu/packages/patches/ecl-16-format-directive-limit.patch, gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch, gnu/packages/patches/ecl-16-libffi.patch: New files. * gnu/local.mk (dist_patch_DATA): Register the patches.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/ecl-16-format-directive-limit.patch83
-rw-r--r--gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch17
-rw-r--r--gnu/packages/patches/ecl-16-libffi.patch16
3 files changed, 116 insertions, 0 deletions
diff --git a/gnu/packages/patches/ecl-16-format-directive-limit.patch b/gnu/packages/patches/ecl-16-format-directive-limit.patch
new file mode 100644
index 0000000000..237db92722
--- /dev/null
+++ b/gnu/packages/patches/ecl-16-format-directive-limit.patch
@@ -0,0 +1,83 @@
+Patch backported by Sage.
+
+Fix from upstream that happens to work around
+https://trac.sagemath.org/ticket/23011
+diff --git a/src/lsp/format.lsp b/src/lsp/format.lsp
+index 77ca799..53b887c 100644
+--- a/src/lsp/format.lsp
++++ b/src/lsp/format.lsp
+@@ -307,11 +307,13 @@
+ :start (format-directive-start struct)
+ :end (format-directive-end struct))))
+
++(defconstant +format-directive-limit+ (1+ (char-code #\~)))
++
+ #+formatter
+ (defparameter *format-directive-expanders*
+- (make-array char-code-limit :initial-element nil))
++ (make-array +format-directive-limit+ :initial-element nil))
+ (defparameter *format-directive-interpreters*
+- (make-array char-code-limit :initial-element nil))
++ (make-array +format-directive-limit+ :initial-element nil))
+
+ (defparameter *default-format-error-control-string* nil)
+ (defparameter *default-format-error-offset* nil)
+@@ -550,24 +552,24 @@
+ (write-string directive stream)
+ (interpret-directive-list stream (cdr directives) orig-args args))
+ (#-ecl format-directive #+ecl vector
++ (multiple-value-bind
++ (new-directives new-args)
++ (let* ((code (char-code (format-directive-character directive)))
++ (function
++ (and (< code +format-directive-limit+)
++ (svref *format-directive-interpreters* code)))
++ (*default-format-error-offset*
++ (1- (format-directive-end directive))))
++ (unless function
++ (error 'format-error
++ :complaint "Unknown format directive."))
+ (multiple-value-bind
+ (new-directives new-args)
+- (let ((function
+- (svref *format-directive-interpreters*
+- (char-code (format-directive-character
+- directive))))
+- (*default-format-error-offset*
+- (1- (format-directive-end directive))))
+- (unless function
+- (error 'format-error
+- :complaint "Unknown format directive."))
+- (multiple-value-bind
+- (new-directives new-args)
+- (funcall function stream directive
+- (cdr directives) orig-args args)
+- (values new-directives new-args)))
+- (interpret-directive-list stream new-directives
+- orig-args new-args)))))
++ (funcall function stream directive
++ (cdr directives) orig-args args)
++ (values new-directives new-args)))
++ (interpret-directive-list stream new-directives
++ orig-args new-args)))))
+ args))
+
+
+@@ -639,11 +641,12 @@
+ (values `(write-string ,directive stream)
+ more-directives))
+ (format-directive
+- (let ((expander
+- (aref *format-directive-expanders*
+- (char-code (format-directive-character directive))))
+- (*default-format-error-offset*
+- (1- (format-directive-end directive))))
++ (let* ((code (char-code (format-directive-character directive)))
++ (expander
++ (and (< code +format-directive-limit+)
++ (svref *format-directive-expanders* code)))
++ (*default-format-error-offset*
++ (1- (format-directive-end directive))))
+ (if expander
+ (funcall expander directive more-directives)
+ (error 'format-error
diff --git a/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch b/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch
new file mode 100644
index 0000000000..42d213c0e9
--- /dev/null
+++ b/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch
@@ -0,0 +1,17 @@
+Patch adapted from Sage.
+diff -Naur ecl-16.1.2.orig/src/c/file.d ecl-16.1.2/src/c/file.d
+--- ecl-16.1.2.orig/src/c/file.d 2016-05-11 13:10:51.867673867 +1200
++++ ecl-16.1.2/src/c/file.d 2016-05-11 14:44:48.121907307 +1200
+@@ -3354,8 +3354,10 @@
+ ecl_disable_interrupts();
+ do {
+ out = fwrite(c, sizeof(char), n, IO_STREAM_FILE(strm));
+- } while (out < n && restartable_io_error(strm, "fwrite"));
+- ecl_enable_interrupts();
++ /* Ignore write errors to stderr to avoid an infinite loop */
++ } while (out < n && (IO_STREAM_FILE(strm) != stderr) && restartable_io_error(strm, "fwrite"));
++
++ ecl_enable_interrupts();
+ return out;
+ }
+
diff --git a/gnu/packages/patches/ecl-16-libffi.patch b/gnu/packages/patches/ecl-16-libffi.patch
new file mode 100644
index 0000000000..fc06a07606
--- /dev/null
+++ b/gnu/packages/patches/ecl-16-libffi.patch
@@ -0,0 +1,16 @@
+Patch adapted from Sage. Allows building ECL on libffi 3.3.
+diff --git a/src/c/ffi.d b/src/c/ffi.d
+index 8861303e..8a959c23 100644
+--- a/src/c/ffi.d
++++ b/src/c/ffi.d
+@@ -133,8 +133,8 @@ static struct {
+ #elif defined(X86_WIN64)
+ {@':win64', FFI_WIN64},
+ #elif defined(X86_ANY) || defined(X86) || defined(X86_64)
+- {@':cdecl', FFI_SYSV},
+- {@':sysv', FFI_SYSV},
++ {@':cdecl', FFI_UNIX64},
++ {@':sysv', FFI_UNIX64},
+ {@':unix64', FFI_UNIX64},
+ #endif
+ };