Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 151 additions & 20 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const std = @import("std");

const version: std.SemanticVersion = .{ .major = 1, .minor = 18, .patch = 0 };
const version: std.SemanticVersion = .{ .major = 1, .minor = 19, .patch = 0 };
const libcharset_version: std.SemanticVersion = .{ .major = 1, .minor = 5, .patch = 0 };

pub fn build(b: *std.Build) void {
Expand Down Expand Up @@ -33,8 +33,17 @@ pub fn build(b: *std.Build) void {
const libcharset_config_header = b.addConfigHeader(.{
.style = .{ .autoconf_undef = upstream.path("libcharset/config.h.in") },
}, .{
.ENABLE_RELOCATABLE = true,
.ENABLE_RELOCATABLE = null,
.HAVE_COPY_FILE_RANGE = null,
.HAVE_DLADDR_IN_LIBC = switch (target.result.os.tag) {
.windows => null,
.linux => true,
.macos => true,
.wasi => null,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE_DLFCN_H = if (target.result.os.tag == .windows) null else true,
.HAVE_INTTYPES_H = true,
.HAVE_LANGINFO_CODESET = if (target.result.os.tag == .windows) null else true,
Expand All @@ -52,8 +61,33 @@ pub fn build(b: *std.Build) void {
.HAVE_UNISTD_H = true,
.HAVE_VISIBILITY = true,
.HAVE_WCHAR_H = true,
.HAVE_WORKING_O_NOATIME = false,
.HAVE_WORKING_O_NOFOLLOW = false,
.HAVE_WORKING_O_DIRECTORY = switch (target.result.os.tag) {
.windows => false,
.linux => false,
.macos => true,
.wasi => true,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE_WORKING_O_NOATIME = switch (target.result.os.tag) {
.windows => false,
.linux => false,
.macos => true,
.wasi => true,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE_WORKING_O_NOFOLLOW = switch (target.result.os.tag) {
.windows => false,
.linux => false,
.macos => true,
.wasi => true,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE__NSGETEXECUTABLEPATH = null,
.INSTALLPREFIX = {},
.LT_OBJDIR = ".libs/",
Expand Down Expand Up @@ -155,10 +189,14 @@ pub fn build(b: *std.Build) void {
.ssize_t = null,
});

const libiconv_package_string = b.fmt("libiconv {d}.{d}", .{ version.major, version.minor });
const libiconv_package_version = b.fmt("{d}.{d}", .{ version.major, version.minor });

const config_h = b.addConfigHeader(.{
.style = .{ .autoconf_undef = upstream.path("config.h.in") },
}, .{
.AC_APPLE_UNIVERSAL_BUILD = null,
.AVOID_ANY_THREADS = null,
.BITSIZEOF_PTRDIFF_T = if (target.result.os.tag == .wasi) false else null,
.BITSIZEOF_SIG_ATOMIC_T = if (target.result.os.tag == .wasi) false else null,
.BITSIZEOF_SIZE_T = if (target.result.os.tag == .wasi) false else null,
Expand Down Expand Up @@ -194,6 +232,8 @@ pub fn build(b: *std.Build) void {
.GNULIB_FSCANF = true,
.GNULIB_FSTAT = true,
.GNULIB_LOCALEDIR = {},
.GNULIB_LOCK = true,
.GNULIB_LSTAT = true,
.GNULIB_MSVC_NOTHROW = true,
.GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU = null,
.GNULIB_SCANF = true,
Expand Down Expand Up @@ -221,10 +261,13 @@ pub fn build(b: *std.Build) void {
.GNULIB_TEST_GETCHAR = true,
.GNULIB_TEST_GETDTABLESIZE = true,
.GNULIB_TEST_GETPROGNAME = true,
.GNULIB_TEST_LSTAT = true,
.GNULIB_TEST_MALLOC_POSIX = true,
.GNULIB_TEST_MEMEQ = true,
.GNULIB_TEST_MEMPCPY = true,
.GNULIB_TEST_OPEN = true,
.GNULIB_TEST_PRINTF = true,
.GNULIB_TEST_PTHREAD_ONCE = true,
.GNULIB_TEST_PUTC = true,
.GNULIB_TEST_PUTCHAR = true,
.GNULIB_TEST_PUTS = true,
Expand All @@ -237,6 +280,7 @@ pub fn build(b: *std.Build) void {
.GNULIB_TEST_SCANF = true,
.GNULIB_TEST_SIGPROCMASK = true,
.GNULIB_TEST_STAT = true,
.GNULIB_TEST_STREQ = true,
.GNULIB_TEST_STRERROR = true,
.GNULIB_TEST_VFPRINTF = true,
.GNULIB_TEST_VPRINTF = true,
Expand Down Expand Up @@ -349,6 +393,15 @@ pub fn build(b: *std.Build) void {
.netbsd => false,
else => @panic("unsupported OS"),
},
.HAVE_DECL_FILENO_UNLOCKED = switch (target.result.os.tag) {
.windows => false,
.linux => true,
.macos => true,
.wasi => true,
.freebsd => true,
.netbsd => false,
else => @panic("unsupported OS"),
},
.HAVE_DECL_FPUTC_UNLOCKED = switch (target.result.os.tag) {
.windows => false,
.linux => true,
Expand Down Expand Up @@ -394,8 +447,8 @@ pub fn build(b: *std.Build) void {
.netbsd => false,
else => @panic("unsupported OS"),
},
.HAVE_DECL_GETCHAR_UNLOCKED = if (target.result.os.tag == .windows) false else true,
.HAVE_DECL_GETC_UNLOCKED = if (target.result.os.tag == .windows) false else true,
.HAVE_DECL_GETCHAR_UNLOCKED = target.result.os.tag != .windows,
.HAVE_DECL_GETC_UNLOCKED = target.result.os.tag != .windows,
.HAVE_DECL_GETDTABLESIZE = switch (target.result.os.tag) {
.windows => false,
.linux => true,
Expand All @@ -406,6 +459,7 @@ pub fn build(b: *std.Build) void {
else => @panic("unsupported OS"),
},
.HAVE_DECL_GETW = true,
.HAVE_DECL_MEMEQ = false,
.HAVE_DECL_PROGRAM_INVOCATION_NAME = switch (target.result.os.tag) {
.windows => false,
.linux => true,
Expand All @@ -424,13 +478,14 @@ pub fn build(b: *std.Build) void {
.netbsd => false,
else => @panic("unsupported OS"),
},
.HAVE_DECL_PUTCHAR_UNLOCKED = if (target.result.os.tag == .windows) false else true,
.HAVE_DECL_PUTC_UNLOCKED = if (target.result.os.tag == .windows) false else true,
.HAVE_DECL_PUTCHAR_UNLOCKED = target.result.os.tag != .windows,
.HAVE_DECL_PUTC_UNLOCKED = target.result.os.tag != .windows,
.HAVE_DECL_PUTW = true,
.HAVE_DECL_SETENV = if (target.result.os.tag == .windows) false else true,
.HAVE_DECL_STRERROR_R = if (target.result.os.tag == .windows) false else true,
.HAVE_DECL_SETENV = target.result.os.tag != .windows,
.HAVE_DECL_STREQ = false,
.HAVE_DECL_STRERROR_R = target.result.os.tag != .windows,
.HAVE_DECL_WCSDUP = true,
.HAVE_DECL__PUTENV = if (target.result.os.tag == .windows) true else false,
.HAVE_DECL__PUTENV = target.result.os.tag == .windows,
.HAVE_DECL___ARGV = switch (target.result.os.tag) {
.windows => true,
.linux => false,
Expand All @@ -440,6 +495,15 @@ pub fn build(b: *std.Build) void {
.netbsd => null,
else => @panic("unsupported OS"),
},
.HAVE_DLADDR_IN_LIBC = switch (target.result.os.tag) {
.windows => null,
.linux => true,
.macos => true,
.wasi => null,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE_DLFCN_H = if (target.result.os.tag == .windows) null else true,
.HAVE_ENVIRON_DECL = switch (target.result.os.tag) {
.windows => true,
Expand Down Expand Up @@ -522,8 +586,8 @@ pub fn build(b: *std.Build) void {
.linux => true,
.macos => null,
.wasi => null,
.freebsd => null,
.netbsd => null,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE_MALLOC_POSIX = true,
Expand All @@ -548,7 +612,14 @@ pub fn build(b: *std.Build) void {
.HAVE_MINMAX_IN_LIMITS_H = null,
.HAVE_MINMAX_IN_SYS_PARAM_H = if (target.result.os.tag == .windows) null else true,
.HAVE_MSVC_INVALID_PARAMETER_HANDLER = if (target.result.os.tag == .windows) true else null,
.HAVE_RAISE = if (target.result.os.tag == .wasi) null else true,
.HAVE_PTHREAD_API = true,
.HAVE_PTHREAD_H = true,
.HAVE_PTHREAD_MUTEX_RECURSIVE = if (target.result.os.tag == .windows) null else true,
.HAVE_PTHREAD_RWLOCK = if (target.result.os.tag == .windows) null else true,
.HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER = null,
.HAVE_PTHREAD_SPINLOCK_T = if (target.result.os.tag == .macos) null else true,
.HAVE_PTHREAD_T = true,
.HAVE_RAISE = true,
.HAVE_RAWMEMCHR = switch (target.result.os.tag) {
.windows => null,
.linux => if (target.result.isGnuLibC()) true else null,
Expand All @@ -562,14 +633,16 @@ pub fn build(b: *std.Build) void {
.HAVE_READLINKAT = if (target.result.os.tag == .windows) null else true,
.HAVE_REALLOC_0_NONNULL = switch (target.result.os.tag) {
.windows => null,
.linux => if (target.result.isMuslLibC()) true else null,
.linux => null,
.macos => true,
.wasi => null,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE_REALLOC_POSIX = if (target.result.os.tag == .freebsd) null else true,
.HAVE_REALPATH = if (target.result.os.tag == .windows) null else true,
.HAVE_SCHED_H = true,
.HAVE_SDKDDKVER_H = if (target.result.os.tag == .windows) true else null,
.HAVE_SEARCH_H = true,
.HAVE_SETDTABLESIZE = null,
Expand All @@ -589,6 +662,7 @@ pub fn build(b: *std.Build) void {
},
.HAVE_STDBOOL_H = true,
.HAVE_STDCKDINT_H = true,
.HAVE_STDCOUNTOF_H = true,
.HAVE_STDINT_H = true,
.HAVE_STDIO_H = true,
.HAVE_STDLIB_H = true,
Expand Down Expand Up @@ -622,25 +696,66 @@ pub fn build(b: *std.Build) void {
.HAVE_SYS_BITYPES_H = null,
.HAVE_SYS_INTTYPES_H = null,
.HAVE_SYS_PARAM_H = true,
.HAVE_SYS_PROCESS_H = null,
.HAVE_SYS_SOCKET_H = if (target.result.os.tag == .windows) null else true,
.HAVE_SYS_STAT_H = true,
.HAVE_SYS_TIME_H = true,
.HAVE_SYS_TYPES_H = true,
.HAVE_THRD_CREATE = null,
.HAVE_THREADS_H = switch (target.result.os.tag) {
.windows => null,
.linux => true,
.macos => null,
.wasi => true,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE_TSEARCH = true,
.HAVE_UNISTD_H = true,
.HAVE_UNISTRING_WOE32DLL_H = null,
.HAVE_UNSIGNED_LONG_LONG_INT = true,
.HAVE_VAR___PROGNAME = null,
.HAVE_VASPRINTF = true,
.HAVE_VISIBILITY = true,
.HAVE_WCHAR_H = true,
.HAVE_WCRTOMB = true,
.HAVE_WEAK_SYMBOLS = switch (target.result.os.tag) {
.windows => null,
.linux => if (target.result.isGnuLibC()) true else null,
.macos => null,
.wasi => null,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
.HAVE_WINDOWS_LOCALE_T = if (target.result.os.tag == .windows) true else null,
.HAVE_WINSOCK2_H = if (target.result.os.tag == .windows) true else null,
.HAVE_WINT_T = true,
.HAVE_WORKING_O_NOATIME = if (target.result.os.tag == .linux) true else false,
.HAVE_WORKING_O_NOFOLLOW = if (target.result.os.tag == .linux) true else false,
.HAVE_WORKING_O_DIRECTORY = target.result.os.tag != .windows,
.HAVE_WORKING_O_NOATIME = target.result.os.tag != .windows,
.HAVE_WORKING_O_NOFOLLOW = target.result.os.tag != .windows,
.HAVE_XLOCALE_H = switch (target.result.os.tag) {
.windows => null,
.linux => null,
.macos => true,
.wasi => null,
.freebsd => true,
.netbsd => null,
else => @panic("unsupported OS"),
},
.HAVE__NSGETEXECUTABLEPATH = null,
.HAVE__SET_INVALID_PARAMETER_HANDLER = if (target.result.os.tag == .windows) true else null,
.HAVE___BUILTIN_EXPECT = true,
.HAVE___FSETERR = switch (target.result.os.tag) {
.windows => null,
.linux => if (target.result.isMuslLibC()) true else null,
.macos => null,
.wasi => true,
.freebsd => null,
.netbsd => null,
else => @panic("unsupported OS"),
},
.HAVE___HEADER_INLINE = if (target.result.os.tag == .macos) true else null,
.HAVE___INLINE = true,
.ICONV_CONST = {},
Expand All @@ -650,14 +765,14 @@ pub fn build(b: *std.Build) void {
.__USE_MINGW_ANSI_STDIO = true,
.MUSL_LIBC = null,
.NEED_SANITIZED_REALLOC = null,
.OPEN_TRAILING_SLASH_BUG = null,
.OPEN_TRAILING_SLASH_BUG = if (target.result.os.tag == .freebsd) true else null,
.PACKAGE = "libiconv",
.PACKAGE_BUGREPORT = "",
.PACKAGE_NAME = "libiconv",
.PACKAGE_STRING = b.fmt("libiconv {d}.{d}", .{ version.major, version.minor }),
.PACKAGE_STRING = libiconv_package_string,
.PACKAGE_TARNAME = "libiconv",
.PACKAGE_URL = "",
.PACKAGE_VERSION = b.fmt("{d}.{d}", .{ version.major, version.minor }),
.PACKAGE_VERSION = libiconv_package_version,
.PROMOTED_MODE_T = @as(enum { int, mode_t }, switch (target.result.os.tag) {
.windows => .int,
.linux => .mode_t,
Expand All @@ -667,6 +782,7 @@ pub fn build(b: *std.Build) void {
.netbsd => .mode_t,
else => @panic("unsupported OS"),
}),
.PTHREAD_IN_USE_DETECTION_HARD = null,
.PTRDIFF_T_SUFFIX = if (target.result.os.tag == .wasi) {} else null,
.READLINK_TRAILING_SLASH_BUG = switch (target.result.os.tag) {
.windows => null,
Expand Down Expand Up @@ -728,6 +844,19 @@ pub fn build(b: *std.Build) void {
else => @panic("unsupported OS"),
},
// .USER_LABEL_PREFIX = if (target.result.os.tag == .macos) ._ else {},
.USE_ISOC_AND_POSIX_THREADS = null,
.USE_ISOC_THREADS = null,
.USE_POSIX_THREADS = if (target.result.os.tag == .windows) null else true,
.USE_POSIX_THREADS_FROM_LIBC = if (target.result.os.tag == .wasi) true else null,
.USE_POSIX_THREADS_WEAK = switch (target.result.os.tag) {
.windows => null,
.linux => if (target.result.isGnuLibC()) true else null,
.macos => null,
.wasi => null,
.freebsd => true,
.netbsd => true,
else => @panic("unsupported OS"),
},
._ALL_SOURCE = true,
._DARWIN_C_SOURCE = true,
.__EXTENSIONS__ = true,
Expand All @@ -750,6 +879,7 @@ pub fn build(b: *std.Build) void {
._TANDEM_SOURCE = true,
._XOPEN_SOURCE = null,
.USE_UNLOCKED_IO = .GNULIB_STDIO_SINGLE_THREAD,
.USE_WINDOWS_THREADS = if (target.result.os.tag == .windows) true else null,
.VERSION = b.fmt("{d}.{d}", .{ version.major, version.minor }),
.WCHAR_T_SUFFIX = if (target.result.os.tag == .wasi) {} else null,
.WINT_T_SUFFIX = if (target.result.os.tag == .wasi) {} else null,
Expand All @@ -758,6 +888,7 @@ pub fn build(b: *std.Build) void {
._FILE_OFFSET_BITS = @as(?i64, if (target.result.os.tag == .windows) 64 else null),
._ISOC11_SOURCE = null,
._LARGE_FILES = null,
._LCONV_C99 = null,
._LINUX_SOURCE_COMPAT = true,
._TIME_BITS = null,
._USE_STD_STAT = true,
Expand Down
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.{
.name = .libiconv,
.version = "1.18.0",
.version = "1.19.0",
.minimum_zig_version = "0.15.1",
.dependencies = .{
.libiconv = .{
.url = "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.18.tar.gz",
.hash = "N-V-__8AAFwJUgGJcIFZ3fj0Q9U_KtvhHdZXlLz1FcAuIcmX",
.url = "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.19.tar.gz",
.hash = "N-V-__8AAL42WwECZQyJs7zPrYUX1cjcCv0qImj0y8A0ckjZ",
},
},
.paths = .{
Expand Down
Loading