diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2005-07-04 05:35:31 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2005-07-04 05:35:31 +0800 |
commit | 34bcee1b7fbce3aedae06dd504c838965a8c5e28 (patch) | |
tree | 819711a41ee772ea689f66de6163282757dbed98 /x11/gnome-applets/files | |
parent | 9cb041f482556c75f90abd698ae70997c3924b4a (diff) | |
download | marcuscom-ports-34bcee1b7fbce3aedae06dd504c838965a8c5e28.tar marcuscom-ports-34bcee1b7fbce3aedae06dd504c838965a8c5e28.tar.gz marcuscom-ports-34bcee1b7fbce3aedae06dd504c838965a8c5e28.tar.bz2 marcuscom-ports-34bcee1b7fbce3aedae06dd504c838965a8c5e28.tar.lz marcuscom-ports-34bcee1b7fbce3aedae06dd504c838965a8c5e28.tar.xz marcuscom-ports-34bcee1b7fbce3aedae06dd504c838965a8c5e28.tar.zst marcuscom-ports-34bcee1b7fbce3aedae06dd504c838965a8c5e28.zip |
Update to 2.11.1, and port cpufreq and the latest battstat code.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@4157 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'x11/gnome-applets/files')
-rw-r--r-- | x11/gnome-applets/files/patch-aa | 101 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_acpi-freebsd.c | 152 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_acpi-freebsd.h | 78 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_battstat.schemas.in | 11 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_battstat_applet.c | 21 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_power-management.c | 112 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-cpufreq-freebsd | 528 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-cpufreq-selector-freebsd | 373 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-drivemount_drive-button.c | 59 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-gweather_weather-iwin.c | 9 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-gweather_weather.c | 12 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-modemlights_Makefile.in | 10 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-modemlights_modem-applet.c | 22 |
13 files changed, 1488 insertions, 0 deletions
diff --git a/x11/gnome-applets/files/patch-aa b/x11/gnome-applets/files/patch-aa new file mode 100644 index 000000000..1bb20f296 --- /dev/null +++ b/x11/gnome-applets/files/patch-aa @@ -0,0 +1,101 @@ +--- configure.orig Tue Mar 1 12:35:29 2005 ++++ configure Tue Mar 1 12:36:09 2005 +@@ -23136,8 +23136,7 @@ + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- ac_define_dir=`eval echo $"${prefix}/share/locale"` +- ac_define_dir=`eval echo $ac_define_dir` ++ ac_define_dir=`eval echo "${prefix}/share/locale"` + GNOMELOCALEDIR="$ac_define_dir" + + +@@ -25795,6 +25800,9 @@ + *linux*) + build_cpufreq_applet=yes + ;; ++ i386-*-freebsd*|amd64-*-freebsd*) ++ build_cpufreq_applet=yes ++ ;; + *) + echo "warning: ${host} is not supported by cpufreq applet, not building" >&2 + build_cpufreq_applet=no +@@ -26085,7 +26093,7 @@ + ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" + + +-iconsdir="${datadir}/icons" ++iconsdir="${prefix}/share/icons" + + pixmapsdir="${datadir}/pixmaps" + +@@ -26099,8 +26107,7 @@ + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- ac_define_dir=`eval echo $"${iconsdir}"` +- ac_define_dir=`eval echo $ac_define_dir` ++ ac_define_dir=`eval echo "${iconsdir}"` + GNOME_ICONDIR="$ac_define_dir" + + +@@ -26112,8 +26119,7 @@ + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- ac_define_dir=`eval echo $"${pixmapsdir}"` +- ac_define_dir=`eval echo $ac_define_dir` ++ ac_define_dir=`eval echo "${pixmapsdir}"` + GNOME_PIXMAPSDIR="$ac_define_dir" + + +@@ -26125,8 +26131,7 @@ + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- ac_define_dir=`eval echo $"${gladedir}"` +- ac_define_dir=`eval echo $ac_define_dir` ++ ac_define_dir=`eval echo "${gladedir}"` + GNOME_GLADEDIR="$ac_define_dir" + + +@@ -26138,8 +26143,7 @@ + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- ac_define_dir=`eval echo $"${datadir}"` +- ac_define_dir=`eval echo $ac_define_dir` ++ ac_define_dir=`eval echo "${datadir}"` + DATADIR="$ac_define_dir" + + +@@ -26151,8 +26155,7 @@ + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- ac_define_dir=`eval echo $"${sysconfdir}"` +- ac_define_dir=`eval echo $ac_define_dir` ++ ac_define_dir=`eval echo "${sysconfdir}"` + SYSCONFDIR="$ac_define_dir" + + +@@ -26164,8 +26167,7 @@ + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- ac_define_dir=`eval echo $"${libdir}"` +- ac_define_dir=`eval echo $ac_define_dir` ++ ac_define_dir=`eval echo "${libdir}"` + LIBDIR="$ac_define_dir" + + +@@ -26177,8 +26179,7 @@ + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- ac_define_dir=`eval echo $"$prefix"` +- ac_define_dir=`eval echo $ac_define_dir` ++ ac_define_dir=`eval echo "$prefix"` + PREFIX="$ac_define_dir" + + diff --git a/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c new file mode 100644 index 000000000..48746fa03 --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c @@ -0,0 +1,152 @@ +--- battstat/acpi-freebsd.c.orig Sun Jul 3 16:41:26 2005 ++++ battstat/acpi-freebsd.c Sun Jul 3 16:49:55 2005 +@@ -31,9 +31,13 @@ + + #include <stdio.h> + #include <sys/types.h> ++#include <sys/socket.h> + #include <sys/sysctl.h> ++#include <sys/un.h> + #include <sys/ioctl.h> ++#if defined(__i386__) + #include <machine/apm_bios.h> ++#endif + #include <stdlib.h> + #include <errno.h> + #include <unistd.h> +@@ -92,16 +96,36 @@ gboolean + acpi_freebsd_init(struct acpi_info * acpiinfo) + { + int acpi_fd; ++ int event_fd; + + g_assert(acpiinfo); + +- acpi_fd = open(ACPIDEV, O_RDONLY); +- if (acpi_fd >= 0) { +- acpiinfo->acpifd = acpi_fd; ++ if (acpiinfo->acpifd == -1) { ++ acpi_fd = open(ACPIDEV, O_RDONLY); ++ if (acpi_fd >= 0) { ++ acpiinfo->acpifd = acpi_fd; ++ } ++ else { ++ acpiinfo->acpifd = -1; ++ return FALSE; ++ } + } +- else { +- acpiinfo->acpifd = -1; +- return FALSE; ++ ++ event_fd = socket(PF_UNIX, SOCK_STREAM, 0); ++ if (event_fd >= 0) { ++ struct sockaddr_un addr; ++ addr.sun_family = AF_UNIX; ++ strcpy(addr.sun_path, "/var/run/devd.pipe"); ++ if (connect(event_fd, (struct sockaddr *) &addr, sizeof(addr)) == 0) { ++ acpiinfo->event_fd = event_fd; ++ acpiinfo->event_inited = TRUE; ++ acpiinfo->channel = g_io_channel_unix_new(event_fd); ++ } ++ else { ++ close(event_fd); ++ acpiinfo->event_fd = -1; ++ acpiinfo->event_inited = FALSE; ++ } + } + + update_battery_info(acpiinfo); +@@ -110,6 +134,65 @@ acpi_freebsd_init(struct acpi_info * acp + return TRUE; + } + ++#define ACPI_EVENT_IGNORE 0 ++#define ACPI_EVENT_AC 1 ++#define ACPI_EVENT_BATTERY_INFO 2 ++ ++static int parse_acpi_event(GString *buffer) ++{ ++ if (strstr(buffer->str, "system=ACPI")) { ++ if (strstr(buffer->str, "subsystem=ACAD")) ++ return ACPI_EVENT_AC; ++ if (strstr(buffer->str, "subsystem=CMBAT")) ++ return ACPI_EVENT_BATTERY_INFO; ++ } ++ ++ return ACPI_EVENT_IGNORE; ++} ++ ++void acpi_freebsd_update(struct acpi_info *acpiinfo) ++{ ++ /* XXX This is needed for systems where devd does not have permissions ++ * to allow for event-driven updates. ++ */ ++ update_ac_info(acpiinfo); ++ update_battery_info(acpiinfo); ++} ++ ++gboolean acpi_process_event(struct acpi_info *acpiinfo, gboolean *read_error) ++{ ++ gsize i; ++ int evt; ++ gboolean result = FALSE; ++ GString *buffer; ++ GIOStatus stat; ++ buffer = g_string_new(NULL); ++ ++ *read_error = FALSE; ++ stat = g_io_channel_read_line_string(acpiinfo->channel, buffer, &i, NULL); ++ ++ if (stat == G_IO_STATUS_ERROR || stat == G_IO_STATUS_EOF) { ++ *read_error = TRUE; ++ g_string_free(buffer, TRUE); ++ return FALSE; ++ } ++ ++ evt = parse_acpi_event(buffer); ++ switch (evt) { ++ case ACPI_EVENT_AC: ++ update_ac_info(acpiinfo); ++ result = TRUE; ++ break; ++ case ACPI_EVENT_BATTERY_INFO: ++ update_battery_info(acpiinfo); ++ result = TRUE; ++ break; ++ } ++ ++ g_string_free(buffer, TRUE); ++ return result; ++} ++ + void + acpi_freebsd_cleanup(struct acpi_info * acpiinfo) + { +@@ -119,21 +202,12 @@ acpi_freebsd_cleanup(struct acpi_info * + close(acpiinfo->acpifd); + acpiinfo->acpifd = -1; + } +-} + +-/* XXX This is a hack since user-land applications can't get ACPI events yet. +- * Devd provides this (or supposedly provides this), but you need to be +- * root to access devd. +- */ +-gboolean +-acpi_process_event(struct acpi_info * acpiinfo) +-{ +- g_assert(acpiinfo); +- +- update_ac_info(acpiinfo); +- update_battery_info(acpiinfo); +- +- return TRUE; ++ if (acpiinfo->event_fd >= 0) { ++ g_io_channel_unref(acpiinfo->channel); ++ close(acpiinfo->event_fd); ++ acpiinfo->event_fd = -1; ++ } + } + + gboolean diff --git a/x11/gnome-applets/files/patch-battstat_acpi-freebsd.h b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.h new file mode 100644 index 000000000..918cd59eb --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.h @@ -0,0 +1,78 @@ +--- battstat/acpi-freebsd.h.orig Sun Jul 3 16:50:22 2005 ++++ battstat/acpi-freebsd.h Sun Jul 3 16:54:14 2005 +@@ -29,61 +29,31 @@ + #define ACPI_LIFE "hw.acpi.battery.life" + #define ACPI_STATE "hw.acpi.battery.state" + +-struct acpi_info { +- gboolean ac_online; +- int acpifd; +- int max_capacity; +- int low_capacity; +- int critical_capacity; ++/* XXX: AMD64 does not have machine/apm_bios.h. */ ++#if !defined(__i386__) ++struct apm_info { ++ guint ai_acline; ++ guint ai_batt_stat; ++ guint ai_batt_life; ++ int ai_batt_time; ++ guint ai_status; + }; +- +-gboolean acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info * acpiinfo); +-gboolean acpi_process_event(struct acpi_info * acpiinfo); +-gboolean acpi_freebsd_init(struct acpi_info * acpiinfo); +-void acpi_freebsd_cleanup(struct acpi_info * acpiinfo); +- +-#endif /* __ACPI_FREEBSD_H__ */ +-/* +- * Copyright (C) 2004 by Joe Marcus Clarke <marcus@FreeBSD.org> +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. +- */ +- +-#ifndef __ACPI_FREEBSD_H__ +-#define __ACPI_FREEBSD_H__ +- +-#define ACPIDEV "/dev/acpi" +- +-#define BATT_MIN 0 +-#define BATT_MAX 64 +- +-#define ACPI_ACLINE "hw.acpi.acline" +-#define ACPI_TIME "hw.acpi.battery.time" +-#define ACPI_LIFE "hw.acpi.battery.life" +-#define ACPI_STATE "hw.acpi.battery.state" ++#endif + + struct acpi_info { + gboolean ac_online; ++ gboolean event_inited; + int acpifd; ++ int event_fd; + int max_capacity; + int low_capacity; + int critical_capacity; ++ GIOChannel * channel; + }; + + gboolean acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info * acpiinfo); +-gboolean acpi_process_event(struct acpi_info * acpiinfo); ++void acpi_freebsd_update(struct acpi_info * acpiinfo); ++gboolean acpi_process_event(struct acpi_info * acpiinfo, gboolean *read_error); + gboolean acpi_freebsd_init(struct acpi_info * acpiinfo); + void acpi_freebsd_cleanup(struct acpi_info * acpiinfo); + diff --git a/x11/gnome-applets/files/patch-battstat_battstat.schemas.in b/x11/gnome-applets/files/patch-battstat_battstat.schemas.in new file mode 100644 index 000000000..a6bed2361 --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_battstat.schemas.in @@ -0,0 +1,11 @@ +--- battstat/battstat.schemas.in.orig Fri Oct 1 16:22:39 2004 ++++ battstat/battstat.schemas.in Fri Oct 1 16:22:46 2004 +@@ -115,7 +115,7 @@ + <key>/schemas/apps/battstat-applet/prefs/suspend_command</key> + <owner>battstat-applet</owner> + <type>string</type> +- <default>/usr/bin/apm -s</default> ++ <default>/usr/sbin/zzz</default> + <locale name="C"> + <short>Suspend Command</short> + <long>Command to send to suspend the computer</long> diff --git a/x11/gnome-applets/files/patch-battstat_battstat_applet.c b/x11/gnome-applets/files/patch-battstat_battstat_applet.c new file mode 100644 index 000000000..3bee2ecc8 --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_battstat_applet.c @@ -0,0 +1,21 @@ +--- battstat/battstat_applet.c.orig Sun Jul 3 17:25:06 2005 ++++ battstat/battstat_applet.c Sun Jul 3 17:25:36 2005 +@@ -446,14 +446,15 @@ battery_full_notify (void) + static void + battery_full_dialog( void ) + { ++ GtkWidget *dialog, *hbox, *image, *label; ++ GdkPixbuf *pixbuf; ++ gchar *new_label; ++ + /* first attempt to use libnotify */ + if (battery_full_notify ()) + return; + +- GtkWidget *dialog, *hbox, *image, *label; +- GdkPixbuf *pixbuf; + +- gchar *new_label; + dialog = gtk_dialog_new_with_buttons ( + _("Battery Notice"), + NULL, diff --git a/x11/gnome-applets/files/patch-battstat_power-management.c b/x11/gnome-applets/files/patch-battstat_power-management.c new file mode 100644 index 000000000..ab70e5be4 --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_power-management.c @@ -0,0 +1,112 @@ +--- battstat/power-management.c.orig Sun Jul 3 16:55:38 2005 ++++ battstat/power-management.c Sun Jul 3 17:02:43 2005 +@@ -191,16 +191,40 @@ apm_readinfo (BatteryStatus *status) + + #elif __FreeBSD__ + ++#if defined(__i386__) + #include <machine/apm_bios.h> ++#endif + #include "acpi-freebsd.h" + + static struct acpi_info acpiinfo; + static gboolean using_acpi; + static int acpi_count; ++static int acpiwatch; + static struct apm_info apminfo; + ++gboolean acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info *acpiinfo); ++ + #define APMDEVICE "/dev/apm" + ++static gboolean acpi_callback (GIOChannel * chan, GIOCondition cond, gpointer data) ++{ ++ gboolean read_error; ++ if (cond & (G_IO_ERR | G_IO_HUP)) { ++ acpi_freebsd_cleanup(&acpiinfo); ++ return FALSE; ++ } ++ ++ if (acpi_process_event(&acpiinfo, &read_error)) { ++ acpi_freebsd_read(&apminfo, &acpiinfo); ++ } ++ else if (read_error) { ++ acpi_freebsd_cleanup(&acpiinfo); ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ + static const char * + apm_readinfo (BatteryStatus *status) + { +@@ -208,21 +232,27 @@ apm_readinfo (BatteryStatus *status) + + if (DEBUG) g_print("apm_readinfo() (FreeBSD)\n"); + +- if (using_acpi) { ++ if (using_acpi && (!acpiinfo.event_inited || acpiinfo.event_fd >= 0)) { + if (acpi_count <= 0) { + acpi_count = 30; +- acpi_process_event(&acpiinfo); ++ if (!acpiinfo.event_inited) { ++ acpi_freebsd_update(&acpiinfo); ++ } + if (acpi_freebsd_read(&apminfo, &acpiinfo) == FALSE) + return ERR_FREEBSD_ACPI; + } + acpi_count--; + } +- else +- { +- /* This is how I read the information from the APM subsystem under +- FreeBSD. Each time this functions is called (once every second) +- the APM device is opened, read from and then closed. +- */ ++ else if (using_acpi && acpiinfo.event_inited) { ++ if (acpi_freebsd_init(&acpiinfo)) { ++ acpiwatch = g_io_add_watch (acpiinfo.channel, ++ G_IO_IN | G_IO_ERR | G_IO_HUP, ++ acpi_callback, NULL); ++ acpi_freebsd_read(&apminfo, &acpiinfo); ++ } ++ } ++ else { ++#if defined(__i386__) + fd = open(APMDEVICE, O_RDONLY); + if (fd == -1) { + return ERR_OPEN_APMDEV; +@@ -236,6 +266,9 @@ apm_readinfo (BatteryStatus *status) + if(apminfo.ai_status == 0) + return ERR_APM_E; + } ++#else ++ return ERR_OPEN_APMDEV; ++#endif + + status->present = TRUE; + status->on_ac_power = apminfo.ai_acline ? 1 : 0; +@@ -480,6 +513,12 @@ power_management_initialise( void ) + } + else + using_acpi = FALSE; ++ ++ if (using_acpi && acpiinfo.event_fd >= 0) { ++ acpiwatch = g_io_add_watch (acpiinfo.channel, ++ G_IO_IN | G_IO_ERR | G_IO_HUP, ++ acpi_callback, NULL); ++ } + #endif + pm_initialised = 1; + +@@ -504,6 +543,9 @@ power_management_cleanup( void ) + } + #elif defined(__FreeBSD__) + if (using_acpi) { ++ if (acpiwatch != 0) ++ g_source_remove(acpiwatch); ++ acpiwatch = 0; + acpi_freebsd_cleanup(&acpiinfo); + } + #endif diff --git a/x11/gnome-applets/files/patch-cpufreq-freebsd b/x11/gnome-applets/files/patch-cpufreq-freebsd new file mode 100644 index 000000000..1037fd8f9 --- /dev/null +++ b/x11/gnome-applets/files/patch-cpufreq-freebsd @@ -0,0 +1,528 @@ +--- cpufreq/src/Makefile.in.orig Sun Feb 13 01:00:35 2005 ++++ cpufreq/src/Makefile.in Sun Feb 13 01:01:31 2005 +@@ -55,6 +55,7 @@ + cpufreq-prefs.$(OBJEXT) cpufreq-popup.$(OBJEXT) \ + cpufreq-monitor.$(OBJEXT) cpufreq-monitor-factory.$(OBJEXT) \ + cpufreq-monitor-procfs.$(OBJEXT) \ ++ cpufreq-monitor-sysctl.$(OBJEXT) \ + cpufreq-monitor-sysfs.$(OBJEXT) \ + cpufreq-monitor-cpuinfo.$(OBJEXT) + cpufreq_applet_OBJECTS = $(am_cpufreq_applet_OBJECTS) +@@ -68,6 +69,7 @@ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-cpuinfo.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-factory.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-procfs.Po \ ++@AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-sysctl.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-sysfs.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-popup.Po \ +@@ -336,6 +338,7 @@ + cpufreq-monitor-protected.h \ + cpufreq-monitor-factory.c cpufreq-monitor-factory.h \ + cpufreq-monitor-procfs.c cpufreq-monitor-procfs.h \ ++ cpufreq-monitor-sysctl.c cpufreq-monitor-sysctl.h \ + cpufreq-monitor-sysfs.c cpufreq-monitor-sysfs.h \ + cpufreq-monitor-cpuinfo.c cpufreq-monitor-cpuinfo.h + +@@ -419,6 +422,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-cpuinfo.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-factory.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-procfs.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-sysctl.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-sysfs.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-popup.Po@am__quote@ +--- cpufreq/src/cpufreq-monitor-sysctl.h.orig Sun Feb 13 01:00:25 2005 ++++ cpufreq/src/cpufreq-monitor-sysctl.h Sat Feb 12 20:25:21 2005 +@@ -0,0 +1,48 @@ ++/* ++ * Copyright (C) 2001, 2002 Free Software Foundation ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * Authors : Joe Marcus Clarke <marcus@FreeBSD.org> ++ */ ++ ++#ifndef __CPUFREQ_MONITOR_SYSCTL_H__ ++#define __CPUFREQ_MONITOR_SYSCTL_H__ ++ ++#include <glib-object.h> ++#include "cpufreq-monitor.h" ++ ++#define TYPE_CPUFREQ_MONITOR_SYSCTL (cpufreq_monitor_sysctl_get_type ()) ++#define CPUFREQ_MONITOR_SYSCTL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CPUFREQ_MONITOR_SYSCTL, CPUFreqMonitorSysctl)) ++#define CPUFREQ_MONITOR_SYSCTL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_CPUFREQ_MONITOR_SYSCTL, CPUFreqMonitorSysctlClass)) ++#define IS_CPUFREQ_MONITOR_SYSCTL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CPUFREQ_MONITOR_SYSCTL)) ++#define IS_CPUFREQ_MONITOR_SYSCTL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CPUFREQ_MONITOR_SYSCTL)) ++#define CPUFREQ_MONITOR_SYSCTL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CPUFREQ_MONITOR_SYSCTL, CPUFreqMonitorSysctlClass)) ++ ++typedef struct _CPUFreqMonitorSysctl CPUFreqMonitorSysctl; ++typedef struct _CPUFreqMonitorSysctlClass CPUFreqMonitorSysctlClass; ++ ++struct _CPUFreqMonitorSysctl { ++ CPUFreqMonitor parent; ++}; ++ ++struct _CPUFreqMonitorSysctlClass { ++ CPUFreqMonitorClass parent_class; ++}; ++ ++GType cpufreq_monitor_sysctl_get_type (); ++CPUFreqMonitor *cpufreq_monitor_sysctl_new (guint cpu); ++ ++#endif /* __CPUFREQ_MONITOR_SYSCTL_H__ */ +--- cpufreq/src/cpufreq-monitor-sysctl.c.orig Sun Feb 13 03:52:42 2005 ++++ cpufreq/src/cpufreq-monitor-sysctl.c Mon Feb 14 00:42:07 2005 +@@ -0,0 +1,269 @@ ++/* ++ * Copyright (C) 2001, 2002 Free Software Foundation ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * Authors : Joe Marcus Clarke <marcus@FreeBSD.org> ++ */ ++ ++#include <glib.h> ++#include <glib/gi18n.h> ++ ++#include <string.h> ++ ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++ ++#include "cpufreq-monitor-sysctl.h" ++#include "cpufreq-monitor-protected.h" ++ ++#define PARENT_TYPE TYPE_CPUFREQ_MONITOR ++ ++#define CPUFREQ_MONITOR_GET_PROTECTED(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PARENT_TYPE, CPUFreqMonitorProtected)) ++ ++static void cpufreq_monitor_sysctl_class_init (CPUFreqMonitorSysctlClass *klass); ++static void cpufreq_monitor_sysctl_finalize (GObject *object); ++ ++static void cpufreq_monitor_sysctl_run (CPUFreqMonitor *monitor); ++static GList *cpufreq_monitor_sysctl_get_available_frequencies (CPUFreqMonitor *monitor); ++ ++static gboolean cpufreq_monitor_sysctl_get (gpointer gdata); ++ ++ ++static CPUFreqMonitorClass *parent_class = NULL; ++ ++typedef struct _CPUFreqMonitorProtected CPUFreqMonitorProtected; ++ ++GType cpufreq_monitor_sysctl_get_type () ++{ ++ static GType type = 0; ++ ++ if (!type) { ++ static const GTypeInfo info = { ++ sizeof (CPUFreqMonitorSysctlClass), ++ (GBaseInitFunc) NULL, ++ (GBaseFinalizeFunc) NULL, ++ (GClassInitFunc) cpufreq_monitor_sysctl_class_init, ++ NULL, ++ NULL, ++ sizeof (CPUFreqMonitorSysctl), ++ 0, ++ NULL ++ }; ++ ++ type = g_type_register_static (PARENT_TYPE, "CPUFreqMonitorSysctl", ++ &info, 0); ++ } ++ ++ return type; ++} ++ ++static void ++cpufreq_monitor_sysctl_class_init (CPUFreqMonitorSysctlClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ CPUFreqMonitorClass *monitor_class = CPUFREQ_MONITOR_CLASS (klass); ++ ++ parent_class = g_type_class_peek_parent (klass); ++ ++ monitor_class->run = cpufreq_monitor_sysctl_run; ++ monitor_class->get_available_frequencies = cpufreq_monitor_sysctl_get_available_frequencies; ++ ++ object_class->finalize = cpufreq_monitor_sysctl_finalize; ++} ++ ++static void ++cpufreq_monitor_sysctl_finalize (GObject *object) ++{ ++ g_return_if_fail (IS_CPUFREQ_MONITOR_SYSCTL (object)); ++ ++ if (G_OBJECT_CLASS (parent_class)->finalize) ++ (* G_OBJECT_CLASS (parent_class)->finalize) (object); ++} ++ ++CPUFreqMonitor * ++cpufreq_monitor_sysctl_new (guint cpu) ++{ ++ CPUFreqMonitorSysctl *monitor; ++ ++ monitor = g_object_new (TYPE_CPUFREQ_MONITOR_SYSCTL, "cpu", cpu, NULL); ++ ++ return CPUFREQ_MONITOR (monitor); ++} ++ ++static gboolean ++cpufreq_monitor_sysctl_get (gpointer gdata) ++{ ++ gint fmax, fmin, ifreq; ++ gchar *freq, *perc, *unit, *governor; ++ gboolean changed; ++ size_t len; ++ gchar *freq_oid; ++ CPUFreqMonitorSysctl *monitor; ++ CPUFreqMonitorProtected *private; ++ ++ monitor = (CPUFreqMonitorSysctl *) gdata; ++ private = CPUFREQ_MONITOR_GET_PROTECTED (CPUFREQ_MONITOR (monitor)); ++ ++ if (private->available_freqs == NULL) { ++ if (!cpufreq_monitor_sysctl_get_available_frequencies (CPUFREQ_MONITOR (monitor))) ++ return FALSE; ++ } ++ ++ fmax = atoi ((gchar *) private->available_freqs->data); ++ fmin = atoi ((gchar *) g_list_nth_data (private->available_freqs, (g_list_length (private->available_freqs) - 1))); ++ ++ len = sizeof (ifreq); ++ freq_oid = g_strdup_printf ("dev.cpu.%d.freq", private->cpu); ++ ++ if (sysctlbyname (freq_oid, &ifreq, &len, NULL, 0) == -1) { ++ g_free (freq_oid); ++ return FALSE; ++ } ++ ++ ifreq *= 1000; ++ ++ if (ifreq == fmax) ++ governor = g_strdup ("performance"); ++ else if (ifreq == fmin) ++ governor = g_strdup ("economy"); ++ else ++ governor = g_strdup ("other"); ++ ++ freq = parent_class->get_human_readable_freq (ifreq); ++ perc = parent_class->get_human_readable_perc (fmax, ifreq); ++ unit = parent_class->get_human_readable_unit (ifreq); ++ ++ changed = FALSE; ++ ++ if (!private->governor || (g_ascii_strcasecmp (governor, private->governor) != 0)) { ++ changed = TRUE; ++ } ++ ++ if (!private->freq || (g_ascii_strcasecmp (freq, private->freq) != 0)) { ++ changed = TRUE; ++ } ++ ++ if (!private->perc || (g_ascii_strcasecmp (perc, private->perc) != 0)) { ++ changed = TRUE; ++ } ++ ++ if (!private->unit || (g_ascii_strcasecmp (unit, private->unit) != 0)) { ++ changed = TRUE; ++ } ++ ++ parent_class->free_data (CPUFREQ_MONITOR (monitor)); ++ ++ private->governor = governor; ++ private->freq = freq; ++ private->perc = perc; ++ private->unit = unit; ++ ++ if (private->governor == NULL) ++ return FALSE; ++ if (private->freq == NULL) ++ return FALSE; ++ if (private->perc == NULL) ++ return FALSE; ++ if (private->unit == NULL) ++ return FALSE; ++ ++ if (changed) ++ g_signal_emit (CPUFREQ_MONITOR (monitor), parent_class->signals[CHANGED], 0); ++ ++ return TRUE; ++} ++ ++static void ++cpufreq_monitor_sysctl_run (CPUFreqMonitor *monitor) ++{ ++ CPUFreqMonitorProtected *private; ++ ++ g_return_if_fail (IS_CPUFREQ_MONITOR_SYSCTL (monitor)); ++ ++ private = CPUFREQ_MONITOR_GET_PROTECTED (CPUFREQ_MONITOR (monitor)); ++ ++ if (private->timeout_handler > 0) ++ g_source_remove (private->timeout_handler); ++ ++ private->timeout_handler = g_timeout_add (1000, cpufreq_monitor_sysctl_get, (gpointer) monitor); ++} ++ ++static void ++free_string (gpointer str, gpointer gdata) ++{ ++ if (str) g_free (str); ++} ++ ++static GList * ++cpufreq_monitor_sysctl_get_available_frequencies (CPUFreqMonitor *monitor) ++{ ++ CPUFreqMonitorProtected *private; ++ gchar *levels_oid, *levels; ++ gchar **levelsp, **l; ++ gint mib[4]; ++ size_t len; ++ ++ g_return_val_if_fail (IS_CPUFREQ_MONITOR_SYSCTL (monitor), NULL); ++ ++ private = CPUFREQ_MONITOR_GET_PROTECTED (CPUFREQ_MONITOR (monitor)); ++ ++ if (private->available_freqs) { ++ g_list_foreach (private->available_freqs, ++ free_string, NULL); ++ g_list_free (private->available_freqs); ++ private->available_freqs = NULL; ++ } ++ ++ levels_oid = g_strdup_printf ("dev.cpu.%d.freq_levels", ++ private->cpu); ++ len = 4; ++ sysctlnametomib (levels_oid, mib, &len); ++ len = sizeof (levels); ++ g_free (levels_oid); ++ ++ if (sysctl (mib, 4, NULL, &len, NULL, 0) == -1) ++ return NULL; ++ ++ levels = g_malloc (len); ++ if (sysctl (mib, 4, levels, &len, NULL, 0) == -1) ++ return NULL; ++ ++ levelsp = g_strsplit (levels, " ", 0); ++ g_free (levels); ++ ++ for (l = levelsp; l && *l; l++) { ++ gchar **frpr; ++ ++ frpr = g_strsplit (*l, "/", 0); ++ if (frpr && frpr[0] != NULL) { ++ /* sysctl format is %d/%d where the ++ * first %d is the frequency, and ++ * the second is the power used in ++ * mW. ++ */ ++ int freq = atoi (frpr[0]); ++ private->available_freqs = ++ g_list_append (private->available_freqs, g_strdup_printf ("%d", freq * 1000)); ++ } ++ g_strfreev (frpr); ++ } ++ ++ g_strfreev (levelsp); ++ ++ return private->available_freqs; ++} ++#endif /* __FreeBSD__ */ +--- cpufreq/src/cpufreq-monitor-factory.c.orig Thu Apr 14 12:11:06 2005 ++++ cpufreq/src/cpufreq-monitor-factory.c Sun Jul 3 17:09:15 2005 +@@ -17,13 +17,21 @@ + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Authors : Carlos García Campos <carlosgc@gnome.org> ++ * Joe Marcus Clarke <marcus@FreeBSD.org> + */ + + #include <glib.h> ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif /* __FreeBSD__ */ + + #include "cpufreq-applet.h" + #include "cpufreq-monitor-sysfs.h" + #include "cpufreq-monitor-procfs.h" ++#ifdef __FreeBSD__ ++#include "cpufreq-monitor-sysctl.h" ++#endif /* __FreeBSD__ */ + #include "cpufreq-monitor-cpuinfo.h" + #include "cpufreq-monitor-factory.h" + +@@ -31,6 +39,7 @@ CPUFreqMonitor * + cpufreq_monitor_factory_create_monitor (guint cpu) + { + CPUFreqMonitor *monitor = NULL; ++#ifndef __FreeBSD__ + + if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.6 kernel */ + monitor = cpufreq_monitor_sysfs_new (cpu); +@@ -49,6 +58,20 @@ cpufreq_monitor_factory_create_monitor ( + + monitor = cpufreq_monitor_cpuinfo_new (cpu); + } ++#else ++ size_t len; ++ ++ if (sysctlbyname ("dev.cpu.0.freq", NULL, &len, NULL, 0) == 0) { ++ monitor = cpufreq_monitor_sysctl_new (cpu); ++ } else { ++ cpufreq_applet_display_error (_("CPU frequency scaling unsupported"), ++ _("You will not be able to modify the frequency of your machine. " ++ "Your machine may be misconfigured or not have hardware support " ++ "for CPU frequency scaling.")); ++ ++ monitor = cpufreq_monitor_cpuinfo_new (cpu); ++ } ++#endif /* __FreeBSD__ */ + + return monitor; + } +--- cpufreq/src/cpufreq-monitor-cpuinfo.c.orig Thu Apr 14 12:11:06 2005 ++++ cpufreq/src/cpufreq-monitor-cpuinfo.c Sun Jul 3 17:07:16 2005 +@@ -23,6 +23,10 @@ + #include <glib/gi18n.h> + #include <libgnomevfs/gnome-vfs.h> + ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif /* __FreeBSD__ */ + #include <string.h> + #include <stdio.h> + +@@ -104,6 +108,7 @@ cpufreq_monitor_cpuinfo_new (guint cpu) + static gboolean + cpufreq_monitor_cpuinfo_get (gpointer gdata) + { ++#ifndef __FreeBSD__ + GnomeVFSHandle *handle; + GnomeVFSFileSize bytes_read; + GnomeVFSResult result; +@@ -111,6 +116,9 @@ cpufreq_monitor_cpuinfo_get (gpointer gd + gchar **lines; + gchar buffer[256]; + gchar *p; ++#else ++ size_t len; ++#endif /* __FreeBSD__ */ + gchar *freq, *perc, *unit, *governor; + gint cpu, i; + CPUFreqMonitorCPUInfo *monitor; +@@ -120,6 +128,7 @@ cpufreq_monitor_cpuinfo_get (gpointer gd + + private = CPUFREQ_MONITOR_GET_PROTECTED (CPUFREQ_MONITOR (monitor)); + ++#ifndef __FreeBSD__ + uri = gnome_vfs_get_uri_from_local_path ("/proc/cpuinfo"); + + result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ); +@@ -180,6 +189,12 @@ cpufreq_monitor_cpuinfo_get (gpointer gd + + g_strfreev (lines); + g_free (file); ++#else ++ len = sizeof (cpu); ++ ++ if (sysctlbyname ("hw.clockrate", &cpu, &len, NULL, 0) == -1) ++ return FALSE; ++#endif /* __FreeBSD__ */ + + governor = g_strdup (_("Frequency Scaling Unsupported")); + freq = parent_class->get_human_readable_freq (cpu * 1000); /* kHz are expected*/ +--- cpufreq/src/cpufreq-applet.c.orig Thu Apr 14 12:11:06 2005 ++++ cpufreq/src/cpufreq-applet.c Sun Jul 3 17:28:43 2005 +@@ -17,6 +17,7 @@ + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Authors : Carlos García Campos <carlosgc@gnome.org> ++ * Joe Marcus Clarke <marcus@FreeBSD.org> + */ + + #include <config.h> +@@ -26,6 +27,10 @@ + #include <panel-applet-gconf.h> + #include <glade/glade.h> + #include <glib/gi18n.h> ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif /* __FreeBSD__ */ + #include <string.h> + + #include "cpufreq-applet.h" +@@ -193,6 +198,7 @@ cpufreq_applet_about_cb (BonoboUICompone + { + static const gchar *authors[] = { + "Carlos Garcia Campos <carlosgc@gnome.org>", ++ "Joe Marcus Clarke <marcus@FreeBSD.org> (FreeBSD support)", + NULL + }; + static const gchar *documenters[] = { +@@ -233,6 +239,7 @@ static gint + cpufreq_applet_get_max_cpu (void) + { + gint mcpu = -1; ++#ifndef __FreeBSD__ + gchar *file = NULL; + + do { +@@ -242,11 +249,20 @@ cpufreq_applet_get_max_cpu (void) + } while (g_file_test (file, G_FILE_TEST_EXISTS)); + g_free (file); + mcpu --; ++#else ++ size_t len; ++ ++ len = sizeof (mcpu); ++ ++ sysctlbyname ("hw.ncpu", &mcpu, &len, NULL, 0); ++ mcpu --; ++#endif /* __FreeBSD__ */ + + if (mcpu >= 0) + return mcpu; + + mcpu = -1; ++#ifndef __FreeBSD__ + file = NULL; + do { + if (file) g_free (file); +@@ -255,6 +271,7 @@ cpufreq_applet_get_max_cpu (void) + } while (g_file_test (file, G_FILE_TEST_EXISTS)); + g_free (file); + mcpu --; ++#endif + + if (mcpu >= 0) + return mcpu; diff --git a/x11/gnome-applets/files/patch-cpufreq-selector-freebsd b/x11/gnome-applets/files/patch-cpufreq-selector-freebsd new file mode 100644 index 000000000..8932c975a --- /dev/null +++ b/x11/gnome-applets/files/patch-cpufreq-selector-freebsd @@ -0,0 +1,373 @@ +--- cpufreq/src/cpufreq-selector/Makefile.in.orig Mon Feb 14 00:26:10 2005 ++++ cpufreq/src/cpufreq-selector/Makefile.in Mon Feb 14 00:26:58 2005 +@@ -53,7 +53,7 @@ + PROGRAMS = $(bin_PROGRAMS) + am_cpufreq_selector_OBJECTS = cpufreq.$(OBJEXT) \ + cpufreq-sysfs.$(OBJEXT) cpufreq-procfs.$(OBJEXT) \ +- main.$(OBJEXT) ++ cpufreq-sysctl.$(OBJEXT) main.$(OBJEXT) + cpufreq_selector_OBJECTS = $(am_cpufreq_selector_OBJECTS) + am__DEPENDENCIES_1 = + cpufreq_selector_DEPENDENCIES = $(am__DEPENDENCIES_1) +@@ -61,6 +61,7 @@ + depcomp = $(SHELL) $(top_srcdir)/depcomp + am__depfiles_maybe = depfiles + @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cpufreq-procfs.Po \ ++@AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-sysctl.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-sysfs.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq.Po ./$(DEPDIR)/main.Po + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ +@@ -310,6 +311,7 @@ + cpufreq.c cpufreq.h \ + cpufreq-sysfs.c cpufreq-sysfs.h \ + cpufreq-procfs.c cpufreq-procfs.h \ ++ cpufreq-sysctl.c cpufreq-sysctl.h \ + main.c + + cpufreq_selector_LDADD = $(CPUFREQ_SELECTOR_LIBS) -lpopt +@@ -385,6 +387,7 @@ + -rm -f *.tab.c + + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-procfs.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-sysctl.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-sysfs.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ +--- cpufreq/src/cpufreq-selector/cpufreq-sysctl.h.orig Mon Feb 14 00:38:57 2005 ++++ cpufreq/src/cpufreq-selector/cpufreq-sysctl.h Mon Feb 14 00:21:39 2005 +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (C) 2001, 2002 Free Software Foundation ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * Authors : Joe Marcus Clarke <marcus@FreeBSD.org> ++ */ ++ ++#ifndef __CPUFREQ_SYSCTL_H__ ++#define __CPUFREQ_SYSCTL_H__ ++ ++#include <glib-object.h> ++ ++#include "cpufreq.h" ++ ++#define TYPE_CPUFREQ_SYSCTL (cpufreq_sysctl_get_type ()) ++#define CPUFREQ_SYSCTL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CPUFREQ_SYSCTL, CPUFreqSysctl)) ++#define CPUFREQ_SYSCTL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_CPUFREQ_SYSCTL, CPUFreqSysctlClass)) ++#define IS_CPUFREQ_SYSCTL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CPUFREQ_SYSCTL)) ++#define IS_CPUFREQ_SYSCTL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CPUFREQ_SYSCTL)) ++#define CPUFREQ_SYSCTL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CPUFREQ_SYSCTL, CPUFreqSysctlClass)) ++ ++typedef struct _CPUFreqSysctl CPUFreqSysctl; ++typedef struct _CPUFreqSysctlClass CPUFreqSysctlClass; ++typedef struct _CPUFreqSysctlPriv CPUFreqSysctlPriv; ++ ++struct _CPUFreqSysctl { ++ CPUFreq parent; ++}; ++ ++struct _CPUFreqSysctlClass { ++ CPUFreqClass parent_class; ++}; ++ ++ ++GType cpufreq_sysctl_get_type (); ++CPUFreqSysctl *cpufreq_sysctl_new (); ++ ++#endif /* __CPUFREQ_SYSCTL_H__ */ +--- cpufreq/src/cpufreq-selector/cpufreq-sysctl.c.orig Mon Feb 14 00:38:52 2005 ++++ cpufreq/src/cpufreq-selector/cpufreq-sysctl.c Mon Feb 14 00:44:43 2005 +@@ -0,0 +1,235 @@ ++/* ++ * Copyright (C) 2001, 2002 Free Software Foundation ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * Authors : Joe Marcus Clarke <marcus@FreeBSD.org> ++ */ ++ ++#include <glib.h> ++#include <stdio.h> ++#include <stdlib.h> ++ ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif /* __FreeBSD__ */ ++ ++#include "cpufreq-sysctl.h" ++ ++#define PARENT_TYPE TYPE_CPUFREQ ++ ++#define CPUFREQ_SYSCTL_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), TYPE_CPUFREQ_SYSCTL, CPUFreqSysctlPrivate)) ++ ++static void cpufreq_sysctl_init (CPUFreqSysctl *cfq); ++static void cpufreq_sysctl_class_init (CPUFreqSysctlClass *klass); ++static void cpufreq_sysctl_finalize (GObject *object); ++ ++static void cpufreq_sysctl_set_governor (CPUFreq *cfq, const gchar *governor); ++static void cpufreq_sysctl_set_frequency (CPUFreq *cfq, gint frequency); ++ ++static void cpufreq_sysctl_setup (CPUFreqSysctl *cfq); ++ ++static GObjectClass *parent_class = NULL; ++ ++typedef struct _CPUFreqSysctlPrivate CPUFreqSysctlPrivate; ++ ++struct _CPUFreqSysctlPrivate ++{ ++ gint pmax; ++}; ++ ++GType cpufreq_sysctl_get_type () ++{ ++ static GType type = 0; ++ ++ if (!type) { ++ static const GTypeInfo info = { ++ sizeof (CPUFreqSysctlClass), ++ (GBaseInitFunc) NULL, ++ (GBaseFinalizeFunc) NULL, ++ (GClassInitFunc) cpufreq_sysctl_class_init, ++ NULL, ++ NULL, ++ sizeof (CPUFreqSysctl), ++ 0, ++ (GInstanceInitFunc) cpufreq_sysctl_init ++ }; ++ ++ type = g_type_register_static (PARENT_TYPE, "CPUFreqSysctl", ++ &info, 0); ++ } ++ ++ return type; ++} ++ ++static void ++cpufreq_sysctl_init (CPUFreqSysctl *cfq) ++{ ++ CPUFreqSysctlPrivate *private; ++ ++ g_return_if_fail (IS_CPUFREQ_SYSCTL (cfq)); ++ ++ private = CPUFREQ_SYSCTL_GET_PRIVATE (cfq); ++} ++ ++static void ++cpufreq_sysctl_class_init (CPUFreqSysctlClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ CPUFreqClass *cfq_class = CPUFREQ_CLASS (klass); ++ ++ parent_class = g_type_class_peek_parent (klass); ++ ++ g_type_class_add_private (klass, sizeof (CPUFreqSysctlPrivate)); ++ ++ cfq_class->set_governor = cpufreq_sysctl_set_governor; ++ cfq_class->set_frequency = cpufreq_sysctl_set_frequency; ++ ++ object_class->finalize = cpufreq_sysctl_finalize; ++} ++ ++static void ++cpufreq_sysctl_finalize (GObject *object) ++{ ++ if (G_OBJECT_CLASS (parent_class)->finalize) ++ (* G_OBJECT_CLASS (parent_class)->finalize) (object); ++} ++ ++CPUFreqSysctl * ++cpufreq_sysctl_new () ++{ ++ CPUFreqSysctl *cfq; ++ ++ cfq = g_object_new (TYPE_CPUFREQ_SYSCTL, NULL); ++ ++ cpufreq_sysctl_setup (cfq); ++ ++ return cfq; ++} ++ ++static void ++cpufreq_sysctl_set_governor (CPUFreq *cfq, const gchar *governor) ++{ ++ /* Not implemented. */ ++} ++ ++static void ++cpufreq_sysctl_set_frequency (CPUFreq *cfq, gint frequency) ++{ ++ gint cpu, i; ++ size_t len; ++ gchar *freq_oid; ++ ++ g_return_if_fail (IS_CPUFREQ_SYSCTL (cfq)); ++ ++ g_object_get (G_OBJECT (cfq), "n_cpu", &cpu, NULL); ++ ++ frequency = (gint) ((gdouble) frequency / 1000); /* Convert back to MHz*/ ++ ++ for (i = 0; i < cpu; i++) { ++ freq_oid = g_strdup_printf ("dev.cpu.%d.freq", i); ++ ++ sysctlbyname (freq_oid, NULL, &len, &frequency, sizeof (frequency)); ++ g_free (freq_oid); ++ } ++} ++ ++ ++static void ++cpufreq_sysctl_setup (CPUFreqSysctl *cfq) ++{ ++ guint cpu; ++ gint fmax, fmin; ++ gint pmax; ++ gint ifreq; ++ gint mib[4]; ++ gchar *governor, *levels; ++ gchar **levelsp, **frpr, **l; ++ size_t len; ++ CPUFreqSysctlPrivate *private; ++ ++ g_return_if_fail (IS_CPUFREQ_SYSCTL (cfq)); ++ ++ private = CPUFREQ_SYSCTL_GET_PRIVATE (cfq); ++ ++ pmax = 100; ++ fmax = 0; ++ fmin = 0; ++ ifreq = 0; ++ ++ private->pmax = pmax; ++ ++ len = sizeof (cpu); ++ ++ if (sysctlbyname ("hw.ncpu", &cpu, &len, NULL, 0) == -1) ++ cpu = 1; ++ ++ len = 4; ++ sysctlnametomib ("dev.cpu.0.freq_levels", mib, &len); ++ len = sizeof (levels); ++ ++ if (sysctl (mib, 4, NULL, &len, NULL, 0) == -1) { ++ g_warning ("Failed to fetch dev.cpu.0.freq_levels"); ++ return; ++ } ++ ++ levels = g_malloc (len); ++ if (sysctl (mib, 4, levels, &len, NULL, 0) == -1) { ++ g_warning ("Failed to fetch data for dev.cpu.0.freq_levels"); ++ return; ++ } ++ ++ levelsp = g_strsplit (levels, " ", 0); ++ g_free (levels); ++ ++ frpr = g_strsplit (levelsp[0], "/", 0); /* MAX */ ++ if (frpr && frpr[0] != NULL) ++ fmax = atoi (frpr[0]); ++ g_strfreev (frpr); ++ ++ for (l = levelsp; l && *l; l++) /* Walk to the last frequency */ ++ ; ++ ++ l --; ++ frpr = g_strsplit (*l, "/", 0); ++ if (frpr && frpr[0] != NULL) ++ fmin = atoi (frpr[0]); ++ ++ g_strfreev (frpr); ++ g_strfreev (levelsp); ++ ++ len = sizeof (ifreq); ++ if (sysctlbyname ("dev.cpu.0.freq", &ifreq, &len, NULL, 0) == -1) { ++ g_warning ("Failed to fetch data for dev.cpu.0.freq"); ++ return; ++ } ++ ++ if (ifreq == fmax) ++ governor = g_strdup ("performance"); ++ else if (ifreq == fmin) ++ governor = g_strdup ("economy"); ++ else ++ governor = g_strdup ("other"); ++ ++ fmax *= 1000; ++ fmin *= 1000; ++ ++ g_object_set (G_OBJECT (cfq), "n_cpu", cpu, ++ "sc_max", fmax, "sc_min", fmin, ++ "governor", governor, NULL); ++ ++ g_free (governor); ++} +--- cpufreq/src/cpufreq-selector/main.c.orig Sun Apr 3 12:03:13 2005 ++++ cpufreq/src/cpufreq-selector/main.c Sun Jul 3 17:16:19 2005 +@@ -17,6 +17,7 @@ + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Authors : Carlos García Campos <carlosgc@gnome.org> ++ * Joe Marcus Clarke <marcus@FreeBSD.org> + */ + + #include <glib-object.h> +@@ -26,6 +27,9 @@ + #include "cpufreq.h" + #include "cpufreq-sysfs.h" + #include "cpufreq-procfs.h" ++#ifdef __FreeBSD__ ++#include "cpufreq-sysctl.h" ++#endif /* __FreeBSD__ */ + + gint + main (gint argc, gchar **argv) +@@ -34,6 +38,9 @@ main (gint argc, gchar **argv) + static gint cpu = 0; + static gchar *governor = NULL; + static gulong frequency = 0; ++#ifdef __FreeBSD__ ++ size_t len; ++#endif /* __FreeBSD__ */ + GError *error = NULL; + CPUFreq *cfq; + +@@ -71,10 +78,15 @@ main (gint argc, gchar **argv) + + g_option_context_free (context); + ++#ifndef __FreeBSD__ + if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.6 kernel */ + cfq = CPUFREQ (cpufreq_sysfs_new ()); + } else if (g_file_test ("/proc/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.4 kernel */ + cfq = CPUFREQ (cpufreq_procfs_new ()); ++#else ++ if (sysctlbyname ("dev.cpu.0.freq", NULL, &len, NULL, 0) == 0) { ++ cfq = CPUFREQ (cpufreq_sysctl_new ()); ++#endif /* __FreeBSD__ */ + } else { + g_print ("No cpufreq support\n"); + return 1; diff --git a/x11/gnome-applets/files/patch-drivemount_drive-button.c b/x11/gnome-applets/files/patch-drivemount_drive-button.c new file mode 100644 index 000000000..98152da4a --- /dev/null +++ b/x11/gnome-applets/files/patch-drivemount_drive-button.c @@ -0,0 +1,59 @@ +--- drivemount/drive-button.c.orig Sun Jul 3 17:18:34 2005 ++++ drivemount/drive-button.c Sun Jul 3 17:23:33 2005 +@@ -24,6 +24,7 @@ + # include <config.h> + #endif + ++#include <string.h> + #include "drive-button.h" + #include <glib/gi18n.h> + #include <gdk/gdkkeysyms.h> +@@ -641,11 +642,13 @@ run_command (DriveButton *self, const ch + + GList *volumes; + GnomeVFSVolume *volume; ++ char *uri; ++ char *mount_path; + + volumes = gnome_vfs_drive_get_mounted_volumes (self->drive); + volume = GNOME_VFS_VOLUME (volumes->data); +- char *uri = gnome_vfs_volume_get_activation_uri (volume); +- char *mount_path = gnome_vfs_get_local_path_from_uri (uri); ++ uri = gnome_vfs_volume_get_activation_uri (volume); ++ mount_path = gnome_vfs_get_local_path_from_uri (uri); + g_free (uri); + + gnome_vfs_drive_get_display_name (self->drive); +@@ -725,6 +728,11 @@ drive_button_ensure_popup (DriveButton * + char *display_name, *tmp, *label; + int action; + GtkWidget *item; ++ GList *volumes; ++ GnomeVFSVolume *volume = NULL; ++ GnomeVFSDeviceType volume_type; ++ GCallback callback; ++ const char *action_icon = GTK_STOCK_OPEN; + + if (self->popup_menu) return; + +@@ -762,9 +770,7 @@ drive_button_ensure_popup (DriveButton * + } + } + +- GList *volumes; +- GnomeVFSVolume *volume = NULL; +- GnomeVFSDeviceType volume_type = device_type; ++ volume_type = device_type; + + volumes = gnome_vfs_drive_get_mounted_volumes (self->drive); + if (volumes != NULL) +@@ -801,8 +807,7 @@ drive_button_ensure_popup (DriveButton * + g_free (display_name); + display_name = tmp; + +- GCallback callback = G_CALLBACK (open_drive); +- const char *action_icon = GTK_STOCK_OPEN; ++ callback = G_CALLBACK (open_drive); + + switch (volume_type) { + case GNOME_VFS_DEVICE_TYPE_VIDEO_DVD: diff --git a/x11/gnome-applets/files/patch-gweather_weather-iwin.c b/x11/gnome-applets/files/patch-gweather_weather-iwin.c new file mode 100644 index 000000000..e43dacef4 --- /dev/null +++ b/x11/gnome-applets/files/patch-gweather_weather-iwin.c @@ -0,0 +1,9 @@ +--- gweather/weather-iwin.c.orig Tue Dec 21 18:42:38 2004 ++++ gweather/weather-iwin.c Tue Dec 21 18:42:47 2004 +@@ -1,5 +1,6 @@ + /* $Id: patch-gweather_weather-iwin.c,v 1.3 2005-07-03 21:35:31 marcus Exp $ */ + ++#include <sys/types.h> + #include <regex.h> + #include <gnome.h> + #include "weather.h" diff --git a/x11/gnome-applets/files/patch-gweather_weather.c b/x11/gnome-applets/files/patch-gweather_weather.c new file mode 100644 index 000000000..cdc1921ab --- /dev/null +++ b/x11/gnome-applets/files/patch-gweather_weather.c @@ -0,0 +1,12 @@ +--- gweather/weather.c.orig Tue Mar 1 04:34:33 2005 ++++ gweather/weather.c Tue Mar 1 12:36:54 2005 +@@ -20,7 +20,9 @@ + #include <string.h> + #include <ctype.h> + #include <math.h> ++#ifndef __FreeBSD__ + #include <values.h> ++#endif + + #ifdef __FreeBSD__ + #include <sys/types.h> diff --git a/x11/gnome-applets/files/patch-modemlights_Makefile.in b/x11/gnome-applets/files/patch-modemlights_Makefile.in new file mode 100644 index 000000000..874884722 --- /dev/null +++ b/x11/gnome-applets/files/patch-modemlights_Makefile.in @@ -0,0 +1,10 @@ +--- modemlights/Makefile.in.orig Fri Jan 14 00:08:52 2005 ++++ modemlights/Makefile.in Fri Jan 14 00:09:20 2005 +@@ -319,6 +319,7 @@ + modem_applet_LDADD = \ + $(GNOME_APPLETS_LIBS) \ + $(LIBGLADE_LIBS) \ ++ -lutil \ + $(MODEMLIGHTS_LIBS) + + uidir = $(datadir)/gnome-2.0/ui diff --git a/x11/gnome-applets/files/patch-modemlights_modem-applet.c b/x11/gnome-applets/files/patch-modemlights_modem-applet.c new file mode 100644 index 000000000..f4fb13717 --- /dev/null +++ b/x11/gnome-applets/files/patch-modemlights_modem-applet.c @@ -0,0 +1,22 @@ +--- modemlights/modem-applet.c.orig Fri Jan 14 00:06:52 2005 ++++ modemlights/modem-applet.c Fri Jan 14 00:08:28 2005 +@@ -24,12 +24,19 @@ + + #include <panel-applet.h> + #include <fcntl.h> ++#ifndef __FreeBSD__ + #include <pty.h> ++#endif + #include <sys/poll.h> + #include <sys/types.h> + #include <sys/wait.h> + #include <libxml/tree.h> + #include <glade/glade.h> ++#ifdef __FreeBSD__ ++#include <sys/ioctl.h> ++#include <termios.h> ++#include <libutil.h> ++#endif + + #include "modem-applet.h" + |