summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Beslik2015-07-03 17:25:10 +0300
committerRoman Beslik2015-07-03 17:25:10 +0300
commit8fa94e1a172584de49ce642ec14d1ce557126f0e (patch)
tree27980839e19e99fe00ab2db63ff64ac133c4199e
downloadaur-8fa94e1a172584de49ce642ec14d1ce557126f0e.tar.gz
init
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD48
-rw-r--r--glib2.csh1
-rw-r--r--glib2.sh1
-rw-r--r--sched-policy.patch74
5 files changed, 153 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fe6b71dca5f9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = glib2-sched-policy
+ pkgdesc = Common C routines used by GTK+ and other libs. Patched to allow a multithreaded process to have a real time scheduling policy.
+ pkgver = 2.30.0
+ pkgrel = 1
+ url = http://www.gtk.org/
+ arch = i686
+ arch = x86_64
+ license = LGPL
+ makedepends = pkgconfig
+ makedepends = python2
+ depends = pcre
+ depends = libffi
+ optdepends = python2: for gdbus-codegen
+ provides = glib2=2.30.0
+ conflicts = glib2
+ options = !libtool
+ options = !docs
+ options = !emptydirs
+ source = http://ftp.gnome.org/pub/GNOME/sources/glib/2.30/glib-2.30.0.tar.xz
+ source = glib2.sh
+ source = glib2.csh
+ source = sched-policy.patch
+ sha256sums = d64c00b43409eabb89aad78501fcb1a992b002b314a4414a9bd069585cb7cdc1
+ sha256sums = 9456872cdedcc639fb679448d74b85b0facf81033e27157d2861b991823b5a2a
+ sha256sums = 8d5626ffa361304ad3696493c0ef041d0ab10c857f6ef32116b3e2878ecf89e3
+ sha256sums = 1869628f31724adc6145d7d0fc48147acce7e5b01d57ef1b0d483617a4eefd18
+
+pkgname = glib2-sched-policy
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..36d9c8bbbecb
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# $Id: PKGBUILD 140113 2011-10-07 08:18:56Z ibiru $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=glib2-sched-policy
+pkgver=2.30.0
+pkgrel=1
+pkgdesc="Common C routines used by GTK+ and other libs. Patched to allow a multithreaded process to have a real time scheduling policy."
+url="http://www.gtk.org/"
+arch=(i686 x86_64)
+license=('LGPL')
+depends=('pcre' 'libffi')
+makedepends=('pkgconfig' 'python2')
+optdepends=('python2: for gdbus-codegen')
+provides=("glib2=$pkgver")
+conflicts=("glib2")
+options=('!libtool' '!docs' '!emptydirs')
+source=(http://ftp.gnome.org/pub/GNOME/sources/glib/2.30/glib-${pkgver}.tar.xz
+ glib2.sh
+ glib2.csh
+ sched-policy.patch)
+sha256sums=('d64c00b43409eabb89aad78501fcb1a992b002b314a4414a9bd069585cb7cdc1'
+ '9456872cdedcc639fb679448d74b85b0facf81033e27157d2861b991823b5a2a'
+ '8d5626ffa361304ad3696493c0ef041d0ab10c857f6ef32116b3e2878ecf89e3'
+ "1869628f31724adc6145d7d0fc48147acce7e5b01d57ef1b0d483617a4eefd18")
+
+build() {
+ cd "${srcdir}/glib-${pkgver}"
+ PYTHON=/usr/bin/python2 ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --with-pcre=system \
+ --disable-fam
+ patch -p1 < "${srcdir}/sched-policy.patch" || return 1
+ make
+}
+
+package() {
+ cd "${srcdir}/glib-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ install -d "${pkgdir}/etc/profile.d"
+ install -m755 "${srcdir}/glib2.sh" "${pkgdir}/etc/profile.d/"
+ install -m755 "${srcdir}/glib2.csh" "${pkgdir}/etc/profile.d/"
+
+ for _i in "${pkgdir}/etc/bash_completion.d/"*; do
+ chmod -x "${_i}"
+ done
+ sed -i "s|#!/usr/bin/env python|#!/usr/bin/env python2|" "$pkgdir"/usr/bin/gdbus-codegen
+}
diff --git a/glib2.csh b/glib2.csh
new file mode 100644
index 000000000000..7aa3a2ffae57
--- /dev/null
+++ b/glib2.csh
@@ -0,0 +1 @@
+setenv G_BROKEN_FILENAMES 1
diff --git a/glib2.sh b/glib2.sh
new file mode 100644
index 000000000000..96a056e1e608
--- /dev/null
+++ b/glib2.sh
@@ -0,0 +1 @@
+export G_BROKEN_FILENAMES=1
diff --git a/sched-policy.patch b/sched-policy.patch
new file mode 100644
index 000000000000..4fbf319c97eb
--- /dev/null
+++ b/sched-policy.patch
@@ -0,0 +1,74 @@
+From eb905e0394045b84699511da402643f0fb53d923 Mon Sep 17 00:00:00 2001
+From: Kamal Mostafa <kamal@whence.com>
+Date: Thu, 17 Dec 2009 09:32:52 -0800
+Subject: [PATCH] Fix g_thread_create_posix_impl() crash for sched policy != SCHED_OTHER
+
+Capture the initial scheduling policy along with the initial priority,
+and create new threads using that policy, since the priority will not
+be valid otherwise.
+
+Fixes https://bugzilla.gnome.org/show_bug.cgi?id=599079 .
+---
+ gthread/gthread-posix.c | 19 +++++++++++++++----
+ 1 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/gthread/gthread-posix.c b/gthread/gthread-posix.c
+index 9188f84..3528591 100644
+--- a/gthread/gthread-posix.c
++++ b/gthread/gthread-posix.c
+@@ -99,7 +99,8 @@ static gboolean posix_check_cmd_prio_warned = FALSE;
+
+ #if defined (POSIX_MIN_PRIORITY) && defined (POSIX_MAX_PRIORITY)
+ # define HAVE_PRIORITIES 1
+-static gint priority_normal_value;
++static gint initial_sched_priority;
++static gint initial_sched_policy;
+ # ifdef __FreeBSD__
+ /* FreeBSD threads use different priority values from the POSIX_
+ * defines so we just set them here. The corresponding macros
+@@ -112,7 +113,7 @@ static gint priority_normal_value;
+ # define PRIORITY_LOW_VALUE POSIX_MIN_PRIORITY
+ # define PRIORITY_URGENT_VALUE POSIX_MAX_PRIORITY
+ # endif /* !__FreeBSD__ */
+-# define PRIORITY_NORMAL_VALUE priority_normal_value
++# define PRIORITY_NORMAL_VALUE initial_sched_priority
+ #endif /* POSIX_MIN_PRIORITY && POSIX_MAX_PRIORITY */
+
+ static gulong g_thread_min_stack_size = 0;
+@@ -135,13 +136,18 @@ g_thread_impl_init(void)
+ #ifdef HAVE_PRIORITIES
+ # ifdef G_THREADS_IMPL_POSIX
+ {
++ /* Record the initial (current) scheduling policy and priority value.
++ * The priority value will be used as the "normal" priority when
++ * generating the g_thread_priority_map[] array, which will only be
++ * relevant to this scheduling policy. */
+ struct sched_param sched;
+ int policy;
+ posix_check_cmd (pthread_getschedparam (pthread_self(), &policy, &sched));
+- priority_normal_value = sched.sched_priority;
++ initial_sched_policy = policy;
++ initial_sched_priority = sched.sched_priority;
+ }
+ # else /* G_THREADS_IMPL_DCE */
+- posix_check_cmd (priority_normal_value =
++ posix_check_cmd (initial_sched_priority =
+ pthread_getprio (*(pthread_t*)thread,
+ g_thread_priority_map [priority]));
+ # endif
+@@ -342,7 +348,12 @@ g_thread_create_posix_impl (GThreadFunc thread_func,
+ #ifdef HAVE_PRIORITIES
+ # ifdef G_THREADS_IMPL_POSIX
+ {
++ /* Set the new thread's scheduling policy to match that recorded at
++ * init time, since the g_thread_priority_map[] scheduling priority
++ * values are only relevant to that scheduling policy. */
+ struct sched_param sched;
++ posix_check_cmd_prio
++ (pthread_attr_setschedpolicy (&attr, initial_sched_policy));
+ posix_check_cmd (pthread_attr_getschedparam (&attr, &sched));
+ sched.sched_priority = g_thread_priority_map [priority];
+ posix_check_cmd_prio (pthread_attr_setschedparam (&attr, &sched));
+--
+1.6.3.3
+