View | Details | Raw Unified | Return to bug 224202
Collapse All | Expand All

(-)b/x11-toolkits/wlc/Makefile (-6 / +5 lines)
Lines 1-7 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	wlc
3
PORTNAME=	wlc
4
PORTVERSION=	0.0.8
4
PORTVERSION=	0.0.10
5
PORTREVISION=	1
5
PORTREVISION=	1
6
CATEGORIES=	x11-toolkits wayland
6
CATEGORIES=	x11-toolkits wayland
7
7
Lines 9-16 MAINTAINER= x11@FreeBSD.org Link Here
9
COMMENT=	Wayland compositor library
9
COMMENT=	Wayland compositor library
10
10
11
LICENSE=	MIT
11
LICENSE=	MIT
12
LICENSE_FILES=	${WRKSRC}/LISENSE
12
LICENSE_FILES=	${WRKSRC}/LICENSE
13
13
14
RUN_DEPENDS=	xkeyboard-config>=0:x11/xkeyboard-config
14
BUILD_DEPENDS=	wayland-protocols>=0:graphics/wayland-protocols
15
BUILD_DEPENDS=	wayland-protocols>=0:graphics/wayland-protocols
15
LIB_DEPENDS=	libxkbcommon.so:x11/libxkbcommon \
16
LIB_DEPENDS=	libxkbcommon.so:x11/libxkbcommon \
16
		libxcb-ewmh.so:x11/xcb-util-wm \
17
		libxcb-ewmh.so:x11/xcb-util-wm \
Lines 20-33 LIB_DEPENDS= libxkbcommon.so:x11/libxkbcommon \ Link Here
20
		libinput.so:x11/libinput \
21
		libinput.so:x11/libinput \
21
		libxcb-image.so:x11/xcb-util-image
22
		libxcb-image.so:x11/xcb-util-image
22
23
23
RUN_DEPENDS=	xkeyboard-config>=0:x11/xkeyboard-config
24
25
USE_GITHUB=	yes
24
USE_GITHUB=	yes
26
GH_ACCOUNT=	cloudef
25
GH_ACCOUNT=	cloudef
27
GH_TAGNAME=	fa780ce
26
GH_TAGNAME=	v0.0.10
28
GH_TUPLE=	cloudef:chck:3f27d2a:chck
27
GH_TUPLE=	cloudef:chck:3f27d2a:chck
29
28
30
USES=		cmake gnome localbase pkgconfig pathfix
29
USES=		cmake gnome localbase pkgconfig
31
USE_XORG=	pixman x11 xcb xcursor xfixes
30
USE_XORG=	pixman x11 xcb xcursor xfixes
32
USE_GL=		egl gbm glesv2
31
USE_GL=		egl gbm glesv2
33
USE_GNOME=	cairo
32
USE_GNOME=	cairo
(-)b/x11-toolkits/wlc/distinfo (-3 / +3 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1488036711
1
TIMESTAMP = 1507979369
2
SHA256 (cloudef-wlc-0.0.8-fa780ce_GH0.tar.gz) = bf22b99b52cc2fb4ecc27da90ee47f516f8d5d1a02afdc495488c14d01788bc8
2
SHA256 (cloudef-wlc-0.0.10-v0.0.10_GH0.tar.gz) = 4f806cc695eebfb5c18297563427836c0997900bedc3011a5e7a99efb4000ac3
3
SIZE (cloudef-wlc-0.0.8-fa780ce_GH0.tar.gz) = 120603
3
SIZE (cloudef-wlc-0.0.10-v0.0.10_GH0.tar.gz) = 136429
4
SHA256 (cloudef-chck-3f27d2a_GH0.tar.gz) = fa3765dbaad52e968aae8b9a06a8ace24fab0d9ca53cc08a1f5543ff33959ebd
4
SHA256 (cloudef-chck-3f27d2a_GH0.tar.gz) = fa3765dbaad52e968aae8b9a06a8ace24fab0d9ca53cc08a1f5543ff33959ebd
5
SIZE (cloudef-chck-3f27d2a_GH0.tar.gz) = 119955
5
SIZE (cloudef-chck-3f27d2a_GH0.tar.gz) = 119955
(-)a/x11-toolkits/wlc/files/patch-src_session_fd.c (-48 lines)
Removed Link Here
1
--- src/session/fd.c.orig	2016-08-19 13:28:50 UTC
2
+++ src/session/fd.c
3
@@ -10,7 +10,9 @@
4
 #include <sys/select.h>
5
 #include <sys/socket.h>
6
 #include <sys/types.h>
7
+#if !defined(__FreeBSD__)
8
 #include <linux/major.h>
9
+#endif
10
 #include <xf86drm.h>
11
 #include "internal.h"
12
 #include "macros.h"
13
@@ -135,7 +137,7 @@ recv_fd(int sock, int *out_fd, void *out
14
       return read;
15
 
16
    if (message.msg_controllen == 0)
17
-   	  return read;
18
+      return read;
19
 
20
    if (!(cmsg = CMSG_FIRSTHDR(&message)))
21
       return read;
22
@@ -171,6 +173,7 @@ fd_open(const char *path, int flags, enu
23
    }
24
 
25
    /* we will only open allowed paths */
26
+#if !defined(__FreeBSD__)
27
 #define FILTER(x, m) { x, (sizeof(x) > 32 ? 32 : sizeof(x)) - 1, m }
28
    static struct {
29
       const char *base;
30
@@ -186,14 +189,15 @@ fd_open(const char *path, int flags, enu
31
       wlc_log(WLC_LOG_WARN, "Denying open from: %s", path);
32
       return -1;
33
    }
34
+#endif
35
 
36
    struct stat st;
37
    if (stat(path, &st) < 0)
38
-	  return -1;
39
+      return -1;
40
 
41
-#ifdef __linux__
42
+#if !defined(__FreeBSD__)
43
    if (major(st.st_rdev) != allow[type].major)
44
-   	  return -1;
45
+      return -1;
46
 #endif
47
 
48
    int fd;
(-)a/x11-toolkits/wlc/files/patch-src_session_tty.c (-165 lines)
Removed Link Here
1
--- src/session/tty.c.orig	2016-08-19 13:28:50 UTC
2
+++ src/session/tty.c
3
@@ -9,27 +9,18 @@
4
 #include "internal.h"
5
 #include "tty.h"
6
 
7
-#if defined(__linux__)
8
-#  define TTY_BASENAME "/dev/tty"
9
-#  define TTY_0        "/dev/tty0"
10
-#  include <linux/kd.h>
11
-#  include <linux/major.h>
12
-#  include <linux/vt.h>
13
-#elif defined(__FreeBSD__)
14
+#if defined(__FreeBSD__)
15
+#  include <termios.h>
16
 #  include <sys/consio.h>
17
 #  include <sys/kbio.h>
18
 #  define TTY_BASENAME    "/dev/ttyv"
19
 #  define TTY_0           "/dev/ttyv0"
20
-#  define TTY_MAJOR       0
21
-#  define VT_GETSTATE	  0x5603
22
-#  define VT_ACTIVATE	  0x5606
23
-#  define K_UNICODE       0x03
24
-#  define K_OFF           0x04
25
-struct vt_stat {
26
-    unsigned short v_active;    /* active vt */
27
-    unsigned short v_signal;	/* signal to send */
28
-    unsigned short v_state;	/* vt bitmask */
29
-};
30
+#else
31
+#  include <linux/kd.h>
32
+#  include <linux/major.h>
33
+#  include <linux/vt.h>
34
+#  define TTY_BASENAME "/dev/tty"
35
+#  define TTY_0        "/dev/tty0"
36
 #endif
37
 
38
 #ifndef KDSKBMUTE
39
@@ -100,22 +91,22 @@ open_tty(int vt)
40
 }
41
 
42
 static bool
43
-setup_tty(int fd, bool replace_vt)
44
+setup_tty(int fd, int vt, bool replace_vt)
45
 {
46
    if (fd < 0)
47
       return false;
48
 
49
+#if defined(__FreeBSD__)
50
+   wlc.vt = vt+1;
51
+#else
52
    struct stat st;
53
    if (fstat(fd, &st) == -1)
54
       die("Could not stat tty fd");
55
-
56
    wlc.vt = minor(st.st_rdev);
57
-
58
    if (major(st.st_rdev) != TTY_MAJOR || wlc.vt == 0)
59
       die("Not a valid vt");
60
+#endif
61
 
62
-/* FreeBSD's new vt is still missing some bits */
63
-#if defined(__linux__)
64
    if (!replace_vt) {
65
       int kd_mode;
66
       if (ioctl(fd, KDGETMODE, &kd_mode) == -1)
67
@@ -125,18 +116,20 @@ setup_tty(int fd, bool replace_vt)
68
          die("vt%d is already in graphics mode (%d). Is another display server running?", wlc.vt, kd_mode);
69
    }
70
 
71
+#if defined(__FreeBSD__)
72
+   ioctl(fd, VT_GETACTIVE, &wlc.old_state.vt);
73
+#else
74
    struct vt_stat state;
75
    if (ioctl(fd, VT_GETSTATE, &state) == -1)
76
       die("Could not get current vt");
77
-
78
    wlc.old_state.vt = state.v_active;
79
+#endif
80
 
81
    if (ioctl(fd, VT_ACTIVATE, wlc.vt) == -1)
82
       die("Could not activate vt%d", wlc.vt);
83
 
84
    if (ioctl(fd, VT_WAITACTIVE, wlc.vt) == -1)
85
       die("Could not wait for vt%d to become active", wlc.vt);
86
-#endif
87
 
88
    if (ioctl(fd, KDGKBMODE, &wlc.old_state.kb_mode) == -1)
89
       die("Could not get keyboard mode");
90
@@ -144,7 +137,19 @@ setup_tty(int fd, bool replace_vt)
91
    // vt will be restored from now on
92
    wlc.tty = fd;
93
 
94
-#if defined(__linux__)
95
+#if defined(__FreeBSD__)
96
+   if (ioctl(fd, KDSKBMODE, K_CODE) == -1) {
97
+      wlc_tty_terminate();
98
+      die("Could not set keyboard mode to K_CODE");
99
+   }
100
+   /* Put the tty into raw mode */
101
+   struct termios tios;
102
+   if (tcgetattr(fd, &tios))
103
+      die("Failed to get terminal attribute");
104
+   cfmakeraw(&tios);
105
+   if (tcsetattr(fd, TCSANOW, &tios))
106
+      die("Failed to set terminal attribute");
107
+#else
108
    if (ioctl(fd, KDSKBMUTE, 1) == -1 && ioctl(fd, KDSKBMODE, K_OFF) == -1) {
109
       wlc_tty_terminate();
110
       die("Could not set keyboard mode to K_OFF");
111
@@ -156,18 +161,19 @@ setup_tty(int fd, bool replace_vt)
112
       die("Could not set console mode to KD_GRAPHICS");
113
    }
114
 
115
-#if defined(__linux__)
116
    struct vt_mode mode = {
117
       .mode = VT_PROCESS,
118
       .relsig = SIGUSR1,
119
       .acqsig = SIGUSR2
120
    };
121
+#if defined(__FreeBSD__)
122
+   mode.frsig = SIGIO; /* not used, but has to be set anyway */
123
+#endif
124
 
125
    if (ioctl(fd, VT_SETMODE, &mode) == -1) {
126
       wlc_tty_terminate();
127
       die("Could not set vt%d mode", wlc.vt);
128
    }
129
-#endif
130
 
131
    return true;
132
 }
133
@@ -230,13 +236,19 @@ wlc_tty_terminate(void)
134
       // The ACTIVATE / WAITACTIVE may be potentially bad here.
135
       // However, we need to make sure the vt we initially opened is also active on cleanup.
136
       // We can't make sure this is synchronized due to unclean exits.
137
+
138
       if (ioctl(wlc.tty, VT_ACTIVATE, wlc.vt) != -1 && ioctl(wlc.tty, VT_WAITACTIVE, wlc.vt) != -1) {
139
          wlc_log(WLC_LOG_INFO, "Restoring vt %d (0x%lx) (fd %d)", wlc.vt, wlc.old_state.kb_mode, wlc.tty);
140
 
141
-         if (ioctl(wlc.tty, KDSKBMUTE, 0) == -1 &&
142
-             ioctl(wlc.tty, KDSKBMODE, wlc.old_state.kb_mode) == -1 &&
143
-             ioctl(wlc.tty, KDSKBMODE, K_UNICODE) == -1)
144
-            wlc_log(WLC_LOG_ERROR, "Failed to restore vt%d KDSKMODE", wlc.vt);
145
+#if defined(__FreeBSD__)
146
+         if (ioctl(wlc.tty, KDSKBMODE, wlc.old_state.kb_mode) == -1 &&
147
+             ioctl(wlc.tty, KDSKBMODE, K_XLATE) == -1)
148
+#else
149
+            if (ioctl(wlc.tty, KDSKBMUTE, 0) == -1 &&
150
+                ioctl(wlc.tty, KDSKBMODE, wlc.old_state.kb_mode) == -1 &&
151
+                ioctl(wlc.tty, KDSKBMODE, K_UNICODE) == -1)
152
+#endif
153
+               wlc_log(WLC_LOG_ERROR, "Failed to restore vt%d KDSKMODE", wlc.vt);
154
 
155
          if (ioctl(wlc.tty, KDSETMODE, KD_TEXT) == -1)
156
             wlc_log(WLC_LOG_ERROR, "Failed to restore vt%d mode to VT_AUTO", wlc.vt);
157
@@ -271,7 +283,7 @@ wlc_tty_init(int vt)
158
    if (!vt && !(vt = find_vt(getenv("XDG_VTNR"), &replace_vt)))
159
       die("Could not find vt");
160
 
161
-   if (!setup_tty(open_tty(vt), replace_vt))
162
+   if (!setup_tty(open_tty(vt), vt, replace_vt))
163
       die("Could not open tty with vt%d", vt);
164
 
165
    struct sigaction action = {
(-)b/x11-toolkits/wlc/pkg-plist (-1 / +1 lines)
Lines 5-9 include/wlc/wlc-wayland.h Link Here
5
include/wlc/wlc.h
5
include/wlc/wlc.h
6
lib/libwlc.so
6
lib/libwlc.so
7
lib/libwlc.so.0
7
lib/libwlc.so.0
8
lib/libwlc.so.0.0.5
8
lib/libwlc.so.0.0.9
9
libdata/pkgconfig/wlc.pc
9
libdata/pkgconfig/wlc.pc

Return to bug 224202