[93334] users/cal/ports/x11/herbstluftwm

cal at macports.org cal at macports.org
Sun May 20 07:19:18 PDT 2012


Revision: 93334
          https://trac.macports.org/changeset/93334
Author:   cal at macports.org
Date:     2012-05-20 07:19:17 -0700 (Sun, 20 May 2012)
Log Message:
-----------
herbstluftwm: update to 0.3

Modified Paths:
--------------
    users/cal/ports/x11/herbstluftwm/Portfile
    users/cal/ports/x11/herbstluftwm/files/config.patch

Added Paths:
-----------
    users/cal/ports/x11/herbstluftwm/files/0001-Use-clock_get_time-on-systems-with-a-mach-kernel.patch

Modified: users/cal/ports/x11/herbstluftwm/Portfile
===================================================================
--- users/cal/ports/x11/herbstluftwm/Portfile	2012-05-20 14:05:00 UTC (rev 93333)
+++ users/cal/ports/x11/herbstluftwm/Portfile	2012-05-20 14:19:17 UTC (rev 93334)
@@ -4,7 +4,7 @@
 PortSystem              1.0
 
 name                    herbstluftwm
-version                 0.1
+version                 0.3
 categories              x11 x11-wm
 platforms               darwin
 license                 BSD
@@ -24,12 +24,18 @@
     USERWM=${prefix}/bin/herbstluftwm"
 
 homepage                http://wwwcip.cs.fau.de/~re06huxa/herbstluftwm/
-fetch.type              git
-git.url                 git://git.cs.fau.de/re06huxa/herbstluftwm
-git.branch              v${version}
+master_sites            ${homepage}/tarballs/
 
-patchfiles              config.patch
+checksums               rmd160  056efcf0e2091b479f8b2a04eb3d7d1b72645cda \
+                        sha256  219ceb2066515a2cfb68430e86306071c25135771efb33168849334761caa8b0
 
+livecheck.type          regex
+livecheck.url           ${master_sites}
+livecheck.regex         ${name}-(\[0-9\]+(\\.\[0-9\]+)*)\\${extract.suffix}
+
+patchfiles              config.patch \
+                        0001-Use-clock_get_time-on-systems-with-a-mach-kernel.patch
+
 depends_build           bin:a2x:asciidoc
 
 depends_lib             path:lib/pkgconfig/glib-2.0.pc:glib2 \

Added: users/cal/ports/x11/herbstluftwm/files/0001-Use-clock_get_time-on-systems-with-a-mach-kernel.patch
===================================================================
--- users/cal/ports/x11/herbstluftwm/files/0001-Use-clock_get_time-on-systems-with-a-mach-kernel.patch	                        (rev 0)
+++ users/cal/ports/x11/herbstluftwm/files/0001-Use-clock_get_time-on-systems-with-a-mach-kernel.patch	2012-05-20 14:19:17 UTC (rev 93334)
@@ -0,0 +1,100 @@
+From bae6fa9479e079a04af752d3c52446ceebbdc3cd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Thorsten=20Wi=C3=9Fmann?= <edu at thorsten-wissmann.de>
+Date: Sun, 20 May 2012 15:58:01 +0200
+Subject: [PATCH] Use clock_get_time on systems with a mach-kernel
+
+---
+ src/rules.c |    9 ++-------
+ src/utils.c |   28 ++++++++++++++++++++++++++++
+ src/utils.h |    2 ++
+ 4 Dateien geändert, 34 Zeilen hinzugefügt(+), 7 Zeilen entfernt(-)
+
+diff --git src/rules.c src/rules.c
+index 04ccaf2..640c1da 100644
+--- src/rules.c
++++ src/rules.c
+@@ -11,7 +11,6 @@
+ #include "ipc-protocol.h"
+ 
+ #include <glib.h>
+-#include <time.h>
+ #include <string.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+@@ -220,9 +219,7 @@ void consequence_destroy(HSConsequence* cons) {
+ HSRule* rule_create() {
+     HSRule* rule = g_new0(HSRule, 1);
+     rule->once = false;
+-    struct timespec t;
+-    clock_gettime(CLOCK_MONOTONIC, &t);
+-    rule->birth_time = t.tv_sec;
++    rule->birth_time = get_monotonic_timestamp();
+     return rule;
+ }
+ 
+@@ -510,9 +507,7 @@ bool condition_pid(HSCondition* rule, HSClient* client) {
+ }
+ 
+ bool condition_maxage(HSCondition* rule, HSClient* client) {
+-    struct timespec cur;
+-    clock_gettime(CLOCK_MONOTONIC, &cur);
+-    time_t diff = cur.tv_sec - g_current_rule_birth_time;
++    time_t diff = get_monotonic_timestamp() - g_current_rule_birth_time;
+     return (rule->value.integer >= diff);
+ }
+ 
+diff --git src/utils.c src/utils.c
+index 171bd97..e7c7dee 100644
+--- src/utils.c
++++ src/utils.c
+@@ -18,6 +18,34 @@
+ #include <glib.h>
+ 
+ 
++
++#include <time.h>
++#include <sys/time.h>
++
++#ifdef __MACH__
++#include <mach/clock.h>
++#include <mach/mach.h>
++#endif
++
++
++
++
++time_t get_monotonic_timestamp() {
++    struct timespec ts;
++#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
++    clock_serv_t cclock;
++    mach_timespec_t mts;
++    host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
++    clock_get_time(cclock, &mts);
++    mach_port_deallocate(mach_task_self(), cclock);
++    ts.tv_sec = mts.tv_sec;
++    ts.tv_nsec = mts.tv_nsec;
++#else
++    clock_gettime(CLOCK_REALTIME, &ts);
++#endif
++    return ts.tv_sec;
++}
++
+ /// print a printf-like message to stderr and exit
+ // from dwm.c
+ void die(const char *errstr, ...) {
+diff --git src/utils.h src/utils.h
+index f6c19ed..99412dc 100644
+--- src/utils.h
++++ src/utils.h
+@@ -41,6 +41,8 @@ bool string_to_bool(char* string, bool oldvalue);
+ 
+ char* strlasttoken(char* str, char* delim);
+ 
++time_t get_monotonic_timestamp();
++
+ // duplicates an argument-vector
+ char** argv_duplicate(int argc, char** argv);
+ // frees all entrys in argument-vector and then the vector itself
+-- 
+1.7.10.2
+

Modified: users/cal/ports/x11/herbstluftwm/files/config.patch
===================================================================
--- users/cal/ports/x11/herbstluftwm/files/config.patch	2012-05-20 14:05:00 UTC (rev 93333)
+++ users/cal/ports/x11/herbstluftwm/files/config.patch	2012-05-20 14:19:17 UTC (rev 93334)
@@ -1,5 +1,5 @@
---- config.mk.orig	2011-10-09 21:06:21.000000000 +0200
-+++ config.mk	2011-10-09 21:56:01.000000000 +0200
+--- config.mk.orig	2012-03-27 14:18:22.000000000 +0200
++++ config.mk	2012-05-15 21:49:15.000000000 +0200
 @@ -1,7 +1,7 @@
  
  # paths
@@ -10,7 +10,7 @@
  
  INCS = -Isrc/ -I/usr/include -I${X11INC}  `pkg-config --cflags glib-2.0`
  LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 `pkg-config --libs glib-2.0`
-@@ -9,13 +9,13 @@
+@@ -13,13 +13,13 @@
  # FLAGS
  LD = gcc
  CC = gcc
@@ -21,8 +21,8 @@
      -D HERBSTLUFT_VERSION_MAJOR=$(VERSION_MAJOR) \
      -D HERBSTLUFT_VERSION_MINOR=$(VERSION_MINOR)
  CFLAGS += $(VERSIONFLAGS)
--LDFLAGS = -g ${LIBS}
-+LDFLAGS = -g ${LIBS} ${EXTRALDFLAGS}
- PREFIX = ./build
+-LDFLAGS = -g
++LDFLAGS = -g ${EXTRALDFLAGS}
+ INSTALLDIR = /
+ PREFIX = $(INSTALLDIR)/usr/
  BINDIR = $(PREFIX)/bin
- SHAREDIR = $(PREFIX)/share
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120520/b58886ce/attachment.html>


More information about the macports-changes mailing list