lol

squashfsTools: 4.5 -> 4.5.1

The patch that was previously fetched from GitHub is now part of the
4.5.1 release, and is no longer needed. Furthermore, 4.5.1 introduces
some new scripts to build manpages, and some new build inputs are
required to make that work.

This also rebases the Darwin patch. I don't have a Mac so I can't test
this personally. There was one conflict:

diff --cc squashfs-tools/read_xattrs.c
index 2067f80,b28c3a0..0000000
--- a/squashfs-tools/read_xattrs.c
+++ b/squashfs-tools/read_xattrs.c
@@@ -36,9 -38,7 +38,7 @@@
#include "xattr.h"
#include "error.h"

- #include <stdlib.h>
-
-extern int read_fs_bytes(int, long long, int, void *);
+extern int read_fs_bytes(int, long long, long long, void *);
extern int read_block(int, long long, long long *, int, void *);

static struct hash_entry {

Resolved by updating the signature from int to long long.

+30 -31
+18 -18
pkgs/tools/filesystems/squashfs/darwin.patch
··· 5 5 See also https://github.com/plougher/squashfs-tools/pull/69. 6 6 7 7 diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c 8 - index 4b06ccb..3cad2ab 100644 8 + index ea2f604..9c979f8 100644 9 9 --- a/squashfs-tools/action.c 10 10 +++ b/squashfs-tools/action.c 11 11 @@ -39,6 +39,10 @@ ··· 19 19 #include "squashfs_fs.h" 20 20 #include "mksquashfs.h" 21 21 #include "action.h" 22 - @@ -2414,9 +2418,12 @@ static char *get_start(char *s, int n) 22 + @@ -2415,9 +2419,12 @@ static char *get_start(char *s, int n) 23 23 24 24 static int subpathname_fn(struct atom *atom, struct action_data *action_data) 25 25 { ··· 34 34 35 35 /* 36 36 diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c 37 - index fe23d78..5c2f835 100644 37 + index 216b979..eea2ec9 100644 38 38 --- a/squashfs-tools/info.c 39 39 +++ b/squashfs-tools/info.c 40 40 @@ -144,31 +144,22 @@ void dump_state() ··· 89 89 } 90 90 91 91 diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c 92 - index a45b77f..3607448 100644 92 + index 843f9f4..ed2c3a6 100644 93 93 --- a/squashfs-tools/mksquashfs.c 94 94 +++ b/squashfs-tools/mksquashfs.c 95 95 @@ -35,7 +35,12 @@ ··· 117 117 118 118 #ifndef linux 119 119 #include <sys/sysctl.h> 120 - @@ -5022,6 +5030,7 @@ static void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, 120 + @@ -5064,6 +5072,7 @@ static void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, 121 121 sigemptyset(&sigmask); 122 122 sigaddset(&sigmask, SIGQUIT); 123 123 sigaddset(&sigmask, SIGHUP); ··· 125 125 if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0) 126 126 BAD_ERROR("Failed to set signal mask in intialise_threads\n"); 127 127 128 - @@ -5760,6 +5769,35 @@ static int get_physical_memory() 128 + @@ -5802,6 +5811,35 @@ static int get_physical_memory() 129 129 long long page_size = sysconf(_SC_PAGESIZE); 130 130 int phys_mem; 131 131 ··· 161 161 if(num_pages == -1 || page_size == -1) { 162 162 struct sysinfo sys; 163 163 int res = sysinfo(&sys); 164 - @@ -5772,6 +5810,7 @@ static int get_physical_memory() 164 + @@ -5814,6 +5852,7 @@ static int get_physical_memory() 165 165 } 166 166 167 167 phys_mem = num_pages * page_size >> 20; ··· 170 170 if(phys_mem < SQUASHFS_LOWMEM) 171 171 BAD_ERROR("Mksquashfs requires more physical memory than is " 172 172 diff --git a/squashfs-tools/read_xattrs.c b/squashfs-tools/read_xattrs.c 173 - index 4debedf..3257c30 100644 173 + index 2067f80..ca8b7f4 100644 174 174 --- a/squashfs-tools/read_xattrs.c 175 175 +++ b/squashfs-tools/read_xattrs.c 176 176 @@ -31,13 +31,13 @@ ··· 186 186 187 187 -#include <stdlib.h> 188 188 - 189 - extern int read_fs_bytes(int, long long, int, void *); 189 + extern int read_fs_bytes(int, long long, long long, void *); 190 190 extern int read_block(int, long long, long long *, int, void *); 191 191 192 192 diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c 193 - index 727f1d5..c1a6183 100644 193 + index d434b42..1208e45 100644 194 194 --- a/squashfs-tools/unsquashfs.c 195 195 +++ b/squashfs-tools/unsquashfs.c 196 196 @@ -32,8 +32,12 @@ ··· 206 206 #include <sys/types.h> 207 207 #include <sys/time.h> 208 208 #include <sys/resource.h> 209 - @@ -1175,7 +1179,7 @@ int create_inode(char *pathname, struct inode *i) 209 + @@ -1182,7 +1186,7 @@ int create_inode(char *pathname, struct inode *i) 210 210 break; 211 211 case SQUASHFS_SYMLINK_TYPE: 212 212 case SQUASHFS_LSYMLINK_TYPE: { ··· 215 215 { i->time, 0 }, 216 216 { i->time, 0 } 217 217 }; 218 - @@ -1194,8 +1198,7 @@ int create_inode(char *pathname, struct inode *i) 218 + @@ -1201,8 +1205,7 @@ int create_inode(char *pathname, struct inode *i) 219 219 goto failed; 220 220 } 221 221 ··· 225 225 if(res == -1) { 226 226 EXIT_UNSQUASH_STRICT("create_inode: failed to" 227 227 " set time on %s, because %s\n", 228 - @@ -2683,6 +2686,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size, int cat_ 228 + @@ -2687,6 +2690,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size, int cat_ 229 229 sigemptyset(&sigmask); 230 230 sigaddset(&sigmask, SIGQUIT); 231 231 sigaddset(&sigmask, SIGHUP); ··· 234 234 EXIT_UNSQUASH("Failed to set signal mask in initialise_threads\n"); 235 235 236 236 diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h 237 - index 934618b..0e680ab 100644 237 + index 1099678..5b6a038 100644 238 238 --- a/squashfs-tools/unsquashfs.h 239 239 +++ b/squashfs-tools/unsquashfs.h 240 240 @@ -46,6 +46,10 @@ ··· 249 249 #include "squashfs_fs.h" 250 250 #include "unsquashfs_error.h" 251 251 diff --git a/squashfs-tools/unsquashfs_info.c b/squashfs-tools/unsquashfs_info.c 252 - index c8e2b9b..7d4f7af 100644 252 + index e906eaf..f1e68c2 100644 253 253 --- a/squashfs-tools/unsquashfs_info.c 254 254 +++ b/squashfs-tools/unsquashfs_info.c 255 255 @@ -96,31 +96,22 @@ void dump_state() ··· 304 304 } 305 305 306 306 diff --git a/squashfs-tools/unsquashfs_xattr.c b/squashfs-tools/unsquashfs_xattr.c 307 - index 7742dfe..f8cd3b6 100644 307 + index 61910e1..73e0090 100644 308 308 --- a/squashfs-tools/unsquashfs_xattr.c 309 309 +++ b/squashfs-tools/unsquashfs_xattr.c 310 310 @@ -27,6 +27,11 @@ ··· 320 320 321 321 extern int root_process; 322 322 diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c 323 - index 64dfd82..d82d186 100644 323 + index b1c0089..6d7ed98 100644 324 324 --- a/squashfs-tools/xattr.c 325 325 +++ b/squashfs-tools/xattr.c 326 326 @@ -22,6 +22,14 @@ ··· 353 353 #include "squashfs_swap.h" 354 354 #include "mksquashfs.h" 355 355 -- 356 - 2.23.0 356 + 2.35.1 357 357
+12 -13
pkgs/tools/filesystems/squashfs/default.nix
··· 2 2 , stdenv 3 3 , fetchFromGitHub 4 4 , fetchpatch 5 - , zlib 6 - , xz 5 + , help2man 7 6 , lz4 8 7 , lzo 8 + , nixosTests 9 + , which 10 + , xz 11 + , zlib 9 12 , zstd 10 - , nixosTests 11 13 }: 12 14 13 15 stdenv.mkDerivation rec { 14 16 pname = "squashfs"; 15 - version = "4.5"; 17 + version = "4.5.1"; 16 18 17 19 src = fetchFromGitHub { 18 20 owner = "plougher"; 19 21 repo = "squashfs-tools"; 20 22 rev = version; 21 - sha256 = "1nanwz5qvsakxfm37md5i7xqagv69nfik9hpj8qlp6ymw266vgxr"; 23 + sha256 = "sha256-Y3ZPjeE9HN1F+NtGe6EchYziWrTPVQ4SuKaCvNbXMKI="; 22 24 }; 23 25 24 26 patches = [ 25 27 # This patch adds an option to pad filesystems (increasing size) in 26 28 # exchange for better chunking / binary diff calculation. 27 29 ./4k-align.patch 28 - # Otherwise sizes of some files may break in our ISO; see 29 - # https://github.com/NixOS/nixpkgs/issues/132286 30 - (fetchpatch { 31 - url = "https://github.com/plougher/squashfs-tools/commit/19b161c1cd3e31f7a396ea92dea4390ad43f27b9.diff"; 32 - sha256 = "15ng8m2my3a6a9hnfx474bip2vwdh08hzs2k0l5gwd36jv2z1h3f"; 33 - }) 34 30 ] ++ lib.optional stdenv.isDarwin ./darwin.patch; 35 31 36 - buildInputs = [ zlib xz zstd lz4 lzo ]; 32 + buildInputs = [ zlib xz zstd lz4 lzo which help2man ]; 37 33 38 34 preBuild = '' 39 35 cd squashfs-tools 40 36 '' ; 41 37 42 - installFlags = [ "INSTALL_DIR=${placeholder "out"}/bin" ]; 38 + installFlags = [ 39 + "INSTALL_DIR=${placeholder "out"}/bin" 40 + "INSTALL_MANPAGES_DIR=${placeholder "out"}/share/man/man1" 41 + ]; 43 42 44 43 makeFlags = [ 45 44 "XZ_SUPPORT=1"