public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/lshw/, sys-apps/lshw/files/
Date: Thu,  4 Jan 2018 07:14:38 +0000 (UTC)	[thread overview]
Message-ID: <1515050007.1cb1b9ca5d372c83314d9f7b02c80eb7c10cc0bc.vapier@gentoo> (raw)

commit:     1cb1b9ca5d372c83314d9f7b02c80eb7c10cc0bc
Author:     Wenkai Du <wenkai.du <AT> intel <DOT> com>
AuthorDate: Thu Jan  4 07:13:02 2018 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Jan  4 07:13:27 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cb1b9ca

sys-apps/lshw: add upstream fix for crashes w/Intel SGX

 sys-apps/lshw/files/lshw-02.18b-sgx.patch | 32 ++++++++++++++
 sys-apps/lshw/lshw-02.18b-r1.ebuild       | 73 +++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)

diff --git a/sys-apps/lshw/files/lshw-02.18b-sgx.patch b/sys-apps/lshw/files/lshw-02.18b-sgx.patch
new file mode 100644
index 00000000000..92bd6c23e2f
--- /dev/null
+++ b/sys-apps/lshw/files/lshw-02.18b-sgx.patch
@@ -0,0 +1,32 @@
+patch from upstream:
+https://ezix.org/src/pkg/lshw/commit/5e5744732b2dcdf83845919256388b3842033183
+
+From 5e5744732b2dcdf83845919256388b3842033183 Mon Sep 17 00:00:00 2001
+From: Wenkai Du <wenkai.du@intel.com>
+Date: Fri, 22 Dec 2017 09:57:57 -0800
+Subject: [PATCH] lshw: fix segmentation fault when /dev/sgx is present
+
+When Intel SGX is enabled in kernel, /dev/sgx is created and is
+picked up by "/dev/sg*" glob matching.
+
+Signed-off-by: Wenkai Du <wenkai.du@intel.com>
+---
+ src/core/scsi.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/scsi.cc b/src/core/scsi.cc
+index b38dda2cd8a8..75061c0fb195 100644
+--- a/src/core/scsi.cc
++++ b/src/core/scsi.cc
+@@ -30,7 +30,7 @@
+ 
+ __ID("@(#) $Id$");
+ 
+-#define SG_X "/dev/sg*"
++#define SG_X "/dev/sg[0-9]*"
+ #define SG_MAJOR 21
+ 
+ #ifndef SCSI_IOCTL_GET_PCI
+-- 
+2.15.1
+

diff --git a/sys-apps/lshw/lshw-02.18b-r1.ebuild b/sys-apps/lshw/lshw-02.18b-r1.ebuild
new file mode 100644
index 00000000000..c22eab42757
--- /dev/null
+++ b/sys-apps/lshw/lshw-02.18b-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PLOCALES='fr'
+
+inherit flag-o-matic eutils toolchain-funcs l10n
+
+MAJ_PV=${PV:0:${#PV}-1}
+MIN_PVE=${PV:0-1}
+MIN_PV=${MIN_PVE/b/B}
+
+MY_P="$PN-$MIN_PV.$MAJ_PV"
+DESCRIPTION="Hardware Lister"
+HOMEPAGE="https://www.ezix.org/project/wiki/HardwareLiSter"
+SRC_URI="https://www.ezix.org/software/files/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="gtk sqlite static"
+
+REQUIRED_USE="static? ( !gtk )"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2 )
+	sqlite? ( dev-db/sqlite:3 )"
+DEPEND="${RDEPEND}
+	gtk? ( virtual/pkgconfig )
+	sqlite? ( virtual/pkgconfig )"
+RDEPEND="${RDEPEND}
+	sys-apps/hwids"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-02.18b-gentoo.patch
+	"${FILESDIR}"/${PN}-02.18b-gettext-array.patch
+	"${FILESDIR}"/${PN}-02.18b-sgx.patch
+)
+
+src_prepare() {
+	epatch "${PATCHES[@]}"
+
+	l10n_find_plocales_changes "src/po" "" ".po" || die
+	sed -i \
+		-e "/^LANGUAGES =/ s/=.*/= $(l10n_get_locales)/" \
+		src/po/Makefile || die
+	sed -i \
+		-e 's:\<pkg-config\>:${PKG_CONFIG}:' \
+		src/Makefile src/gui/Makefile || die
+}
+
+src_compile() {
+	tc-export CC CXX AR PKG_CONFIG
+	use static && append-ldflags -static
+
+	# Need two sep make statements to avoid parallel build issues. #588174
+	local sqlite=$(usex sqlite 1 0)
+	emake SQLITE=${sqlite} all
+	use gtk && emake SQLITE=${sqlite} gui
+}
+
+src_install() {
+	emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install $(usex gtk 'install-gui' '')
+	dodoc README.md docs/*
+	if use gtk ; then
+		newicon -s scalable src/gui/artwork/logo.svg gtk-lshw.svg
+		make_desktop_entry \
+			"${EPREFIX}"/usr/sbin/gtk-lshw \
+			"${DESCRIPTION}"
+	fi
+}


             reply	other threads:[~2018-01-04  7:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04  7:14 Mike Frysinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-13 15:17 [gentoo-commits] repo/gentoo:master commit in: sys-apps/lshw/, sys-apps/lshw/files/ Ben Kohler
2021-05-18 14:15 Ben Kohler
2018-05-21 16:15 Mikle Kolyada
2017-09-01  2:22 Tim Harder
2017-03-15  6:02 Mike Frysinger
2016-02-06 13:29 Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515050007.1cb1b9ca5d372c83314d9f7b02c80eb7c10cc0bc.vapier@gentoo \
    --to=vapier@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox