summaryrefslogtreecommitdiffstats
path: root/testing/lshw
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-09-15 09:09:34 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-09-15 09:10:06 +0000
commit1f2f5461925b211f1af1be504b35ae152f30a7e4 (patch)
tree89136ce6815ce1aed932681c2f7097ee6061ba11 /testing/lshw
parent52a7c9f48f175a358619c118b3130ae892d8e932 (diff)
downloadaports-1f2f5461925b211f1af1be504b35ae152f30a7e4.tar.bz2
aports-1f2f5461925b211f1af1be504b35ae152f30a7e4.tar.xz
testing/lshw: moved back to testing
Diffstat (limited to 'testing/lshw')
-rw-r--r--testing/lshw/APKBUILD49
-rw-r--r--testing/lshw/basename-limits-long-bits.patch68
-rw-r--r--testing/lshw/lshw-gcc43.patch23
-rw-r--r--testing/lshw/no-private-uint.patch123
4 files changed, 263 insertions, 0 deletions
diff --git a/testing/lshw/APKBUILD b/testing/lshw/APKBUILD
new file mode 100644
index 000000000..fd4d5b71a
--- /dev/null
+++ b/testing/lshw/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Paul Kilar <pkilar@gmail.com>
+# Maintainer: Paul Kilar <pkilar@gmail.com>
+pkgname=lshw
+pkgver='02.17'
+pkgrel=1
+pkgdesc="Hardware Lister"
+url="http://ezix.org/project/wiki/HardwareLiSter"
+arch="all"
+license="GPL3+"
+depends=""
+depends_dev=""
+makedepends="sqlite-dev"
+install=""
+subpackages="$pkgname-doc $pkgname-lang"
+source="http://ezix.org/software/files/lshw-B.$pkgver.tar.gz
+ no-private-uint.patch
+ basename-limits-long-bits.patch
+ "
+
+_builddir="$srcdir"/$pkgname-B.$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ make RPM_OPT_FLAGS=-DNONLS
+}
+
+package() {
+ cd "$_builddir"
+ make -j1 DESTDIR="$pkgdir" install
+}
+
+md5sums="a5feb796cb302850eaf5b4530888e3ed lshw-B.02.17.tar.gz
+4ed02e5d2246bf66c6420ca007555cfa no-private-uint.patch
+4c5aa7c045adf03577448cc59168a691 basename-limits-long-bits.patch"
+sha256sums="eb9cc053fa0f1e78685cb695596e73931bfb55d2377e3bc3b8b94aff4c5a489c lshw-B.02.17.tar.gz
+2e5a3d63da8475db17fd90969bcb1930cf19d2b8da7be41edeea5c2a53878382 no-private-uint.patch
+c8365f7ac8fc7a751c78d89ab446111bb1a235bc977a1b21e1b826c2e62361d1 basename-limits-long-bits.patch"
+sha512sums="868899dce98e786a08a2134d6e132c388d71ab0f03fa6e10881e14d7a882c1882b46bbc6bd6ddb021cfab87ad6c9fd369453c3916f0b3353027eb2d470e55d9b lshw-B.02.17.tar.gz
+6cd1e4e1e5972bfff2dd159ffc4a1a38157598f993ad927afc70f067496e461c2a25d9721c4773bda6465750b9125f9eb3d89e0b83b1842fafcf552262276da8 no-private-uint.patch
+50005efd1f9a77495f5acb36e4d6bbec0a2e22cf8ce3b17f28e6be738bfc1d6943fb9adf38a2414a719df0b8ccb4be2b0f4313e441d77e3e3043b73d30566190 basename-limits-long-bits.patch"
diff --git a/testing/lshw/basename-limits-long-bits.patch b/testing/lshw/basename-limits-long-bits.patch
new file mode 100644
index 000000000..68c9cf983
--- /dev/null
+++ b/testing/lshw/basename-limits-long-bits.patch
@@ -0,0 +1,68 @@
+commit 9389deed8b49a4845c51d5e7177d143cbb96718a
+Author: Isaac Dunham <ibid.ag@gmail.com>
+Date: Fri Sep 12 21:45:32 2014 -0700
+
+ Numerous less obvious fixes
+
+ -sysconf(_SC_LONG_BIT) is 8*sizeof(long)
+ -POSIX basename() requires a char *, not const char*
+ -limits.h is necessary for PATH_MAX
+
+diff --git a/src/core/abi.cc b/src/core/abi.cc
+index 5fdd8e3..7f78d4b 100644
+--- a/src/core/abi.cc
++++ b/src/core/abi.cc
+@@ -19,7 +19,7 @@ __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
+ bool scan_abi(hwNode & system)
+ {
+ // are we compiled as 32- or 64-bit process ?
+- system.setWidth(sysconf(_SC_LONG_BIT));
++ system.setWidth(8*sizeof(long));
+
+ pushd(PROC_SYS);
+
+diff --git a/src/core/cpufreq.cc b/src/core/cpufreq.cc
+index da3960f..aa0df00 100644
+--- a/src/core/cpufreq.cc
++++ b/src/core/cpufreq.cc
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <dirent.h>
++#include <limits.h>
+
+ __ID("@(#) $Id: cpufreq.cc 2470 2012-01-19 12:04:26Z lyonel $");
+
+diff --git a/src/core/pci.cc b/src/core/pci.cc
+index aaa257c..b8a7917 100644
+--- a/src/core/pci.cc
++++ b/src/core/pci.cc
+@@ -12,6 +12,8 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <dirent.h>
++#include <libgen.h>
++#include <limits.h>
+
+ __ID("@(#) $Id: pci.cc 2496 2012-05-15 08:00:13Z lyonel $");
+
+@@ -1127,10 +1129,16 @@ bool scan_pci(hwNode & n)
+ {
+ string drivername = readlink(string(devices[i]->d_name)+"/driver");
+ string modulename = readlink(string(devices[i]->d_name)+"/driver/module");
+-
+- device->setConfig("driver", basename(drivername.c_str()));
++ char driver_c[PATH_MAX];
++ char module_c[PATH_MAX];
++ bzero(driver_c,PATH_MAX);
++ bzero(module_c,PATH_MAX);
++ strncpy(driver_c, drivername.c_str(),PATH_MAX);
++ strncpy(module_c, modulename.c_str(),PATH_MAX);
++
++ device->setConfig("driver", basename(driver_c));
+ if(exists(modulename))
+- device->setConfig("module", basename(modulename.c_str()));
++ device->setConfig("module", basename(module_c));
+
+ if(exists(string(devices[i]->d_name)+"/rom"))
+ {
diff --git a/testing/lshw/lshw-gcc43.patch b/testing/lshw/lshw-gcc43.patch
new file mode 100644
index 000000000..c56b03890
--- /dev/null
+++ b/testing/lshw/lshw-gcc43.patch
@@ -0,0 +1,23 @@
+--- src/core/abi.cc.orig 2010-03-15 21:26:20.000000000 +0100
++++ src/core/abi.cc 2013-08-06 21:05:08.693772583 +0200
+@@ -11,6 +11,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <dirent.h>
++#include <cstdlib>
+
+ __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
+
+@@ -38,10 +39,10 @@
+ for(i=0; i<n; i++)
+ {
+ system.addCapability(namelist[i]->d_name);
+- free(namelist[i]);
++ std::free(namelist[i]);
+ }
+ if(namelist)
+- free(namelist);
++ std::free(namelist);
+ }
+
+ popd();
diff --git a/testing/lshw/no-private-uint.patch b/testing/lshw/no-private-uint.patch
new file mode 100644
index 000000000..1c67d574f
--- /dev/null
+++ b/testing/lshw/no-private-uint.patch
@@ -0,0 +1,123 @@
+commit 4928bab9086d6e9610413f15675babdf5566c5ce
+Author: Isaac Dunham <ibid.ag@gmail.com>
+Date: Fri Sep 12 21:19:19 2014 -0700
+
+ Uncruftify: remove __ from uint*_t
+
+diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
+index 5c3d654..fd38b2f 100644
+--- a/src/core/device-tree.cc
++++ b/src/core/device-tree.cc
+@@ -24,13 +24,13 @@
+ __ID("@(#) $Id: device-tree.cc 2521 2013-05-08 13:43:30Z lyonel $");
+
+ #define DIMMINFOSIZE 0x80
+-typedef __uint8_t dimminfo_buf[DIMMINFOSIZE];
++typedef uint8_t dimminfo_buf[DIMMINFOSIZE];
+
+ struct dimminfo
+ {
+- __uint8_t version3;
++ uint8_t version3;
+ char serial[16];
+- __uint16_t version1, version2;
++ uint16_t version1, version2;
+ };
+
+ #define DEVICETREE "/proc/device-tree"
+diff --git a/src/core/network.cc b/src/core/network.cc
+index 134c887..a298d35 100644
+--- a/src/core/network.cc
++++ b/src/core/network.cc
+@@ -49,9 +49,9 @@ __ID("@(#) $Id: network.cc 2516 2013-02-03 16:43:25Z lyonel $");
+ #define SIOCETHTOOL 0x8946
+ #endif
+ typedef unsigned long long u64;
+-typedef __uint32_t u32;
+-typedef __uint16_t u16;
+-typedef __uint8_t u8;
++typedef uint32_t u32;
++typedef uint16_t u16;
++typedef uint8_t u8;
+
+ struct ethtool_cmd
+ {
+diff --git a/src/core/osutils.cc b/src/core/osutils.cc
+index fd19288..f9ce76c 100644
+--- a/src/core/osutils.cc
++++ b/src/core/osutils.cc
+@@ -496,48 +496,48 @@ string escapecomment(const string & s)
+
+ unsigned short be_short(const void * from)
+ {
+- __uint8_t *p = (__uint8_t*)from;
++ uint8_t *p = (uint8_t*)from;
+
+- return ((__uint16_t)(p[0]) << 8) +
+- (__uint16_t)p[1];
++ return ((uint16_t)(p[0]) << 8) +
++ (uint16_t)p[1];
+ }
+
+
+ unsigned short le_short(const void * from)
+ {
+- __uint8_t *p = (__uint8_t*)from;
++ uint8_t *p = (uint8_t*)from;
+
+- return ((__uint16_t)(p[1]) << 8) +
+- (__uint16_t)p[0];
++ return ((uint16_t)(p[1]) << 8) +
++ (uint16_t)p[0];
+ }
+
+
+ unsigned long be_long(const void * from)
+ {
+- __uint8_t *p = (__uint8_t*)from;
++ uint8_t *p = (uint8_t*)from;
+
+- return ((__uint32_t)(p[0]) << 24) +
+- ((__uint32_t)(p[1]) << 16) +
+- ((__uint32_t)(p[2]) << 8) +
+- (__uint32_t)p[3];
++ return ((uint32_t)(p[0]) << 24) +
++ ((uint32_t)(p[1]) << 16) +
++ ((uint32_t)(p[2]) << 8) +
++ (uint32_t)p[3];
+ }
+
+
+ unsigned long le_long(const void * from)
+ {
+- __uint8_t *p = (__uint8_t*)from;
++ uint8_t *p = (uint8_t*)from;
+
+- return ((__uint32_t)(p[3]) << 24) +
+- ((__uint32_t)(p[2]) << 16) +
+- ((__uint32_t)(p[1]) << 8) +
+- (__uint32_t)p[0];
++ return ((uint32_t)(p[3]) << 24) +
++ ((uint32_t)(p[2]) << 16) +
++ ((uint32_t)(p[1]) << 8) +
++ (uint32_t)p[0];
+
+ }
+
+
+ unsigned long long be_longlong(const void * from)
+ {
+- __uint8_t *p = (__uint8_t*)from;
++ uint8_t *p = (uint8_t*)from;
+
+ return ((unsigned long long)(p[0]) << 56) +
+ ((unsigned long long)(p[1]) << 48) +
+@@ -552,7 +552,7 @@ unsigned long long be_longlong(const void * from)
+
+ unsigned long long le_longlong(const void * from)
+ {
+- __uint8_t *p = (__uint8_t*)from;
++ uint8_t *p = (uint8_t*)from;
+
+ return ((unsigned long long)(p[7]) << 56) +
+ ((unsigned long long)(p[6]) << 48) +