summaryrefslogtreecommitdiff
path: root/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c
diff options
context:
space:
mode:
authorKoop Mast <kwm@FreeBSD.org>2014-11-19 11:49:04 +0000
committerKoop Mast <kwm@FreeBSD.org>2014-11-19 11:49:04 +0000
commitaf3811313c14afb06fe2d1f6158e3e431bbfc2b6 (patch)
tree1ad98a4e8faecd0e2fa9ac2c18e65da4cf89c236 /x11/gnome-applets/files/patch-battstat_acpi-freebsd.c
parentCleanup the @dirrm (diff)
The FreeBSD GNOME team proudly presents GNOME 3.14 and Cinnamon 2.2.
Gnome 3.14.1 and Cinnamon 2.2.16 are supported on FreeBSD 9.3-RELEASE and up. This commit removes the old GNOME 2 desktop, bindings and some ports that can't be compiled. A few ports where updated to more recent versions to allow them to compile with this update. Apart from updating ports to newer versions GDM is more integrated with gnome-shell now, and handles several things for the GNOME desktop such as screen locking. If you want to use GNOME 3 via startx, you will have to add your own lock screen/screensaver. For example xscreensaver can be used for sessions started without GDM. Shell Extensions can be installed via https://extensions.gnome.org/ , we have ported a few that can't be installed via this way. The old gnome-utils and gnome-games ports where split up into single ports and where converted to meta-ports. gnome-terminal requires a UTF-8 locale to run, gdm handles this already, but if you use startx you need to do this yourself. Upgrade instructions: Delete the old and conflicting packages: # pkg delete clutter gnome-utils gnome-panel gnome-keyring vala-vapigen \ guile gcalctool gnome-media libgnomekbd # pkg delete gnome-screensaver gnome-applets bug-buddy evolution-exchange \ evolution-webcal gnome-system-tools seahorse-plugins gnome-control-center For package users the following lines will be enough: # pkg upgrade # pkg install gnome3 For ports users should do the following: # portmaster -a # portmaster x11/gnome3 We are currently aware of two issues. The first issue is a bug in the file monitoring code in the glib20 port. This bug causes glib programs to crash when files in a monitored directory are added or removed. Upstream is aware of the problem, but since the problem is quite complex there is no solution yet. This problem isn't restricted to BSD. The second issue is that on certain video cards totem will display a purple/pink overlay on the video. It not clear yet where the issues comes from. Major thanks goes to Gustau Perez for being a driving force behind getting GNOME 3 up to speed again. Also thanks to Antoine Brodin for running the exp-runs. This update was also made possible by: Joe Maloney Kris Moore Beeblebrox Ryan Lortie Antoine Jacoutot and everyone I missed
Notes
Notes: svn path=/head/; revision=372768
Diffstat (limited to 'x11/gnome-applets/files/patch-battstat_acpi-freebsd.c')
-rw-r--r--x11/gnome-applets/files/patch-battstat_acpi-freebsd.c152
1 files changed, 0 insertions, 152 deletions
diff --git a/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c
deleted file mode 100644
index 48746fa03bbd..000000000000
--- a/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c
+++ /dev/null
@@ -1,152 +0,0 @@
---- 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