From 3eb2bfea4ae1af5a69c2cb85aaff38471221e58e Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Sun, 28 Sep 2008 07:09:12 +0200
Subject: [PATCH] Rename glib template to something more correct, while I'm
 here add a patch from pkgsrc to make it build.

--HG--
extra : convert_revision : b90f70cc5983c63bb79a586a773260b27650fc51
---
 templates/glib-2.18.1-fix-statfs-netbsd.diff  | 35 +++++++++++++++++++
 .../{glib2-2.18.1.tmpl => glib-2.18.1.tmpl}   |  8 ++++-
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 templates/glib-2.18.1-fix-statfs-netbsd.diff
 rename templates/{glib2-2.18.1.tmpl => glib-2.18.1.tmpl} (86%)

diff --git a/templates/glib-2.18.1-fix-statfs-netbsd.diff b/templates/glib-2.18.1-fix-statfs-netbsd.diff
new file mode 100644
index 00000000000..4297a0c6aac
--- /dev/null
+++ b/templates/glib-2.18.1-fix-statfs-netbsd.diff
@@ -0,0 +1,35 @@
+$NetBSD: patch-ba,v 1.3 2008/09/06 11:07:20 obache Exp $
+
+--- gio/gunixmounts.c.orig	2008-09-02 15:09:19.000000000 +0000
++++ gio/gunixmounts.c
+@@ -563,7 +563,11 @@ get_mtab_monitor_file (void)
+ static GList *
+ _g_get_unix_mounts (void)
+ {
++#ifdef __NetBSD__
++  struct statvfs *mntent = NULL;
++#else
+   struct statfs *mntent = NULL;
++#endif
+   int num_mounts, i;
+   GUnixMountEntry *mount_entry;
+   GList *return_list;
+@@ -580,8 +584,18 @@ _g_get_unix_mounts (void)
+       
+       mount_entry->mount_path = g_strdup (mntent[i].f_mntonname);
+       mount_entry->device_path = g_strdup (mntent[i].f_mntfromname);
++#if defined(__digital__)
++      mount_entry->filesystem_type = g_strdup ("unknown");
++#else
+       mount_entry->filesystem_type = g_strdup (mntent[i].f_fstypename);
++#endif
++#if defined(__NetBSD__)
++      if (mntent[i].f_flag & MNT_RDONLY)
++#elif defined(__digital__)
++      if (mntent[i].f_flags & M_RDONLY)
++#else
+       if (mntent[i].f_flags & MNT_RDONLY)
++#endif
+ 	mount_entry->is_read_only = TRUE;
+ 
+       mount_entry->is_system_internal =
diff --git a/templates/glib2-2.18.1.tmpl b/templates/glib-2.18.1.tmpl
similarity index 86%
rename from templates/glib2-2.18.1.tmpl
rename to templates/glib-2.18.1.tmpl
index 21c1ef7a03e..b55dabf409b 100755
--- a/templates/glib2-2.18.1.tmpl
+++ b/templates/glib-2.18.1.tmpl
@@ -9,6 +9,9 @@ pkgname=glib-2.18.1
 # Suffix extraction, only supported: zip and tar/tar+(gz|bzip2).
 extract_sufx=".tar.bz2"
 
+# Patches to be applied to the source before building it.
+patch_files="glib-2.18.1-fix-statfs-netbsd.diff"
+
 # Use this if pkgname doesn't match or if there are multiple
 # source distribution files.
 #distfiles=""
@@ -16,11 +19,14 @@ extract_sufx=".tar.bz2"
 # URL to fetch
 url=http://ftp.gnome.org/pub/gnome/sources/glib/2.18
 
+make_cmd="$PKGFS_MASTERDIR/bin/gmake"
+
 # Arguments passed to configure if $build_style = {,gnu_}configure.
 #configure_args=""
 
 # Arguments passed to configure through the environment
-configure_env="ac_cv_func_statfs=no"
+configure_env="ac_cv_path_PKG_CONFIG=$PKGFS_MASTERDIR/bin/pkg-config
+ac_cv_func_statfs=no"
 
 # Build style: gnu_configure, bsd-makefile, gnu-makefile, configure.
 build_style=gnu_configure