about summary refs log tree commit diff
path: root/pkgs/development/interpreters/guile
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-03-10 18:04:37 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-04-26 21:54:54 -0400
commit85cc94c40e3dee7cb17c452fa4e04d09fc20983a (patch)
tree8998fce1838fc8d9770e41a7e4a5486aa97f62ab /pkgs/development/interpreters/guile
parent0e9da4c958378811f1ea4df4903f4315c83dbf53 (diff)
downloadnixlib-85cc94c40e3dee7cb17c452fa4e04d09fc20983a.tar
nixlib-85cc94c40e3dee7cb17c452fa4e04d09fc20983a.tar.gz
nixlib-85cc94c40e3dee7cb17c452fa4e04d09fc20983a.tar.bz2
nixlib-85cc94c40e3dee7cb17c452fa4e04d09fc20983a.tar.lz
nixlib-85cc94c40e3dee7cb17c452fa4e04d09fc20983a.tar.xz
nixlib-85cc94c40e3dee7cb17c452fa4e04d09fc20983a.tar.zst
nixlib-85cc94c40e3dee7cb17c452fa4e04d09fc20983a.zip
guile_2_0: add patches for macos 10.12
Diffstat (limited to 'pkgs/development/interpreters/guile')
-rw-r--r--pkgs/development/interpreters/guile/2.0.nix9
-rw-r--r--pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch28
2 files changed, 36 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix
index 17ca1d1dcd95..24266d596765 100644
--- a/pkgs/development/interpreters/guile/2.0.nix
+++ b/pkgs/development/interpreters/guile/2.0.nix
@@ -46,7 +46,14 @@
     })
     ./riscv.patch
   ] ++
-    (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch);
+    (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch)
+    ++ stdenv.lib.optionals stdenv.isDarwin [
+      (fetchpatch {
+        url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch";
+        sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207";
+      })
+      ./filter-mkostemp-darwin.patch
+    ];
 
   # Explicitly link against libgcc_s, to work around the infamous
   # "libgcc_s.so.1 must be installed for pthread_cancel to work".
diff --git a/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch b/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch
new file mode 100644
index 000000000000..8b9b853fb00d
--- /dev/null
+++ b/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch
@@ -0,0 +1,28 @@
+Filter incompat. mkostemp(3) flags on macOS 10.12
+
+macOS Sierra introduces a mkostemp(3) function which is used when
+present. Contrary to the GNUlib version of mkostemp(3) that was used
+previously, this version fails with 'invalid argument' when flags other
+than from a specified set are passed. From mktemp(3):
+
+| The mkostemp() function is like mkstemp() but allows specifying
+| additional open(2) flags (defined in <fcntl.h>). The permitted flags
+| are O_APPEND, O_SHLOCK, O_EXLOCK and O_CLOEXEC.
+
+Signed-off-by: Clemens Lang <cal@macports.org>
+Upstream-Status: Submitted [https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23]
+--- a/libguile/filesys.c.orig	2017-01-09 00:53:27.000000000 +0100
++++ b/libguile/filesys.c	2017-01-09 00:54:48.000000000 +0100
+@@ -1486,6 +1486,12 @@
+       mode_bits = scm_i_mode_bits (mode);
+     }
+ 
++#ifdef __APPLE__
++  /* macOS starting with 10.12 defines mkostemp(2) which is used if defined,
++   * but only accepts some flags according to its manpage. It fails with
++   * invalid argument when other flags are passed. */
++  open_flags &= O_APPEND | O_SHLOCK | O_EXLOCK | O_CLOEXEC;
++#endif
+   SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
+   if (rv == -1)
+     SCM_SYSERROR;