libdeflate 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +34 -0
  3. data/README.md +1 -6
  4. data/ext/libdeflate/extconf.rb +18 -7
  5. data/ext/libdeflate/libdeflate_ext.c +17 -17
  6. data/lib/libdeflate/version.rb +1 -1
  7. data/libdeflate.gemspec +2 -1
  8. metadata +13 -84
  9. data/.gitmodules +0 -3
  10. data/.travis.yml +0 -5
  11. data/ext/libdeflate/libdeflate/.gitignore +0 -19
  12. data/ext/libdeflate/libdeflate/COPYING +0 -21
  13. data/ext/libdeflate/libdeflate/Makefile +0 -231
  14. data/ext/libdeflate/libdeflate/Makefile.msc +0 -64
  15. data/ext/libdeflate/libdeflate/NEWS +0 -57
  16. data/ext/libdeflate/libdeflate/README.md +0 -170
  17. data/ext/libdeflate/libdeflate/common/common_defs.h +0 -351
  18. data/ext/libdeflate/libdeflate/common/compiler_gcc.h +0 -134
  19. data/ext/libdeflate/libdeflate/common/compiler_msc.h +0 -95
  20. data/ext/libdeflate/libdeflate/lib/adler32.c +0 -213
  21. data/ext/libdeflate/libdeflate/lib/adler32_impl.h +0 -281
  22. data/ext/libdeflate/libdeflate/lib/aligned_malloc.c +0 -57
  23. data/ext/libdeflate/libdeflate/lib/aligned_malloc.h +0 -13
  24. data/ext/libdeflate/libdeflate/lib/bt_matchfinder.h +0 -357
  25. data/ext/libdeflate/libdeflate/lib/crc32.c +0 -368
  26. data/ext/libdeflate/libdeflate/lib/crc32_impl.h +0 -286
  27. data/ext/libdeflate/libdeflate/lib/crc32_table.h +0 -526
  28. data/ext/libdeflate/libdeflate/lib/decompress_impl.h +0 -404
  29. data/ext/libdeflate/libdeflate/lib/deflate_compress.c +0 -2817
  30. data/ext/libdeflate/libdeflate/lib/deflate_compress.h +0 -14
  31. data/ext/libdeflate/libdeflate/lib/deflate_constants.h +0 -66
  32. data/ext/libdeflate/libdeflate/lib/deflate_decompress.c +0 -889
  33. data/ext/libdeflate/libdeflate/lib/gzip_compress.c +0 -95
  34. data/ext/libdeflate/libdeflate/lib/gzip_constants.h +0 -45
  35. data/ext/libdeflate/libdeflate/lib/gzip_decompress.c +0 -130
  36. data/ext/libdeflate/libdeflate/lib/hc_matchfinder.h +0 -405
  37. data/ext/libdeflate/libdeflate/lib/lib_common.h +0 -35
  38. data/ext/libdeflate/libdeflate/lib/matchfinder_avx2.h +0 -53
  39. data/ext/libdeflate/libdeflate/lib/matchfinder_common.h +0 -205
  40. data/ext/libdeflate/libdeflate/lib/matchfinder_neon.h +0 -61
  41. data/ext/libdeflate/libdeflate/lib/matchfinder_sse2.h +0 -53
  42. data/ext/libdeflate/libdeflate/lib/unaligned.h +0 -202
  43. data/ext/libdeflate/libdeflate/lib/x86_cpu_features.c +0 -169
  44. data/ext/libdeflate/libdeflate/lib/x86_cpu_features.h +0 -48
  45. data/ext/libdeflate/libdeflate/lib/zlib_compress.c +0 -87
  46. data/ext/libdeflate/libdeflate/lib/zlib_constants.h +0 -21
  47. data/ext/libdeflate/libdeflate/lib/zlib_decompress.c +0 -91
  48. data/ext/libdeflate/libdeflate/libdeflate.h +0 -274
  49. data/ext/libdeflate/libdeflate/programs/benchmark.c +0 -558
  50. data/ext/libdeflate/libdeflate/programs/checksum.c +0 -197
  51. data/ext/libdeflate/libdeflate/programs/detect.sh +0 -62
  52. data/ext/libdeflate/libdeflate/programs/gzip.c +0 -603
  53. data/ext/libdeflate/libdeflate/programs/prog_util.c +0 -530
  54. data/ext/libdeflate/libdeflate/programs/prog_util.h +0 -162
  55. data/ext/libdeflate/libdeflate/programs/test_checksums.c +0 -135
  56. data/ext/libdeflate/libdeflate/programs/tgetopt.c +0 -118
  57. data/ext/libdeflate/libdeflate/tools/afl-fuzz/Makefile +0 -12
  58. data/ext/libdeflate/libdeflate/tools/afl-fuzz/deflate_compress/fuzz.c +0 -40
  59. data/ext/libdeflate/libdeflate/tools/afl-fuzz/deflate_compress/inputs/0 +0 -0
  60. data/ext/libdeflate/libdeflate/tools/afl-fuzz/deflate_decompress/fuzz.c +0 -28
  61. data/ext/libdeflate/libdeflate/tools/afl-fuzz/deflate_decompress/inputs/0 +0 -3
  62. data/ext/libdeflate/libdeflate/tools/afl-fuzz/gzip_decompress/fuzz.c +0 -28
  63. data/ext/libdeflate/libdeflate/tools/afl-fuzz/gzip_decompress/inputs/0 +0 -0
  64. data/ext/libdeflate/libdeflate/tools/afl-fuzz/prepare_for_fuzz.sh +0 -14
  65. data/ext/libdeflate/libdeflate/tools/afl-fuzz/zlib_decompress/fuzz.c +0 -28
  66. data/ext/libdeflate/libdeflate/tools/afl-fuzz/zlib_decompress/inputs/0 +0 -3
  67. data/ext/libdeflate/libdeflate/tools/android_build.sh +0 -104
  68. data/ext/libdeflate/libdeflate/tools/checksum_benchmarks.sh +0 -76
  69. data/ext/libdeflate/libdeflate/tools/exec_tests.sh +0 -30
  70. data/ext/libdeflate/libdeflate/tools/gen_crc32_multipliers.c +0 -108
  71. data/ext/libdeflate/libdeflate/tools/gen_crc32_table.c +0 -100
  72. data/ext/libdeflate/libdeflate/tools/gzip_tests.sh +0 -412
  73. data/ext/libdeflate/libdeflate/tools/make-windows-releases +0 -21
  74. data/ext/libdeflate/libdeflate/tools/mips_build.sh +0 -9
  75. data/ext/libdeflate/libdeflate/tools/msc_test.bat +0 -3
  76. data/ext/libdeflate/libdeflate/tools/pgo_build.sh +0 -23
  77. data/ext/libdeflate/libdeflate/tools/produce_gzip_benchmark_table.sh +0 -37
  78. data/ext/libdeflate/libdeflate/tools/run_tests.sh +0 -305
  79. data/ext/libdeflate/libdeflate/tools/windows_build.sh +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b7ee0a79b0d89444143345fedd33de7a96be9f54
4
- data.tar.gz: d0ffc8949202a68544765a960ba503b4acfe9618
2
+ SHA256:
3
+ metadata.gz: fe15171c2f781773ed4be5ae2abc819b4cf4ddf27f73263fc116595776d9a00b
4
+ data.tar.gz: 9e745bc4052502d3ab57ddcf5ca319f1096bfe183ab5b22819d0c9ab169cf765
5
5
  SHA512:
6
- metadata.gz: 93046b87d92e3659017591a506ab9fa637390d43937101a05e179d3423e96120572706d0047f826c280cb2b1caa14c08b42eb5d6e360fbe10b0af5bd5a935261
7
- data.tar.gz: cb160d1a4407a026fe37ba63ee50d77d491b63f98f669ede35031965c0395bf035befa4f3409e7792be30e96500491b3e255483c8ef6b41663cb5a202a0dc53b
6
+ metadata.gz: 84da467236b94d33e2a39253ae296214c3f25a50509364c4f8ba2151c931b29778f2bd7a78f82893f05158a12a23c3329305cd879d17e69e40e1f16ac640f6ed
7
+ data.tar.gz: 1ca1a8143416b805b3510a774d1f09edb50ad4d8c17d5248aa5070680175b5cc1942365c57251d8bb506c23cf454620698b3aac6cfe45340f399ee4fdc0f6cca
@@ -0,0 +1,34 @@
1
+ name: Test
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ branches: [master]
7
+ permissions:
8
+ contents: read
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ matrix:
13
+ ruby-version: ['3.0', '3.1', '3.2']
14
+ os: [macos-latest, ubuntu-latest]
15
+ runs-on: ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby-version }}
21
+ bundler-cache: true
22
+ - run: bundle exec rake
23
+ test-with-system-library:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v3
27
+ - uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: '3.2'
30
+ bundler-cache: true
31
+ - run: sudo apt-get -y install libdeflate-dev
32
+ - run: bundle exec rake
33
+ env:
34
+ LIBDEFLATE_USE_SYSTEM_LIBRARIES: 1
data/README.md CHANGED
@@ -1,10 +1,5 @@
1
1
  # libdeflate-ruby
2
2
 
3
- [![Gem](https://img.shields.io/gem/v/libdeflate.svg?style=flat-square)](https://rubygems.org/gems/libdeflate)
4
- [![Travis](https://img.shields.io/travis/kaorimatz/libdeflate-ruby.svg?style=flat-square)](https://travis-ci.org/kaorimatz/libdeflate-ruby)
5
- [![Coveralls](https://img.shields.io/coveralls/kaorimatz/libdeflate-ruby.svg?style=flat-square)](https://coveralls.io/github/kaorimatz/libdeflate-ruby)
6
- [![Gemnasium](https://img.shields.io/gemnasium/kaorimatz/libdeflate-ruby.svg?style=flat-square)](https://gemnasium.com/kaorimatz/libdeflate-ruby)
7
-
8
3
  Ruby bindings for [libdeflate](https://github.com/ebiggers/libdeflate).
9
4
 
10
5
  ## Installation
@@ -32,7 +27,7 @@ compressor = Libdeflate::Compressor.new
32
27
  compressed_string = compressor.compress('Hello, World!')
33
28
 
34
29
  decompressor = Libdeflate::Decompressor.new
35
- decompressed_string = decompressor.decompress(compressed_string)
30
+ decompressor.decompress(compressed_string)
36
31
  ```
37
32
 
38
33
  ## Development
@@ -2,13 +2,24 @@ require 'mkmf'
2
2
 
3
3
  dir_config('libdeflate')
4
4
 
5
- if enable_config('bundled-libdeflate', false) || !(find_header('libdeflate.h') && have_library('deflate'))
6
- $VPATH << '$(srcdir)/libdeflate/lib'
7
- $INCFLAGS << ' -I$(srcdir)/libdeflate -I$(srcdir)/libdeflate/common'
8
-
9
- $srcs = Dir.glob(File.join($srcdir, '*.c'))
10
- $srcs += Dir.glob(File.join($srcdir, 'libdeflate', 'lib', '*.c'))
11
- $srcs.sort!
5
+ unless arg_config('--use-system-libraries', !!ENV['LIBDEFLATE_USE_SYSTEM_LIBRARIES'])
6
+ require 'mini_portile2'
7
+ recipe = MiniPortileCMake.new('libdeflate', '1.18')
8
+ recipe.files << {
9
+ url: 'https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.18.tar.gz',
10
+ sha256: '225d982bcaf553221c76726358d2ea139bb34913180b20823c782cede060affd',
11
+ }
12
+ recipe.configure_options << %w[
13
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON
14
+ -DLIBDEFLATE_BUILD_GZIP=OFF
15
+ -DLIBDEFLATE_BUILD_SHARED_LIB=OFF
16
+ ]
17
+ recipe.cook
18
+ abort 'libdeflate.h not found' unless find_header('libdeflate.h', "#{recipe.path}/include")
19
+ abort 'libdeflate not found' unless find_library('deflate', 'libdeflate_alloc_compressor', "#{recipe.path}/lib")
20
+ else
21
+ abort 'libdeflate.h not found' unless find_header('libdeflate.h')
22
+ abort 'libdeflate not found' unless find_library('deflate', 'libdeflate_alloc_compressor')
12
23
  end
13
24
 
14
25
  create_makefile('libdeflate/libdeflate_ext')
@@ -135,7 +135,7 @@ rb_compressor_initialize(int argc, VALUE *argv, VALUE self)
135
135
  static inline struct libdeflate_compressor *
136
136
  check_compressor(VALUE self)
137
137
  {
138
- return rb_check_typeddata(self, &compressor_data_type);
138
+ return rb_check_typeddata(self, &compressor_data_type);
139
139
  }
140
140
 
141
141
  /*
@@ -198,7 +198,6 @@ rb_compressor_compress(int argc, VALUE *argv, VALUE self)
198
198
 
199
199
  if (out_nbytes > 0) {
200
200
  rb_str_set_len(outbuf, out_nbytes);
201
- OBJ_INFECT(outbuf, str);
202
201
  return outbuf;
203
202
  }
204
203
 
@@ -220,7 +219,6 @@ rb_compressor_compress(int argc, VALUE *argv, VALUE self)
220
219
  }
221
220
 
222
221
  rb_str_set_len(outbuf, out_nbytes);
223
- OBJ_INFECT(outbuf, str);
224
222
 
225
223
  return outbuf;
226
224
  }
@@ -267,22 +265,23 @@ rb_decompressor_initialize(VALUE self)
267
265
  static inline struct libdeflate_decompressor *
268
266
  check_decompressor(VALUE self)
269
267
  {
270
- return rb_check_typeddata(self, &decompressor_data_type);
268
+ return rb_check_typeddata(self, &decompressor_data_type);
271
269
  }
272
270
 
273
271
  static long
274
- next_power_of_two(long n) {
275
- n--;
276
- n |= n >> 1;
277
- n |= n >> 2;
278
- n |= n >> 4;
279
- n |= n >> 8;
280
- n |= n >> 16;
272
+ next_power_of_two(long n)
273
+ {
274
+ n--;
275
+ n |= n >> 1;
276
+ n |= n >> 2;
277
+ n |= n >> 4;
278
+ n |= n >> 8;
279
+ n |= n >> 16;
281
280
  #if LONG_MAX > UINT32_MAX
282
- n |= n >> 32;
281
+ n |= n >> 32;
283
282
  #endif
284
- n++;
285
- return n;
283
+ n++;
284
+ return n;
286
285
  }
287
286
 
288
287
  /*
@@ -293,8 +292,10 @@ next_power_of_two(long n) {
293
292
  * <i>format</i> are DEFLATE (default), ZLIB and GZIP. If <i>outbuf</i> is
294
293
  * given, the resulting uncompressed data will be written to it.
295
294
  *
296
- * decompressor.decompress("\x01\x03\x00\xFC\xFFfoo") #=> "foo"
297
- * decompressor.decompress("x\x9C\x01\x03\x00\xFC\xFFfoo\x02\x82\x01E", Libdeflate::ZLIB) #=> "foo"
295
+ * decompressor.decompress("\x01\x03\x00\xFC\xFFfoo")
296
+ * #=> "foo"
297
+ * decompressor.decompress("x\x9C\x01\x03\x00\xFC\xFFfoo\x02\x82\x01E", Libdeflate::ZLIB)
298
+ * #=> "foo"
298
299
  *
299
300
  * outbuf = 'bar'
300
301
  * decompressor.decompress("\x01\x03\x00\xFC\xFFfoo", nil, outbuf) #=> "foo"
@@ -356,7 +357,6 @@ rb_compressor_decompress(int argc, VALUE *argv, VALUE self)
356
357
  }
357
358
 
358
359
  rb_str_set_len(outbuf, actual_out_nbytes_ret);
359
- OBJ_INFECT(outbuf, str);
360
360
 
361
361
  return outbuf;
362
362
  }
@@ -1,3 +1,3 @@
1
1
  module Libdeflate
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
data/libdeflate.gemspec CHANGED
@@ -23,9 +23,10 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
  spec.extensions = ['ext/libdeflate/extconf.rb']
25
25
 
26
+ spec.add_runtime_dependency 'mini_portile2', '>= 2.2.0'
27
+
26
28
  spec.add_development_dependency 'benchmark-ips'
27
29
  spec.add_development_dependency 'bundler'
28
- spec.add_development_dependency 'coveralls'
29
30
  spec.add_development_dependency 'rake'
30
31
  spec.add_development_dependency 'rake-compiler'
31
32
  spec.add_development_dependency 'rspec'
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libdeflate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Matsumoto
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-29 00:00:00.000000000 Z
11
+ date: 2023-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: benchmark-ips
14
+ name: mini_portile2
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
19
+ version: 2.2.0
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 2.2.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: benchmark-ips
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: coveralls
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -116,12 +116,11 @@ extensions:
116
116
  - ext/libdeflate/extconf.rb
117
117
  extra_rdoc_files: []
118
118
  files:
119
+ - ".github/workflows/test.yml"
119
120
  - ".gitignore"
120
- - ".gitmodules"
121
121
  - ".rspec"
122
122
  - ".rubocop.yml"
123
123
  - ".rubocop_todo.yml"
124
- - ".travis.yml"
125
124
  - Gemfile
126
125
  - LICENSE.txt
127
126
  - README.md
@@ -129,75 +128,6 @@ files:
129
128
  - bin/console
130
129
  - bin/setup
131
130
  - ext/libdeflate/extconf.rb
132
- - ext/libdeflate/libdeflate/.gitignore
133
- - ext/libdeflate/libdeflate/COPYING
134
- - ext/libdeflate/libdeflate/Makefile
135
- - ext/libdeflate/libdeflate/Makefile.msc
136
- - ext/libdeflate/libdeflate/NEWS
137
- - ext/libdeflate/libdeflate/README.md
138
- - ext/libdeflate/libdeflate/common/common_defs.h
139
- - ext/libdeflate/libdeflate/common/compiler_gcc.h
140
- - ext/libdeflate/libdeflate/common/compiler_msc.h
141
- - ext/libdeflate/libdeflate/lib/adler32.c
142
- - ext/libdeflate/libdeflate/lib/adler32_impl.h
143
- - ext/libdeflate/libdeflate/lib/aligned_malloc.c
144
- - ext/libdeflate/libdeflate/lib/aligned_malloc.h
145
- - ext/libdeflate/libdeflate/lib/bt_matchfinder.h
146
- - ext/libdeflate/libdeflate/lib/crc32.c
147
- - ext/libdeflate/libdeflate/lib/crc32_impl.h
148
- - ext/libdeflate/libdeflate/lib/crc32_table.h
149
- - ext/libdeflate/libdeflate/lib/decompress_impl.h
150
- - ext/libdeflate/libdeflate/lib/deflate_compress.c
151
- - ext/libdeflate/libdeflate/lib/deflate_compress.h
152
- - ext/libdeflate/libdeflate/lib/deflate_constants.h
153
- - ext/libdeflate/libdeflate/lib/deflate_decompress.c
154
- - ext/libdeflate/libdeflate/lib/gzip_compress.c
155
- - ext/libdeflate/libdeflate/lib/gzip_constants.h
156
- - ext/libdeflate/libdeflate/lib/gzip_decompress.c
157
- - ext/libdeflate/libdeflate/lib/hc_matchfinder.h
158
- - ext/libdeflate/libdeflate/lib/lib_common.h
159
- - ext/libdeflate/libdeflate/lib/matchfinder_avx2.h
160
- - ext/libdeflate/libdeflate/lib/matchfinder_common.h
161
- - ext/libdeflate/libdeflate/lib/matchfinder_neon.h
162
- - ext/libdeflate/libdeflate/lib/matchfinder_sse2.h
163
- - ext/libdeflate/libdeflate/lib/unaligned.h
164
- - ext/libdeflate/libdeflate/lib/x86_cpu_features.c
165
- - ext/libdeflate/libdeflate/lib/x86_cpu_features.h
166
- - ext/libdeflate/libdeflate/lib/zlib_compress.c
167
- - ext/libdeflate/libdeflate/lib/zlib_constants.h
168
- - ext/libdeflate/libdeflate/lib/zlib_decompress.c
169
- - ext/libdeflate/libdeflate/libdeflate.h
170
- - ext/libdeflate/libdeflate/programs/benchmark.c
171
- - ext/libdeflate/libdeflate/programs/checksum.c
172
- - ext/libdeflate/libdeflate/programs/detect.sh
173
- - ext/libdeflate/libdeflate/programs/gzip.c
174
- - ext/libdeflate/libdeflate/programs/prog_util.c
175
- - ext/libdeflate/libdeflate/programs/prog_util.h
176
- - ext/libdeflate/libdeflate/programs/test_checksums.c
177
- - ext/libdeflate/libdeflate/programs/tgetopt.c
178
- - ext/libdeflate/libdeflate/tools/afl-fuzz/Makefile
179
- - ext/libdeflate/libdeflate/tools/afl-fuzz/deflate_compress/fuzz.c
180
- - ext/libdeflate/libdeflate/tools/afl-fuzz/deflate_compress/inputs/0
181
- - ext/libdeflate/libdeflate/tools/afl-fuzz/deflate_decompress/fuzz.c
182
- - ext/libdeflate/libdeflate/tools/afl-fuzz/deflate_decompress/inputs/0
183
- - ext/libdeflate/libdeflate/tools/afl-fuzz/gzip_decompress/fuzz.c
184
- - ext/libdeflate/libdeflate/tools/afl-fuzz/gzip_decompress/inputs/0
185
- - ext/libdeflate/libdeflate/tools/afl-fuzz/prepare_for_fuzz.sh
186
- - ext/libdeflate/libdeflate/tools/afl-fuzz/zlib_decompress/fuzz.c
187
- - ext/libdeflate/libdeflate/tools/afl-fuzz/zlib_decompress/inputs/0
188
- - ext/libdeflate/libdeflate/tools/android_build.sh
189
- - ext/libdeflate/libdeflate/tools/checksum_benchmarks.sh
190
- - ext/libdeflate/libdeflate/tools/exec_tests.sh
191
- - ext/libdeflate/libdeflate/tools/gen_crc32_multipliers.c
192
- - ext/libdeflate/libdeflate/tools/gen_crc32_table.c
193
- - ext/libdeflate/libdeflate/tools/gzip_tests.sh
194
- - ext/libdeflate/libdeflate/tools/make-windows-releases
195
- - ext/libdeflate/libdeflate/tools/mips_build.sh
196
- - ext/libdeflate/libdeflate/tools/msc_test.bat
197
- - ext/libdeflate/libdeflate/tools/pgo_build.sh
198
- - ext/libdeflate/libdeflate/tools/produce_gzip_benchmark_table.sh
199
- - ext/libdeflate/libdeflate/tools/run_tests.sh
200
- - ext/libdeflate/libdeflate/tools/windows_build.sh
201
131
  - ext/libdeflate/libdeflate_ext.c
202
132
  - ext/libdeflate/libdeflate_ext.h
203
133
  - lib/libdeflate.rb
@@ -207,7 +137,7 @@ homepage: https://github.com/kaorimatz/libdeflate-ruby
207
137
  licenses:
208
138
  - MIT
209
139
  metadata: {}
210
- post_install_message:
140
+ post_install_message:
211
141
  rdoc_options: []
212
142
  require_paths:
213
143
  - lib
@@ -222,9 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
152
  - !ruby/object:Gem::Version
223
153
  version: '0'
224
154
  requirements: []
225
- rubyforge_project:
226
- rubygems_version: 2.6.11
227
- signing_key:
155
+ rubygems_version: 3.4.10
156
+ signing_key:
228
157
  specification_version: 4
229
158
  summary: Ruby bindings for libdeflate
230
159
  test_files: []
data/.gitmodules DELETED
@@ -1,3 +0,0 @@
1
- [submodule "ext/libdeflate/libdeflate"]
2
- path = ext/libdeflate/libdeflate
3
- url = https://github.com/ebiggers/libdeflate
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.15.1
@@ -1,19 +0,0 @@
1
- *.a
2
- *.dll
3
- *.exe
4
- *.exp
5
- *.lib
6
- *.o
7
- *.obj
8
- *.so
9
- /.lib-cflags
10
- /.prog-cflags
11
- /programs/config.h
12
- /benchmark
13
- /checksum
14
- /gzip
15
- /gunzip
16
- /run_tests.log
17
- /test_checksums
18
- tags
19
- cscope*
@@ -1,21 +0,0 @@
1
- Copyright 2016 Eric Biggers
2
-
3
- Permission is hereby granted, free of charge, to any person
4
- obtaining a copy of this software and associated documentation files
5
- (the "Software"), to deal in the Software without restriction,
6
- including without limitation the rights to use, copy, modify, merge,
7
- publish, distribute, sublicense, and/or sell copies of the Software,
8
- and to permit persons to whom the Software is furnished to do so,
9
- subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,231 +0,0 @@
1
- #
2
- # Use 'make help' to list available targets.
3
- #
4
- # Define V=1 to enable "verbose" mode, showing all executed commands.
5
- #
6
- # Define DECOMPRESSION_ONLY to omit all compression code, building a
7
- # decompression-only library. If doing this, you must also build a specific
8
- # library target such as 'libdeflate.a', as the programs will no longer compile.
9
- #
10
- # Define DISABLE_GZIP to disable support for the gzip wrapper format.
11
- #
12
- # Define DISABLE_ZLIB to disable support for the zlib wrapper format.
13
- #
14
- ##############################################################################
15
-
16
- #### Common compiler flags.
17
- #### Flags given here are not intended to be overridden, but you can add more
18
- #### by defining CFLAGS in the environment or on the 'make' command line.
19
-
20
- cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \
21
- 1>&2 2>/dev/null; then echo $(1); fi)
22
-
23
- override CFLAGS := \
24
- $(CFLAGS) -O2 -fomit-frame-pointer -std=c99 -I. -Icommon \
25
- -Wall -Wundef \
26
- $(call cc-option,-Wpedantic) \
27
- $(call cc-option,-Wdeclaration-after-statement) \
28
- $(call cc-option,-Wmissing-prototypes) \
29
- $(call cc-option,-Wstrict-prototypes) \
30
- $(call cc-option,-Wvla)
31
-
32
- ##############################################################################
33
-
34
- STATIC_LIB_SUFFIX := .a
35
- SHARED_LIB_SUFFIX := .so
36
- SHARED_LIB_CFLAGS := -fPIC
37
- PROG_SUFFIX :=
38
- PROG_CFLAGS :=
39
- HARD_LINKS := 1
40
-
41
- # Compiling for Windows with MinGW?
42
- ifneq ($(findstring -mingw,$(shell $(CC) -dumpmachine 2>/dev/null)),)
43
- ifeq ($(AR),ar)
44
- ifneq ($(findstring -mingw,$(CC)),)
45
- AR := $(patsubst %-gcc,%-ar,$(CC))
46
- endif
47
- endif
48
- STATIC_LIB_SUFFIX := .lib
49
- SHARED_LIB_SUFFIX := .dll
50
- SHARED_LIB_CFLAGS :=
51
- PROG_SUFFIX := .exe
52
- PROG_CFLAGS := -static -municode
53
- HARD_LINKS :=
54
- override CFLAGS := $(CFLAGS) $(call cc-option,-Wno-pedantic-ms-format)
55
- endif
56
-
57
- ##############################################################################
58
-
59
- #### Quiet make is enabled by default. Define V=1 to disable.
60
-
61
- ifneq ($(findstring s,$(MAKEFLAGS)),s)
62
- ifneq ($(V),1)
63
- QUIET_CC = @echo ' CC ' $@;
64
- QUIET_CCLD = @echo ' CCLD ' $@;
65
- QUIET_AR = @echo ' AR ' $@;
66
- QUIET_LN = @echo ' LN ' $@;
67
- QUIET_CP = @echo ' CP ' $@;
68
- QUIET_GEN = @echo ' GEN ' $@;
69
- endif
70
- endif
71
-
72
- ##############################################################################
73
-
74
- COMMON_HEADERS := $(wildcard common/*.h)
75
- DEFAULT_TARGETS :=
76
-
77
- #### Library
78
-
79
- STATIC_LIB := libdeflate$(STATIC_LIB_SUFFIX)
80
- SHARED_LIB := libdeflate$(SHARED_LIB_SUFFIX)
81
-
82
- LIB_CFLAGS += $(CFLAGS) -fvisibility=hidden -D_ANSI_SOURCE
83
-
84
- LIB_HEADERS := $(wildcard lib/*.h)
85
-
86
- LIB_SRC := lib/aligned_malloc.c lib/deflate_decompress.c lib/x86_cpu_features.c
87
-
88
- DECOMPRESSION_ONLY :=
89
- ifndef DECOMPRESSION_ONLY
90
- LIB_SRC += lib/deflate_compress.c
91
- endif
92
-
93
- DISABLE_ZLIB :=
94
- ifndef DISABLE_ZLIB
95
- LIB_SRC += lib/adler32.c lib/zlib_decompress.c
96
- ifndef DECOMPRESSION_ONLY
97
- LIB_SRC += lib/zlib_compress.c
98
- endif
99
- endif
100
-
101
- DISABLE_GZIP :=
102
- ifndef DISABLE_GZIP
103
- LIB_SRC += lib/crc32.c lib/gzip_decompress.c
104
- ifndef DECOMPRESSION_ONLY
105
- LIB_SRC += lib/gzip_compress.c
106
- endif
107
- endif
108
-
109
- STATIC_LIB_OBJ := $(LIB_SRC:.c=.o)
110
- SHARED_LIB_OBJ := $(LIB_SRC:.c=.shlib.o)
111
-
112
- # Compile static library object files
113
- $(STATIC_LIB_OBJ): %.o: %.c $(LIB_HEADERS) $(COMMON_HEADERS) .lib-cflags
114
- $(QUIET_CC) $(CC) -o $@ -c $(LIB_CFLAGS) $<
115
-
116
- # Compile shared library object files
117
- $(SHARED_LIB_OBJ): %.shlib.o: %.c $(LIB_HEADERS) $(COMMON_HEADERS) .lib-cflags
118
- $(QUIET_CC) $(CC) -o $@ -c $(LIB_CFLAGS) $(SHARED_LIB_CFLAGS) -DLIBDEFLATE_DLL $<
119
-
120
- # Create static library
121
- $(STATIC_LIB):$(STATIC_LIB_OBJ)
122
- $(QUIET_AR) $(AR) cr $@ $+
123
-
124
- DEFAULT_TARGETS += $(STATIC_LIB)
125
-
126
- # Create shared library
127
- $(SHARED_LIB):$(SHARED_LIB_OBJ)
128
- $(QUIET_CCLD) $(CC) -o $@ $(LDFLAGS) $(LIB_CFLAGS) -shared $+
129
-
130
- DEFAULT_TARGETS += $(SHARED_LIB)
131
-
132
- # Rebuild if CC or LIB_CFLAGS changed
133
- .lib-cflags: FORCE
134
- @flags='$(CC):$(LIB_CFLAGS)'; \
135
- if [ "$$flags" != "`cat $@ 2>/dev/null`" ]; then \
136
- [ -e $@ ] && echo "Rebuilding library due to new compiler flags"; \
137
- echo "$$flags" > $@; \
138
- fi
139
-
140
- ##############################################################################
141
-
142
- #### Programs
143
-
144
- PROG_CFLAGS += $(CFLAGS) \
145
- -D_DEFAULT_SOURCE \
146
- -D_FILE_OFFSET_BITS=64 \
147
- -DHAVE_CONFIG_H
148
-
149
- PROG_COMMON_HEADERS := programs/prog_util.h programs/config.h
150
- PROG_COMMON_SRC := programs/prog_util.c programs/tgetopt.c
151
- NONTEST_PROGRAM_SRC := programs/gzip.c
152
- TEST_PROGRAM_SRC := programs/benchmark.c programs/test_checksums.c \
153
- programs/checksum.c
154
-
155
- NONTEST_PROGRAMS := $(NONTEST_PROGRAM_SRC:programs/%.c=%$(PROG_SUFFIX))
156
- DEFAULT_TARGETS += $(NONTEST_PROGRAMS)
157
- TEST_PROGRAMS := $(TEST_PROGRAM_SRC:programs/%.c=%$(PROG_SUFFIX))
158
-
159
- PROG_COMMON_OBJ := $(PROG_COMMON_SRC:%.c=%.o)
160
- NONTEST_PROGRAM_OBJ := $(NONTEST_PROGRAM_SRC:%.c=%.o)
161
- TEST_PROGRAM_OBJ := $(TEST_PROGRAM_SRC:%.c=%.o)
162
- PROG_OBJ := $(PROG_COMMON_OBJ) $(NONTEST_PROGRAM_OBJ) $(TEST_PROGRAM_OBJ)
163
-
164
- # Generate autodetected configuration header
165
- programs/config.h:programs/detect.sh .prog-cflags
166
- $(QUIET_GEN) CC="$(CC)" CFLAGS="$(PROG_CFLAGS)" $< > $@
167
-
168
- # Compile program object files
169
- $(PROG_OBJ): %.o: %.c $(PROG_COMMON_HEADERS) $(COMMON_HEADERS) .prog-cflags
170
- $(QUIET_CC) $(CC) -o $@ -c $(PROG_CFLAGS) $<
171
-
172
- # Link the programs.
173
- #
174
- # Note: the test programs are not compiled by default. One reason is that the
175
- # test programs must be linked with zlib for doing comparisons.
176
-
177
- $(NONTEST_PROGRAMS): %$(PROG_SUFFIX): programs/%.o $(PROG_COMMON_OBJ) $(STATIC_LIB)
178
- $(QUIET_CCLD) $(CC) -o $@ $(LDFLAGS) $(PROG_CFLAGS) $+
179
-
180
- $(TEST_PROGRAMS): %$(PROG_SUFFIX): programs/%.o $(PROG_COMMON_OBJ) $(STATIC_LIB)
181
- $(QUIET_CCLD) $(CC) -o $@ $(LDFLAGS) $(PROG_CFLAGS) $+ -lz
182
-
183
- ifdef HARD_LINKS
184
- # Hard link gunzip to gzip
185
- gunzip$(PROG_SUFFIX):gzip$(PROG_SUFFIX)
186
- $(QUIET_LN) ln -f $< $@
187
- else
188
- # No hard links; copy gzip to gunzip
189
- gunzip$(PROG_SUFFIX):gzip$(PROG_SUFFIX)
190
- $(QUIET_CP) cp -f $< $@
191
- endif
192
-
193
- DEFAULT_TARGETS += gunzip$(PROG_SUFFIX)
194
-
195
- # Rebuild if CC or PROG_CFLAGS changed
196
- .prog-cflags: FORCE
197
- @flags='$(CC):$(PROG_CFLAGS)'; \
198
- if [ "$$flags" != "`cat $@ 2>/dev/null`" ]; then \
199
- [ -e $@ ] && echo "Rebuilding programs due to new compiler flags"; \
200
- echo "$$flags" > $@; \
201
- fi
202
-
203
- ##############################################################################
204
-
205
- all:$(DEFAULT_TARGETS)
206
-
207
- test_programs:$(TEST_PROGRAMS)
208
-
209
- help:
210
- @echo "Available targets:"
211
- @echo "------------------"
212
- @for target in $(DEFAULT_TARGETS) $(TEST_PROGRAMS); do \
213
- echo -e "$$target"; \
214
- done
215
-
216
- clean:
217
- rm -f *.a *.dll *.exe *.exp *.so \
218
- lib/*.o lib/*.obj lib/*.dllobj \
219
- programs/*.o programs/*.obj \
220
- $(DEFAULT_TARGETS) $(TEST_PROGRAMS) programs/config.h \
221
- libdeflate.lib libdeflatestatic.lib \
222
- .lib-cflags .prog-cflags
223
-
224
- realclean: clean
225
- rm -f tags cscope* run_tests.log
226
-
227
- FORCE:
228
-
229
- .PHONY: all test_programs help clean realclean
230
-
231
- .DEFAULT_GOAL = all