diff --git a/meta-oe/recipes-devtools/lshw/files/0001-Fix-musl-build.patch b/meta-oe/recipes-devtools/lshw/files/0001-Fix-musl-build.patch deleted file mode 100644 index fa90aa1211a..00000000000 --- a/meta-oe/recipes-devtools/lshw/files/0001-Fix-musl-build.patch +++ /dev/null @@ -1,125 +0,0 @@ -From a5a4bb4254b2109bd3e272174946f0bb36ee99a8 Mon Sep 17 00:00:00 2001 -From: Leon Anavi -Date: Tue, 25 Aug 2020 11:45:45 +0300 -Subject: [PATCH] Fix musl build - -Apply the following fixes for musl: - -- Fix basename() is in libgen.h -- Fix wrong usage of LONG_BIT - -Same fixes have been submitted to the upstream of lshw by Sergio -Prado but they have not been merged yet. - -Upstream-Status: Submitted - -Co-Authored-By: Sergio Prado -Signed-off-by: Leon Anavi ---- - src/core/abi.cc | 4 +--- - src/core/sysfs.cc | 19 ++++++++++--------- - 2 files changed, 11 insertions(+), 12 deletions(-) - -diff --git a/src/core/abi.cc b/src/core/abi.cc -index adff7b5..76c664c 100644 ---- a/src/core/abi.cc -+++ b/src/core/abi.cc -@@ -20,9 +20,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 ? -- long sc = sysconf(LONG_BIT); -- if(sc==-1) sc = sysconf(_SC_LONG_BIT); -- if(sc!=-1) system.setWidth(sc); -+ system.setWidth(LONG_BIT); - - pushd(PROC_SYS); - -diff --git a/src/core/sysfs.cc b/src/core/sysfs.cc -index 32d6564..c2fa84f 100644 ---- a/src/core/sysfs.cc -+++ b/src/core/sysfs.cc -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - - - __ID("@(#) $Id$"); -@@ -100,7 +101,7 @@ static string sysfs_getbustype(const string & path) - { - devname = - string(fs.path + "/bus/") + string(namelist[i]->d_name) + -- "/devices/" + basename(path.c_str()); -+ "/devices/" + basename(const_cast(path.c_str())); - - if (samefile(devname, path)) - return string(namelist[i]->d_name); -@@ -140,7 +141,7 @@ static string sysfstobusinfo(const string & path) - - if (bustype == "usb") - { -- string name = basename(path.c_str()); -+ string name = basename(const_cast(path.c_str())); - if (matches(name, "^[0-9]+-[0-9]+(\\.[0-9]+)*:[0-9]+\\.[0-9]+$")) - { - size_t colon = name.rfind(":"); -@@ -151,7 +152,7 @@ static string sysfstobusinfo(const string & path) - - if (bustype == "virtio") - { -- string name = basename(path.c_str()); -+ string name = basename(const_cast(path.c_str())); - if (name.compare(0, 6, "virtio") == 0) - return "virtio@" + name.substr(6); - else -@@ -159,10 +160,10 @@ static string sysfstobusinfo(const string & path) - } - - if (bustype == "vio") -- return string("vio@") + basename(path.c_str()); -+ return string("vio@") + basename(const_cast(path.c_str())); - - if (bustype == "ccw") -- return string("ccw@") + basename(path.c_str()); -+ return string("ccw@") + basename(const_cast(path.c_str())); - - if (bustype == "ccwgroup") - { -@@ -240,7 +241,7 @@ string entry::driver() const - string driverlink = This->devpath + "/driver"; - if (!exists(driverlink)) - return ""; -- return basename(readlink(driverlink).c_str()); -+ return basename(const_cast(readlink(driverlink).c_str())); - } - - -@@ -328,7 +329,7 @@ string entry::name_in_class(const string & classname) const - - string entry::name() const - { -- return basename(This->devpath.c_str()); -+ return basename(const_cast(This->devpath.c_str())); - } - - -@@ -340,12 +341,12 @@ entry entry::parent() const - - string entry::classname() const - { -- return basename(dirname(This->devpath).c_str()); -+ return basename(const_cast(dirname(This->devpath).c_str())); - } - - bool entry::isvirtual() const - { -- return string(basename(dirname(dirname(This->devpath)).c_str())) == "virtual"; -+ return string(basename(const_cast(dirname(dirname(This->devpath)).c_str()))) == "virtual"; - } - - string entry::string_attr(const string & name, const string & def) const --- -2.17.1 - diff --git a/meta-oe/recipes-devtools/lshw/lshw_02.19.2.bb b/meta-oe/recipes-devtools/lshw/lshw_git.bb similarity index 59% rename from meta-oe/recipes-devtools/lshw/lshw_02.19.2.bb rename to meta-oe/recipes-devtools/lshw/lshw_git.bb index 8b3608a2482..6845d0daf9f 100644 --- a/meta-oe/recipes-devtools/lshw/lshw_02.19.2.bb +++ b/meta-oe/recipes-devtools/lshw/lshw_git.bb @@ -9,16 +9,21 @@ SECTION = "console/tools" LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64|riscv64).*-linux" -SRC_URI = " \ - http://ezix.org/software/files/lshw-B.${PV}.tar.gz \ - file://0001-Fix-musl-build.patch \ -" -SRC_URI[md5sum] = "8c70d46e906688309095c73ecb9396e3" -SRC_URI[sha256sum] = "9bb347ac87142339a366a1759ac845e3dbb337ec000aa1b99b50ac6758a80f80" +SRC_URI = "git://github.com/lyonel/lshw.git;protocol=https;branch=master" +SRCREV = "42fef565731411a784101de614a54bff79d1858e" + +S = "${WORKDIR}/git" -S = "${WORKDIR}/lshw-B.${PV}" +DEPENDS = "gettext-native" + +PACKAGECONFIG ?= " \ + ${@bb.utils.filter('MACHINE_FEATURES', 'pci', d)} \ + ${@bb.utils.filter('MACHINE_FEATURES', 'usbhost', d)} \ +" +PACKAGECONFIG[pci] = ",,,pciutils" +PACKAGECONFIG[usbhost] = ",,,usbutils" do_compile() { # build core only - don't ship gui