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

(-)libcec/Makefile (-5 / +11 lines)
Lines 2-9 Link Here
2
# $FreeBSD: head/multimedia/libcec/Makefile 342445 2014-02-03 13:57:46Z miwi $
2
# $FreeBSD: head/multimedia/libcec/Makefile 342445 2014-02-03 13:57:46Z miwi $
3
3
4
PORTNAME=	libcec
4
PORTNAME=	libcec
5
PORTVERSION=	2.1.3
5
PORTVERSION=	2.1.4
6
PORTREVISION=	1
7
CATEGORIES=	multimedia
6
CATEGORIES=	multimedia
8
MASTER_SITES=	GH
7
MASTER_SITES=	GH
9
8
Lines 15-28 Link Here
15
14
16
USE_GITHUB=	yes
15
USE_GITHUB=	yes
17
GH_ACCOUNT=	Pulse-Eight
16
GH_ACCOUNT=	Pulse-Eight
18
GH_COMMIT=	54be21e
17
GH_COMMIT=	81e3821
19
GH_TAGNAME=	${PORTNAME}-${PORTVERSION}
18
GH_TAGNAME=	${PORTNAME}-${PORTVERSION}-repack
20
19
21
USES=		pathfix pkgconfig
20
USES=		pathfix pkgconfig libtool
22
PATHFIX_MAKEFILEIN=Makefile.am
21
PATHFIX_MAKEFILEIN=Makefile.am
23
USE_AUTOTOOLS=	aclocal autoheader automake autoconf libtoolize
22
USE_AUTOTOOLS=	aclocal autoheader automake autoconf libtoolize
24
ACLOCAL_ARGS=	-I.
23
ACLOCAL_ARGS=	-I.
25
AUTOMAKE_ARGS=	--add-missing
24
AUTOMAKE_ARGS=	--add-missing
26
USE_LDCONFIG=	yes
25
USE_LDCONFIG=	yes
27
26
27
post-patch:
28
	${REINPLACE_CMD} 's;-Wno-psabi;;' ${WRKSRC}/configure.ac
29
30
post-install:
31
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libcec.so.2
32
	@${CAT} ${PKGMESSAGE}
33
28
.include <bsd.port.mk>
34
.include <bsd.port.mk>
(-)libcec/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (libcec-2.1.3.tar.gz) = 2aa88451b528184b02077ee8c6cd10e2f89121a6a05b1b35b4b792b03108a9d1
1
SHA256 (libcec-2.1.4.tar.gz) = b8e869cc16a5c73a0da4443911cfd0e931f17324bdaad8210b0de085db0573ea
2
SIZE (libcec-2.1.3.tar.gz) = 1087121
2
SIZE (libcec-2.1.4.tar.gz) = 1093922
(-)libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp (-100 lines)
Lines 1-100 Link Here
1
--- ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp.orig	2013-05-13 15:09:14.000000000 +0200
2
+++ ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp	2013-06-12 16:31:03.000000000 +0200
3
@@ -61,6 +61,8 @@
4
 #include <libudev.h>
5
 }
6
 #elif defined(__FreeBSD__)
7
+#include <sys/param.h>
8
+#include <sys/sysctl.h>
9
 #include <stdio.h>
10
 #include <unistd.h>
11
 #endif
12
@@ -434,22 +436,77 @@
13
   }
14
 #elif defined(__FreeBSD__)
15
   char devicePath[PATH_MAX + 1];
16
+  char infos[512];
17
+  char sysctlname[32];
18
+  char ttyname[8];
19
+  char *pos;
20
+  size_t infos_size = sizeof(infos);
21
   int i;
22
 
23
-  for (i = 0; i < 8; ++i)
24
+  for (i = 0; ; ++i)
25
   {
26
-    (void)snprintf(devicePath, sizeof(devicePath), "/dev/ttyU%d", i);
27
-    if (strDevicePath && strcmp(devicePath, strDevicePath) != 0)
28
+    unsigned int iVendor, iProduct;
29
+    memset(infos, 0, sizeof(infos));
30
+    (void)snprintf(sysctlname, sizeof(sysctlname),
31
+      "dev.umodem.%d.%%pnpinfo", i);
32
+    if (sysctlbyname(sysctlname, infos, &infos_size,
33
+      NULL, 0) != 0)
34
+        break;
35
+    pos = strstr(infos, "vendor=");
36
+    if (pos == NULL)
37
       continue;
38
-    if (!access(devicePath, 0))
39
-    {
40
-      snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicePath);
41
-      snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", devicePath);
42
-      deviceList[iFound].iVendorId = CEC_VID;
43
-      deviceList[iFound].iProductId = CEC_VID;
44
-      deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
45
-      iFound++;
46
+    sscanf(pos, "vendor=%x ", &iVendor);
47
+
48
+    pos = strstr(infos, "product=");
49
+    if (pos == NULL)
50
+      continue;
51
+    sscanf(pos, "product=%x ", &iProduct);
52
+
53
+    if (iVendor != CEC_VID || (iProduct != CEC_PID && iProduct != CEC_PID2))
54
+      continue;
55
+
56
+    pos = strstr(infos, "ttyname=");
57
+    if (pos == NULL)
58
+      continue;
59
+    sscanf(pos, "ttyname=%s ", ttyname);
60
+
61
+    (void)snprintf(devicePath, sizeof(devicePath),
62
+      "/dev/tty%s", ttyname);
63
+
64
+    if (strDevicePath) {
65
+      char currStrDevicePath[512];
66
+      int port = 0;
67
+      int devaddr = 0;
68
+      memset(currStrDevicePath, 0, sizeof(currStrDevicePath));
69
+      memset(infos, 0, sizeof(infos));
70
+      (void)snprintf(sysctlname, sizeof(sysctlname),
71
+        "dev.umodem.%d.%%location", i);
72
+      if (sysctlbyname(sysctlname, infos, &infos_size,
73
+        NULL, 0) != 0)
74
+          break;
75
+
76
+      pos = strstr(infos, "port=");
77
+      if (pos == NULL)
78
+        continue;
79
+      sscanf(pos, "port=%d ", &port);
80
+
81
+      pos = strstr(infos, "devaddr=");
82
+      if (pos == NULL)
83
+        continue;
84
+      sscanf(pos, "devaddr=%d ", &devaddr);
85
+
86
+      (void)snprintf(currStrDevicePath, sizeof(currStrDevicePath),
87
+        "/dev/ugen%d.%d", port, devaddr);
88
+
89
+      if (strcmp(currStrDevicePath, strDevicePath) != 0)
90
+        continue;
91
     }
92
+    snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicePath);
93
+    snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", devicePath);
94
+    deviceList[iFound].iVendorId = iVendor;
95
+    deviceList[iFound].iProductId = iProduct;
96
+    deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
97
+    iFound++;
98
   }
99
 #else
100
   //silence "unused" warnings
(-)libcec/pkg-plist (-1 lines)
Lines 1-6 Link Here
1
lib/libcec.so
1
lib/libcec.so
2
lib/libcec.so.2
2
lib/libcec.so.2
3
lib/libcec.la
4
lib/libcec.a
3
lib/libcec.a
5
include/libcec/cec.h
4
include/libcec/cec.h
6
include/libcec/cecc.h
5
include/libcec/cecc.h

Return to bug 190345