aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--community/lshw/APKBUILD22
-rw-r--r--community/lshw/fix-musl-sc_long_bit.patch14
-rw-r--r--community/lshw/wrapper-for-basename.patch23
3 files changed, 27 insertions, 32 deletions
diff --git a/community/lshw/APKBUILD b/community/lshw/APKBUILD
index cbe2150a70..d2a31a5136 100644
--- a/community/lshw/APKBUILD
+++ b/community/lshw/APKBUILD
@@ -1,7 +1,8 @@
# Contributor: Paul Kilar <pkilar@gmail.com>
# Maintainer: Paul Kilar <pkilar@gmail.com>
pkgname=lshw
-pkgver='02.18'
+pkgver=02.19.2
+_pkgver="B.$pkgver"
pkgrel=0
pkgdesc="Hardware Lister"
url="https://ezix.org/project/wiki/HardwareLiSter"
@@ -9,21 +10,24 @@ arch="all"
license="GPL-3.0-or-later"
makedepends="sqlite-dev linux-headers"
subpackages="$pkgname-doc $pkgname-lang"
-source="https://ezix.org/software/files/lshw-B.$pkgver.tar.gz
+source="https://ezix.org/software/files/lshw-$_pkgver.tar.gz
+ fix-musl-sc_long_bit.patch
wrapper-for-basename.patch
"
-
-builddir="$srcdir"/$pkgname-B.$pkgver
+builddir="$srcdir"/$pkgname-$_pkgver
build() {
- cd "$builddir"
make RPM_OPT_FLAGS=-DNONLS
}
+check() {
+ ./src/lshw -version
+}
+
package() {
- cd "$builddir"
- make -j1 DESTDIR="$pkgdir" install
+ make DESTDIR="$pkgdir" install
}
-sha512sums="4385db86101178b8bd33a80e991718e14f83277c66b3d63ae97cb4339196873b6e9b31a174024bf43d16fe66e1d7f8cf5cea56076697878087880c8821b11e47 lshw-B.02.18.tar.gz
-bad7910af7ac3d8bc59e1f8e178a9d29851cfe4048473e5036a661b4650c5144693e6bf83f4c03304a7afb5c3003e2e732518a57d304bcc084bd78f109722da0 wrapper-for-basename.patch"
+sha512sums="f3abc6241fe7912740f11b5b97a1f7778cb7cc69f5209b83063cbc1d3aa7b082dedb3aac4119ce100391547400ed6bb2d413ca47de50794e1066f31961be41a5 lshw-B.02.19.2.tar.gz
+21d5692b50086018685232261e4851cd6dcd84660512dde58317c06a3b10d73d04d7f0b164264cb9c4dd4154947672dbbf1f288291bab5ec952e57458b71ab42 fix-musl-sc_long_bit.patch
+7adbb35c9ba0af3ba698c472226781ae1a518deb1f85f6cb8b53ac05c84b40ae94cbfd5761b58709b1d5726660f9eb159cf1233a77b2fa6565010dde17167b7d wrapper-for-basename.patch"
diff --git a/community/lshw/fix-musl-sc_long_bit.patch b/community/lshw/fix-musl-sc_long_bit.patch
new file mode 100644
index 0000000000..b409dfe947
--- /dev/null
+++ b/community/lshw/fix-musl-sc_long_bit.patch
@@ -0,0 +1,14 @@
+--- a/src/core/abi.cc
++++ b/src/core/abi.cc
+@@ -21,7 +21,11 @@
+ {
+ // are we compiled as 32- or 64-bit process ?
+ long sc = sysconf(LONG_BIT);
++#ifdef _SC_LONG_BIT
+ if(sc==-1) sc = sysconf(_SC_LONG_BIT);
++#else
++ if(sc==-1) sc = (CHAR_BIT * sizeof(long));
++#endif
+ if(sc!=-1) system.setWidth(sc);
+
+ pushd(PROC_SYS);
diff --git a/community/lshw/wrapper-for-basename.patch b/community/lshw/wrapper-for-basename.patch
index ff0172bd1b..dabfa79b6c 100644
--- a/community/lshw/wrapper-for-basename.patch
+++ b/community/lshw/wrapper-for-basename.patch
@@ -10,35 +10,12 @@ without glibc.
Switch to the portable version. Because this variant modifies its
argument, similarly to dirname, a wrapper is needed.
---
- src/core/dasd.cc | 4 ++--
src/core/osutils.cc | 10 ++++++++++
src/core/osutils.h | 1 +
src/core/pci.cc | 4 ++--
src/core/sysfs.cc | 8 ++++----
5 files changed, 19 insertions(+), 8 deletions(-)
-diff --git a/src/core/dasd.cc b/src/core/dasd.cc
-index b62a7ee..3a716ac 100644
---- a/src/core/dasd.cc
-+++ b/src/core/dasd.cc
-@@ -19,7 +19,7 @@ using namespace std;
- bool scan_dasd(hwNode & n)
- {
- size_t dev_num;
-- char *dev_name;
-+ std::string dev_name;
- glob_t devices;
- uint64_t capacity;
-
-@@ -42,7 +42,7 @@ bool scan_dasd(hwNode & n)
- {
- for(dev_num=0;dev_num<devices.gl_pathc;dev_num++)
- {
-- dev_name = basename(devices.gl_pathv[dev_num]);
-+ dev_name = basename(std::string(devices.gl_pathv[dev_num]));
- for (std::vector<std::string>::iterator it = sysfs_attribs.begin(); it != sysfs_attribs.end(); ++it)
- {
- std::string attrib_fname = std::string(SYSFS_PREFIX) + dev_name + "/device/" + *it;
diff --git a/src/core/osutils.cc b/src/core/osutils.cc
index e93b79e..1624ab1 100644
--- a/src/core/osutils.cc