fast_excel 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +5 -1
  3. data/.gitignore +3 -0
  4. data/.octocov.yml +28 -0
  5. data/CHANGELOG.md +9 -0
  6. data/Gemfile +4 -2
  7. data/Rakefile +4 -1
  8. data/examples/comment_options.rb +39 -0
  9. data/fast_excel.gemspec +3 -2
  10. data/lib/fast_excel/binding/workbook.rb +53 -6
  11. data/lib/fast_excel/binding/worksheet.rb +28 -4
  12. data/lib/fast_excel/binding.rb +116 -13
  13. data/lib/fast_excel.rb +13 -12
  14. data/libxlsxwriter/.cirrus.yml +9 -0
  15. data/libxlsxwriter/.github/workflows/cmake_actions.yml +10 -6
  16. data/libxlsxwriter/.github/workflows/code_style.yml +2 -0
  17. data/libxlsxwriter/.github/workflows/make_32_actions.yml +43 -0
  18. data/libxlsxwriter/.github/workflows/windows_build.yml +7 -6
  19. data/libxlsxwriter/.github/workflows/zig_build.yml +1 -3
  20. data/libxlsxwriter/.gitignore +9 -7
  21. data/libxlsxwriter/.indent.pro +6 -0
  22. data/libxlsxwriter/CMakeLists.txt +377 -238
  23. data/libxlsxwriter/Changes.txt +189 -0
  24. data/libxlsxwriter/LICENSE.txt +1 -1
  25. data/libxlsxwriter/Makefile +36 -4
  26. data/libxlsxwriter/Readme.md +1 -1
  27. data/libxlsxwriter/build.zig +181 -92
  28. data/libxlsxwriter/build.zig.zon +15 -4
  29. data/libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h +4 -0
  30. data/libxlsxwriter/include/xlsxwriter/app.h +2 -1
  31. data/libxlsxwriter/include/xlsxwriter/chart.h +134 -1
  32. data/libxlsxwriter/include/xlsxwriter/chartsheet.h +2 -1
  33. data/libxlsxwriter/include/xlsxwriter/comment.h +2 -1
  34. data/libxlsxwriter/include/xlsxwriter/common.h +12 -8
  35. data/libxlsxwriter/include/xlsxwriter/content_types.h +3 -1
  36. data/libxlsxwriter/include/xlsxwriter/core.h +2 -1
  37. data/libxlsxwriter/include/xlsxwriter/custom.h +2 -1
  38. data/libxlsxwriter/include/xlsxwriter/drawing.h +2 -1
  39. data/libxlsxwriter/include/xlsxwriter/format.h +34 -3
  40. data/libxlsxwriter/include/xlsxwriter/hash_table.h +2 -1
  41. data/libxlsxwriter/include/xlsxwriter/metadata.h +5 -1
  42. data/libxlsxwriter/include/xlsxwriter/packager.h +6 -1
  43. data/libxlsxwriter/include/xlsxwriter/relationships.h +3 -1
  44. data/libxlsxwriter/include/xlsxwriter/rich_value.h +51 -0
  45. data/libxlsxwriter/include/xlsxwriter/rich_value_rel.h +50 -0
  46. data/libxlsxwriter/include/xlsxwriter/rich_value_structure.h +53 -0
  47. data/libxlsxwriter/include/xlsxwriter/rich_value_types.h +49 -0
  48. data/libxlsxwriter/include/xlsxwriter/shared_strings.h +2 -1
  49. data/libxlsxwriter/include/xlsxwriter/styles.h +2 -1
  50. data/libxlsxwriter/include/xlsxwriter/table.h +2 -1
  51. data/libxlsxwriter/include/xlsxwriter/theme.h +2 -1
  52. data/libxlsxwriter/include/xlsxwriter/third_party/ioapi.h +4 -4
  53. data/libxlsxwriter/include/xlsxwriter/third_party/zip.h +3 -3
  54. data/libxlsxwriter/include/xlsxwriter/utility.h +58 -7
  55. data/libxlsxwriter/include/xlsxwriter/vml.h +2 -1
  56. data/libxlsxwriter/include/xlsxwriter/workbook.h +59 -2
  57. data/libxlsxwriter/include/xlsxwriter/worksheet.h +159 -13
  58. data/libxlsxwriter/include/xlsxwriter/xmlwriter.h +11 -10
  59. data/libxlsxwriter/include/xlsxwriter.h +5 -4
  60. data/libxlsxwriter/libxlsxwriter.podspec +6 -6
  61. data/libxlsxwriter/src/Makefile +2 -1
  62. data/libxlsxwriter/src/app.c +2 -1
  63. data/libxlsxwriter/src/chart.c +360 -63
  64. data/libxlsxwriter/src/chartsheet.c +2 -1
  65. data/libxlsxwriter/src/comment.c +2 -1
  66. data/libxlsxwriter/src/content_types.c +22 -1
  67. data/libxlsxwriter/src/core.c +2 -1
  68. data/libxlsxwriter/src/custom.c +2 -1
  69. data/libxlsxwriter/src/drawing.c +7 -3
  70. data/libxlsxwriter/src/format.c +21 -1
  71. data/libxlsxwriter/src/hash_table.c +2 -1
  72. data/libxlsxwriter/src/metadata.c +176 -20
  73. data/libxlsxwriter/src/packager.c +306 -6
  74. data/libxlsxwriter/src/relationships.c +25 -1
  75. data/libxlsxwriter/src/rich_value.c +191 -0
  76. data/libxlsxwriter/src/rich_value_rel.c +142 -0
  77. data/libxlsxwriter/src/rich_value_structure.c +162 -0
  78. data/libxlsxwriter/src/rich_value_types.c +199 -0
  79. data/libxlsxwriter/src/shared_strings.c +2 -1
  80. data/libxlsxwriter/src/styles.c +31 -7
  81. data/libxlsxwriter/src/table.c +2 -1
  82. data/libxlsxwriter/src/theme.c +2 -1
  83. data/libxlsxwriter/src/utility.c +136 -46
  84. data/libxlsxwriter/src/vml.c +2 -1
  85. data/libxlsxwriter/src/workbook.c +191 -10
  86. data/libxlsxwriter/src/worksheet.c +514 -34
  87. data/libxlsxwriter/src/xmlwriter.c +17 -22
  88. data/libxlsxwriter/third_party/minizip/Makefile.orig +1 -1
  89. data/libxlsxwriter/third_party/minizip/configure.ac +1 -1
  90. data/libxlsxwriter/third_party/minizip/ioapi.h +6 -6
  91. data/libxlsxwriter/third_party/minizip/miniunz.c +16 -2
  92. data/libxlsxwriter/third_party/minizip/unzip.c +4 -4
  93. data/libxlsxwriter/third_party/minizip/unzip.h +1 -1
  94. data/libxlsxwriter/third_party/minizip/zip.c +5 -5
  95. data/libxlsxwriter/third_party/minizip/zip.h +3 -3
  96. data/libxlsxwriter/version.txt +1 -1
  97. data/sonar-project.properties +4 -0
  98. data/test/color_to_hex_test.rb +15 -0
  99. data/test/comment_opt_test.rb +76 -0
  100. data/test/date_test.rb +14 -0
  101. data/test/format_test.rb +5 -1
  102. data/test/get_worksheet_test.rb +28 -0
  103. data/test/test_helper.rb +7 -4
  104. data/test/tmpdir_test.rb +32 -0
  105. data/test/validations_test.rb +25 -19
  106. data/test/worksheet_test.rb +10 -2
  107. metadata +42 -12
  108. data/libxlsxwriter/cmake/FindMINIZIP.cmake +0 -121
  109. data/libxlsxwriter/cmake/FindPackage.cmake +0 -183
  110. data/libxlsxwriter/cmake/i686-toolchain.cmake +0 -7
  111. data/test/reopen_test.rb +0 -22
@@ -1,20 +1,16 @@
1
1
  const std = @import("std");
2
- const Path = std.Build.LazyPath;
2
+ const zon_version = @import("build.zig.zon").version;
3
3
 
4
- // Although this function looks imperative, note that its job is to
5
- // declaratively construct a build graph that will be libcuted by an external
6
- // runner.
7
4
  pub fn build(b: *std.Build) void {
8
- // Standard target options allows the person running `zig build` to choose
9
- // what target to build for. Here we do not override the defaults, which
10
- // means any target is allowed, and the default is native. Other options
11
- // for restricting supported target set are available.
12
5
  const target = b.standardTargetOptions(.{});
13
-
14
- // Standard optimization options allow the person running `zig build` to select
15
- // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
16
- // set a preferred release mode, allowing the user to decide how to optimize.
17
6
  const optimize = b.standardOptimizeOption(.{});
7
+ const options: BuildConfig = .{
8
+ .target = target,
9
+ .optimize = optimize,
10
+ };
11
+ const xlsxw_version = std.SemanticVersion.parse(zon_version) catch |err| {
12
+ std.debug.panic("Error: {s}", .{@errorName(err)});
13
+ };
18
14
 
19
15
  const shared = b.option(bool, "SHARED_LIBRARY", "Build the Shared Library [default: false]") orelse false;
20
16
  const examples = b.option(bool, "BUILD_EXAMPLES", "Build libxlsxwriter examples [default: false]") orelse false;
@@ -24,93 +20,99 @@ pub fn build(b: *std.Build) void {
24
20
  const md5 = b.option(bool, "USE_OPENSSL_MD5", "Build libxlsxwriter with the OpenSSL MD5 lib [default: off]") orelse false;
25
21
  const stdtmpfile = b.option(bool, "USE_STANDARD_TMPFILE", "Use the C standard library's tmpfile() [default: off]") orelse false;
26
22
 
27
- const lib = if (shared) b.addSharedLibrary(.{
28
- .name = "xlsxwriter",
29
- .target = target,
30
- .optimize = optimize,
31
- .version = .{
32
- .major = 1,
33
- .minor = 1,
34
- .patch = 6,
35
- },
36
- }) else b.addStaticLibrary(.{
23
+ const lib = b.addLibrary(.{
37
24
  .name = "xlsxwriter",
38
- .target = target,
39
- .optimize = optimize,
25
+ .root_module = createModule(b, options),
26
+ .linkage = if (shared) .dynamic else .static,
27
+ .version = xlsxw_version,
40
28
  });
41
29
  lib.pie = true;
42
30
  switch (optimize) {
43
31
  .Debug, .ReleaseSafe => lib.bundle_compiler_rt = true,
44
- else => lib.strip = true,
32
+ else => lib.root_module.strip = true,
45
33
  }
46
34
  if (tests)
47
- lib.defineCMacro("TESTING", null);
48
- lib.addCSourceFiles(&.{
49
- "src/vml.c",
50
- "src/chartsheet.c",
51
- "src/theme.c",
52
- "src/content_types.c",
53
- "src/xmlwriter.c",
54
- "src/app.c",
55
- "src/styles.c",
56
- "src/core.c",
57
- "src/comment.c",
58
- "src/utility.c",
59
- "src/metadata.c",
60
- "src/custom.c",
61
- "src/hash_table.c",
62
- "src/relationships.c",
63
- "src/drawing.c",
64
- "src/chart.c",
65
- "src/shared_strings.c",
66
- "src/worksheet.c",
67
- "src/format.c",
68
- "src/table.c",
69
- "src/workbook.c",
70
- "src/packager.c",
71
- }, cflags);
35
+ lib.root_module.addCMacro("TESTING", "");
36
+ lib.root_module.addCSourceFiles(.{
37
+ .files = &.{
38
+ "src/vml.c",
39
+ "src/chartsheet.c",
40
+ "src/theme.c",
41
+ "src/content_types.c",
42
+ "src/xmlwriter.c",
43
+ "src/app.c",
44
+ "src/styles.c",
45
+ "src/core.c",
46
+ "src/comment.c",
47
+ "src/utility.c",
48
+ "src/metadata.c",
49
+ "src/custom.c",
50
+ "src/hash_table.c",
51
+ "src/relationships.c",
52
+ "src/drawing.c",
53
+ "src/chart.c",
54
+ "src/shared_strings.c",
55
+ "src/worksheet.c",
56
+ "src/format.c",
57
+ "src/table.c",
58
+ "src/workbook.c",
59
+ "src/packager.c",
60
+ "src/rich_value.c",
61
+ "src/rich_value_rel.c",
62
+ "src/rich_value_structure.c",
63
+ "src/rich_value_types.c",
64
+ },
65
+ .flags = cflags,
66
+ });
72
67
 
73
68
  // minizip
74
69
  if (minizip) {
75
- lib.addCSourceFiles(switch (target.getOsTag()) {
76
- .windows => minizip_src ++ [_][]const u8{
77
- "third_party/minizip/iowin32.c",
70
+ lib.root_module.addCSourceFiles(.{
71
+ .files = switch (lib.rootModuleTarget().os.tag) {
72
+ .windows => minizip_src ++ [_][]const u8{
73
+ "third_party/minizip/iowin32.c",
74
+ },
75
+ else => minizip_src,
78
76
  },
79
- else => minizip_src,
80
- }, cflags);
77
+ .flags = cflags,
78
+ });
81
79
  }
82
80
 
83
- // zig-pkg: download & build zlib (to all targets)
84
- const zlib_dep = b.dependency("zlib", .{
85
- .optimize = optimize,
86
- .target = target,
87
- });
88
- const zlib = zlib_dep.artifact("z");
89
- lib.linkLibrary(zlib);
81
+ const zlib = buildZlib(b, options);
82
+ lib.root_module.linkLibrary(zlib);
90
83
  lib.installLibraryHeaders(zlib);
91
84
 
92
85
  // md5
93
86
  if (!md5)
94
- lib.addCSourceFile(.{ .file = .{ .path = "third_party/md5/md5.c" }, .flags = cflags })
87
+ lib.root_module.addCSourceFile(.{
88
+ .file = b.path("third_party/md5/md5.c"),
89
+ .flags = cflags,
90
+ })
95
91
  else
96
- lib.linkSystemLibrary("crypto");
92
+ lib.root_module.linkSystemLibrary("crypto", .{});
97
93
 
98
94
  // dtoa
99
95
  if (dtoa)
100
- lib.addCSourceFile(.{ .file = Path.relative("third_party/dtoa/emyg_dtoa.c"), .flags = cflags });
96
+ lib.root_module.addCSourceFile(.{
97
+ .file = b.path("third_party/dtoa/emyg_dtoa.c"),
98
+ .flags = cflags,
99
+ });
101
100
 
102
101
  // tmpfileplus
103
102
  if (stdtmpfile)
104
- lib.addCSourceFile(.{ .file = .{ .path = "third_party/tmpfileplus/tmpfileplus.c" }, .flags = cflags })
103
+ lib.root_module.addCSourceFile(.{
104
+ .file = b.path("third_party/tmpfileplus/tmpfileplus.c"),
105
+ .flags = cflags,
106
+ })
105
107
  else
106
- lib.defineCMacro("USE_STANDARD_TMPFILE", null);
108
+ lib.root_module.addCMacro("USE_STANDARD_TMPFILE", "");
107
109
 
108
- lib.addIncludePath(Path.relative("include"));
109
- lib.addIncludePath(Path.relative("third_party"));
110
- lib.linkLibC();
110
+ lib.root_module.addIncludePath(b.path("include"));
111
+ lib.root_module.addIncludePath(b.path("third_party"));
112
+ lib.root_module.link_libc = true;
111
113
 
112
114
  // get headers on include to zig-out/include
113
- lib.installHeadersDirectory("include", "");
115
+ lib.installHeadersDirectory(b.path("include"), "", .{});
114
116
 
115
117
  // get binaries on zig-cache to zig-out
116
118
  b.installArtifact(lib);
@@ -118,42 +120,52 @@ pub fn build(b: *std.Build) void {
118
120
  // build examples
119
121
  if (examples) {
120
122
  buildExe(b, .{
123
+ .options = options,
121
124
  .lib = lib,
122
125
  .path = "examples/anatomy.c",
123
126
  });
124
127
  buildExe(b, .{
128
+ .options = options,
125
129
  .lib = lib,
126
130
  .path = "examples/array_formula.c",
127
131
  });
128
132
  buildExe(b, .{
133
+ .options = options,
129
134
  .lib = lib,
130
135
  .path = "examples/autofilter.c",
131
136
  });
132
137
  buildExe(b, .{
138
+ .options = options,
133
139
  .lib = lib,
134
140
  .path = "examples/background.c",
135
141
  });
136
142
  buildExe(b, .{
143
+ .options = options,
137
144
  .lib = lib,
138
145
  .path = "examples/chart_area.c",
139
146
  });
140
147
  buildExe(b, .{
148
+ .options = options,
141
149
  .lib = lib,
142
150
  .path = "examples/chart_column.c",
143
151
  });
144
152
  buildExe(b, .{
153
+ .options = options,
145
154
  .lib = lib,
146
155
  .path = "examples/data_validate.c",
147
156
  });
148
157
  buildExe(b, .{
158
+ .options = options,
149
159
  .lib = lib,
150
160
  .path = "examples/hello.c",
151
161
  });
152
162
  buildExe(b, .{
163
+ .options = options,
153
164
  .lib = lib,
154
165
  .path = "examples/watermark.c",
155
166
  });
156
167
  buildExe(b, .{
168
+ .options = options,
157
169
  .lib = lib,
158
170
  .path = "examples/worksheet_protection.c",
159
171
  });
@@ -161,100 +173,122 @@ pub fn build(b: *std.Build) void {
161
173
  // build tests
162
174
  if (tests) {
163
175
  buildTest(b, .{
176
+ .options = options,
164
177
  .lib = lib,
165
178
  .path = "test/unit/app/test_app.c",
166
179
  });
167
180
  buildTest(b, .{
181
+ .options = options,
168
182
  .lib = lib,
169
183
  .path = "test/unit/chart/test_chart.c",
170
184
  });
171
185
  buildTest(b, .{
186
+ .options = options,
172
187
  .lib = lib,
173
188
  .path = "test/unit/chartsheet/test_chartsheet.c",
174
189
  });
175
190
  buildTest(b, .{
191
+ .options = options,
176
192
  .lib = lib,
177
193
  .path = "test/unit/content_types/test_content_types.c",
178
194
  });
179
195
  buildTest(b, .{
196
+ .options = options,
180
197
  .lib = lib,
181
198
  .path = "test/unit/content_types/test_content_types_write_default.c",
182
199
  });
183
200
  buildTest(b, .{
201
+ .options = options,
184
202
  .lib = lib,
185
203
  .path = "test/unit/content_types/test_content_types_write_override.c",
186
204
  });
187
205
  buildTest(b, .{
206
+ .options = options,
188
207
  .lib = lib,
189
208
  .path = "test/unit/relationships/test_relationships.c",
190
209
  });
191
210
  buildTest(b, .{
211
+ .options = options,
192
212
  .lib = lib,
193
213
  .path = "test/unit/app/test_app_xml_declaration.c",
194
214
  });
195
215
  buildTest(b, .{
216
+ .options = options,
196
217
  .lib = lib,
197
218
  .path = "test/unit/relationships/test_relationships_xml_declaration.c",
198
219
  });
199
220
  buildTest(b, .{
221
+ .options = options,
200
222
  .lib = lib,
201
223
  .path = "test/unit/custom/test_custom_xml_declaration.c",
202
224
  });
203
225
  buildTest(b, .{
226
+ .options = options,
204
227
  .lib = lib,
205
228
  .path = "test/unit/metadata/test_metadata_xml_declaration.c",
206
229
  });
207
230
  buildTest(b, .{
231
+ .options = options,
208
232
  .lib = lib,
209
233
  .path = "test/unit/core/test_core_xml_declaration.c",
210
234
  });
211
235
  buildTest(b, .{
236
+ .options = options,
212
237
  .lib = lib,
213
238
  .path = "test/unit/sst/test_shared_strings.c",
214
239
  });
215
240
  buildTest(b, .{
241
+ .options = options,
216
242
  .lib = lib,
217
243
  .path = "test/unit/workbook/test_workbook.c",
218
244
  });
219
245
  buildTest(b, .{
246
+ .options = options,
220
247
  .lib = lib,
221
248
  .path = "test/unit/xmlwriter/test_xmlwriter.c",
222
249
  });
223
250
  buildTest(b, .{
251
+ .options = options,
224
252
  .lib = lib,
225
253
  .path = "test/unit/table/test_table01.c",
226
254
  });
227
255
  buildTest(b, .{
256
+ .options = options,
228
257
  .lib = lib,
229
258
  .path = "test/unit/table/test_table02.c",
230
259
  });
231
260
  buildTest(b, .{
261
+ .options = options,
232
262
  .lib = lib,
233
263
  .path = "test/unit/table/test_table03.c",
234
264
  });
235
265
  buildTest(b, .{
266
+ .options = options,
236
267
  .lib = lib,
237
268
  .path = "test/unit/table/test_table04.c",
238
269
  });
239
270
  buildTest(b, .{
271
+ .options = options,
240
272
  .lib = lib,
241
273
  .path = "test/unit/styles/test_styles_write_border.c",
242
274
  });
243
275
  }
244
276
  }
245
277
 
246
- fn buildExe(b: *std.Build, info: BuildInfo) void {
278
+ fn buildExe(b: *std.Build, info: BuildExec) void {
247
279
  const exe = b.addExecutable(.{
248
280
  .name = info.filename(),
249
- .optimize = info.lib.optimize,
250
- .target = info.lib.target,
281
+ .root_module = createModule(b, info.options),
282
+ });
283
+ exe.root_module.addCSourceFile(.{
284
+ .file = b.path(info.path),
285
+ .flags = cflags,
251
286
  });
252
- exe.addCSourceFile(.{ .file = Path.relative(info.path), .flags = cflags });
253
- exe.linkLibrary(info.lib);
254
- for (info.lib.include_dirs.items) |include| {
255
- exe.include_dirs.append(include) catch {};
287
+ exe.root_module.linkLibrary(info.lib);
288
+ for (info.lib.root_module.include_dirs.items) |include| {
289
+ exe.root_module.include_dirs.append(b.allocator, include) catch @panic("OOM");
256
290
  }
257
- exe.linkLibC();
291
+ exe.root_module.link_libc = true;
258
292
  b.installArtifact(exe);
259
293
 
260
294
  const run_cmd = b.addRunArtifact(exe);
@@ -270,21 +304,26 @@ fn buildExe(b: *std.Build, info: BuildInfo) void {
270
304
  run_step.dependOn(&run_cmd.step);
271
305
  }
272
306
 
273
- fn buildTest(b: *std.Build, info: BuildInfo) void {
307
+ fn buildTest(b: *std.Build, info: BuildExec) void {
274
308
  const exe = b.addExecutable(.{
275
309
  .name = info.filename(),
276
- .optimize = info.lib.optimize,
277
- .target = info.lib.target,
310
+ .root_module = createModule(b, info.options),
311
+ });
312
+ exe.root_module.addCMacro("TESTING", "");
313
+ exe.root_module.addCSourceFile(.{
314
+ .file = b.path(info.path),
315
+ .flags = cflags,
316
+ });
317
+ exe.root_module.addCSourceFile(.{
318
+ .file = b.path("test/unit/test_all.c"),
319
+ .flags = cflags,
278
320
  });
279
- exe.defineCMacro("TESTING", null);
280
- exe.addCSourceFile(.{ .file = Path.relative(info.path), .flags = cflags });
281
- exe.addCSourceFile(.{ .file = Path.relative("test/unit/test_all.c"), .flags = cflags });
282
- exe.addIncludePath(Path.relative("test/unit"));
283
- for (info.lib.include_dirs.items) |include| {
284
- exe.include_dirs.append(include) catch {};
321
+ exe.root_module.addIncludePath(b.path("test/unit"));
322
+ exe.root_module.linkLibrary(info.lib);
323
+ for (info.lib.root_module.include_dirs.items) |include| {
324
+ exe.root_module.include_dirs.append(b.allocator, include) catch @panic("OOM");
285
325
  }
286
- exe.linkLibrary(info.lib);
287
- exe.linkLibC();
326
+ exe.root_module.link_libc = true;
288
327
  b.installArtifact(exe);
289
328
 
290
329
  const run_cmd = b.addRunArtifact(exe);
@@ -300,6 +339,13 @@ fn buildTest(b: *std.Build, info: BuildInfo) void {
300
339
  run_step.dependOn(&run_cmd.step);
301
340
  }
302
341
 
342
+ fn createModule(b: *std.Build, options: BuildConfig) *std.Build.Module {
343
+ return b.createModule(.{
344
+ .target = options.target,
345
+ .optimize = options.optimize,
346
+ });
347
+ }
348
+
303
349
  const cflags = &.{
304
350
  "-std=c89",
305
351
  "-Wall",
@@ -313,12 +359,55 @@ const minizip_src: []const []const u8 = &.{
313
359
  "third_party/minizip/zip.c",
314
360
  };
315
361
 
316
- const BuildInfo = struct {
362
+ const BuildExec = struct {
363
+ options: BuildConfig,
317
364
  lib: *std.Build.Step.Compile,
318
365
  path: []const u8,
319
366
 
320
- fn filename(self: BuildInfo) []const u8 {
367
+ fn filename(self: BuildExec) []const u8 {
321
368
  var split = std.mem.splitSequence(u8, std.fs.path.basename(self.path), ".");
322
369
  return split.first();
323
370
  }
324
371
  };
372
+ const BuildConfig = struct {
373
+ target: std.Build.ResolvedTarget,
374
+ optimize: std.builtin.OptimizeMode,
375
+ };
376
+
377
+ fn buildZlib(b: *std.Build, options: BuildConfig) *std.Build.Step.Compile {
378
+ const libz = b.addLibrary(.{
379
+ .name = "z",
380
+ .root_module = createModule(b, options),
381
+ });
382
+ if (b.lazyDependency("zlib", .{
383
+ .target = options.target,
384
+ .optimize = options.optimize,
385
+ })) |zlib_path| {
386
+ libz.root_module.addIncludePath(zlib_path.path(""));
387
+ libz.root_module.addCSourceFiles(.{
388
+ .root = zlib_path.path(""),
389
+ .files = &.{
390
+ "adler32.c",
391
+ "crc32.c",
392
+ "deflate.c",
393
+ "infback.c",
394
+ "inffast.c",
395
+ "inflate.c",
396
+ "inftrees.c",
397
+ "trees.c",
398
+ "zutil.c",
399
+ "compress.c",
400
+ "uncompr.c",
401
+ "gzclose.c",
402
+ "gzlib.c",
403
+ "gzread.c",
404
+ "gzwrite.c",
405
+ },
406
+ .flags = cflags,
407
+ });
408
+ libz.installHeader(zlib_path.path("zconf.h"), "zconf.h");
409
+ libz.installHeader(zlib_path.path("zlib.h"), "zlib.h");
410
+ }
411
+ libz.root_module.link_libc = true;
412
+ return libz;
413
+ }
@@ -1,11 +1,22 @@
1
1
  .{
2
- .name = "libxlsxwriter",
3
- .version = "1.1.6",
2
+ .name = .libxlsxwriter,
3
+ .version = "1.1.9",
4
+ .fingerprint = 0xa28d9a85f22fad0e,
5
+ .minimum_zig_version = "0.16.0",
4
6
  .dependencies = .{
5
7
  .zlib = .{
6
- .url = "https://github.com/kassane/zlib/archive/4a99cc2bfa344c969f086fcb8c5873d80448f3e6.tar.gz",
7
- .hash = "12209e851f7e2c6ba2f01de3e11b1771f03e49666065320abd8414aac152bfa75fae",
8
+ .url = "git+https://github.com/madler/zlib#v1.3.1",
9
+ .hash = "N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o",
8
10
  },
9
11
  },
12
+ .paths = .{
13
+ "build.zig",
14
+ "build.zig.zon",
15
+ "Readme.md",
16
+ "License.txt",
17
+ "src",
18
+ "include",
19
+ "third_party",
20
+ },
10
21
  }
11
22
  //syntax tip: zig - anon struct (json-like)
@@ -15,6 +15,10 @@
15
15
  #import "metadata.h"
16
16
  #import "packager.h"
17
17
  #import "relationships.h"
18
+ #import "rich_value.h"
19
+ #import "rich_value_rel.h"
20
+ #import "rich_value_structure.h"
21
+ #import "rich_value_types.h"
18
22
  #import "shared_strings.h"
19
23
  #import "styles.h"
20
24
  #import "table.h"
@@ -1,7 +1,8 @@
1
1
  /*
2
2
  * libxlsxwriter
3
3
  *
4
- * Copyright 2014-2022, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
4
+ * SPDX-License-Identifier: BSD-2-Clause
5
+ * Copyright 2014-2026, John McNamara, jmcnamara@cpan.org.
5
6
  *
6
7
  * app - A libxlsxwriter library for creating Excel XLSX app files.
7
8
  *