pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

i3-git: Enable logging and SHM support.



Module Name:	pkgsrc-wip
Committed By:	Mateusz Poszwa <old4%o2.pl@localhost>
Pushed By:	f8l
Date:		Tue Feb 9 17:05:30 2016 +0100
Changeset:	f566732a5e095903cc8532beafa9daeea21cf2b2

Modified Files:
	i3-git/Makefile
	i3-git/PLIST
	i3-git/distinfo
	i3-git/patches/patch-src_log.c
Removed Files:
	i3-git/patches/patch-Makefile
	i3-git/patches/patch-src_main.c

Log Message:
i3-git: Enable logging and SHM support.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f566732a5e095903cc8532beafa9daeea21cf2b2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 i3-git/Makefile                 |  7 +++---
 i3-git/PLIST                    |  1 +
 i3-git/distinfo                 |  4 +---
 i3-git/patches/patch-Makefile   | 12 -----------
 i3-git/patches/patch-src_log.c  | 48 +++++++++++++++++------------------------
 i3-git/patches/patch-src_main.c | 27 -----------------------
 6 files changed, 26 insertions(+), 73 deletions(-)

diffs:
diff --git a/i3-git/Makefile b/i3-git/Makefile
index f4d04db..6354d72 100644
--- a/i3-git/Makefile
+++ b/i3-git/Makefile
@@ -30,12 +30,12 @@ CONF_FILES=	${EGDIR}/config ${PKG_SYSCONFDIR}/config
 CONF_FILES+=	${EGDIR}/config.keycodes ${PKG_SYSCONFDIR}/config.keycodes
 
 MAKE_ENV+=	SYSCONFDIR=${PKG_SYSCONFDIR:C/\/i3//}
-MAKE_ENV+=	DEBUG=0
-MAKE_ENV+=	SHM_SUPPORT=0
+#MAKE_ENV+=	DEBUG=0
+#MAKE_ENV+=	SHM_SUPPORT=0
 MAKE_ENV+=	VERSION=${VERSION}
 
 REPLACE_PERL+=	i3-dmenu-desktop
-REPLACE_PERL+=	i3-migrate-config-to-v4 
+REPLACE_PERL+=	i3-migrate-config-to-v4
 REPLACE_PERL+=	i3-save-tree
 
 SUBST_CLASSES+=		conf
@@ -65,6 +65,7 @@ post-install:
 .include "../../x11/libXcursor/buildlink3.mk"
 .include "../../x11/startup-notification/buildlink3.mk"
 
+.include "../../mk/pthread.buildlink3.mk"
 .include "../../sysutils/desktop-file-utils/desktopdb.mk"
 .include "../../wip/mk/git-package.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/i3-git/PLIST b/i3-git/PLIST
index 1301fcb..b8701fd 100644
--- a/i3-git/PLIST
+++ b/i3-git/PLIST
@@ -2,6 +2,7 @@
 bin/i3
 bin/i3-config-wizard
 bin/i3-dmenu-desktop
+bin/i3-dump-log
 bin/i3-input
 bin/i3-migrate-config-to-v4
 bin/i3-msg
diff --git a/i3-git/distinfo b/i3-git/distinfo
index af99f3f..dc44c30 100644
--- a/i3-git/distinfo
+++ b/i3-git/distinfo
@@ -1,6 +1,4 @@
 $NetBSD: distinfo,v 1.9 2015/11/09 11:05:44 nros Exp $
 
-SHA1 (patch-Makefile) = 919f0e87efa951bde531b9172b74589d3e1c474a
-SHA1 (patch-src_log.c) = 75ac4d0681d114e0343ddb015292c6c8ee81c1ae
-SHA1 (patch-src_main.c) = c03fcb12d404fcdfd14c1892b771ee0c7a86b39d
 SHA1 (patch-common.mk) = a9d3fc1a6f242f2ec98b81b8bfdd748925aa4c14
+SHA1 (patch-src_log.c) = 3b70d5be029936e02bb2e5beddf2cd7d6adc7328
diff --git a/i3-git/patches/patch-Makefile b/i3-git/patches/patch-Makefile
deleted file mode 100644
index 4e6434b..0000000
--- a/i3-git/patches/patch-Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-Makefile,v 1.1.1.1 2013/02/12 23:25:35 tonnerre Exp $
-
---- Makefile.orig	2012-11-25 16:04:42.000000000 +0000
-+++ Makefile
-@@ -18,7 +18,6 @@ include i3-msg/i3-msg.mk
- include i3-input/i3-input.mk
- include i3-nagbar/i3-nagbar.mk
- include i3bar/i3bar.mk
--include i3-dump-log/i3-dump-log.mk
- include docs/docs.mk
- include man/man.mk
- 
diff --git a/i3-git/patches/patch-src_log.c b/i3-git/patches/patch-src_log.c
index 0f9b231..e5f02be 100644
--- a/i3-git/patches/patch-src_log.c
+++ b/i3-git/patches/patch-src_log.c
@@ -1,35 +1,27 @@
 $NetBSD: patch-src_log.c,v 1.3 2014/08/09 19:14:01 degroote Exp $
 
-NetBSD does not support shm_open (3), disable the code in this case
+Use ftruncate(2) instead of posix_fallocate(2) on NetBSD.
+Do not set process-shared attribute on NetBSD.
 
---- src/log.c.orig	2014-06-15 17:12:43.000000000 +0000
-+++ src/log.c	2014-08-09 20:52:23.000000000 +0000
-@@ -108,6 +108,7 @@
-          * For 512 MiB of RAM this will lead to a 5 MiB log buffer.
-          * At the moment (2011-12-10), no testcase leads to an i3 log
-          * of more than ~ 600 KiB. */
-+#if !defined(__NetBSD__)
-     long long physical_mem_bytes;
- #if defined(__APPLE__)
-     int mib[2] = {CTL_HW, HW_MEMSIZE};
-@@ -163,6 +164,7 @@
-     logwalk = logbuffer + sizeof(i3_shmlog_header);
-     loglastwrap = logbuffer + logbuffer_size;
-     store_log_markers();
-+#endif /* !defined(__NetBSD__) */
- }
+--- src/log.c.orig	2016-01-11 23:36:55.000000000 +0000
++++ src/log.c
+@@ -129,7 +129,7 @@ void open_logbuffer(void) {
+         return;
+     }
  
- /*
-@@ -170,10 +172,12 @@
-  *
-  */
- void close_logbuffer(void) {
+-#if defined(__OpenBSD__) || defined(__APPLE__)
++#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+     if (ftruncate(logbuffer_shm, logbuffer_size) == -1) {
+         fprintf(stderr, "Could not ftruncate SHM segment for the i3 log: %s\n", strerror(errno));
+ #else
+@@ -156,8 +156,10 @@ void open_logbuffer(void) {
+ 
+     pthread_condattr_t cond_attr;
+     pthread_condattr_init(&cond_attr);
 +#if !defined(__NetBSD__)
-     close(logbuffer_shm);
-     shm_unlink(shmlogname);
-     logbuffer = NULL;
-     shmlogname = "";
+     if (pthread_condattr_setpshared(&cond_attr, PTHREAD_PROCESS_SHARED) != 0)
+         fprintf(stderr, "pthread_condattr_setpshared() failed, i3-dump-log -f will not work!\n");
 +#endif
- }
+     pthread_cond_init(&(header->condvar), &cond_attr);
  
- /*
+     logwalk = logbuffer + sizeof(i3_shmlog_header);
diff --git a/i3-git/patches/patch-src_main.c b/i3-git/patches/patch-src_main.c
deleted file mode 100644
index 7e6eea7..0000000
--- a/i3-git/patches/patch-src_main.c
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-src_main.c,v 1.1.1.1 2013/02/12 23:25:35 tonnerre Exp $
-
---- src/main.c.orig	2012-12-11 23:08:17.000000000 +0000
-+++ src/main.c
-@@ -218,12 +218,6 @@ static void i3_exit(void) {
- #if EV_VERSION_MAJOR >= 4
-     ev_loop_destroy(main_loop);
- #endif
--
--    if (*shmlogname != '\0') {
--        fprintf(stderr, "Closing SHM log \"%s\"\n", shmlogname);
--        fflush(stderr);
--        shm_unlink(shmlogname);
--    }
- }
- 
- /*
-@@ -233,9 +227,6 @@ static void i3_exit(void) {
-  *
-  */
- static void handle_signal(int sig, siginfo_t *info, void *data) {
--    if (*shmlogname != '\0') {
--        shm_unlink(shmlogname);
--    }
-     raise(sig);
- }
- 


Home | Main Index | Thread Index | Old Index