Skip to content

Instantly share code, notes, and snippets.

@matthiasr
Created January 15, 2012 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthiasr/1617326 to your computer and use it in GitHub Desktop.
Save matthiasr/1617326 to your computer and use it in GitHub Desktop.
pkgsrc www/py-uwsgi: DragonFly port
commit 5a9a0563f219cf8bdac041601ba93a8d9d705c9d
Author: Matthias Rampke <matthias@rampke.de>
Date: Wed Dec 21 12:30:19 2011 +0100
www/py-uwsgi: DragonFly port
diff --git a/www/py-uwsgi/distinfo b/www/py-uwsgi/distinfo
index fb8f4aa..2ac23c4 100644
--- a/www/py-uwsgi/distinfo
+++ b/www/py-uwsgi/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.10 2012/01/09 07:08:25 sbd Exp $
+$NetBSD$
SHA1 (uwsgi-0.9.8.6.tar.gz) = bb835c3c14310640b24ebdbcf0aa91e8ce8bd5a6
RMD160 (uwsgi-0.9.8.6.tar.gz) = 78b92fe3a9b272ca5a2704b0db7d1956b9149a0b
Size (uwsgi-0.9.8.6.tar.gz) = 359620 bytes
-SHA1 (patch-uwsgiconfig.py) = d7d7e3143658b1860f6d79f288d76ecb21aaf660
+SHA1 (patch-logging.c) = 99aad732b1a55a860469369b70f19772abd46434
+SHA1 (patch-uwsgi.h) = 16a2d152bea7476d5e5821becb4238b5aa4870de
+SHA1 (patch-uwsgiconfig.py) = e7032543c069179a4b63f3680cb2dd9b383fcc8d
diff --git a/www/py-uwsgi/patches/patch-logging.c b/www/py-uwsgi/patches/patch-logging.c
new file mode 100644
index 0000000..722172c
--- /dev/null
+++ b/www/py-uwsgi/patches/patch-logging.c
@@ -0,0 +1,20 @@
+$NetBSD$
+
+DragonFly port.
+
+--- logging.c.orig 2011-09-11 05:50:42.000000000 +0000
++++ logging.c
+@@ -184,8 +184,13 @@ void get_memusage() {
+ struct kinfo_proc *kproc;
+ kproc = kvm_getprocs(kv, KERN_PROC_PID, uwsgi.mypid, &cnt);
+ if (kproc && cnt > 0) {
++#ifdef __FreeBSD__
+ uwsgi.workers[uwsgi.mywid].vsz_size = kproc->ki_size;
+ uwsgi.workers[uwsgi.mywid].rss_size = kproc->ki_rssize * uwsgi.page_size;
++#elif defined(__DragonFly__)
++ uwsgi.workers[uwsgi.mywid].vsz_size = kproc->kp_vm_map_size;
++ uwsgi.workers[uwsgi.mywid].rss_size = kproc->kp_vm_rssize * uwsgi.page_size;
++#endif
+ }
+ #elif defined(__NetBSD__) || defined(__OpenBSD__)
+ struct kinfo_proc2 *kproc2;
diff --git a/www/py-uwsgi/patches/patch-uwsgi.h b/www/py-uwsgi/patches/patch-uwsgi.h
new file mode 100644
index 0000000..cd00305
--- /dev/null
+++ b/www/py-uwsgi/patches/patch-uwsgi.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+DragonFly port.
+
+--- uwsgi.h.orig 2011-09-11 05:50:42.000000000 +0000
++++ uwsgi.h
+@@ -210,6 +210,9 @@ extern int pivot_root(const char *new_ro
+ #include <sys/devpoll.h>
+ #elif defined(__HAIKU__)
+ #else
++#ifdef __DragonFly__
++#define _KERNEL_STRUCTURES /* or we will clash with the sys/user.h inclusion later in logging.c */
++#endif /* __DragonFly__ */
+ #include <sys/event.h>
+ #endif
+
diff --git a/www/py-uwsgi/patches/patch-uwsgiconfig.py b/www/py-uwsgi/patches/patch-uwsgiconfig.py
index 2336ed0..f64989b 100644
--- a/www/py-uwsgi/patches/patch-uwsgiconfig.py
+++ b/www/py-uwsgi/patches/patch-uwsgiconfig.py
@@ -1,9 +1,38 @@
-$NetBSD: patch-uwsgiconfig.py,v 1.3 2012/01/09 07:08:25 sbd Exp $
+$NetBSD$
+
+DragonFly Port.
Find include/uuid/uuid.h and lib/libuuid.so under the BUILDLINK_DIR.
--- uwsgiconfig.py.orig 2011-09-11 05:54:27.000000000 +0000
+++ uwsgiconfig.py
+@@ -102,7 +102,7 @@ def build_uwsgi(uc):
+ for p in ep:
+ p = p.rstrip().lstrip()
+ if p == 'ugreen':
+- if uwsgi_os == 'OpenBSD' or uwsgi_cpu[0:3] == 'arm' or uwsgi_os == 'Haiku':
++ if uwsgi_os == 'OpenBSD' or uwsgi_cpu[0:3] == 'arm' or uwsgi_os == 'Haiku' or (uwsgi_os == 'DragonFly' and uwsgi_cpu == 'x86_64'):
+ continue
+ epc += "UDEP(%s);" % p
+ eplc += "ULEP(%s);" % p
+@@ -128,7 +128,7 @@ def build_uwsgi(uc):
+ p = p.rstrip().lstrip()
+
+ if p == 'ugreen':
+- if uwsgi_os == 'OpenBSD' or uwsgi_cpu[0:3] == 'arm' or uwsgi_os == 'Haiku':
++ if uwsgi_os == 'OpenBSD' or uwsgi_cpu[0:3] == 'arm' or uwsgi_os == 'Haiku' or (uwsgi_os == 'DragonFly' and uwsgi_cpu == 'x86_64'):
+ continue
+ path = 'plugins/%s' % p
+ path = path.rstrip('/')
+@@ -325,7 +325,7 @@ class uConf(object):
+ if int(sun_major) >= 5:
+ if int(sun_minor) >= 10:
+ event_mode = 'port'
+- elif uwsgi_os in ('Darwin', 'FreeBSD', 'OpenBSD', 'NetBSD'):
++ elif uwsgi_os in ('Darwin', 'FreeBSD', 'OpenBSD', 'NetBSD','DragonFly'):
+ event_mode = 'kqueue'
+
+ if event_mode == 'epoll':
@@ -443,7 +443,7 @@ class uConf(object):
has_json = False
has_uuid = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment