s/long// (leaving "unsigned") in some code that fails when long is anything but 32 bits (and unsigned is 32 bits in pretty much all modern platforms.) this allows ups-nut-usb to work on sparc64 for me, otherwise the hidparser fails. bump pkg revision for ups-nut-usb, as that pkg changes (at least for big endian platforms.)diff -r1.29 -r1.30 pkgsrc/sysutils/ups-nut/distinfo
(mrg)
@@ -1,8 +1,9 @@ | @@ -1,8 +1,9 @@ | |||
1 | $NetBSD: distinfo,v 1.29 2015/11/04 01:32:34 agc Exp $ | 1 | $NetBSD: distinfo,v 1.30 2015/11/10 08:52:38 mrg Exp $ | |
2 | 2 | |||
3 | SHA1 (nut-2.6.5.tar.gz) = 320debe11df91f04e32824694d0c89a020677f71 | 3 | SHA1 (nut-2.6.5.tar.gz) = 320debe11df91f04e32824694d0c89a020677f71 | |
4 | RMD160 (nut-2.6.5.tar.gz) = d6e6acd4696e3c3f8c0ecd998f8676a8625decb9 | 4 | RMD160 (nut-2.6.5.tar.gz) = d6e6acd4696e3c3f8c0ecd998f8676a8625decb9 | |
5 | SHA512 (nut-2.6.5.tar.gz) = f1c76e6280057dc558d53451e7de2bdc7f37a0f175b1c52c27e7dcb83deeb78f6885007ad188a7a3a19e411eba87e03eb2246310bd7a5a5bb6fa3ad2bebd49d8 | 5 | SHA512 (nut-2.6.5.tar.gz) = f1c76e6280057dc558d53451e7de2bdc7f37a0f175b1c52c27e7dcb83deeb78f6885007ad188a7a3a19e411eba87e03eb2246310bd7a5a5bb6fa3ad2bebd49d8 | |
6 | Size (nut-2.6.5.tar.gz) = 2038832 bytes | 6 | Size (nut-2.6.5.tar.gz) = 2038832 bytes | |
7 | SHA1 (patch-aa) = 48110f378518edb43a653753eb4ef6ea28344c62 | 7 | SHA1 (patch-aa) = 48110f378518edb43a653753eb4ef6ea28344c62 | |
8 | SHA1 (patch-ab) = 44988118570714ab2c3fffdd75909c2255b94fa6 | 8 | SHA1 (patch-ab) = 44988118570714ab2c3fffdd75909c2255b94fa6 | |
9 | SHA1 (patch-drivers_hidparser.c) = c71d84bbf3140db1f82ef155fdf5afec79cbd38d |
@@ -1,18 +1,19 @@ | @@ -1,18 +1,19 @@ | |||
1 | # $NetBSD: Makefile,v 1.4 2012/10/23 19:51:28 asau Exp $ | 1 | # $NetBSD: Makefile,v 1.5 2015/11/10 08:52:38 mrg Exp $ | |
2 | 2 | |||
3 | .include "../../sysutils/ups-nut/Makefile.common" | 3 | .include "../../sysutils/ups-nut/Makefile.common" | |
4 | 4 | |||
5 | PKGNAME= ${DISTNAME:S/nut/ups-nut-usb/} | 5 | PKGNAME= ${DISTNAME:S/nut/ups-nut-usb/} | |
6 | PKGREVISION= 1 | |||
6 | COMMENT= Network UPS Tools USB drivers | 7 | COMMENT= Network UPS Tools USB drivers | |
7 | 8 | |||
8 | DEPENDS+= ups-nut-2.*:../../sysutils/ups-nut | 9 | DEPENDS+= ups-nut-2.*:../../sysutils/ups-nut | |
9 | 10 | |||
10 | INSTALLATION_DIRS+= ${PREFIX}/libexec/nut | 11 | INSTALLATION_DIRS+= ${PREFIX}/libexec/nut | |
11 | INSTALLATION_DIRS+= ${PREFIX}/${PKGMANDIR}/man8 | 12 | INSTALLATION_DIRS+= ${PREFIX}/${PKGMANDIR}/man8 | |
12 | 13 | |||
13 | BUILD_DEFS+= NUT_STATEDIR | 14 | BUILD_DEFS+= NUT_STATEDIR | |
14 | 15 | |||
15 | CONFIGURE_ARGS+= --with-usb --with-drvpath=${NUT_DRVDIR:Q} | 16 | CONFIGURE_ARGS+= --with-usb --with-drvpath=${NUT_DRVDIR:Q} | |
16 | 17 | |||
17 | do-install: | 18 | do-install: | |
18 | for f in usbhid-ups bcmxcp_usb tripplite_usb blazer_usb richcomm_usb;\ | 19 | for f in usbhid-ups bcmxcp_usb tripplite_usb blazer_usb richcomm_usb;\ |
$NetBSD: patch-drivers_hidparser.c,v 1.1 2015/11/10 08:52:38 mrg Exp $
work around horrible big-endian code that assumes "long" is 32 bits.
enables usb-nut-ups to work on sparc64.
--- drivers/hidparser.c.orig 2012-07-31 10:38:59.000000000 -0700
+++ drivers/hidparser.c 2015-11-10 00:30:11.000000000 -0800
@@ -163,7 +163,7 @@
#if WORDS_BIGENDIAN
{
int i;
- unsigned long valTmp = 0;
+ unsigned valTmp = 0;
for (i = 0; i < ItemSize[pParser->Item & SIZE_MASK]; i++) {
memcpy(&valTmp, &pParser->ReportDesc[(pParser->Pos)+i], 1);