diff options
-rw-r--r-- | filesystems/squashfs/DESCR | 10 | ||||
-rw-r--r-- | filesystems/squashfs/Makefile | 38 | ||||
-rw-r--r-- | filesystems/squashfs/PLIST | 32 | ||||
-rw-r--r-- | filesystems/squashfs/distinfo | 20 | ||||
-rw-r--r-- | filesystems/squashfs/options.mk | 32 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-Makefile | 61 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-action.c | 17 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-fnm__extmatch.h | 15 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-mksquashfs.c | 53 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-pseudo.c | 13 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-unsquashfs.c | 31 |
11 files changed, 164 insertions, 158 deletions
diff --git a/filesystems/squashfs/DESCR b/filesystems/squashfs/DESCR index a7e9184ef28..860783900c9 100644 --- a/filesystems/squashfs/DESCR +++ b/filesystems/squashfs/DESCR @@ -1,8 +1,8 @@ -Squashfs is a highly compressed read-only filesystem for Linux. -It uses either gzip/xz/lzo/lz4 compression to compress both files, inodes -and directories. Inodes in the system are very small and all blocks are -packed to minimise data overhead. Block sizes greater than 4K are supported -up to a maximum of 1Mbytes (default block size 128K). +Squashfs is a highly compressed read-only filesystem for Linux. It +uses either gzip/xz/lzo/lz4/zstd compression to compress both files, +inodes and directories. Inodes in the system are very small and all +blocks are packed to minimise data overhead. Block sizes greater than +4K are supported up to a maximum of 1Mbytes (default block size 128K). Squashfs is intended for general read-only filesystem use, for archival use (i.e. in cases where a .tar.gz file may be used), and in constrained diff --git a/filesystems/squashfs/Makefile b/filesystems/squashfs/Makefile index 0f632508531..30da6f99eea 100644 --- a/filesystems/squashfs/Makefile +++ b/filesystems/squashfs/Makefile @@ -1,15 +1,16 @@ -# $NetBSD: Makefile,v 1.7 2020/03/20 11:57:37 nia Exp $ +# $NetBSD: Makefile,v 1.8 2020/06/19 21:17:46 scole Exp $ -VERSION= 4.3 -DISTNAME= squashfs${VERSION} +VERSION= 4.4 +DISTNAME= squashfs-tools-${VERSION} PKGNAME= squashfs-${VERSION} -PKGREVISION= 2 CATEGORIES= filesystems -MASTER_SITES= http://downloads.sourceforge.net/project/squashfs/squashfs/${DISTNAME}/ +MASTER_SITES= ${MASTER_SITE_GITHUB:=plougher/} +GITHUB_PROJECT= squashfs-tools +GITHUB_TAG= ${PKGVERSION_NOREV} MAINTAINER= pkgsrc-users@NetBSD.org -HOMEPAGE= http://squashfs.sourceforge.net/ +HOMEPAGE= https://github.com/plougher/squashfs-tools COMMENT= Tools for squashfs archives LICENSE= gnu-gpl-v2 @@ -19,33 +20,32 @@ LICENSE= gnu-gpl-v2 USE_LANGUAGES= c USE_TOOLS+= gmake +USE_LIBTOOL= yes INSTALLATION_DIRS= bin \ share/doc/squashfs \ - share/doc/squashfs/OLD-READMEs \ - share/examples/squashfs + share/doc/squashfs/RELEASE-READMEs SQUASH_DIR= ${WRKDIR}/${DISTNAME} WRKSRC= ${SQUASH_DIR}/squashfs-tools SQUASH_PKG_DOC= ${DESTDIR}${PREFIX}/share/doc/squashfs -MAKE_ENV+= EXTRA_LDFLAGS="${COMPILER_RPATH_FLAG}${PREFIX}/lib" +# xxx no sigtimedwait or sigwaitinfo on mac os? +BROKEN_ON_PLATFORM= Darwin-*-* do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/mksquashfs ${DESTDIR}${PREFIX}/bin - ${INSTALL_PROGRAM} ${WRKSRC}/unsquashfs ${DESTDIR}${PREFIX}/bin + ${LIBTOOL} --mode=install ${INSTALL_PROGRAM} \ + ${WRKSRC}/mksquashfs ${DESTDIR}${PREFIX}/bin + ${LIBTOOL} --mode=install ${INSTALL_PROGRAM} \ + ${WRKSRC}/unsquashfs ${DESTDIR}${PREFIX}/bin ${INSTALL_DATA} ${SQUASH_DIR}/ACKNOWLEDGEMENTS ${SQUASH_PKG_DOC} ${INSTALL_DATA} ${SQUASH_DIR}/CHANGES ${SQUASH_PKG_DOC} ${INSTALL_DATA} ${SQUASH_DIR}/COPYING ${SQUASH_PKG_DOC} - ${INSTALL_DATA} ${SQUASH_DIR}/DONATIONS ${SQUASH_PKG_DOC} ${INSTALL_DATA} ${SQUASH_DIR}/INSTALL ${SQUASH_PKG_DOC} - ${INSTALL_DATA} ${SQUASH_DIR}/PERFORMANCE.README ${SQUASH_PKG_DOC} ${INSTALL_DATA} ${SQUASH_DIR}/README ${SQUASH_PKG_DOC} - ${INSTALL_DATA} ${SQUASH_DIR}/README-4.3 ${SQUASH_PKG_DOC} - ${INSTALL_DATA} ${SQUASH_DIR}/OLD-READMEs/* ${SQUASH_PKG_DOC}/OLD-READMEs/ - ${INSTALL_DATA} ${SQUASH_DIR}/pseudo-file.example ${DESTDIR}${PREFIX}/share/examples/squashfs/ + ${INSTALL_DATA} ${SQUASH_DIR}/README-4.4 ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/USAGE ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/RELEASE-READMEs/* \ + ${SQUASH_PKG_DOC}/RELEASE-READMEs/ -.include "../../archivers/lzo/buildlink3.mk" -.include "../../archivers/xz/buildlink3.mk" -.include "../../devel/zlib/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/filesystems/squashfs/PLIST b/filesystems/squashfs/PLIST index a8d022c9df4..f328a88931c 100644 --- a/filesystems/squashfs/PLIST +++ b/filesystems/squashfs/PLIST @@ -1,22 +1,24 @@ -@comment $NetBSD: PLIST,v 1.3 2018/01/01 22:29:28 rillig Exp $ +@comment $NetBSD: PLIST,v 1.4 2020/06/19 21:17:46 scole Exp $ bin/mksquashfs bin/unsquashfs share/doc/squashfs/ACKNOWLEDGEMENTS share/doc/squashfs/CHANGES share/doc/squashfs/COPYING -share/doc/squashfs/DONATIONS share/doc/squashfs/INSTALL -share/doc/squashfs/OLD-READMEs/README-2.0 -share/doc/squashfs/OLD-READMEs/README-2.1 -share/doc/squashfs/OLD-READMEs/README-3.0 -share/doc/squashfs/OLD-READMEs/README-3.1 -share/doc/squashfs/OLD-READMEs/README-3.2 -share/doc/squashfs/OLD-READMEs/README-3.3 -share/doc/squashfs/OLD-READMEs/README-4.0 -share/doc/squashfs/OLD-READMEs/README-4.1 -share/doc/squashfs/OLD-READMEs/README-4.2 -share/doc/squashfs/OLD-READMEs/README-AMD64 -share/doc/squashfs/PERFORMANCE.README share/doc/squashfs/README -share/doc/squashfs/README-4.3 -share/examples/squashfs/pseudo-file.example +share/doc/squashfs/README-4.4 +share/doc/squashfs/RELEASE-READMEs/DONATIONS +share/doc/squashfs/RELEASE-READMEs/PERFORMANCE.README +share/doc/squashfs/RELEASE-READMEs/README-2.0 +share/doc/squashfs/RELEASE-READMEs/README-2.0-AMD64 +share/doc/squashfs/RELEASE-READMEs/README-2.1 +share/doc/squashfs/RELEASE-READMEs/README-3.0 +share/doc/squashfs/RELEASE-READMEs/README-3.1 +share/doc/squashfs/RELEASE-READMEs/README-3.2 +share/doc/squashfs/RELEASE-READMEs/README-3.3 +share/doc/squashfs/RELEASE-READMEs/README-4.0 +share/doc/squashfs/RELEASE-READMEs/README-4.1 +share/doc/squashfs/RELEASE-READMEs/README-4.2 +share/doc/squashfs/RELEASE-READMEs/README-4.3 +share/doc/squashfs/RELEASE-READMEs/pseudo-file.example +share/doc/squashfs/USAGE diff --git a/filesystems/squashfs/distinfo b/filesystems/squashfs/distinfo index 963c1958beb..1242d364370 100644 --- a/filesystems/squashfs/distinfo +++ b/filesystems/squashfs/distinfo @@ -1,12 +1,10 @@ -$NetBSD: distinfo,v 1.2 2017/02/09 18:16:07 scole Exp $ +$NetBSD: distinfo,v 1.3 2020/06/19 21:17:46 scole Exp $ -SHA1 (squashfs4.3.tar.gz) = a615979db9cee82e4a934a1455577f597d290b41 -RMD160 (squashfs4.3.tar.gz) = fc91627c0757205c4a0fbe2037913cec1cefb1fd -SHA512 (squashfs4.3.tar.gz) = 854ed7acc99920f24ecf11e0da807e5a2a162eeda55db971aba63a03f0da2c13b20ec0564a906c4b0e415bd8258b273a10208c7abc0704f2ceea773aa6148a79 -Size (squashfs4.3.tar.gz) = 182550 bytes -SHA1 (patch-Makefile) = e9701425da11a12157407f6212ad0e1cd7fed536 -SHA1 (patch-action.c) = d0fc02e79f93a125f20992362214b359460bdce2 -SHA1 (patch-fnm__extmatch.h) = 167c9b473c78f3e10d7536791d63e42c39794e4a -SHA1 (patch-mksquashfs.c) = 8e91a84b4bfd0de4aef79d9165ff41f17e5b8c41 -SHA1 (patch-pseudo.c) = 6c4e94d8f559404f7b6e155c71267ce7fd6c1456 -SHA1 (patch-unsquashfs.c) = 1e02204097129fdd0309124d2a664c2e081db2f0 +SHA1 (squashfs-tools-4.4.tar.gz) = 883eb8bfae3aaef619e6d3b7ae51f5aa83097cfd +RMD160 (squashfs-tools-4.4.tar.gz) = 1967b075376dbc05c9683509afd508af89e95d65 +SHA512 (squashfs-tools-4.4.tar.gz) = 133ce437fb8c929933d52cff710b61dd9181f6f8be58250b0d6a59a7bb79a2b350f68f456b06a0e17c469409a71272d586802d570248273ddcd5dad088c00308 +Size (squashfs-tools-4.4.tar.gz) = 241842 bytes +SHA1 (patch-Makefile) = ee53cb3c16983cb3767df2ccdcf4636bd646fc3c +SHA1 (patch-action.c) = 35200e6cafd0846fb05fac50862ba3ceb4777935 +SHA1 (patch-mksquashfs.c) = 723e9250e0ce821825de916671ac51251dce9432 +SHA1 (patch-unsquashfs.c) = 167ee4ec1aea744dac6e13d837f1ae19a0f2472a diff --git a/filesystems/squashfs/options.mk b/filesystems/squashfs/options.mk index 725180b8994..4020d7dece8 100644 --- a/filesystems/squashfs/options.mk +++ b/filesystems/squashfs/options.mk @@ -1,20 +1,18 @@ -# $NetBSD: options.mk,v 1.3 2019/11/03 19:26:22 rillig Exp $ +# $NetBSD: options.mk,v 1.4 2020/06/19 21:17:46 scole Exp $ +# xxx unsquashfs hung for me without any error message when extracting +# an xattr archive and xattr was an included as a package option PKG_OPTIONS_VAR= PKG_OPTIONS.squashfs -PKG_SUPPORTED_OPTIONS= zlib lz4 lzo xz xattr -PKG_SUGGESTED_OPTIONS= zlib lzo xz +PKG_SUPPORTED_OPTIONS= zlib xz lzo lz4 zstd xattr reproducible +PKG_SUGGESTED_OPTIONS= zlib xz lzo lz4 zstd xattr reproducible .include "../../mk/bsd.options.mk" -# XXX any other OS support xattr? -.if ${OPSYS} == "Linux" -PKG_SUGGESTED_OPTIONS+= xattr -.endif - .if empty(PKG_OPTIONS:Mzlib) && \ empty(PKG_OPTIONS:Mlz4) && \ empty(PKG_OPTIONS:Mlzo) && \ - empty(PKG_OPTIONS:Mxz) + empty(PKG_OPTIONS:Mxz) && \ + empty(PKG_OPTIONS:Mzstd) PKG_FAIL_REASON= "need at least one compression algorithm selected" .endif @@ -29,7 +27,7 @@ BUILD_MAKE_FLAGS+= GZIP_SUPPORT=0 .if !empty(PKG_OPTIONS:Mlz4) .include "../../archivers/lz4/buildlink3.mk" BUILD_MAKE_FLAGS+= LZ4_SUPPORT=1 -SQUASH_COMPRESSORS+= lz4 +SQUASH_COMPRESSORS+= lz4 .else BUILD_MAKE_FLAGS+= LZ4_SUPPORT=0 .endif @@ -50,6 +48,14 @@ SQUASH_COMPRESSORS+= xz BUILD_MAKE_FLAGS+= XZ_SUPPORT=0 .endif +.if !empty(PKG_OPTIONS:Mzstd) +.include "../../archivers/zstd/buildlink3.mk" +BUILD_MAKE_FLAGS+= ZSTD_SUPPORT=1 +SQUASH_COMPRESSORS+= zstd +.else +BUILD_MAKE_FLAGS+= ZSTD_SUPPORT=0 +.endif + .if !empty(PKG_OPTIONS:Mxattr) BUILD_MAKE_FLAGS+= XATTR_SUPPORT=1 .else @@ -66,3 +72,9 @@ BUILD_MAKE_FLAGS+= COMP_DEFAULT=gzip BUILD_MAKE_FLAGS+= COMP_DEFAULT=${SQUASH_COMPRESSORS:Nxattr:[1]} . endif .endif + +.if !empty(PKG_OPTIONS:Mreproducible) +BUILD_MAKE_FLAGS+= REPRODUCIBLE_DEFAULT=1 +.else +BUILD_MAKE_FLAGS+= REPRODUCIBLE_DEFAULT=0 +.endif diff --git a/filesystems/squashfs/patches/patch-Makefile b/filesystems/squashfs/patches/patch-Makefile index 3adab6f7484..10001f3ca48 100644 --- a/filesystems/squashfs/patches/patch-Makefile +++ b/filesystems/squashfs/patches/patch-Makefile @@ -1,8 +1,9 @@ -$NetBSD: patch-Makefile,v 1.2 2017/02/09 18:16:08 scole Exp $ -Add fnm_extmatch.h dependency, use options framework +$NetBSD: patch-Makefile,v 1.3 2020/06/19 21:17:46 scole Exp $ ---- Makefile.orig 2014-05-11 11:56:00.000000000 -0700 -+++ Makefile 2017-02-06 12:08:05.000000000 -0800 +use options framework and libtool + +--- Makefile.orig 2019-08-29 01:58:04.000000000 +0000 ++++ Makefile @@ -15,7 +15,7 @@ # Obviously, you must select at least one of the available gzip, lzma, lzo # compression types. @@ -12,16 +13,16 @@ Add fnm_extmatch.h dependency, use options framework ########### Building XZ support ############# # -@@ -81,7 +81,7 @@ +@@ -85,7 +85,7 @@ GZIP_SUPPORT = 1 # in Mksquashfs. Obviously the compression algorithm must have been # selected to be built # -COMP_DEFAULT = gzip +#COMP_DEFAULT = gzip + ############################################### - # Extended attribute (XATTRs) build options # -@@ -92,7 +92,7 @@ +@@ -97,7 +97,7 @@ COMP_DEFAULT = gzip # If your C library or build/target environment doesn't support XATTRs then # comment out the next line to build Mksquashfs and Unsquashfs without XATTR # support @@ -30,7 +31,7 @@ Add fnm_extmatch.h dependency, use options framework # Select whether you wish xattrs to be stored by Mksquashfs and extracted # by Unsquashfs by default. If selected users can disable xattr support by -@@ -100,7 +100,7 @@ +@@ -105,7 +105,7 @@ XATTR_SUPPORT = 1 # # If unselected, Mksquashfs/Unsquashfs won't store and extract xattrs by # default. Users can enable xattrs by using the -xattrs option. @@ -39,31 +40,33 @@ Add fnm_extmatch.h dependency, use options framework ############################################### -@@ -229,7 +229,8 @@ - - mksquashfs.o: Makefile mksquashfs.c squashfs_fs.h squashfs_swap.h mksquashfs.h \ - sort.h pseudo.h compressor.h xattr.h action.h error.h progressbar.h \ -- info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h -+ info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h \ -+ fnm_extmatch.h +@@ -277,11 +277,15 @@ $(error "COMP_DEFAULT is set to ${COMP_D + built!") + endif - read_fs.o: read_fs.c squashfs_fs.h squashfs_swap.h compressor.h xattr.h \ - error.h mksquashfs.h -@@ -247,7 +248,7 @@ ++%.lo : %.c ++ $(LIBTOOL) --mode=compile --tag=CC $(CC) -o $@ -c $(CFLAGS) $(CPPFLAGS) $< ++ + .PHONY: all + all: mksquashfs unsquashfs - read_xattrs.o: read_xattrs.c squashfs_fs.h squashfs_swap.h xattr.h error.h +-mksquashfs: $(MKSQUASHFS_OBJS) +- $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(MKSQUASHFS_OBJS) $(LIBS) -o $@ ++mksquashfs: $(MKSQUASHFS_OBJS:.o=.lo) ++ $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(MKSQUASHFS_OBJS:.o=.lo) \ ++ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LIBS) --action.o: action.c squashfs_fs.h mksquashfs.h action.h error.h -+action.o: action.c squashfs_fs.h mksquashfs.h action.h error.h fnm_extmatch.h + mksquashfs.o: Makefile mksquashfs.c squashfs_fs.h squashfs_swap.h mksquashfs.h \ + sort.h pseudo.h compressor.h xattr.h action.h error.h progressbar.h \ +@@ -331,8 +335,9 @@ lz4_wrapper.o: lz4_wrapper.c squashfs_fs - progressbar.o: progressbar.c error.h + xz_wrapper.o: xz_wrapper.c squashfs_fs.h xz_wrapper.h compressor.h -@@ -279,7 +280,7 @@ - $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(UNSQUASHFS_OBJS) $(LIBS) -o $@ +-unsquashfs: $(UNSQUASHFS_OBJS) +- $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(UNSQUASHFS_OBJS) $(LIBS) -o $@ ++unsquashfs: $(UNSQUASHFS_OBJS:.o=.lo) ++ $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(UNSQUASHFS_OBJS:.o=.lo) \ ++ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LIBS) unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h \ -- squashfs_compat.h xattr.h read_fs.h compressor.h -+ squashfs_compat.h xattr.h read_fs.h compressor.h fnm_extmatch.h - - unsquash-1.o: unsquashfs.h unsquash-1.c squashfs_fs.h squashfs_compat.h - + squashfs_compat.h xattr.h read_fs.h compressor.h diff --git a/filesystems/squashfs/patches/patch-action.c b/filesystems/squashfs/patches/patch-action.c index 50f080671e3..f70d82767bc 100644 --- a/filesystems/squashfs/patches/patch-action.c +++ b/filesystems/squashfs/patches/patch-action.c @@ -1,17 +1,10 @@ -$NetBSD: patch-action.c,v 1.1 2016/09/09 15:40:17 scole Exp $ +$NetBSD: patch-action.c,v 1.2 2020/06/19 21:17:46 scole Exp $ + Do not use alloca and strdupa which some platforms may not have ---- action.c.orig 2014-05-10 04:54:13.000000000 +0000 +--- action.c.orig 2019-08-29 01:58:04.000000000 +0000 +++ action.c -@@ -43,6 +43,7 @@ - #include "mksquashfs.h" - #include "action.h" - #include "error.h" -+#include "fnm_extmatch.h" - - /* - * code to parse actions -@@ -1953,9 +1954,22 @@ static char *get_start(char *s, int n) +@@ -2284,9 +2284,22 @@ static char *get_start(char *s, int n) static int subpathname_fn(struct atom *atom, struct action_data *action_data) { @@ -34,4 +27,4 @@ Do not use alloca and strdupa which some platforms may not have + return ret_val; } - TEST_VAR_FN(filesize, ACTION_REG, action_data->buf->st_size) + /* diff --git a/filesystems/squashfs/patches/patch-fnm__extmatch.h b/filesystems/squashfs/patches/patch-fnm__extmatch.h deleted file mode 100644 index 92b37935fb0..00000000000 --- a/filesystems/squashfs/patches/patch-fnm__extmatch.h +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-fnm__extmatch.h,v 1.1 2016/09/09 15:40:17 scole Exp $ -Define FNM_EXTMATCH if not already defined - ---- fnm_extmatch.h.orig 2016-09-09 14:49:14.000000000 +0000 -+++ fnm_extmatch.h -@@ -0,0 +1,9 @@ -+/* -+ * this is defined in external/gpl[23]/gnulib various fnmatch_.h -+ * with _GNU_SOURCE or various _POSIX_C_SOURCE but not -+ * pksrgc/pkgtools/libnbcompat pkg/include/nbcompat/fnmatch.h or -+ * usr/include/fnmatch.h, what is best way to fix? -+ */ -+#ifndef FNM_EXTMATCH -+# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ -+#endif diff --git a/filesystems/squashfs/patches/patch-mksquashfs.c b/filesystems/squashfs/patches/patch-mksquashfs.c index f7381184501..56bb8568585 100644 --- a/filesystems/squashfs/patches/patch-mksquashfs.c +++ b/filesystems/squashfs/patches/patch-mksquashfs.c @@ -1,13 +1,44 @@ -$NetBSD: patch-mksquashfs.c,v 1.1 2016/09/09 15:40:17 scole Exp $ -Include fnm_extmatch.h +$NetBSD: patch-mksquashfs.c,v 1.2 2020/06/19 21:17:46 scole Exp $ ---- mksquashfs.c.orig 2014-05-12 22:18:20.000000000 +0000 +#ifdef linux includes and don't use sysinfo() unless for linux + +--- mksquashfs.c.orig 2019-08-29 01:58:04.000000000 +0000 +++ mksquashfs.c -@@ -76,6 +76,7 @@ - #include "read_fs.h" - #include "restore.h" - #include "process_fragments.h" -+#include "fnm_extmatch.h" - - int delete = FALSE; - int fd; +@@ -35,7 +35,9 @@ + #include <stddef.h> + #include <sys/types.h> + #include <sys/stat.h> ++#if defined(__linux__) + #include <sys/sysmacros.h> ++#endif + #include <fcntl.h> + #include <errno.h> + #include <dirent.h> +@@ -50,7 +52,9 @@ + #include <sys/wait.h> + #include <limits.h> + #include <ctype.h> ++#if defined(__linux__) + #include <sys/sysinfo.h> ++#endif + + #ifndef linux + #define __BYTE_ORDER BYTE_ORDER +@@ -5196,6 +5200,7 @@ int get_physical_memory() + int phys_mem; + + if(num_pages == -1 || page_size == -1) { ++#if defined(__linux__) + struct sysinfo sys; + int res = sysinfo(&sys); + +@@ -5204,6 +5209,9 @@ int get_physical_memory() + + num_pages = sys.totalram; + page_size = sys.mem_unit; ++#else ++ BAD_ERROR("Mksquashfs sysconf num_pages or page_size failed!\n"); ++#endif + } + + phys_mem = num_pages * page_size >> 20; diff --git a/filesystems/squashfs/patches/patch-pseudo.c b/filesystems/squashfs/patches/patch-pseudo.c deleted file mode 100644 index 4544b3acc7b..00000000000 --- a/filesystems/squashfs/patches/patch-pseudo.c +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-pseudo.c -include sys/stat.h - ---- pseudo.c.orig 2017-02-06 12:32:28.000000000 -0800 -+++ pseudo.c 2017-02-06 12:32:46.000000000 -0800 -@@ -32,6 +32,7 @@ - #include <stdlib.h> - #include <sys/types.h> - #include <sys/wait.h> -+#include <sys/stat.h> - #include <ctype.h> - - #include "pseudo.h" diff --git a/filesystems/squashfs/patches/patch-unsquashfs.c b/filesystems/squashfs/patches/patch-unsquashfs.c index 0823a127af1..8c2ce3d4de7 100644 --- a/filesystems/squashfs/patches/patch-unsquashfs.c +++ b/filesystems/squashfs/patches/patch-unsquashfs.c @@ -1,32 +1,27 @@ -$NetBSD: patch-unsquashfs.c,v 1.1 2016/09/09 15:40:17 scole Exp $ -Some workarounds for not using autoconf and include fnm_extmatch.h +$NetBSD: patch-unsquashfs.c,v 1.2 2020/06/19 21:17:46 scole Exp $ ---- unsquashfs.c.orig 2014-05-12 22:18:35.000000000 +0000 +Some workarounds for not using autoconf + +--- unsquashfs.c.orig 2019-08-29 01:58:04.000000000 +0000 +++ unsquashfs.c -@@ -31,13 +31,25 @@ - #include "unsquashfs_info.h" +@@ -32,8 +32,18 @@ #include "stdarg.h" + #include "fnmatch_compat.h" -#include <sys/sysinfo.h> -+/* XXX need autoconf */ -+#if ( defined(__linux__) ) -+ #include <sys/sysinfo.h> -+#endif -+ +-#include <sys/sysmacros.h> +/* XXX need autoconf HAVE_SYS_SYSCTL_H */ +#if ( defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__) || \ + defined(__FreeBSD__) || defined(__OpenBSD__) ) + #include <sys/sysctl.h> +#endif + ++/* XXX probably others... */ ++#if defined(__linux__) ++ #include <sys/sysinfo.h> ++ #include <sys/sysmacros.h> ++#endif ++ #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> - #include <limits.h> - #include <ctype.h> - -+#include "fnm_extmatch.h" -+ - struct cache *fragment_cache, *data_cache; - struct queue *to_reader, *to_inflate, *to_writer, *from_writer; - pthread_t *thread, *inflator_thread; |