summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2005-03-27 11:18:37 +0000
committerjmmv <jmmv@pkgsrc.org>2005-03-27 11:18:37 +0000
commit829b59d5cd1b4a173168905eb655eec393aba730 (patch)
tree5974209b46baa7b62ce90afb18e223554436fbd5 /sysutils
parentee4c732566cda8e62433d3f03349511effcf6bea (diff)
downloadpkgsrc-829b59d5cd1b4a173168905eb655eec393aba730.tar.gz
Fix build under NetBSD 2.x (and maybe other systems) which do not have
read counts (f_syncreads and f_asyncreads) in statfs nor statvfs. Also do the same for write counts for consistency. Problem reported by Leonard Schmidt <lems at gmx.net> in tech-pkg@.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/libgtop2/Makefile22
-rw-r--r--sysutils/libgtop2/distinfo4
-rw-r--r--sysutils/libgtop2/patches/patch-ad17
3 files changed, 38 insertions, 5 deletions
diff --git a/sysutils/libgtop2/Makefile b/sysutils/libgtop2/Makefile
index 4bad38395b7..04c7d33de95 100644
--- a/sysutils/libgtop2/Makefile
+++ b/sysutils/libgtop2/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2005/03/22 16:03:37 jmmv Exp $
+# $NetBSD: Makefile,v 1.15 2005/03/27 11:18:37 jmmv Exp $
DISTNAME= libgtop-2.10.0
PKGNAME= ${DISTNAME:S/-/2-/}
@@ -75,6 +75,26 @@ post-install:
@${CHMOD} g+s ${PREFIX}/bin/libgtop_server2
.endif
+# XXX This needs a check in the configure script, which should be clean
+# enough to be integrated in the mainstream sources.
+statvfs_h= /usr/include/sys/statvfs.h
+.if exists(${statvfs_h})
+reads_count!= if ${GREP} f_syncreads ${statvfs_h} >/dev/null; then \
+ ${ECHO} yes; else ${ECHO} no; fi
+. if ${reads_count} == "yes"
+CPPFLAGS+= -DHAVE_STATVFS_READS_COUNT
+. endif
+. undef reads_count
+
+writes_count!= if ${GREP} f_syncwrites ${statvfs_h} >/dev/null; then \
+ ${ECHO} yes; else ${ECHO} no; fi
+. if ${writes_count} == "yes"
+CPPFLAGS+= -DHAVE_STATVFS_WRITES_COUNT
+. endif
+. undef writes_count
+.endif
+.undef statvfs_h
+
BUILDLINK_DEPENDS.glib2+= glib2>=2.6.0
.include "../../devel/gettext-lib/buildlink3.mk"
diff --git a/sysutils/libgtop2/distinfo b/sysutils/libgtop2/distinfo
index e77d446adc1..8b4a91aa265 100644
--- a/sysutils/libgtop2/distinfo
+++ b/sysutils/libgtop2/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.10 2005/03/22 16:03:37 jmmv Exp $
+$NetBSD: distinfo,v 1.11 2005/03/27 11:18:37 jmmv Exp $
SHA1 (libgtop-2.10.0.tar.bz2) = cf2f999de7de7397a4aee638b0423c6f61c1aee0
RMD160 (libgtop-2.10.0.tar.bz2) = 8b8e631511e61ef72d22bdd364e96b1881b73314
@@ -6,4 +6,4 @@ Size (libgtop-2.10.0.tar.bz2) = 746223 bytes
SHA1 (patch-aa) = 5fe5ccdf8444b3efaaa1bc3cff4c2d4944729f1e
SHA1 (patch-ab) = 55f4c875e4886194cba25874ab042da8e17261c7
SHA1 (patch-ac) = dea1b6fba42d77a4fe6b2e9269cdab0521d3a305
-SHA1 (patch-ad) = f3724aeb1469bb55bf19835947733566c88a28b6
+SHA1 (patch-ad) = c707545313bd4382825cedde30032f9083003823
diff --git a/sysutils/libgtop2/patches/patch-ad b/sysutils/libgtop2/patches/patch-ad
index 8fd30adfccb..faf3f1d3f13 100644
--- a/sysutils/libgtop2/patches/patch-ad
+++ b/sysutils/libgtop2/patches/patch-ad
@@ -1,4 +1,4 @@
-$NetBSD: patch-ad,v 1.1 2005/03/22 16:03:37 jmmv Exp $
+$NetBSD: patch-ad,v 1.2 2005/03/27 11:18:37 jmmv Exp $
--- sysdeps/freebsd/fsusage.c.orig 2005-02-28 09:54:41.000000000 +0100
+++ sysdeps/freebsd/fsusage.c
@@ -20,7 +20,7 @@ $NetBSD: patch-ad,v 1.1 2005/03/22 16:03:37 jmmv Exp $
#include <stdio.h>
#include <string.h>
-@@ -26,9 +33,15 @@ _glibtop_freebsd_get_fsusage_read_write(
+@@ -26,16 +33,26 @@ _glibtop_freebsd_get_fsusage_read_write(
const char *path)
{
int result;
@@ -36,3 +36,16 @@ $NetBSD: patch-ad,v 1.1 2005/03/22 16:03:37 jmmv Exp $
if (result == -1) {
return;
+ }
+
++#ifdef HAVE_STATVFS_READS_COUNT
+ buf->read = sfs.f_syncreads + sfs.f_asyncreads;
++ buf->flags |= (1 << GLIBTOP_FSUSAGE_READ);
++#endif
++#ifdef HAVE_STATVFS_WRITES_COUNT
+ buf->write = sfs.f_syncwrites + sfs.f_asyncwrites;
+-
+- buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
++ buf->flags |= (1 << GLIBTOP_FSUSAGE_WRITE);
++#endif
+ }