dev-scheme/guile: fix compilation on Darwin, thanks * in bug #612338
authorFabian Groffen <grobian@gentoo.org>
Wed, 21 Jun 2017 12:33:25 +0000 (14:33 +0200)
committerFabian Groffen <grobian@gentoo.org>
Wed, 21 Jun 2017 12:33:36 +0000 (14:33 +0200)
Package-Manager: Portage-2.3.6, Repoman-2.3.1

dev-scheme/guile/files/guile-2.0.14-darwin.patch [new file with mode: 0644]
dev-scheme/guile/guile-2.0.14.ebuild

diff --git a/dev-scheme/guile/files/guile-2.0.14-darwin.patch b/dev-scheme/guile/files/guile-2.0.14-darwin.patch
new file mode 100644 (file)
index 0000000..17741ae
--- /dev/null
@@ -0,0 +1,38 @@
+fix compilation on Darwin
+
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23
+https://bugs.gentoo.org/show_bug.cgi?id=612338
+
+--- guile-2.0.14/libguile/filesys.c
++++ guile-2.0.14/libguile/filesys.c
+@@ -1486,6 +1486,9 @@
+       mode_bits = scm_i_mode_bits (mode);
+     }
+ 
++#ifdef __APPLE__
++  open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC;
++#endif
+   SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
+   if (rv == -1)
+     SCM_SYSERROR;
+--- guile-2.0.14/libguile/stime.c
++++ guile-2.0.14/libguile/stime.c
+@@ -830,6 +830,10 @@
+ 
+ #ifdef HAVE_POSIX_CPUTIME
+   {
++#ifdef __APPLE__
++    if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)
++      get_internal_run_time = get_internal_run_time_posix_timer;
++#else
+     clockid_t dummy;
+     
+     /* Only use the _POSIX_CPUTIME clock if it's going to work across
+@@ -839,6 +843,7 @@
+       get_internal_run_time = get_internal_run_time_posix_timer;
+     else
+       errno = 0;
++#endif
+   }
+ #endif /* HAVE_POSIX_CPUTIME */
+ #endif /* HAVE_CLOCKTIME */
index 78edbb0f216a59b2cad4bc841a6f2322359fa875..6be23f4049ec97e84ad53c0243d64fa6a1726dc1 100644 (file)
@@ -32,7 +32,10 @@ MAJOR="2.0"
 
 DOCS=( GUILE-VERSION HACKING README )
 
-PATCHES=( "${FILESDIR}/${PN}-2-snarf.patch" )
+PATCHES=(
+       "${FILESDIR}/${PN}-2-snarf.patch"
+       "${FILESDIR}/${P}-darwin.patch"
+)
 
 src_prepare() {
        default