sys-fs/squashfs-tools: Fix includes
authorJeroen Roovers <jer@gentoo.org>
Thu, 14 Mar 2019 15:13:48 +0000 (16:13 +0100)
committerJeroen Roovers <jer@gentoo.org>
Thu, 14 Mar 2019 15:15:06 +0000 (16:15 +0100)
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Bug: https://bugs.gentoo.org/show_bug.cgi?id=575232
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
sys-fs/squashfs-tools/files/squashfs-tools-3.2-makedev.patch [new file with mode: 0644]
sys-fs/squashfs-tools/files/squashfs-tools-3.4-makedev.patch [new file with mode: 0644]
sys-fs/squashfs-tools/squashfs-tools-3.2_p2-r1.ebuild [new file with mode: 0644]
sys-fs/squashfs-tools/squashfs-tools-3.4-r1.ebuild [new file with mode: 0644]

diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-3.2-makedev.patch b/sys-fs/squashfs-tools/files/squashfs-tools-3.2-makedev.patch
new file mode 100644 (file)
index 0000000..b7bffe0
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -34,6 +34,7 @@
+ #include <zlib.h>
+ #include <sys/mman.h>
+ #include <utime.h>
++#include <sys/sysmacros.h> /* makedev */
+ 
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -44,6 +44,7 @@
+ #include <sys/mman.h>
+ #include <pthread.h>
+ #include <math.h>
++#include <sys/sysmacros.h> /* makedev */
+ 
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-3.4-makedev.patch b/sys-fs/squashfs-tools/files/squashfs-tools-3.4-makedev.patch
new file mode 100644 (file)
index 0000000..17eb3ff
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -47,6 +47,7 @@
+ #include <math.h>
+ #include <regex.h>
+ #include <fnmatch.h>
++#include <sys/sysmacros.h> /* makedev */
+ 
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -47,6 +47,7 @@
+ #include <math.h>
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
++#include <sys/sysmacros.h> /* makedev */
+ 
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
diff --git a/sys-fs/squashfs-tools/squashfs-tools-3.2_p2-r1.ebuild b/sys-fs/squashfs-tools/squashfs-tools-3.2_p2-r1.ebuild
new file mode 100644 (file)
index 0000000..969a1b0
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs
+
+MY_PV=${PV/_p/-r}
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="3.0" # squashfs filesystem version
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+RDEPEND="sys-libs/zlib"
+DEPEND="${RDEPEND}"
+S=${WORKDIR}/squashfs${MY_PV}/squashfs-tools
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.2-makedev.patch
+)
+
+src_prepare() {
+       default
+       sed -i \
+               -e 's:-O2:$(CFLAGS):' \
+               -e '/-lz/s:$: $(LDFLAGS):' \
+               Makefile || die
+
+       echo "struct dir_info; `grep '^int dir_scan2' mksquashfs.c`;" >> global.h
+}
+
+src_compile() {
+       emake CC="$(tc-getCC)"
+}
+
+src_install() {
+       newbin mksquashfs mksquashfs-${SLOT}
+       newbin unsquashfs unsquashfs-${SLOT}
+       cd ..
+       dodoc README ACKNOWLEDGEMENTS CHANGES PERFORMANCE.README README-3.2
+}
diff --git a/sys-fs/squashfs-tools/squashfs-tools-3.4-r1.ebuild b/sys-fs/squashfs-tools/squashfs-tools-3.4-r1.ebuild
new file mode 100644 (file)
index 0000000..4b252ea
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs
+
+MY_PV=${PV/_p/-r}
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="3.1" # squashfs filesystem version
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+RDEPEND="sys-libs/zlib"
+DEPEND="${RDEPEND}"
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.4-makedev.patch
+)
+S=${WORKDIR}/squashfs${MY_PV}/squashfs-tools
+
+src_prepare() {
+       default
+       sed -i \
+               -e 's:-O2:$(CFLAGS):' \
+               -e '/-lz/s:$: $(LDFLAGS):' \
+               Makefile || die
+
+       sed -i -e 's:get_nprocs():sysconf(_SC_NPROCESSORS_ONLN):' *.c
+}
+
+src_compile() {
+       emake CC="$(tc-getCC)"
+}
+
+src_install() {
+       newbin mksquashfs mksquashfs-${SLOT}
+       newbin unsquashfs unsquashfs-${SLOT}
+       cd ..
+       dodoc README ACKNOWLEDGEMENTS CHANGES PERFORMANCE.README README
+}