From 66801d7fecf84023164d5c596c80eaa4fc6f73b2 Mon Sep 17 00:00:00 2001 From: Felix Janda Date: Sat, 26 Nov 2016 14:33:04 -0500 Subject: sys-fs/squashfs-tools: fix build with musl Add two patches: First patch is essentially from https://github.com/plougher/squashfs-tools/pull/3 and gives a fallback for missing FNM_EXTMATCH. The second patch is from https://github.com/plougher/squashfs-tools/pull/9 and adds the missing include for the S_IF* constants. Fixes: https://github.com/gentoo/gentoo/pull/2922 Gentoo-Bug: https://bugs.gentoo.org/600934 (cherry picked from commit 56065404e0d3d90f7ee5ce1b759e9044e655de88) Signed-off-by: Robin H. Johnson --- .../files/squashfs-tools-4.3-extmatch.patch | 121 +++++++++++++++++++++ .../files/squashfs-tools-4.3-musl.patch | 24 ++++ sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild | 2 + 3 files changed, 147 insertions(+) create mode 100644 sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch create mode 100644 sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch (limited to 'sys-fs/squashfs-tools') diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch new file mode 100644 index 000000000000..7ffc062006c0 --- /dev/null +++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch @@ -0,0 +1,121 @@ +From https://github.com/plougher/squashfs-tools/pull/9 + +From 4280e74de14070869787a9166242f9ce2dafd82e Mon Sep 17 00:00:00 2001 +From: Alexandru Ardelean +Date: Wed, 6 Jan 2016 15:33:43 +0200 +Subject: [PATCH] squashfs-tools: with fnmatch.h compatibility with musl + +musl does not define FNM_EXTMATCH + +Signed-off-by: Alexandru Ardelean +--- + squashfs-tools/action.c | 2 +- + squashfs-tools/fnmatch_compat.h | 32 ++++++++++++++++++++++++++++++++ + squashfs-tools/mksquashfs.c | 2 +- + squashfs-tools/unsquashfs.c | 1 + + squashfs-tools/unsquashfs.h | 1 - + 5 files changed, 35 insertions(+), 3 deletions(-) + create mode 100644 squashfs-tools/fnmatch_compat.h + +diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c +index 35889a4..4b06ccb 100644 +--- a/squashfs-tools/action.c ++++ b/squashfs-tools/action.c +@@ -31,7 +31,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -43,6 +42,7 @@ + #include "mksquashfs.h" + #include "action.h" + #include "error.h" ++#include "fnmatch_compat.h" + + /* + * code to parse actions +diff --git a/squashfs-tools/fnmatch_compat.h b/squashfs-tools/fnmatch_compat.h +new file mode 100644 +index 0000000..7b4afd8 +--- /dev/null ++++ b/squashfs-tools/fnmatch_compat.h +@@ -0,0 +1,32 @@ ++#ifndef FNMATCH_COMPAT ++#define FNMATCH_COMPAT ++/* ++ * Squashfs ++ * ++ * Copyright (c) 2015 ++ * Phillip Lougher ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * fnmatch_compat.h ++ */ ++ ++#include ++ ++#ifndef FNM_EXTMATCH ++#define FNM_EXTMATCH 0 ++#endif ++ ++#endif +diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c +index d221c35..4e7cbdd 100644 +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -46,7 +46,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -76,6 +75,7 @@ + #include "read_fs.h" + #include "restore.h" + #include "process_fragments.h" ++#include "fnmatch_compat.h" + + int delete = FALSE; + int fd; +diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c +index 1323dd6..2428baa 100644 +--- a/squashfs-tools/unsquashfs.c ++++ b/squashfs-tools/unsquashfs.c +@@ -30,6 +30,7 @@ + #include "xattr.h" + #include "unsquashfs_info.h" + #include "stdarg.h" ++#include "fnmatch_compat.h" + + #include + #include +diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h +index ecd0bb4..0edbd25 100644 +--- a/squashfs-tools/unsquashfs.h ++++ b/squashfs-tools/unsquashfs.h +@@ -40,7 +40,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch new file mode 100644 index 000000000000..52b7f48c8eab --- /dev/null +++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch @@ -0,0 +1,24 @@ +From https://github.com/plougher/squashfs-tools/pull/9 + +From b0ca8a5c98ff73e70b2ab1bc24aa824aa2458287 Mon Sep 17 00:00:00 2001 +From: Alexandru Ardelean +Date: Wed, 6 Jan 2016 15:36:48 +0200 +Subject: [PATCH] pseudo.c: add explicit include + +Signed-off-by: Alexandru Ardelean +--- + squashfs-tools/pseudo.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c +index f85fe60..83bfc97 100644 +--- a/squashfs-tools/pseudo.c ++++ b/squashfs-tools/pseudo.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + + #include "pseudo.h" diff --git a/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild b/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild index 7b050d6908ad..1729abe02c72 100644 --- a/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild +++ b/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild @@ -38,6 +38,8 @@ src_prepare() { epatch "${FILESDIR}"/${P}-local-cve-fix.patch epatch "${FILESDIR}"/${P}-mem-overflow.patch epatch "${FILESDIR}"/${P}-xattrs.patch + epatch "${FILESDIR}"/${P}-extmatch.patch + epatch "${FILESDIR}"/${P}-musl.patch } use10() { usex $1 1 0 ; } -- cgit v1.2.3-65-gdbad