Skip to content

Commit 2fa0901

Browse files
committed
squashfs_tools: update to version 4.7.2.
1 parent 3562c50 commit 2fa0901

File tree

2 files changed

+80
-57
lines changed

2 files changed

+80
-57
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
From ab99a3f89407d5946a420e7b693a9437bc68ecde Mon Sep 17 00:00:00 2001
1+
From 4eefd6ddcde271f0f29777928584227b4f4c9885 Mon Sep 17 00:00:00 2001
22
From: Oscar Lesta <oscar.lesta@gmail.com>
33
Date: Fri, 29 Mar 2024 18:46:59 -0300
44
Subject: Initial Haiku patch.
55

66
Based on original patch by @dshynkev (Dmytro Shynkevych).
77

88
diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile
9-
index 9aa4381..02fa546 100755
9+
index f894328..37d25c5 100644
1010
--- a/squashfs-tools/Makefile
1111
+++ b/squashfs-tools/Makefile
12-
@@ -219,7 +219,7 @@ CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \
12+
@@ -268,7 +268,7 @@ CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \
1313
-D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" \
1414
-Wall
1515

@@ -19,14 +19,15 @@ index 9aa4381..02fa546 100755
1919
CFLAGS += -DGZIP_SUPPORT
2020
MKSQUASHFS_OBJS += gzip_wrapper.o
2121
diff --git a/squashfs-tools/endian_compat.h b/squashfs-tools/endian_compat.h
22-
index c416f7f..0aa4815 100644
22+
index 65787e2..053a80b 100644
2323
--- a/squashfs-tools/endian_compat.h
2424
+++ b/squashfs-tools/endian_compat.h
25-
@@ -23,7 +23,7 @@
25+
@@ -23,8 +23,7 @@
2626
*
2727
* endian_compat.h
2828
*/
2929
-#ifndef linux
30+
-#include <sys/types.h>
3031
+#if !defined(linux) && ! defined(__HAIKU__)
3132
#define __BYTE_ORDER BYTE_ORDER
3233
#define __BIG_ENDIAN BIG_ENDIAN
@@ -47,73 +48,93 @@ index 0000000..a643394
4748
+
4849
+#endif /* HAIKU_MACROS_H */
4950
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
50-
index ba28d65..20e2aee 100644
51+
index 263343c..f02bcb0 100644
5152
--- a/squashfs-tools/mksquashfs.c
5253
+++ b/squashfs-tools/mksquashfs.c
53-
@@ -53,6 +53,9 @@
54-
#include <sys/sysinfo.h>
54+
@@ -49,8 +49,10 @@
55+
#include <limits.h>
56+
#include <ctype.h>
57+
58+
-#ifdef __linux__
59+
+#if defined(__linux__)
5560
#include <sys/sysmacros.h>
56-
#include <sched.h>
57-
+#elif __HAIKU__
58-
+#include <OS.h>
61+
+#elif defined(__HAIKU__)
5962
+#include "haiku_macros.h"
60-
#else
61-
#include <sys/sysctl.h>
6263
#endif
63-
@@ -5257,6 +5260,12 @@ static void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq,
64-
processors = sysconf(_SC_NPROCESSORS_ONLN);
65-
else
66-
processors = CPU_COUNT(&cpu_set);
67-
+#elif __HAIKU__
68-
+ system_info sysinfo;
69-
+ if (get_system_info(&sysinfo) == B_OK)
70-
+ processors = sysinfo.cpu_count;
71-
+ else
72-
+ processors = 1;
73-
#else
74-
int mib[2];
75-
size_t len = sizeof(processors);
76-
@@ -5664,8 +5673,13 @@ static void write_recovery_data(struct squashfs_super_block *sBlk)
64+
65+
#include "squashfs_fs.h"
66+
@@ -5724,8 +5726,13 @@ static void write_recovery_data(struct squashfs_super_block *sBlk)
7767
BAD_ERROR("Could not read $HOME, use -recovery-path or -no-recovery options\n");
7868
}
7969

80-
+#if __HAIKU__
81-
+ res = asprintf(&recovery_file, "%s/squashfs_recovery_%s_%" B_PRId32, recovery_pathname,
70+
+#ifdef B_HAIKU_32_BIT
71+
+ ASPRINTF(&recovery_file, "%s/squashfs_recovery_%s_%ld", recovery_pathname,
8272
+ getbase(destination_file), pid);
8373
+#else
84-
res = asprintf(&recovery_file, "%s/squashfs_recovery_%s_%d", recovery_pathname,
74+
ASPRINTF(&recovery_file, "%s/squashfs_recovery_%s_%d", recovery_pathname,
8575
getbase(destination_file), pid);
8676
+#endif
87-
if(res == -1)
88-
MEM_ERROR();
77+
metadata = MALLOC(bytes);
78+
res = read_fs_bytes(fd, sBlk->inode_table_start, bytes, metadata);
79+
if(res == 0) {
80+
diff --git a/squashfs-tools/nprocessors_compat.c b/squashfs-tools/nprocessors_compat.c
81+
index 4aa1282..0ade3d8 100644
82+
--- a/squashfs-tools/nprocessors_compat.c
83+
+++ b/squashfs-tools/nprocessors_compat.c
84+
@@ -23,7 +23,8 @@
8985

90-
diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
91-
index 0ac6356..227ad52 100644
92-
--- a/squashfs-tools/unsquashfs.c
93-
+++ b/squashfs-tools/unsquashfs.c
94-
@@ -36,6 +36,9 @@
86+
static int processors = -1;
87+
88+
-#ifdef __linux__
89+
+#if defined(__linux__)
90+
+
9591
#include <sched.h>
96-
#include <sys/sysinfo.h>
97-
#include <sys/sysmacros.h>
98-
+#elif __HAIKU__
92+
#include <unistd.h>
93+
94+
@@ -41,7 +42,22 @@ int get_nprocessors(void)
95+
else
96+
return processors = sysconf(_SC_NPROCESSORS_ONLN);
97+
}
98+
+
99+
+#elif defined(__HAIKU__)
100+
+
99101
+#include <OS.h>
100-
+#include "haiku_macros.h"
102+
+
103+
+int get_nprocessors(void)
104+
+{
105+
+ system_info sysinfo;
106+
+ if (get_system_info(&sysinfo) == B_OK)
107+
+ return sysinfo.cpu_count;
108+
+
109+
+ return 1;
110+
+}
111+
+
101112
#else
113+
+
102114
#include <sys/sysctl.h>
115+
#include "error.h"
116+
117+
@@ -67,4 +83,5 @@ int get_nprocessors(void)
118+
119+
return processors;
120+
}
121+
+
103122
#endif
104-
@@ -2775,6 +2778,12 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size, int cat_
105-
processors = sysconf(_SC_NPROCESSORS_ONLN);
106-
else
107-
processors = CPU_COUNT(&cpu_set);
108-
+#elif __HAIKU__
109-
+ system_info sysinfo;
110-
+ if (get_system_info(&sysinfo) == B_OK)
111-
+ processors = sysinfo.cpu_count;
112-
+ else
113-
+ processors = 1;
114-
#else
115-
int mib[2];
116-
size_t len = sizeof(processors);
123+
diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
124+
index bde1460..b2fed82 100644
125+
--- a/squashfs-tools/unsquashfs.c
126+
+++ b/squashfs-tools/unsquashfs.c
127+
@@ -44,6 +44,10 @@
128+
#include <sys/sysmacros.h>
129+
#endif
130+
131+
+#ifdef __HAIKU__
132+
+#include "haiku_macros.h"
133+
+#endif
134+
+
135+
#include <sys/types.h>
136+
#include <sys/time.h>
137+
#include <limits.h>
117138
--
118-
2.43.2
139+
2.50.1
119140

sys-fs/squashfs_tools/squashfs_tools-4.6.1.recipe renamed to sys-fs/squashfs_tools/squashfs_tools-4.7.2.recipe

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ systems) where low overhead is needed."
99
HOMEPAGE="https://github.com/plougher/squashfs-tools"
1010
COPYRIGHT="2002-2023 Phillip Lougher"
1111
LICENSE="GNU GPL v2"
12-
REVISION="2"
12+
REVISION="1"
1313
SOURCE_URI="https://github.com/plougher/squashfs-tools/archive/refs/tags/$portVersion.tar.gz"
14-
CHECKSUM_SHA256="94201754b36121a9f022a190c75f718441df15402df32c2b520ca331a107511c"
14+
CHECKSUM_SHA256="4672b5c47d9418d3a5ae5b243defc6d9eae8275b9771022247c6a6082c815914"
1515
SOURCE_DIR="squashfs-tools-$portVersion"
1616

1717
PATCHES="squashfs_tools-$portVersion.patchset"
@@ -56,9 +56,11 @@ BUILD_REQUIRES="
5656
devel:libzstd$secondaryArchSuffix
5757
"
5858
BUILD_PREREQUIRES="
59+
cmd:echo # /bin/echo needed by "install-manpages.sh"
5960
cmd:help2man
6061
cmd:gcc$secondaryArchSuffix
6162
cmd:make
63+
cmd:which # (otherwise fails to find cmd:echo)
6264
"
6365

6466
MAKE_ARGS="

0 commit comments

Comments
 (0)