archive_r_ruby 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c84dab51e8d84438b6eca7d3d96baa9398ea8606307e423b2416b7f12f263ecf
4
- data.tar.gz: 2b1df674056604436d193e8bfa871bfb823a41c2ba0edc6dd220d30c958f5ef0
3
+ metadata.gz: 31ab071dbf392b718d285cd2d4bb0aef9aac274e38f089e901236e0d4cf3483c
4
+ data.tar.gz: '018420a12b7898091dc050576d0cf64293aff277e1bbede44992e301e8f9b091'
5
5
  SHA512:
6
- metadata.gz: 15230cc63edf0704c6d7fd129b0fd5460eb42c474c34eeb5cd6ce834095819ea5202541fdada77a00f4aa63c0379fb152c8c10047b4386a02522858c6579ab71
7
- data.tar.gz: 8ec342c7bb690af3daeeb4774db7e2ab838273bc36bbb964fbe3cb825cddb0963d1700948e03c5cb1dc7b4ece6f513d711a42e7e4cbee5e4cc061586657d9306
6
+ metadata.gz: b3384d869082817b9787fe25b8d4862428babb257d29ff2d4db1c125b257091d6875aaa6e9f8e30b41c096d7e06544a7d5c621c4cdf1d37c842e9de0cd327eb2
7
+ data.tar.gz: ec74d0381f296bae55934a8a448db6b0d3712c3fe0bcb63e6a7ee40a3756739464f07c394057de92600434eca8c451998abc9cb416bf974d3255e2b9c3acc485
@@ -1,5 +1,5 @@
1
1
  archive_r License
2
- Version: 0.1.2 (2025-12-02)
2
+ Version: 0.1.3 (2025-12-02)
3
3
 
4
4
  ----------------------------------------
5
5
  Primary License
@@ -0,0 +1,270 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ # V=0 quiet, V=1 verbose. other values don't work.
5
+ V = 0
6
+ V0 = $(V:0=)
7
+ Q1 = $(V:1=)
8
+ Q = $(Q1:0=@)
9
+ ECHO1 = $(V:1=@ :)
10
+ ECHO = $(ECHO1:0=@ echo)
11
+ NULLCMD = :
12
+
13
+ #### Start of system configuration section. ####
14
+
15
+ srcdir = .
16
+ topdir = /usr/local/Cellar/ruby@3.3/3.3.9/include/ruby-3.3.0
17
+ hdrdir = $(topdir)
18
+ arch_hdrdir = /usr/local/Cellar/ruby@3.3/3.3.9/include/ruby-3.3.0/x86_64-darwin22
19
+ PATH_SEPARATOR = :
20
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:::/Users/runner/work/archive_r/archive_r/src
21
+ prefix = $(DESTDIR)/usr/local/Cellar/ruby@3.3/3.3.9
22
+ rubysitearchprefix = $(rubylibprefix)/$(sitearch)
23
+ rubyarchprefix = $(rubylibprefix)/$(arch)
24
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
25
+ exec_prefix = $(prefix)
26
+ vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
27
+ sitearchhdrdir = $(sitehdrdir)/$(sitearch)
28
+ rubyarchhdrdir = $(rubyhdrdir)/$(arch)
29
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
30
+ sitehdrdir = $(rubyhdrdir)/site_ruby
31
+ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
32
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
33
+ vendorlibdir = $(vendordir)/$(ruby_version)
34
+ vendordir = $(DESTDIR)/usr/local/lib/ruby/vendor_ruby
35
+ sitearchdir = $(sitelibdir)/$(sitearch)
36
+ sitelibdir = $(sitedir)/$(ruby_version)
37
+ sitedir = $(DESTDIR)/usr/local/lib/ruby/site_ruby
38
+ rubyarchdir = $(rubylibdir)/$(arch)
39
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
40
+ sitearchincludedir = $(includedir)/$(sitearch)
41
+ archincludedir = $(includedir)/$(arch)
42
+ sitearchlibdir = $(libdir)/$(sitearch)
43
+ archlibdir = $(libdir)/$(arch)
44
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
45
+ mandir = $(datarootdir)/man
46
+ localedir = $(datarootdir)/locale
47
+ libdir = $(exec_prefix)/lib
48
+ psdir = $(docdir)
49
+ pdfdir = $(docdir)
50
+ dvidir = $(docdir)
51
+ htmldir = $(docdir)
52
+ infodir = $(datarootdir)/info
53
+ docdir = $(datarootdir)/doc/$(PACKAGE)
54
+ oldincludedir = $(DESTDIR)/usr/include
55
+ includedir = $(prefix)/include
56
+ runstatedir = $(localstatedir)/run
57
+ localstatedir = $(prefix)/var
58
+ sharedstatedir = $(prefix)/com
59
+ sysconfdir = $(prefix)/etc
60
+ datadir = $(datarootdir)
61
+ datarootdir = $(prefix)/share
62
+ libexecdir = $(exec_prefix)/libexec
63
+ sbindir = $(exec_prefix)/sbin
64
+ bindir = $(exec_prefix)/bin
65
+ archdir = $(rubyarchdir)
66
+
67
+
68
+ CC_WRAPPER =
69
+ CC = clang
70
+ CXX = clang++ -std=gnu++11
71
+ LIBRUBY = $(LIBRUBY_SO)
72
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
73
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
74
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation $(MAINLIBS)
75
+ empty =
76
+ OUTFLAG = -o $(empty)
77
+ COUTFLAG = -o $(empty)
78
+ CSRCFLAG = $(empty)
79
+
80
+ RUBY_EXTCONF_H =
81
+ cflags = -fdeclspec $(optflags) $(debugflags) $(warnflags)
82
+ cxxflags =
83
+ optflags = -O3 -fno-fast-math
84
+ debugflags = -ggdb3
85
+ warnflags = -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef
86
+ cppflags =
87
+ CCDLFLAGS = -fno-common
88
+ CFLAGS = $(CCDLFLAGS) $(cflags) -fno-common -pipe $(ARCH_FLAG)
89
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) -I/Users/runner/work/archive_r/archive_r/include -I/Users/runner/work/archive_r/archive_r/src -I/usr/local/opt/libarchive/include
90
+ DEFS =
91
+ CPPFLAGS = -I/usr/local/opt/libarchive/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl@3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
92
+ CXXFLAGS = $(CCDLFLAGS) -fdeclspec -std=c++17 $(ARCH_FLAG)
93
+ ldflags = -L. -fstack-protector-strong -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@3/lib
94
+ dldflags = -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@3/lib -Wl,-undefined,dynamic_lookup
95
+ ARCH_FLAG =
96
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
97
+ LDSHARED = $(CC) -dynamic -bundle
98
+ LDSHAREDXX = $(CXX) -dynamic -bundle
99
+ AR = ar
100
+ EXEEXT =
101
+
102
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
103
+ RUBY_SO_NAME = ruby.3.3
104
+ RUBYW_INSTALL_NAME =
105
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
106
+ RUBYW_BASE_NAME = rubyw
107
+ RUBY_BASE_NAME = ruby
108
+
109
+ arch = x86_64-darwin22
110
+ sitearch = $(arch)
111
+ ruby_version = 3.3.0
112
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
113
+ RUBY = $(ruby)
114
+ BUILTRUBY = $(bindir)/$(RUBY_BASE_NAME)
115
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
116
+
117
+ RM = rm -f
118
+ RM_RF = rm -fr
119
+ RMDIRS = rmdir -p
120
+ MAKEDIRS = mkdir -p
121
+ INSTALL = /usr/bin/install -c
122
+ INSTALL_PROG = $(INSTALL) -m 0755
123
+ INSTALL_DATA = $(INSTALL) -m 644
124
+ COPY = cp
125
+ TOUCH = exit >
126
+
127
+ #### End of system configuration section. ####
128
+
129
+ preload =
130
+ libpath = . $(libdir) /usr/local/opt/libarchive/lib /usr/local/opt/libyaml/lib /usr/local/opt/openssl@3/lib
131
+ LIBPATH = -L. -L$(libdir) -L/usr/local/opt/libarchive/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@3/lib
132
+ DEFFILE =
133
+
134
+ CLEANFILES = mkmf.log
135
+ DISTCLEANFILES =
136
+ DISTCLEANDIRS =
137
+
138
+ extout =
139
+ extout_prefix =
140
+ target_prefix = /archive_r
141
+ LOCAL_LIBS = /Users/runner/work/archive_r/archive_r/build/libarchive_r_core.a
142
+ LIBS = $(LIBRUBYARG_SHARED) -larchive -lpthread
143
+ ORIG_SRCS = archive_r_ext.cc
144
+ SRCS = $(ORIG_SRCS)
145
+ OBJS = archive_r_ext.o
146
+ HDRS =
147
+ LOCAL_HDRS =
148
+ TARGET = archive_r
149
+ TARGET_NAME = archive_r
150
+ TARGET_ENTRY = Init_$(TARGET_NAME)
151
+ DLLIB = $(TARGET).bundle
152
+ EXTSTATIC =
153
+ STATIC_LIB =
154
+
155
+ TIMESTAMP_DIR = .
156
+ BINDIR = $(bindir)
157
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
158
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
159
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
160
+ HDRDIR = $(sitehdrdir)$(target_prefix)
161
+ ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
162
+ TARGET_SO_DIR =
163
+ TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
164
+ CLEANLIBS = $(TARGET_SO) $(TARGET_SO).dSYM
165
+ CLEANOBJS = $(OBJS) *.bak
166
+ TARGET_SO_DIR_TIMESTAMP = $(TIMESTAMP_DIR)/.sitearchdir.-.archive_r.time
167
+
168
+ all: $(DLLIB)
169
+ static: $(STATIC_LIB)
170
+ .PHONY: all install static install-so install-rb
171
+ .PHONY: clean clean-so clean-static clean-rb
172
+
173
+ clean-static::
174
+ clean-rb-default::
175
+ clean-rb::
176
+ clean-so::
177
+ clean: clean-so clean-static clean-rb-default clean-rb
178
+ -$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
179
+
180
+ distclean-rb-default::
181
+ distclean-rb::
182
+ distclean-so::
183
+ distclean-static::
184
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
185
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
186
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
187
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
188
+
189
+ realclean: distclean
190
+ install: install-so install-rb
191
+
192
+ install-so: $(DLLIB) $(TARGET_SO_DIR_TIMESTAMP)
193
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
194
+ clean-static::
195
+ -$(Q)$(RM) $(STATIC_LIB)
196
+ install-rb: pre-install-rb do-install-rb install-rb-default
197
+ install-rb-default: pre-install-rb-default do-install-rb-default
198
+ pre-install-rb: Makefile
199
+ pre-install-rb-default: Makefile
200
+ do-install-rb:
201
+ do-install-rb-default:
202
+ pre-install-rb-default:
203
+ @$(NULLCMD)
204
+ $(TARGET_SO_DIR_TIMESTAMP):
205
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
206
+ $(Q) $(TOUCH) $@
207
+
208
+ site-install: site-install-so site-install-rb
209
+ site-install-so: install-so
210
+ site-install-rb: install-rb
211
+
212
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
213
+
214
+ .cc.o:
215
+ $(ECHO) compiling $(<)
216
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
217
+
218
+ .cc.S:
219
+ $(ECHO) translating $(<)
220
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
221
+
222
+ .mm.o:
223
+ $(ECHO) compiling $(<)
224
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
225
+
226
+ .mm.S:
227
+ $(ECHO) translating $(<)
228
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
229
+
230
+ .cxx.o:
231
+ $(ECHO) compiling $(<)
232
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
233
+
234
+ .cxx.S:
235
+ $(ECHO) translating $(<)
236
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
237
+
238
+ .cpp.o:
239
+ $(ECHO) compiling $(<)
240
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
241
+
242
+ .cpp.S:
243
+ $(ECHO) translating $(<)
244
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
245
+
246
+ .c.o:
247
+ $(ECHO) compiling $(<)
248
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
249
+
250
+ .c.S:
251
+ $(ECHO) translating $(<)
252
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
253
+
254
+ .m.o:
255
+ $(ECHO) compiling $(<)
256
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
257
+
258
+ .m.S:
259
+ $(ECHO) translating $(<)
260
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
261
+
262
+ $(TARGET_SO): $(OBJS) Makefile
263
+ $(ECHO) linking shared-object archive_r/$(DLLIB)
264
+ -$(Q)$(RM) $(@)
265
+ $(Q) $(LDSHAREDXX) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
266
+ $(Q) $(POSTLINK)
267
+
268
+
269
+
270
+ $(OBJS): $(HDRS) $(ruby_headers)
Binary file
Binary file
@@ -62,17 +62,47 @@ $INCFLAGS << " -I#{archive_r_src}"
62
62
  # C++17 standard
63
63
  $CXXFLAGS << " -std=c++17"
64
64
 
65
+ # Configure libarchive paths from environment variables
66
+ if ENV['LIBARCHIVE_ROOT']
67
+ root = File.expand_path(ENV['LIBARCHIVE_ROOT'])
68
+ $INCFLAGS << " -I#{File.join(root, 'include')}"
69
+ $LIBPATH.unshift(File.join(root, 'lib'))
70
+ end
71
+
72
+ if ENV['LIBARCHIVE_INCLUDE_DIRS']
73
+ ENV['LIBARCHIVE_INCLUDE_DIRS'].split(File::PATH_SEPARATOR).each do |dir|
74
+ $INCFLAGS << " -I#{dir}"
75
+ end
76
+ end
77
+
78
+ if ENV['LIBARCHIVE_LIBRARY_DIRS']
79
+ ENV['LIBARCHIVE_LIBRARY_DIRS'].split(File::PATH_SEPARATOR).each do |dir|
80
+ $LIBPATH.unshift(dir)
81
+ end
82
+ end
83
+
65
84
  # Check for libarchive
66
85
  unless have_library('archive')
67
- abort "libarchive is required but not found"
86
+ # Try alternative names for Windows/Static builds
87
+ unless have_library('archive_static') || have_library('libarchive')
88
+ abort "libarchive is required but not found"
89
+ end
68
90
  end
69
91
 
70
92
  # Try to link with pre-built static library first
71
93
  prebuilt_lib = File.join(archive_r_lib_dir, 'libarchive_r_core.a')
94
+ prebuilt_lib_win = File.join(archive_r_lib_dir, 'archive_r_core.lib')
95
+ prebuilt_lib_win_release = File.join(archive_r_lib_dir, 'Release', 'archive_r_core.lib')
72
96
 
73
97
  if File.exist?(prebuilt_lib)
74
98
  $LOCAL_LIBS << " #{prebuilt_lib}"
75
- puts "Using pre-built archive_r core library"
99
+ puts "Using pre-built archive_r core library (Unix style)"
100
+ elsif File.exist?(prebuilt_lib_win)
101
+ $LOCAL_LIBS << " \"#{prebuilt_lib_win}\""
102
+ puts "Using pre-built archive_r core library (Windows style)"
103
+ elsif File.exist?(prebuilt_lib_win_release)
104
+ $LOCAL_LIBS << " \"#{prebuilt_lib_win_release}\""
105
+ puts "Using pre-built archive_r core library (Windows Release style)"
76
106
  else
77
107
  # Build from source as fallback (ensure the Ruby glue source is compiled too)
78
108
  puts "Pre-built library not found, will build from source"
@@ -0,0 +1,35 @@
1
+ have_library: checking for -larchive... -------------------- yes
2
+
3
+ DYLD_LIBRARY_PATH=.:/usr/local/Cellar/ruby@3.3/3.3.9/lib "clang -o conftest -I/usr/local/Cellar/ruby@3.3/3.3.9/include/ruby-3.3.0/x86_64-darwin22 -I/usr/local/Cellar/ruby@3.3/3.3.9/include/ruby-3.3.0/ruby/backward -I/usr/local/Cellar/ruby@3.3/3.3.9/include/ruby-3.3.0 -I. -I/Users/runner/work/archive_r/archive_r/include -I/Users/runner/work/archive_r/archive_r/src -I/usr/local/opt/libarchive/include -I/usr/local/opt/libarchive/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl@3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef -fno-common -pipe conftest.c -L. -L/usr/local/Cellar/ruby@3.3/3.3.9/lib -L/usr/local/opt/libarchive/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@3/lib -L. -fstack-protector-strong -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@3/lib -lruby.3.3 -lpthread "
4
+ checked program was:
5
+ /* begin */
6
+ 1: #include "ruby.h"
7
+ 2:
8
+ 3: int main(int argc, char **argv)
9
+ 4: {
10
+ 5: return !!argv[argc];
11
+ 6: }
12
+ /* end */
13
+
14
+ DYLD_LIBRARY_PATH=.:/usr/local/Cellar/ruby@3.3/3.3.9/lib "clang -o conftest -I/usr/local/Cellar/ruby@3.3/3.3.9/include/ruby-3.3.0/x86_64-darwin22 -I/usr/local/Cellar/ruby@3.3/3.3.9/include/ruby-3.3.0/ruby/backward -I/usr/local/Cellar/ruby@3.3/3.3.9/include/ruby-3.3.0 -I. -I/Users/runner/work/archive_r/archive_r/include -I/Users/runner/work/archive_r/archive_r/src -I/usr/local/opt/libarchive/include -I/usr/local/opt/libarchive/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl@3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef -fno-common -pipe conftest.c -L. -L/usr/local/Cellar/ruby@3.3/3.3.9/lib -L/usr/local/opt/libarchive/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@3/lib -L. -fstack-protector-strong -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@3/lib -lruby.3.3 -larchive -lpthread "
15
+ checked program was:
16
+ /* begin */
17
+ 1: #include "ruby.h"
18
+ 2:
19
+ 3: /*top*/
20
+ 4: extern int t(void);
21
+ 5: int main(int argc, char **argv)
22
+ 6: {
23
+ 7: if (argc > 1000000) {
24
+ 8: int (* volatile tp)(void)=(int (*)(void))&t;
25
+ 9: printf("%d", (*tp)());
26
+ 10: }
27
+ 11:
28
+ 12: return !!argv[argc];
29
+ 13: }
30
+ 14:
31
+ 15: int t(void) { ; return 0; }
32
+ /* end */
33
+
34
+ --------------------
35
+
@@ -1,5 +1,5 @@
1
1
  archive_r License
2
- Version: 0.1.2 (2025-12-02)
2
+ Version: 0.1.3 (2025-12-02)
3
3
 
4
4
  ----------------------------------------
5
5
  Primary License
@@ -8,6 +8,17 @@
8
8
  #include <functional>
9
9
  #include <memory>
10
10
  #include <sys/types.h>
11
+ #include <cstdint>
12
+
13
+ #ifdef _WIN32
14
+ #include <basetsd.h>
15
+ using ssize_t = SSIZE_T;
16
+ #endif
17
+
18
+ // Avoid conflict with potential 'read' macro on Windows
19
+ #ifdef read
20
+ #undef read
21
+ #endif
11
22
 
12
23
  namespace archive_r {
13
24
 
@@ -10,6 +10,11 @@
10
10
  #include <sys/types.h>
11
11
  #include <vector>
12
12
 
13
+ #ifdef _MSC_VER
14
+ #include <BaseTsd.h>
15
+ typedef SSIZE_T ssize_t;
16
+ #endif
17
+
13
18
  #include "archive_r/entry_fault.h"
14
19
  #include "archive_r/entry_metadata.h"
15
20
  #include "archive_r/path_hierarchy.h"
@@ -0,0 +1,19 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // Copyright (c) 2025 archive_r Team
3
+
4
+ #pragma once
5
+
6
+ #include <sys/types.h>
7
+
8
+ #if defined(_WIN32)
9
+ # include <sys/stat.h>
10
+ # if !defined(_SSIZE_T_DEFINED)
11
+ # include <BaseTsd.h>
12
+ using ssize_t = SSIZE_T;
13
+ # define _SSIZE_T_DEFINED
14
+ # endif
15
+ # if !defined(_MODE_T_DEFINED)
16
+ using mode_t = unsigned short; // MSVC does not expose POSIX mode_t by default
17
+ # define _MODE_T_DEFINED
18
+ # endif
19
+ #endif
@@ -13,7 +13,6 @@
13
13
  #include <exception>
14
14
  #include <memory>
15
15
  #include <string>
16
- #include <sys/types.h>
17
16
  #include <vector>
18
17
 
19
18
  namespace archive_r {
@@ -4,6 +4,7 @@
4
4
  #pragma once
5
5
 
6
6
  #include "archive_r/path_hierarchy.h"
7
+ #include "archive_r/platform_compat.h"
7
8
  #include "archive_type.h"
8
9
  #include "archive_stack_cursor.h"
9
10
  #include "entry_fault_error.h"
@@ -11,7 +12,6 @@
11
12
  #include <limits>
12
13
  #include <memory>
13
14
  #include <string>
14
- #include <sys/types.h>
15
15
  #include <unordered_set>
16
16
 
17
17
  namespace archive_r {
@@ -11,10 +11,11 @@
11
11
  #include <memory>
12
12
  #include <stdexcept>
13
13
  #include <string>
14
- #include <sys/types.h>
15
14
  #include <unordered_set>
16
15
  #include <vector>
17
16
 
17
+ #include "archive_r/platform_compat.h"
18
+
18
19
  namespace archive_r {
19
20
 
20
21
  struct archive_deleter {
@@ -8,7 +8,6 @@
8
8
  #include <filesystem>
9
9
  #include <memory>
10
10
  #include <optional>
11
- #include <sys/types.h> // for mode_t
12
11
  #include <unordered_set>
13
12
 
14
13
  namespace archive_r {
@@ -3,25 +3,31 @@
3
3
 
4
4
  #include "system_file_stream.h"
5
5
  #include "archive_r/path_hierarchy_utils.h"
6
+ #include "archive_r/platform_compat.h"
6
7
  #include "entry_fault_error.h"
7
8
 
8
9
  #include <algorithm>
9
10
  #include <cerrno>
11
+ #include <cstdio>
10
12
  #include <filesystem>
11
- #include <grp.h>
12
- #include <pwd.h>
13
13
  #include <stdexcept>
14
14
  #include <sys/stat.h>
15
15
  #include <system_error>
16
16
  #include <string_view>
17
- #include <unistd.h>
18
17
  #include <utility>
19
18
  #include <vector>
20
19
 
20
+ #if !defined(_WIN32)
21
+ # include <grp.h>
22
+ # include <pwd.h>
23
+ # include <unistd.h>
24
+ #endif
25
+
21
26
  namespace archive_r {
22
27
 
23
28
  namespace {
24
29
 
30
+ #if !defined(_WIN32)
25
31
  static long determine_buffer_size(int name) {
26
32
  long size = ::sysconf(name);
27
33
  if (size < 0) {
@@ -55,6 +61,7 @@ static bool lookup_groupname(gid_t gid, std::string &name_out) {
55
61
  }
56
62
  return false;
57
63
  }
64
+ #endif
58
65
 
59
66
  } // namespace
60
67
 
@@ -86,6 +93,14 @@ void SystemFileStream::open_single_part(const PathHierarchy &single_part) {
86
93
 
87
94
  _handle = handle;
88
95
  _active_path = path;
96
+
97
+ #if defined(_WIN32)
98
+ // Enable larger buffering on Windows to improve performance
99
+ // Use 64KB buffer to match StreamArchive's buffer size
100
+ if (_handle) {
101
+ std::setvbuf(_handle, nullptr, _IOFBF, 65536);
102
+ }
103
+ #endif
89
104
  }
90
105
 
91
106
  void SystemFileStream::close_single_part() {
@@ -112,10 +127,24 @@ ssize_t SystemFileStream::read_from_single_part(void *buffer, size_t size) {
112
127
  }
113
128
 
114
129
  int64_t SystemFileStream::seek_within_single_part(int64_t offset, int whence) {
115
- if (fseeko(_handle, offset, whence) != 0) {
116
- return -1;
130
+ int64_t position = -1;
131
+ #if defined(_WIN32)
132
+ if (_fseeki64(_handle, offset, whence) == 0) {
133
+ if (whence == SEEK_SET) {
134
+ position = offset;
135
+ } else {
136
+ position = _ftelli64(_handle);
137
+ }
138
+ }
139
+ #else
140
+ if (fseeko(_handle, offset, whence) == 0) {
141
+ if (whence == SEEK_SET) {
142
+ position = offset;
143
+ } else {
144
+ position = ftello(_handle);
145
+ }
117
146
  }
118
- const auto position = ftello(_handle);
147
+ #endif
119
148
  return position >= 0 ? position : -1;
120
149
  }
121
150
 
@@ -175,7 +204,9 @@ FilesystemMetadataInfo collect_root_path_metadata(const PathHierarchy &hierarchy
175
204
  ec.clear();
176
205
  const bool is_symlink = entry.is_symlink(ec);
177
206
  if (!ec && is_symlink) {
207
+ #ifdef S_IFLNK
178
208
  filetype = S_IFLNK;
209
+ #endif
179
210
  }
180
211
  }
181
212
  }
@@ -210,12 +241,11 @@ FilesystemMetadataInfo collect_root_path_metadata(const PathHierarchy &hierarchy
210
241
  }
211
242
  }
212
243
 
213
- const bool wants_size = wants("size");
214
- const bool wants_uid = wants("uid");
215
- const bool wants_gid = wants("gid");
216
- const bool wants_uname = wants("uname");
217
- const bool wants_gname = wants("gname");
218
- const bool needs_stat = (wants_size && size == 0) || wants_uid || wants_gid || wants_uname || wants_gname;
244
+ const bool needs_stat = (wants("size") && size == 0)
245
+ #if !defined(_WIN32)
246
+ || wants("uid") || wants("gid") || wants("uname") || wants("gname")
247
+ #endif
248
+ ;
219
249
 
220
250
  struct stat stat_buffer;
221
251
  bool have_stat = false;
@@ -224,7 +254,7 @@ FilesystemMetadataInfo collect_root_path_metadata(const PathHierarchy &hierarchy
224
254
  have_stat = (::stat(native_path.c_str(), &stat_buffer) == 0);
225
255
  }
226
256
 
227
- if (wants_size) {
257
+ if (wants("size")) {
228
258
  uint64_t resolved = size;
229
259
  if (resolved == 0 && have_stat) {
230
260
  resolved = static_cast<uint64_t>(stat_buffer.st_size);
@@ -234,26 +264,28 @@ FilesystemMetadataInfo collect_root_path_metadata(const PathHierarchy &hierarchy
234
264
  }
235
265
  }
236
266
 
267
+ #if !defined(_WIN32)
237
268
  if (have_stat) {
238
- if (wants_uid) {
269
+ if (wants("uid")) {
239
270
  metadata["uid"] = static_cast<int64_t>(stat_buffer.st_uid);
240
271
  }
241
- if (wants_gid) {
272
+ if (wants("gid")) {
242
273
  metadata["gid"] = static_cast<int64_t>(stat_buffer.st_gid);
243
274
  }
244
- if (wants_uname) {
275
+ if (wants("uname")) {
245
276
  std::string uname;
246
277
  if (lookup_username(stat_buffer.st_uid, uname)) {
247
278
  metadata["uname"] = std::move(uname);
248
279
  }
249
280
  }
250
- if (wants_gname) {
281
+ if (wants("gname")) {
251
282
  std::string gname;
252
283
  if (lookup_groupname(stat_buffer.st_gid, gname)) {
253
284
  metadata["gname"] = std::move(gname);
254
285
  }
255
286
  }
256
287
  }
288
+ #endif
257
289
  }
258
290
 
259
291
  info.metadata = std::move(metadata);
@@ -7,11 +7,11 @@
7
7
  #include <cstdio>
8
8
  #include <filesystem>
9
9
  #include <string>
10
- #include <sys/types.h>
11
10
  #include <unordered_set>
12
11
  #include <vector>
13
12
 
14
13
  #include "archive_r/multi_volume_stream_base.h"
14
+ #include "archive_r/platform_compat.h"
15
15
  #include "archive_r/entry_metadata.h"
16
16
  #include "archive_r/path_hierarchy.h"
17
17
 
data/lib/archive_r.rb CHANGED
@@ -2,15 +2,40 @@
2
2
  # Copyright (c) 2025 archive_r Team
3
3
 
4
4
  begin
5
+ # Windows/MSVC specific: Ensure dependent DLLs (like libarchive.dll) are found.
6
+ # If LIBARCHIVE_ROOT is set, add its bin directory to the DLL search path.
7
+ if RUBY_PLATFORM =~ /mswin|mingw|cygwin/
8
+ if ENV['LIBARCHIVE_ROOT']
9
+ bin_dir = File.join(ENV['LIBARCHIVE_ROOT'], 'bin')
10
+ if Dir.exist?(bin_dir)
11
+ if defined?(RubyInstaller::Runtime)
12
+ RubyInstaller::Runtime.add_dll_directory(bin_dir)
13
+ else
14
+ ENV['PATH'] = "#{bin_dir};#{ENV['PATH']}"
15
+ end
16
+ end
17
+ end
18
+ end
19
+
5
20
  # Prefer the packaged gem layout (lib/archive_r/archive_r.so)
6
21
  require_relative 'archive_r/archive_r'
7
22
  rescue LoadError
8
- # Fallback to the local development layout (bindings/ruby/archive_r.so)
9
- require_relative '../archive_r'
23
+ begin
24
+ # Fallback to the local development layout (bindings/ruby/archive_r.so)
25
+ require_relative '../archive_r'
26
+ rescue LoadError
27
+ begin
28
+ # Fallback for Windows/MinGW where extension might be directly in lib/ or current dir
29
+ require 'archive_r/archive_r'
30
+ rescue LoadError
31
+ # Last resort: try requiring without directory prefix (common in some Windows setups)
32
+ require 'archive_r'
33
+ end
34
+ end
10
35
  end
11
36
 
12
37
  module Archive_r
13
- VERSION = "0.1.2"
38
+ VERSION = "0.1.3"
14
39
  # Common archive formats excluding libarchive's mtree/raw pseudo formats
15
40
  STANDARD_FORMATS = %w[
16
41
  7zip ar cab cpio empty iso9660 lha rar tar warc xar zip
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: archive_r_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - raizo.tcs
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-12-02 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -38,8 +37,8 @@ dependencies:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
39
  version: '5.0'
41
- description: Ruby bindings for archive_r that recursively walk nested and multipart
42
- archives directly from the source stream without creating temporary files
40
+ description: Fast archive traversal library with support for nested archives and multipart
41
+ files
43
42
  email:
44
43
  - raizo.tcs@users.noreply.github.com
45
44
  executables: []
@@ -47,10 +46,14 @@ extensions:
47
46
  - ext/archive_r/extconf.rb
48
47
  extra_rdoc_files: []
49
48
  files:
50
- - LICENSE.txt
49
+ - LICENSE
51
50
  - README.md
51
+ - ext/archive_r/Makefile
52
+ - ext/archive_r/archive_r.bundle
52
53
  - ext/archive_r/archive_r_ext.cc
54
+ - ext/archive_r/archive_r_ext.o
53
55
  - ext/archive_r/extconf.rb
56
+ - ext/archive_r/mkmf.log
54
57
  - ext/archive_r/vendor/archive_r/LICENSE.txt
55
58
  - ext/archive_r/vendor/archive_r/include/archive_r/data_stream.h
56
59
  - ext/archive_r/vendor/archive_r/include/archive_r/entry.h
@@ -59,6 +62,7 @@ files:
59
62
  - ext/archive_r/vendor/archive_r/include/archive_r/multi_volume_stream_base.h
60
63
  - ext/archive_r/vendor/archive_r/include/archive_r/path_hierarchy.h
61
64
  - ext/archive_r/vendor/archive_r/include/archive_r/path_hierarchy_utils.h
65
+ - ext/archive_r/vendor/archive_r/include/archive_r/platform_compat.h
62
66
  - ext/archive_r/vendor/archive_r/include/archive_r/traverser.h
63
67
  - ext/archive_r/vendor/archive_r/src/archive_stack_cursor.cc
64
68
  - ext/archive_r/vendor/archive_r/src/archive_stack_cursor.h
@@ -90,7 +94,6 @@ metadata:
90
94
  source_code_uri: https://github.com/raizo-tcs/archive_r
91
95
  bug_tracker_uri: https://github.com/raizo-tcs/archive_r/issues
92
96
  changelog_uri: https://github.com/raizo-tcs/archive_r/releases
93
- post_install_message:
94
97
  rdoc_options: []
95
98
  require_paths:
96
99
  - lib
@@ -105,8 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
108
  - !ruby/object:Gem::Version
106
109
  version: '0'
107
110
  requirements: []
108
- rubygems_version: 3.4.20
109
- signing_key:
111
+ rubygems_version: 3.7.1
110
112
  specification_version: 4
111
- summary: Ruby bindings for archive_r that traverse nested archives without temp extraction
113
+ summary: Ruby bindings for archive_r library
112
114
  test_files: []