From 7343f6736acd15aa13bca5d6b504d47c82dc3c40 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 24 Nov 2006 08:03:20 +0000 Subject: Add support for the FreeBSD "distro". This makes the new overview tab in g-s-m much more informative on FreeBSD. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@7947 df743ca5-7f9a-e211-a948-0013205c9059 --- sysutils/gnome-system-monitor/Makefile | 3 +- .../files/patch-src_sysinfo.cpp | 53 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 sysutils/gnome-system-monitor/files/patch-src_sysinfo.cpp (limited to 'sysutils') diff --git a/sysutils/gnome-system-monitor/Makefile b/sysutils/gnome-system-monitor/Makefile index bb067e44b..50986cc6b 100644 --- a/sysutils/gnome-system-monitor/Makefile +++ b/sysutils/gnome-system-monitor/Makefile @@ -3,11 +3,12 @@ # Whom: Joe Marcus Clarke # # $FreeBSD$ -# $MCom: ports/sysutils/gnome-system-monitor/Makefile,v 1.76 2006/10/02 23:31:11 ahze Exp $ +# $MCom: ports/sysutils/gnome-system-monitor/Makefile,v 1.78 2006/11/09 21:10:22 marcus Exp $ # PORTNAME= gnome-system-monitor PORTVERSION= 2.17.2.1 +PORTREVISION= 1 CATEGORIES= sysutils gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/gnome-system-monitor/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/} diff --git a/sysutils/gnome-system-monitor/files/patch-src_sysinfo.cpp b/sysutils/gnome-system-monitor/files/patch-src_sysinfo.cpp new file mode 100644 index 000000000..85d231bb2 --- /dev/null +++ b/sysutils/gnome-system-monitor/files/patch-src_sysinfo.cpp @@ -0,0 +1,53 @@ +--- sysinfo.cpp.orig Fri Nov 24 02:41:14 2006 ++++ sysinfo.cpp Fri Nov 24 02:54:59 2006 +@@ -11,6 +11,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + + #include + #include +@@ -140,16 +143,39 @@ namespace { + } + }; + ++ class FreeBSDSysInfo ++ : public SysInfo ++ { ++ public: ++ FreeBSDSysInfo() ++ : SysInfo("FreeBSD") ++ { ++ this->load_freebsd_info(); ++ } ++ ++ private: ++ void load_freebsd_info() ++ { ++ struct utsname name; ++ ++ uname(&name); ++ ++ this->distro_version = name.release; ++ } ++ }; + + SysInfo* get_sysinfo() + { + if (g_file_test("/etc/debian_version", G_FILE_TEST_EXISTS)) + return new DebianSysInfo; + else ++#ifdef __FreeBSD__ ++ return new FreeBSDSysInfo; ++#else + return new SysInfo(_("Unknown distro")); ++#endif + } + } +- + + GtkWidget * + procman_create_sysinfo_view(void) -- cgit v1.2.3