Description | Compiling SOPE 5.9.0 with gnustep base libs >= 1.29.0 (which was released on Jan 8, 2023) fails.
The following errors are thrown:
x86_64-pc-linux-gnu-gcc NGMimeFileData.m -c \
-MMD -MP -DLIBRARY_MAJOR_VERSION=4 -DLIBRARY_MINOR_VERSION=9 -DLIBRARY_SUBMINOR_VERSION=3 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -pthread -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -march=znver2 -O2 -pipe -Wuninitialized -g -frecord-gcc-switches -fconstant-string-class=NSConstantString -I.. -I../.. -I../../sope-core/NGStreams/ -I../../sope-core/NGExtensions/ -I../../sope-core -I. -I/mnt/noraid_one/portage/tmpdir/portage/gnustep-libs/sope-5.9.0/work/GNUstep/Library/Headers -I/usr/local/include -I/usr/include \
-o obj/NGMime.obj/NGMimeFileData.m.o
NGMimeType.m: In function '+[NGMimeType stringEncodingForCharset:]':
NGMimeType.m:128:16: error: 'NSBIG5StringEncoding' undeclared (first use in this function); did you mean 'NSBig5StringEncoding'?
128 | encoding = NSBIG5StringEncoding;
| ^~~~~~~~
| NSBig5StringEncoding
NGMimeType.m:128:16: note: each undeclared identifier is reported only once for each function it appears in
x86_64-pc-linux-gnu-gcc NGMimeJoinedData.m -c \
-MMD -MP -DLIBRARY_MAJOR_VERSION=4 -DLIBRARY_MINOR_VERSION=9 -DLIBRARY_SUBMINOR_VERSION=3 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -pthread -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -march=znver2 -O2 -pipe -Wuninitialized -g -frecord-gcc-switches -fconstant-string-class=NSConstantString -I.. -I../.. -I../../sope-core/NGStreams/ -I../../sope-core/NGExtensions/ -I../../sope-core -I. -I/mnt/noraid_one/portage/tmpdir/portage/gnustep-libs/sope-5.9.0/work/GNUstep/Library/Headers -I/usr/local/include -I/usr/include \
-o obj/NGMime.obj/NGMimeJoinedData.m.o
NGMimeType.m:134:16: error: 'NSGB2312StringEncoding' undeclared (first use in this function); did you mean 'NSHZ_GB_2312StringEncoding'?
134 | encoding = NSGB2312StringEncoding;
| ^~~~~~
| NSHZ_GB_2312StringEncoding |
---|
Additional Information | Some system information:
System uname: Linux-6.1.53-gentoo-r1-x86_64-x86_64-AMD_Ryzen_5_5600G_with_Radeon_Graphics-with-glibc2.37
Timestamp of repository gentoo: Fri, 03 Nov 2023 10:45:01 +0000
Head commit of repository gentoo: f8f8570e1d34e8e42b9e258723ea22f6d0aad8a5
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils: 1.3.5::gentoo
app-shells/bash: 5.1_p16-r6::gentoo
dev-lang/perl: 5.38.0-r1::gentoo
dev-lang/python: 3.11.5::gentoo
dev-lang/rust: 1.71.1::gentoo
dev-util/cmake: 3.26.5-r2::gentoo
dev-util/meson: 1.2.1-r1::gentoo
sys-apps/baselayout: 2.14::gentoo
sys-apps/openrc: 0.48::gentoo
sys-apps/sandbox: 2.38::gentoo
sys-devel/autoconf: 2.71-r6::gentoo
sys-devel/automake: 1.16.5-r1::gentoo
sys-devel/binutils: 2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc: 13.2.1_p20230826::gentoo
sys-devel/gcc-config: 2.11::gentoo
sys-devel/libtool: 2.4.7-r1::gentoo
sys-devel/make: 4.4.1-r1::gentoo
sys-kernel/linux-headers: 6.1::gentoo (virtual/os-headers)
sys-libs/glibc: 2.37-r7::gentoo
The cause for the compile errors can be found in a change to the enum constants in NSString.h and Unicode.h from gnustep base libs version 1.28.0 to 1.29.0.
This diff shows their changes: https://github.com/gnustep/libs-base/commit/fe2f41c7f19f19bf8b5100a2124e815d92d784d1
With some revision of the enums they also changed some of the constant names.
On my system, the following patch got rid of the compile errors:
--- a/sope-mime/NGMime/NGMimeType.m 2023-09-27 10:35:19.000000000 +0200
+++ b/sope-mime/NGMime/NGMimeType.m 2023-11-03 12:23:55.037647584 +0100
@@ -125,13 +125,21 @@
encoding = NSKoreanEUCStringEncoding;
}
else if ([charset isEqualToString:@"big5"]) {
+#if ((GNUSTEP_BASE_MAJOR_VERSION >= 1) && (GNUSTEP_BASE_MINOR_VERSION >= 19) && (GNUSTEP_BASE_SUBMINOR_VERSION >= 0))
- encoding = NSBig5StringEncoding;
+#else
encoding = NSBIG5StringEncoding;
+#endif
}
else if ([charset isEqualToString:@"iso-2022-jp"]) {
encoding = NSISO2022JPStringEncoding;
}
else if ([charset isEqualToString:@"gb2312"]) {
+#if ((GNUSTEP_BASE_MAJOR_VERSION >= 1) && (GNUSTEP_BASE_MINOR_VERSION >= 19) && (GNUSTEP_BASE_SUBMINOR_VERSION >= 0))
- encoding = NSHZ_GB_2312StringEncoding;
+#else
encoding = NSGB2312StringEncoding;
+#endif
}
else if ([charset isEqualToString:@"koi8-r"]) {
encoding = NSKOI8RStringEncoding;
If basically introduces a version check for the gnustep base libs and uses different enum constants which should refer to the same character set.
That said, I aimed for a quick fix and I'm not 100% sure if I chose the correct constants. It certainly looks correct to me, but I did not test it. |
---|