konpeito 0.4.0 → 0.4.2
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 +4 -4
- data/CHANGELOG.md +30 -0
- data/Rakefile +33 -1
- data/THIRD_PARTY_NOTICES.md +56 -0
- data/lib/konpeito/cli/run_command.rb +1 -1
- data/lib/konpeito/codegen/llvm_generator.rb +13 -0
- data/lib/konpeito/codegen/mruby_backend.rb +138 -0
- data/lib/konpeito/compiler.rb +9 -0
- data/lib/konpeito/version.rb +1 -1
- data/vendor/yyjson/LICENSE +21 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18af8ec6ef271ba48955db2f05fc19b70529a318494bced5fe4e2a83febc3544
|
|
4
|
+
data.tar.gz: 076eb7d785e5bff312c1ec5b8c093c6fc1db034eabe397d5cc1d32d57438e332
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30fe2f9fc64bd7c4d4cff705e8a3e46bef719e947efb6d81418ba51e54ccaad89f5cc6e145fb28a5d84960c864abcc4a284cf2868e81da2b161102619cbaae08
|
|
7
|
+
data.tar.gz: 7653068f209f65ae14e1258b0cf17c5b9b3f956a2af006d3af87375eeebc7dcaf694f8384184c8b84e98fedb3485b32ce9374d6cd148ced09bda7e6dbcc228d8
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ All notable changes to Konpeito will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.2] - 2026-03-10
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Linux symbol collision**: use `internal` linkage for LLVM callback functions to prevent flat namespace collisions on Linux
|
|
12
|
+
- **NativeClass ptr→VALUE**: add missing `ptr2int` conversion for NativeClass objects passed to CRuby APIs
|
|
13
|
+
- **JSON codegen tests**: skip when vendored yyjson source is unavailable (CI environments)
|
|
14
|
+
- **CI stabilization**: run codegen tests per-file in separate processes to prevent `.so` accumulation crashes
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- **macOS ARM CI job**: unit tests and codegen tests on `macos-latest` (ARM)
|
|
18
|
+
- **mruby CI job**: build and run verification with `konpeito run --target mruby`
|
|
19
|
+
- **Japanese tutorial**: add mruby backend section (5.5) matching English tutorial
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Update `actions/checkout` v4 → v6, `actions/setup-java` v4 → v5
|
|
23
|
+
|
|
24
|
+
## [0.4.1] - 2026-03-09
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- `THIRD_PARTY_NOTICES.md` — vendored code and linked library license summary
|
|
28
|
+
- `vendor/yyjson/LICENSE` — MIT license file for vendored yyjson
|
|
29
|
+
- mruby backend: auto-generate `<output>.LICENSES.txt` alongside standalone executables
|
|
30
|
+
- Always includes Konpeito (MIT) and mruby (MIT)
|
|
31
|
+
- Conditionally includes yyjson (MIT) when JSON stdlib is used
|
|
32
|
+
- Conditionally includes raylib (zlib) when raylib stdlib is used
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
- `.gitignore`: allow `vendor/yyjson/LICENSE` to be tracked
|
|
36
|
+
|
|
8
37
|
## [0.4.0] - 2026-03-08
|
|
9
38
|
|
|
10
39
|
### Added
|
|
@@ -247,6 +276,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
247
276
|
- `%a{extern}` - external C struct wrappers
|
|
248
277
|
- `%a{simd}` - SIMD vectorization
|
|
249
278
|
|
|
279
|
+
[0.4.1]: https://github.com/i2y/konpeito/compare/v0.4.0...v0.4.1
|
|
250
280
|
[0.4.0]: https://github.com/i2y/konpeito/compare/v0.3.1...v0.4.0
|
|
251
281
|
[0.3.1]: https://github.com/i2y/konpeito/compare/v0.3.0...v0.3.1
|
|
252
282
|
[0.3.0]: https://github.com/i2y/konpeito/compare/v0.2.4...v0.3.0
|
data/Rakefile
CHANGED
|
@@ -5,7 +5,34 @@ require "rake/testtask"
|
|
|
5
5
|
Rake::TestTask.new(:test) do |t|
|
|
6
6
|
t.libs << "test"
|
|
7
7
|
t.libs << "lib"
|
|
8
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
|
8
|
+
t.test_files = FileList["test/**/*_test.rb"].exclude("test/codegen/**/*_test.rb")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
desc "Run codegen tests (each file in a separate process to avoid .so accumulation crashes)"
|
|
12
|
+
task "test:codegen" do
|
|
13
|
+
test_files = FileList["test/codegen/**/*_test.rb"].sort
|
|
14
|
+
failed = []
|
|
15
|
+
test_files.each do |f|
|
|
16
|
+
print "#{File.basename(f, '.rb')} "
|
|
17
|
+
unless system("bundle", "exec", "ruby", "-Ilib:test", f)
|
|
18
|
+
failed << f
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
puts
|
|
22
|
+
unless failed.empty?
|
|
23
|
+
abort "#{failed.size}/#{test_files.size} codegen test files failed:\n #{failed.join("\n ")}"
|
|
24
|
+
end
|
|
25
|
+
puts "All #{test_files.size} codegen test files passed."
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
desc "Run all tests (non-codegen + codegen in separate processes)"
|
|
29
|
+
task "test:all" => [:test] do
|
|
30
|
+
# Run codegen tests in a separate process so a crash doesn't kill non-codegen results
|
|
31
|
+
sh "bundle exec rake test:codegen" do |ok, _status|
|
|
32
|
+
unless ok
|
|
33
|
+
warn "Codegen tests failed (possibly due to native extension crash on ruby-head)"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
9
36
|
end
|
|
10
37
|
|
|
11
38
|
desc "Run conformance tests against Ruby/Native/JVM backends"
|
|
@@ -23,4 +50,9 @@ task "conformance:jvm" do
|
|
|
23
50
|
ruby "spec/conformance/runner.rb", "--jvm-only"
|
|
24
51
|
end
|
|
25
52
|
|
|
53
|
+
desc "Run CI compilation diagnostics"
|
|
54
|
+
task "test:diagnose" do
|
|
55
|
+
ruby "test/ci_diagnostic.rb"
|
|
56
|
+
end
|
|
57
|
+
|
|
26
58
|
task default: :test
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
Konpeito includes and/or links against the following third-party software.
|
|
4
|
+
|
|
5
|
+
## Vendored Code
|
|
6
|
+
|
|
7
|
+
### yyjson
|
|
8
|
+
|
|
9
|
+
- **License**: MIT
|
|
10
|
+
- **Copyright**: Copyright (c) 2020 YaoYuan <ibireme@gmail.com>
|
|
11
|
+
- **Source**: https://github.com/ibireme/yyjson
|
|
12
|
+
- **Location**: `vendor/yyjson/`
|
|
13
|
+
- **Usage**: JSON parsing and generation in the `KonpeitoJSON` stdlib
|
|
14
|
+
|
|
15
|
+
## Linked Libraries (mruby backend)
|
|
16
|
+
|
|
17
|
+
The mruby backend (`konpeito build --target mruby`) statically links `libmruby.a` into the generated executable. The following libraries may also be linked depending on the stdlibs used.
|
|
18
|
+
|
|
19
|
+
### mruby
|
|
20
|
+
|
|
21
|
+
- **License**: MIT
|
|
22
|
+
- **Copyright**: Copyright (c) mruby developers
|
|
23
|
+
- **Source**: https://github.com/mruby/mruby
|
|
24
|
+
- **Usage**: Runtime for standalone executables
|
|
25
|
+
|
|
26
|
+
### raylib (optional)
|
|
27
|
+
|
|
28
|
+
- **License**: zlib/libpng
|
|
29
|
+
- **Copyright**: Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
|
|
30
|
+
- **Source**: https://github.com/raysan5/raylib
|
|
31
|
+
- **Usage**: Graphics/input stdlib (`module Raylib`)
|
|
32
|
+
- **Linked when**: Code references `module Raylib`
|
|
33
|
+
|
|
34
|
+
### libcurl (optional)
|
|
35
|
+
|
|
36
|
+
- **License**: MIT/X-inspired (curl license)
|
|
37
|
+
- **Copyright**: Copyright (c) Daniel Stenberg
|
|
38
|
+
- **Source**: https://curl.se/
|
|
39
|
+
- **Usage**: HTTP client stdlib (`KonpeitoHTTP`)
|
|
40
|
+
- **Linked when**: Code uses `KonpeitoHTTP` module
|
|
41
|
+
|
|
42
|
+
### OpenSSL (optional)
|
|
43
|
+
|
|
44
|
+
- **License**: Apache-2.0
|
|
45
|
+
- **Copyright**: Copyright (c) The OpenSSL Project
|
|
46
|
+
- **Source**: https://www.openssl.org/
|
|
47
|
+
- **Usage**: Cryptography stdlib (`KonpeitoCrypto`)
|
|
48
|
+
- **Linked when**: Code uses `KonpeitoCrypto` module
|
|
49
|
+
|
|
50
|
+
### zlib (optional)
|
|
51
|
+
|
|
52
|
+
- **License**: zlib
|
|
53
|
+
- **Copyright**: Copyright (c) 1995-2024 Jean-loup Gailly and Mark Adler
|
|
54
|
+
- **Source**: https://zlib.net/
|
|
55
|
+
- **Usage**: Compression stdlib (`KonpeitoCompression`)
|
|
56
|
+
- **Linked when**: Code uses `KonpeitoCompression` module
|
|
@@ -277,7 +277,7 @@ module Konpeito
|
|
|
277
277
|
|
|
278
278
|
# Include extra C files in cache key (they affect the binary)
|
|
279
279
|
source_dir = File.dirname(File.expand_path(source_file))
|
|
280
|
-
extra_c_files = Dir.glob(File.join(source_dir, "*.c"))
|
|
280
|
+
extra_c_files = Dir.glob(File.join(source_dir, "*.c"))
|
|
281
281
|
|
|
282
282
|
options_hash = {
|
|
283
283
|
"inline_rbs" => options[:inline_rbs].to_s,
|
|
@@ -2985,6 +2985,9 @@ module Konpeito
|
|
|
2985
2985
|
# Convert bool to Ruby true/false
|
|
2986
2986
|
is_true = @builder.icmp(:ne, value, LLVM::Int8.from_i(0))
|
|
2987
2987
|
@builder.select(is_true, qtrue, qfalse)
|
|
2988
|
+
when [:native_class, :value]
|
|
2989
|
+
# NativeClass struct pointer to VALUE (i64)
|
|
2990
|
+
@builder.ptr2int(value, LLVM::Int64)
|
|
2988
2991
|
when [:i64, :double]
|
|
2989
2992
|
@builder.si2fp(value, LLVM::Double)
|
|
2990
2993
|
when [:double, :i64]
|
|
@@ -4826,6 +4829,7 @@ module Konpeito
|
|
|
4826
4829
|
callback_func = @mod.functions.add(callback_name,
|
|
4827
4830
|
[value_type, value_type, LLVM::Int32, LLVM::Pointer(value_type), value_type],
|
|
4828
4831
|
value_type)
|
|
4832
|
+
callback_func.linkage = :internal
|
|
4829
4833
|
|
|
4830
4834
|
# Save current builder state
|
|
4831
4835
|
saved_block = @builder.insert_block
|
|
@@ -5221,6 +5225,7 @@ module Konpeito
|
|
|
5221
5225
|
# --- Shared lambda_true helper (created once per module) ---
|
|
5222
5226
|
@lambda_true_func ||= begin
|
|
5223
5227
|
f = @mod.functions.add("__konpeito_lambda_true", [value_type], value_type)
|
|
5228
|
+
f.linkage = :internal
|
|
5224
5229
|
bb = f.basic_blocks.append("entry")
|
|
5225
5230
|
@builder.position_at_end(bb)
|
|
5226
5231
|
@builder.ret(qtrue)
|
|
@@ -5231,6 +5236,7 @@ module Konpeito
|
|
|
5231
5236
|
arity_func_name = "__konpeito_proc_arity_#{param_count}"
|
|
5232
5237
|
arity_func = @mod.functions[arity_func_name] || begin
|
|
5233
5238
|
f = @mod.functions.add(arity_func_name, [value_type], value_type)
|
|
5239
|
+
f.linkage = :internal
|
|
5234
5240
|
bb = f.basic_blocks.append("entry")
|
|
5235
5241
|
@builder.position_at_end(bb)
|
|
5236
5242
|
arity_ruby = @builder.call(@rb_int2inum, LLVM::Int64.from_i(param_count), "arity_val")
|
|
@@ -5560,6 +5566,7 @@ module Konpeito
|
|
|
5560
5566
|
callback_func = @mod.functions.add(callback_name,
|
|
5561
5567
|
[LLVM::Pointer(LLVM::Int8)],
|
|
5562
5568
|
value_type)
|
|
5569
|
+
callback_func.linkage = :internal
|
|
5563
5570
|
|
|
5564
5571
|
# Save current builder state
|
|
5565
5572
|
saved_block = @builder.insert_block
|
|
@@ -5893,6 +5900,7 @@ module Konpeito
|
|
|
5893
5900
|
# VALUE callback(VALUE data) - data is pointer to captures array
|
|
5894
5901
|
callback_type = LLVM::Type.function([value_type], value_type)
|
|
5895
5902
|
callback_func = @mod.functions.add(callback_name, [value_type], value_type)
|
|
5903
|
+
callback_func.linkage = :internal
|
|
5896
5904
|
|
|
5897
5905
|
# Save current builder state
|
|
5898
5906
|
saved_block = @builder.insert_block
|
|
@@ -5988,6 +5996,7 @@ module Konpeito
|
|
|
5988
5996
|
|
|
5989
5997
|
# VALUE callback(VALUE mutex) - mutex is passed as data2
|
|
5990
5998
|
callback_func = @mod.functions.add(callback_name, [value_type], value_type)
|
|
5999
|
+
callback_func.linkage = :internal
|
|
5991
6000
|
|
|
5992
6001
|
# Save current builder state
|
|
5993
6002
|
saved_block = @builder.insert_block
|
|
@@ -8108,6 +8117,7 @@ module Konpeito
|
|
|
8108
8117
|
|
|
8109
8118
|
# VALUE func(VALUE data) — data (params[0]) = self or escape array
|
|
8110
8119
|
callback_func = @mod.functions.add(callback_name, [value_type], value_type)
|
|
8120
|
+
callback_func.linkage = :internal
|
|
8111
8121
|
|
|
8112
8122
|
# Save current builder state
|
|
8113
8123
|
saved_block = @builder.insert_block
|
|
@@ -8227,6 +8237,7 @@ module Konpeito
|
|
|
8227
8237
|
|
|
8228
8238
|
# VALUE func(VALUE data2, VALUE exception)
|
|
8229
8239
|
callback_func = @mod.functions.add(callback_name, [value_type, value_type], value_type)
|
|
8240
|
+
callback_func.linkage = :internal
|
|
8230
8241
|
|
|
8231
8242
|
# Save current builder state
|
|
8232
8243
|
saved_block = @builder.insert_block
|
|
@@ -8387,6 +8398,7 @@ module Konpeito
|
|
|
8387
8398
|
callback_name = "rescue_handler_gflag_#{counter}"
|
|
8388
8399
|
# VALUE func(VALUE data2, VALUE exception) — data2 (params[0]) = self or escape array
|
|
8389
8400
|
callback_func = @mod.functions.add(callback_name, [value_type, value_type], value_type)
|
|
8401
|
+
callback_func.linkage = :internal
|
|
8390
8402
|
|
|
8391
8403
|
saved_block = @builder.insert_block
|
|
8392
8404
|
saved_vars = @variables.dup
|
|
@@ -8524,6 +8536,7 @@ module Konpeito
|
|
|
8524
8536
|
def generate_rescue_handler_with_flag_callback(rescue_clauses, counter)
|
|
8525
8537
|
callback_name = "rescue_handler_flag_#{counter}"
|
|
8526
8538
|
callback_func = @mod.functions.add(callback_name, [value_type, value_type], value_type)
|
|
8539
|
+
callback_func.linkage = :internal
|
|
8527
8540
|
|
|
8528
8541
|
saved_block = @builder.insert_block
|
|
8529
8542
|
saved_vars = @variables.dup
|
|
@@ -62,6 +62,9 @@ module Konpeito
|
|
|
62
62
|
|
|
63
63
|
# Link into standalone executable
|
|
64
64
|
link_to_executable(obj_files, output_file)
|
|
65
|
+
|
|
66
|
+
# Generate license file alongside the executable
|
|
67
|
+
generate_license_file
|
|
65
68
|
ensure
|
|
66
69
|
# Clean up intermediate files
|
|
67
70
|
all_temps = [ir_file, obj_file, init_c_file, init_obj_file, helpers_obj_file] + extra_obj_files
|
|
@@ -808,6 +811,141 @@ module Konpeito
|
|
|
808
811
|
name.gsub(/[^a-zA-Z0-9_]/, "_")
|
|
809
812
|
end
|
|
810
813
|
|
|
814
|
+
# === License file generation ===
|
|
815
|
+
|
|
816
|
+
def generate_license_file
|
|
817
|
+
license_path = "#{output_file}.LICENSES.txt"
|
|
818
|
+
sections = []
|
|
819
|
+
|
|
820
|
+
# Always include Konpeito itself
|
|
821
|
+
sections << license_section(
|
|
822
|
+
"Konpeito",
|
|
823
|
+
"MIT",
|
|
824
|
+
"Copyright (c) Konpeito contributors",
|
|
825
|
+
"https://github.com/i2y/konpeito",
|
|
826
|
+
<<~MIT
|
|
827
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
828
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
829
|
+
in the Software without restriction, including without limitation the rights
|
|
830
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
831
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
832
|
+
furnished to do so, subject to the following conditions:
|
|
833
|
+
|
|
834
|
+
The above copyright notice and this permission notice shall be included in all
|
|
835
|
+
copies or substantial portions of the Software.
|
|
836
|
+
|
|
837
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
838
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
839
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
840
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
841
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
842
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
843
|
+
SOFTWARE.
|
|
844
|
+
MIT
|
|
845
|
+
)
|
|
846
|
+
|
|
847
|
+
# Always include mruby (statically linked)
|
|
848
|
+
sections << license_section(
|
|
849
|
+
"mruby",
|
|
850
|
+
"MIT",
|
|
851
|
+
"Copyright (c) mruby developers",
|
|
852
|
+
"https://github.com/mruby/mruby",
|
|
853
|
+
<<~MIT
|
|
854
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
855
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
856
|
+
in the Software without restriction, including without limitation the rights
|
|
857
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
858
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
859
|
+
furnished to do so, subject to the following conditions:
|
|
860
|
+
|
|
861
|
+
The above copyright notice and this permission notice shall be included in all
|
|
862
|
+
copies or substantial portions of the Software.
|
|
863
|
+
|
|
864
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
865
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
866
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
867
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
868
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
869
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
870
|
+
SOFTWARE.
|
|
871
|
+
MIT
|
|
872
|
+
)
|
|
873
|
+
|
|
874
|
+
# Include yyjson if JSON stdlib is used
|
|
875
|
+
json_used = @extra_c_files.any? { |f| File.basename(f).include?("json") }
|
|
876
|
+
if json_used
|
|
877
|
+
sections << license_section(
|
|
878
|
+
"yyjson",
|
|
879
|
+
"MIT",
|
|
880
|
+
"Copyright (c) 2020 YaoYuan <ibireme@gmail.com>",
|
|
881
|
+
"https://github.com/ibireme/yyjson",
|
|
882
|
+
<<~MIT
|
|
883
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
884
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
885
|
+
in the Software without restriction, including without limitation the rights
|
|
886
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
887
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
888
|
+
furnished to do so, subject to the following conditions:
|
|
889
|
+
|
|
890
|
+
The above copyright notice and this permission notice shall be included in all
|
|
891
|
+
copies or substantial portions of the Software.
|
|
892
|
+
|
|
893
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
894
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
895
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
896
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
897
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
898
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
899
|
+
SOFTWARE.
|
|
900
|
+
MIT
|
|
901
|
+
)
|
|
902
|
+
end
|
|
903
|
+
|
|
904
|
+
# Include raylib if linked
|
|
905
|
+
ffi_libs = @rbs_loader&.all_ffi_libraries || []
|
|
906
|
+
if ffi_libs.any? { |lib| lib.to_s.include?("raylib") }
|
|
907
|
+
sections << license_section(
|
|
908
|
+
"raylib",
|
|
909
|
+
"zlib/libpng",
|
|
910
|
+
"Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)",
|
|
911
|
+
"https://github.com/raysan5/raylib",
|
|
912
|
+
<<~ZLIB
|
|
913
|
+
This software is provided 'as-is', without any express or implied warranty.
|
|
914
|
+
In no event will the authors be held liable for any damages arising from the
|
|
915
|
+
use of this software.
|
|
916
|
+
|
|
917
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
918
|
+
including commercial applications, and to alter it and redistribute it freely,
|
|
919
|
+
subject to the following restrictions:
|
|
920
|
+
|
|
921
|
+
1. The origin of this software must not be misrepresented; you must not claim
|
|
922
|
+
that you wrote the original software. If you use this software in a product,
|
|
923
|
+
an acknowledgment in the product documentation would be appreciated but is
|
|
924
|
+
not required.
|
|
925
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
926
|
+
misrepresented as being the original software.
|
|
927
|
+
3. This notice may not be removed or altered from any source distribution.
|
|
928
|
+
ZLIB
|
|
929
|
+
)
|
|
930
|
+
end
|
|
931
|
+
|
|
932
|
+
File.write(license_path, sections.join("\n"))
|
|
933
|
+
end
|
|
934
|
+
|
|
935
|
+
def license_section(name, license_type, copyright, url, license_text)
|
|
936
|
+
<<~SECTION
|
|
937
|
+
================================================================================
|
|
938
|
+
#{name}
|
|
939
|
+
License: #{license_type}
|
|
940
|
+
#{copyright}
|
|
941
|
+
#{url}
|
|
942
|
+
================================================================================
|
|
943
|
+
|
|
944
|
+
#{license_text.strip}
|
|
945
|
+
|
|
946
|
+
SECTION
|
|
947
|
+
end
|
|
948
|
+
|
|
811
949
|
# === Compilation pipeline ===
|
|
812
950
|
|
|
813
951
|
def compile_ir_to_object(ir_file, obj_file)
|
data/lib/konpeito/compiler.rb
CHANGED
|
@@ -45,6 +45,7 @@ module Konpeito
|
|
|
45
45
|
@cross_mruby_dir = cross_mruby_dir
|
|
46
46
|
@cross_libs_dir = cross_libs_dir
|
|
47
47
|
@output_file = output_file || default_output_file(target: target)
|
|
48
|
+
normalize_output_extension! if @output_file && target == :native
|
|
48
49
|
@compile_stats = nil
|
|
49
50
|
@_resolved_file_count = 0
|
|
50
51
|
@_specialization_count = 0
|
|
@@ -533,6 +534,14 @@ module Konpeito
|
|
|
533
534
|
end
|
|
534
535
|
end
|
|
535
536
|
|
|
537
|
+
def normalize_output_extension!
|
|
538
|
+
ext = File.extname(@output_file)
|
|
539
|
+
expected = Platform.shared_lib_extension
|
|
540
|
+
if (ext == ".bundle" || ext == ".so") && ext != expected
|
|
541
|
+
@output_file = @output_file.sub(/#{Regexp.escape(ext)}\z/, expected)
|
|
542
|
+
end
|
|
543
|
+
end
|
|
544
|
+
|
|
536
545
|
def log(message)
|
|
537
546
|
puts message if verbose
|
|
538
547
|
end
|
data/lib/konpeito/version.rb
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 YaoYuan <ibireme@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: konpeito
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yasushi Itoh
|
|
@@ -56,6 +56,7 @@ files:
|
|
|
56
56
|
- LICENSE
|
|
57
57
|
- README.md
|
|
58
58
|
- Rakefile
|
|
59
|
+
- THIRD_PARTY_NOTICES.md
|
|
59
60
|
- bin/konpeito
|
|
60
61
|
- konpeito.gemspec
|
|
61
62
|
- lib/konpeito.rb
|
|
@@ -216,6 +217,7 @@ files:
|
|
|
216
217
|
- tools/konpeito-asm/src/konpeito/runtime/KThread.java
|
|
217
218
|
- tools/konpeito-asm/src/konpeito/runtime/KTime.java
|
|
218
219
|
- tools/konpeito-asm/src/konpeito/runtime/RubyDispatch.java
|
|
220
|
+
- vendor/yyjson/LICENSE
|
|
219
221
|
homepage: https://github.com/i2y/konpeito
|
|
220
222
|
licenses:
|
|
221
223
|
- MIT
|