pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

guile-fibers: Apply upstream change to enable operation on NetBSD



Module Name:	pkgsrc-wip
Committed By:	Greg Troxel <gdt%lexort.com@localhost>
Pushed By:	gdt
Date:		Fri Dec 23 13:56:20 2022 -0500
Changeset:	dd8fe1757ea20d262509289546b6ecfc2424e713

Modified Files:
	guile-fibers/Makefile
	guile-fibers/distinfo
Added Files:
	guile-fibers/patches/patch-Makefile.am
	guile-fibers/patches/patch-Makefile.in
	guile-fibers/patches/patch-fibers_affinity-darwin.scm
	guile-fibers/patches/patch-fibers_affinity.scm

Log Message:
guile-fibers: Apply upstream change to enable operation on NetBSD

(A new upstream release is likely before this graduates to pkgsrc.)

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=dd8fe1757ea20d262509289546b6ecfc2424e713

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 guile-fibers/Makefile                              |  1 +
 guile-fibers/distinfo                              |  4 +++
 guile-fibers/patches/patch-Makefile.am             | 38 ++++++++++++++++++++
 guile-fibers/patches/patch-Makefile.in             | 15 ++++++++
 .../patches/patch-fibers_affinity-darwin.scm       | 42 ++++++++++++++++++++++
 guile-fibers/patches/patch-fibers_affinity.scm     | 36 +++++++++++++++++++
 6 files changed, 136 insertions(+)

diffs:
diff --git a/guile-fibers/Makefile b/guile-fibers/Makefile
index 2b85b4d9c0..141ab87c5e 100644
--- a/guile-fibers/Makefile
+++ b/guile-fibers/Makefile
@@ -6,6 +6,7 @@ DISTNAME=	fibers-${VERSION}
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_GITHUB:=wingo/}
 GITHUB_RELEASE=	v${VERSION}
+PKGREVISION=	1
 
 MAINTAINER=	gdt%NetBSD.org@localhost
 HOMEPAGE=	https://github.com/wingo/fibers/
diff --git a/guile-fibers/distinfo b/guile-fibers/distinfo
index 6e1d240e77..cc7c025754 100644
--- a/guile-fibers/distinfo
+++ b/guile-fibers/distinfo
@@ -3,3 +3,7 @@ $NetBSD$
 BLAKE2s (fibers-1.2.0.tar.gz) = db16dec4d275d3ee43d4244a026860d39b313fec1960ffab74e0cf1a9a121d9c
 SHA512 (fibers-1.2.0.tar.gz) = b45f124a85fe1e5a94e46cfbbce3693ca86534861035c33b28aeb6aa09e96b5ae14e51a21bd74737d5657c33bf484c5be7c332392d1f251de12352c2a644b854
 Size (fibers-1.2.0.tar.gz) = 577727 bytes
+SHA1 (patch-Makefile.am) = f39c111c9e4f4fc4eca26ac8ada049806ecc6680
+SHA1 (patch-Makefile.in) = 3b42d05a5b52c0b9d440e97db6f35ecf53e7c16d
+SHA1 (patch-fibers_affinity-darwin.scm) = 418f7d807badfc55ef52a4b83c586316f5501c2b
+SHA1 (patch-fibers_affinity.scm) = f909af3b42bae286bfed10fbe610b77c3483e1e7
diff --git a/guile-fibers/patches/patch-Makefile.am b/guile-fibers/patches/patch-Makefile.am
new file mode 100644
index 0000000000..38108e6cc4
--- /dev/null
+++ b/guile-fibers/patches/patch-Makefile.am
@@ -0,0 +1,38 @@
+$NetBSD$
+
+--- Makefile.am.orig	2022-12-22 19:47:03.000000000 +0000
++++ Makefile.am
+@@ -49,7 +49,6 @@ SOURCES = \
+ 	web/server/fibers.scm
+ 
+ BUILT_SOURCES = \
+-	fibers/affinity.scm \
+ 	fibers/config.scm \
+ 	fibers/events-impl.scm \
+ 	fibers/posix-clocks.scm
+@@ -94,16 +93,11 @@ fibers/config.scm: Makefile fibers/confi
+ 	sed -e "s|@extlibdir\@|$(extlibdir)|" \
+ 	    $(srcdir)/fibers/config.scm.in > fibers/config.scm
+ 
+-fibers/affinity.scm: Makefile fibers/affinity-$(PLATFORM).scm
+-	mkdir -p $(abs_top_builddir)/fibers
+-	cp -f $(abs_top_srcdir)/fibers/affinity-$(PLATFORM).scm $(abs_top_builddir)/fibers/affinity.scm
+-
+ fibers/posix-clocks.scm: Makefile fibers/posix-clocks-$(PLATFORM).scm
+ 	mkdir -p $(abs_top_builddir)/fibers
+ 	cp -f $(abs_top_srcdir)/fibers/posix-clocks-$(PLATFORM).scm $(abs_top_builddir)/fibers/posix-clocks.scm
+ 
+ CLEANFILES += \
+-	fibers/affinity.scm \
+ 	fibers/config.scm \
+ 	fibers/events-impl.scm \
+ 	fibers/posix-clocks.scm
+@@ -139,8 +133,6 @@ EXTRA_DIST += \
+ 	fibers/config.scm.in \
+ 	fibers/epoll.scm \
+ 	fibers/libevent.scm \
+-	fibers/affinity-darwin.scm \
+-	fibers/affinity-generic.scm \
+ 	fibers/posix-clocks-darwin.scm \
+ 	fibers/posix-clocks-generic.scm \
+ 	examples
diff --git a/guile-fibers/patches/patch-Makefile.in b/guile-fibers/patches/patch-Makefile.in
new file mode 100644
index 0000000000..16cd690935
--- /dev/null
+++ b/guile-fibers/patches/patch-Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- Makefile.in.orig	2022-12-22 20:10:38.000000000 +0000
++++ Makefile.in
+@@ -1555,10 +1555,6 @@ fibers/config.scm: Makefile fibers/confi
+ 	sed -e "s|@extlibdir\@|$(extlibdir)|" \
+ 	    $(srcdir)/fibers/config.scm.in > fibers/config.scm
+ 
+-fibers/affinity.scm: Makefile fibers/affinity-$(PLATFORM).scm
+-	mkdir -p $(abs_top_builddir)/fibers
+-	cp -f $(abs_top_srcdir)/fibers/affinity-$(PLATFORM).scm $(abs_top_builddir)/fibers/affinity.scm
+-
+ fibers/posix-clocks.scm: Makefile fibers/posix-clocks-$(PLATFORM).scm
+ 	mkdir -p $(abs_top_builddir)/fibers
+ 	cp -f $(abs_top_srcdir)/fibers/posix-clocks-$(PLATFORM).scm $(abs_top_builddir)/fibers/posix-clocks.scm
diff --git a/guile-fibers/patches/patch-fibers_affinity-darwin.scm b/guile-fibers/patches/patch-fibers_affinity-darwin.scm
new file mode 100644
index 0000000000..dc299560c7
--- /dev/null
+++ b/guile-fibers/patches/patch-fibers_affinity-darwin.scm
@@ -0,0 +1,42 @@
+$NetBSD$
+
+--- fibers/affinity-darwin.scm.orig	2022-12-22 19:47:03.000000000 +0000
++++ fibers/affinity-darwin.scm
+@@ -1,37 +0,0 @@
+-;; CPU affinity (Darwin)
+-
+-;;;; Copyright (C) 2022 Aleix Conchillo Flaqué <aconchillo%gmail.com@localhost>
+-;;;;
+-;;;; This library is free software; you can redistribute it and/or
+-;;;; modify it under the terms of the GNU Lesser General Public
+-;;;; License as published by the Free Software Foundation; either
+-;;;; version 3 of the License, or (at your option) any later version.
+-;;;;
+-;;;; This library is distributed in the hope that it will be useful,
+-;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+-;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-;;;; Lesser General Public License for more details.
+-;;;;
+-;;;; You should have received a copy of the GNU Lesser General Public License
+-;;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-
+-;;; Guile defines setaffinity and getaffinity in some systems (e.g. Linux). For
+-;;; those systems where those procedures are not available there should be a
+-;;; Fibers' specific implementation available through the fibers-affinity
+-;;; library.
+-
+-(define-module (fibers affinity)
+-  #:use-module (ice-9 threads)
+-  #:export (getaffinity* setaffinity*))
+-
+-;;
+-;; It seems it is not possible to link a thread to a specific core on
+-;; macOS. See, for example: https://developer.apple.com/forums/thread/44002.
+-;;
+-;; So for now getaffinity/setaffinity are no-ops.
+-;;
+-
+-(define (getaffinity* pid)
+-  (make-bitvector (current-processor-count) 1))
+-
+-(define (setaffinity* pid affinity) *unspecified*)
diff --git a/guile-fibers/patches/patch-fibers_affinity.scm b/guile-fibers/patches/patch-fibers_affinity.scm
new file mode 100644
index 0000000000..a9dce754d3
--- /dev/null
+++ b/guile-fibers/patches/patch-fibers_affinity.scm
@@ -0,0 +1,36 @@
+$NetBSD$
+
+--- fibers/affinity.scm.orig	2022-12-22 20:10:48.000000000 +0000
++++ fibers/affinity.scm
+@@ -21,10 +21,27 @@
+ ;;; library.
+ 
+ (define-module (fibers affinity)
+-  #:use-module (system foreign)
+-  #:use-module (fibers config)
++  #:use-module (ice-9 threads)
+   #:export (getaffinity* setaffinity*))
+ 
++;;
++;; Some platforms don't implement (getaffinity) or (setaffinity).
++;;
++;; For example, it seems it is not possible to link a thread to a specific core
++;; on macOS. See: https://developer.apple.com/forums/thread/44002.
++;;
++;; So for now getaffinity/setaffinity are no-ops on those paltforms.
++;;
++
+ ;; getaffinity/setaffinity should be defined in Guile
+-(define getaffinity* (if (defined? 'getaffinity) getaffinity))
+-(define setaffinity* (if (defined? 'setaffinity) setaffinity))
++(define getaffinity*
++  (cond
++   ((defined? 'getaffinity) getaffinity)
++   (else
++    (lambda (pid)
++      (make-bitvector (current-processor-count) 1)))))
++
++(define setaffinity*
++  (cond
++   ((defined? 'setaffinity) setaffinity)
++   (else (lambda (pid affinity) *unspecified*))))


Home | Main Index | Thread Index | Old Index