summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorayekat2018-12-08 00:19:54 +0100
committerayekat2018-12-08 00:19:54 +0100
commit4c7bfe92b88cf9b45f8246c6a04584196924ec8c (patch)
tree3ca0ab9f82fe494886077035d6293d9a12caefb1
parentaa750c4f20af4011060436f07bbfda53a1ab7644 (diff)
downloadaur-4c7bfe92b88cf9b45f8246c6a04584196924ec8c.tar.gz
Initial overhaul after adopting
Upstream: * Use native libev rather than the one bundled with upstream (no libfiber-specific changes have been applied there anyway). * Use the `dist` scheduler rather than `wsd` (work-stealing): the latter schedules fibers in a rather bizarre way (keeps jumping back and forth between the last to fibers created, and never schedules any of the others). This may require further investigation. Downstream: * Fix license information: it's ISC. * Install headers and pkgconf files as well. * Add gitignore file to ignore build artifacts (except package files).
-rw-r--r--.SRCINFO26
-rw-r--r--.gitignore3
-rw-r--r--0002-dist-libev.diff20
-rw-r--r--0003-no-work-stealing.diff11
-rw-r--r--PKGBUILD56
-rw-r--r--libfiber.pc10
6 files changed, 105 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 192203b1164..6e8c9239cf1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,26 @@
pkgbase = libfiber-git
pkgdesc = A User Space Threading Library Supporting Multi-Core Systems
- pkgver = r212.198c70e
- pkgrel = 1
+ pkgver = r215.111db17
+ pkgrel = 3
url = https://github.com/brianwatling/libfiber
- arch = i686
arch = x86_64
- license = Not
- license = specified
- makedepends = git
+ license = custom:ISC
+ checkdepends = time
makedepends = cmake
- source = git://github.com/brianwatling/libfiber
- sha1sums = SKIP
+ makedepends = git
+ makedepends = libev
+ depends = gcc-libs
+ depends = glibc
+ provides = libfiber
+ conflicts = libfiber
+ source = git+https://github.com/brianwatling/libfiber
+ source = 0002-dist-libev.diff
+ source = 0003-no-work-stealing.diff
+ source = libfiber.pc
+ sha256sums = SKIP
+ sha256sums = e36b02fc439e1185a734db2a312a4650e803acb3eeef1105e40ffdc65726ae5d
+ sha256sums = 88ac1ea4517e6d73a571d243ffd51711a2e4ba2c45b92136968489f9c1979b62
+ sha256sums = eb8f429c6705a23aec697990271e724541815d8b43aafcb36d21fd7186dacacd
pkgname = libfiber-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..ef16b9fdb28
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/libfiber/
+/src/
+/pkg/
diff --git a/0002-dist-libev.diff b/0002-dist-libev.diff
new file mode 100644
index 00000000000..1c966772ede
--- /dev/null
+++ b/0002-dist-libev.diff
@@ -0,0 +1,20 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+
+ all: libfiber.so bin/echo_server runtests
+
+-VPATH += example src test submodules/libev
++VPATH += example src test
+
+ CFILES = \
+ fiber_context.c \
+@@ -49,7 +49,7 @@ ifeq ($(ARCH),x86)
+ CFLAGS += -m32 -march=i686 -DARCH_x86
+ endif
+
+-CFLAGS += -pthread -Wall -Iinclude -Isubmodules/libev -D_REENTRANT -ggdb -O3
++CFLAGS += -pthread -Wall -Iinclude -D_REENTRANT -ggdb -O3
+
+ #don't use split-stack on gcc 4.6 since it doesn't implement getcontext, setcontext, or makecontext
+ GCC46 = $(shell $(CC) -v 2>&1 | grep "gcc.*4.6" > /dev/null; echo $$?)
diff --git a/0003-no-work-stealing.diff b/0003-no-work-stealing.diff
new file mode 100644
index 00000000000..a184b2dd267
--- /dev/null
+++ b/0003-no-work-stealing.diff
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -17,7 +17,7 @@ CFILES = \
+ hazard_pointer.c \
+ work_stealing_deque.c \
+ work_queue.c \
+- fiber_scheduler_wsd.c \
++ fiber_scheduler_dist.c \
+
+ USE_NATIVE_EVENTS ?= 1
+ ifeq ($(USE_NATIVE_EVENTS),1)
diff --git a/PKGBUILD b/PKGBUILD
index 03c278b4cc2..522aa0189d5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,25 +1,44 @@
-# Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
+# Maintainer: Tinu Weber <http://ayekat.ch>
+# Contributor: Anatol Pomozov <anatol.pomozov@gmail.com>
pkgname=libfiber-git
-pkgver=r212.198c70e
-pkgrel=1
+pkgver=r215.111db17
+pkgrel=3
+arch=(x86_64)
+
pkgdesc='A User Space Threading Library Supporting Multi-Core Systems'
-arch=(i686 x86_64)
url='https://github.com/brianwatling/libfiber'
-license=(Not specified)
-makedepends=(git cmake)
-source=(git://github.com/brianwatling/libfiber)
-sha1sums=('SKIP')
+license=(custom:ISC)
+
+depends=(gcc-libs glibc)
+makedepends=(cmake git libev)
+checkdepends=(time)
+
+provides=(libfiber)
+conflicts=(libfiber)
+
+source=('git+https://github.com/brianwatling/libfiber'
+ '0002-dist-libev.diff'
+ '0003-no-work-stealing.diff'
+ 'libfiber.pc')
+sha256sums=(SKIP
+ e36b02fc439e1185a734db2a312a4650e803acb3eeef1105e40ffdc65726ae5d
+ 88ac1ea4517e6d73a571d243ffd51711a2e4ba2c45b92136968489f9c1979b62
+ eb8f429c6705a23aec697990271e724541815d8b43aafcb36d21fd7186dacacd)
pkgver() {
cd libfiber
- # repo does not have any git tags yet
- echo r$(git rev-list --count master).$(git rev-parse --short master)
+ printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd libfiber
- sed -e 's/ time / /g' -i Makefile
+
+ # use downstream (distribution) libev
+ patch -p1 -i "$srcdir"/0002-dist-libev.diff
+
+ # don't use work stealing
+ patch -p1 -i "$srcdir"/0003-no-work-stealing.diff
}
build() {
@@ -34,6 +53,17 @@ check() {
package() {
cd libfiber
- mkdir -p "$pkgdir/usr/lib"
- install libfiber.so "$pkgdir/usr/lib"
+
+ # library
+ install -Dm0755 libfiber.so "$pkgdir"/usr/lib/libfiber.so
+
+ # headers
+ install -dm0755 "$pkgdir"/usr/include
+ install -m0644 include/*.h "$pkgdir"/usr/include/
+
+ # pkg-config
+ install -Dm0644 "$srcdir"/libfiber.pc "$pkgdir"/usr/lib/pkgconfig/libfiber.pc
+
+ # misc
+ install -Dm0644 LICENSE.txt "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE.txt
}
diff --git a/libfiber.pc b/libfiber.pc
new file mode 100644
index 00000000000..a43e896e238
--- /dev/null
+++ b/libfiber.pc
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libfiber
+Description: A User Space Threading Library Supporting Multi-Core Systems
+Version: 0
+Cflags: -I${includedir} -DARCH_x86_64 -m64
+Libs: -L${libdir} -lfiber