diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/dconf/0001-Avoid-posix_fallocate-so-it-works-on-uClibc.patch | 36 | ||||
-rw-r--r-- | testing/dconf/APKBUILD | 41 |
2 files changed, 77 insertions, 0 deletions
diff --git a/testing/dconf/0001-Avoid-posix_fallocate-so-it-works-on-uClibc.patch b/testing/dconf/0001-Avoid-posix_fallocate-so-it-works-on-uClibc.patch new file mode 100644 index 000000000..5317b39c9 --- /dev/null +++ b/testing/dconf/0001-Avoid-posix_fallocate-so-it-works-on-uClibc.patch @@ -0,0 +1,36 @@ +From e6d875ff19ba7f23e68a2131d9abe2de3f39d001 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Sat, 9 Oct 2010 20:34:08 +0000 +Subject: [PATCH] Avoid posix_fallocate() so it works on uClibc + +It seems like the possix_fallocate() does not need to be provided on +all implementations (see "Application Usage" in +http://www.opengroup.org/onlinepubs/009695399/functions/posix_fallocate.html ) + +I'm not too familiar with the code but it looks like _DConfEngine->shm +is a mmap to a file with 1 char size. If thats the case then something +like this would work: +--- + engine/dconf-engine.c | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c +index cf57431..8eb3fa7 100644 +--- a/engine/dconf-engine.c ++++ b/engine/dconf-engine.c +@@ -144,7 +144,11 @@ dconf_engine_setup_user (DConfEngine *engine) + + if (fd >= 0) + { +- if (posix_fallocate (fd, 0, 1) == 0) ++ struct stat st; ++ int r = fstat(fd, &st); ++ if (r == 0 && st.st_size == 0) ++ r = write(fd, "", 1); ++ if (r == 0) + { + engine->shm = mmap (NULL, 1, PROT_READ, MAP_SHARED, fd, 0); + +-- +1.7.3.1 + diff --git a/testing/dconf/APKBUILD b/testing/dconf/APKBUILD new file mode 100644 index 000000000..4a73a3068 --- /dev/null +++ b/testing/dconf/APKBUILD @@ -0,0 +1,41 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=dconf +pkgver=0.5.1 +pkgrel=0 +pkgdesc="A low-level configuration system." +url="http://live.gnome.org/dconf" +license="LGPL2.1" +depends="" +makedepends="vala gobject-introspection gtk+-dev glib-dev libxml2-dev" +install= +source="http://download.gnome.org/sources/dconf/0.5/dconf-$pkgver.tar.bz2 + 0001-Avoid-posix_fallocate-so-it-works-on-uClibc.patch + " + +_builddir="$srcdir"/$pkgname-$pkgver +prepare() { + cd "$_builddir" + for i in $source; do + case $i in + *.patch) + patch -p1 -i "$srcdir/$i" || return 1 + ;; + esac + done +} + +build () +{ + cd "$_builddir" + ./configure --prefix=/usr \ + --libexecdir=/usr/lib/dconf + make +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 +} + +md5sums="c905497d0255fe2ba58564f9655908ab dconf-0.5.1.tar.bz2 +750788f7fa6ff128ecdf7639ffff8b78 0001-Avoid-posix_fallocate-so-it-works-on-uClibc.patch" |