lol

guile_2_0: add patches for macos 10.12

+36 -1
+8 -1
pkgs/development/interpreters/guile/2.0.nix
··· 46 46 }) 47 47 ./riscv.patch 48 48 ] ++ 49 - (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch); 49 + (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch) 50 + ++ stdenv.lib.optionals stdenv.isDarwin [ 51 + (fetchpatch { 52 + url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; 53 + sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; 54 + }) 55 + ./filter-mkostemp-darwin.patch 56 + ]; 50 57 51 58 # Explicitly link against libgcc_s, to work around the infamous 52 59 # "libgcc_s.so.1 must be installed for pthread_cancel to work".
+28
pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch
··· 1 + Filter incompat. mkostemp(3) flags on macOS 10.12 2 + 3 + macOS Sierra introduces a mkostemp(3) function which is used when 4 + present. Contrary to the GNUlib version of mkostemp(3) that was used 5 + previously, this version fails with 'invalid argument' when flags other 6 + than from a specified set are passed. From mktemp(3): 7 + 8 + | The mkostemp() function is like mkstemp() but allows specifying 9 + | additional open(2) flags (defined in <fcntl.h>). The permitted flags 10 + | are O_APPEND, O_SHLOCK, O_EXLOCK and O_CLOEXEC. 11 + 12 + Signed-off-by: Clemens Lang <cal@macports.org> 13 + Upstream-Status: Submitted [https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23] 14 + --- a/libguile/filesys.c.orig 2017-01-09 00:53:27.000000000 +0100 15 + +++ b/libguile/filesys.c 2017-01-09 00:54:48.000000000 +0100 16 + @@ -1486,6 +1486,12 @@ 17 + mode_bits = scm_i_mode_bits (mode); 18 + } 19 + 20 + +#ifdef __APPLE__ 21 + + /* macOS starting with 10.12 defines mkostemp(2) which is used if defined, 22 + + * but only accepts some flags according to its manpage. It fails with 23 + + * invalid argument when other flags are passed. */ 24 + + open_flags &= O_APPEND | O_SHLOCK | O_EXLOCK | O_CLOEXEC; 25 + +#endif 26 + SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags)); 27 + if (rv == -1) 28 + SCM_SYSERROR;