sys-apps/smartmontools: Fix build on MUSL
authorThomas Deutschmann <whissi@gentoo.org>
Sun, 14 Jan 2018 19:10:55 +0000 (20:10 +0100)
committerThomas Deutschmann <whissi@gentoo.org>
Sun, 14 Jan 2018 19:11:11 +0000 (20:11 +0100)
Closes: https://bugs.gentoo.org/644586
Package-Manager: Portage-2.3.19, Repoman-2.3.6

sys-apps/smartmontools/files/smartmontools-6.6-fix-build-on-musl.patch [new file with mode: 0644]
sys-apps/smartmontools/smartmontools-6.6.ebuild

diff --git a/sys-apps/smartmontools/files/smartmontools-6.6-fix-build-on-musl.patch b/sys-apps/smartmontools/files/smartmontools-6.6-fix-build-on-musl.patch
new file mode 100644 (file)
index 0000000..2cd36e0
--- /dev/null
@@ -0,0 +1,13 @@
+Bug: https://bugs.gentoo.org/644586
+
+Upstream fix: https://www.smartmontools.org/changeset/4603
+
+--- smartmontools-6.6/os_linux.cpp
++++ smartmontools-6.6/os_linux.cpp
+@@ -3177,5 +3177,5 @@
+   char path[128];
+   snprintf(path, sizeof(path), "/sys/block/%s/device", name);
+-  char * syshostpath = canonicalize_file_name(path);
++  char * syshostpath = realpath(name, (char *)0);
+   if (!syshostpath)
+     return false;
index e96fcf91947366838a0f454a514edbdbf35e1143..5edbb8d138d34136f330b4048f635636c9a84f7f 100644 (file)
@@ -47,6 +47,8 @@ RDEPEND="${DEPEND}
 
 REQUIRED_USE="( caps? ( daemon ) )"
 
+PATCHES=( "${FILESDIR}"/${P}-fix-build-on-musl.patch )
+
 src_prepare() {
        default