rustorb 0.7.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 943324c3f8e836077537f78132e8664aee230b119262777dcafa82a3fa918e3b
4
+ data.tar.gz: d3f09881c141ef37a47a8f6b8e3e7a1c18e370b2a8b9936a3f8cc0708ebf55c2
5
+ SHA512:
6
+ metadata.gz: 43a8b731bd52ab3b07001818da2a65816536242eca899d82f43603e1a760e45b802182fff50b3b08960f342dfb028b9c231720cb5d69982626a8fbffd6b620ad
7
+ data.tar.gz: d5dd2e77acc312ec2224bc385f1618963564bb0a344434b5765e42cf2a6406ea5833a393a82a8b02ead99168687fa72ba51f528a8ccd969afe1015d159958614
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # Rustorb for Ruby
2
+
3
+ The OMG Ruby Language Mapping (RCLM 1.2, formal/2013-04-05) on rustorb: the
4
+ `rustorb` gem, with `CORBA`, `PortableServer` and `CosNaming` in Ruby over
5
+ the C ABI of `librustorb_ffi` (`crates/rustorb-ffi`), through the
6
+ `rustorb_ext` extension. Stubs and skeletons come from `rustorb-idl -bruby`
7
+ (`FooC.rb` and `FooS.rb`).
8
+
9
+ ```sh
10
+ pip install -r ../tools/rustorb-idl.txt
11
+ rake # cargo build of librustorb_ffi, the extension, the tests
12
+ rake compile # only the extension, into lib/rustorb
13
+ ```
14
+
15
+ ```ruby
16
+ require "corba"
17
+ require "HelloS"
18
+
19
+ class HelloImpl < POA::Example::Hello
20
+ def say(message) = message
21
+ end
22
+
23
+ orb = CORBA.ORB_init(ARGV)
24
+ poa = orb.resolve_initial_references("RootPOA")
25
+ poa.the_POAManager.activate
26
+ puts orb.object_to_string(HelloImpl.new._this)
27
+ orb.run
28
+ ```
29
+
30
+ | Path | Contents |
31
+ | --- | --- |
32
+ | `ext/rustorb_ext/` | the extension: the ABI handles, the CDR streams, the GVL and the threads that serve requests |
33
+ | `lib/rustorb/` | the mapping: exceptions, TypeCode, marshalling, Any, Object and stubs, ORB, PortableServer, DynAny, the DII and DSI, valuetypes, AMI, Portable Interceptors |
34
+ | `lib/CosNamingC.rb`, `lib/CosNamingS.rb` | CosNaming, generated (`rake cos_naming`) |
35
+ | `test/` | the runtime, the mapping test on `cpp/tests/idl/CxxMapping.idl` and the interop cases against an in-process servant |
36
+
37
+ Ruby 3.0 or later on Linux and macOS. The extension links
38
+ `librustorb_ffi.a` statically (`RUSTORB_FFI_LIBRARY`, default the
39
+ checkout's `target/release/librustorb_ffi.a`). See
40
+ [docs/ruby-binding.md](../docs/ruby-binding.md) (Japanese).
41
+
42
+ Licensed under MIT OR Apache-2.0, like the rest of the rustorb core.
@@ -0,0 +1,33 @@
1
+ # Builds rustorb_ext against librustorb_ffi (crates/rustorb-ffi), linked
2
+ # statically. RUSTORB_FFI_LIBRARY names the library, RUSTORB_FFI_INCLUDE
3
+ # the directory of rustorb/rustorb.h. By default: the ones the released gem
4
+ # carries for this platform (vendor/<platform>/librustorb_ffi.a and
5
+ # vendor/include), else those of the checkout this gem is in
6
+ # (target/release/librustorb_ffi.a after cargo build --release -p
7
+ # rustorb-ffi).
8
+ require "mkmf"
9
+
10
+ gem_root = File.expand_path("../..", __dir__)
11
+ root = File.expand_path("..", gem_root)
12
+ cpu = RbConfig::CONFIG["host_cpu"].sub(/\Aarm64\z/, "aarch64")
13
+ os = RbConfig::CONFIG["host_os"] =~ /darwin/ ? "macos" : "linux"
14
+ vendor = File.join(gem_root, "vendor")
15
+ vendored = File.join(vendor, "#{os}-#{cpu}", "librustorb_ffi.a")
16
+ lib = ENV["RUSTORB_FFI_LIBRARY"] ||
17
+ (File.exist?(vendored) ? vendored : File.join(root, "target", "release", "librustorb_ffi.a"))
18
+ inc = ENV["RUSTORB_FFI_INCLUDE"] ||
19
+ (File.exist?(File.join(vendor, "include", "rustorb", "rustorb.h")) ? File.join(vendor, "include") :
20
+ File.join(root, "crates", "rustorb-ffi", "include"))
21
+ unless File.exist?(lib)
22
+ abort "librustorb_ffi not found for #{os}-#{cpu}: #{lib} (set RUSTORB_FFI_LIBRARY, or cargo build --release -p rustorb-ffi)"
23
+ end
24
+
25
+ $INCFLAGS << " -I#{inc}"
26
+ $CFLAGS << " -std=c99 -Wall -Wextra -Wno-unused-parameter -D_POSIX_C_SOURCE=200809L"
27
+ $LOCAL_LIBS << " #{lib}"
28
+ if RUBY_PLATFORM =~ /darwin/
29
+ $LDFLAGS << " -framework CoreFoundation -framework Security"
30
+ else
31
+ $LIBS << " -lpthread -ldl -lm"
32
+ end
33
+ create_makefile("rustorb/rustorb_ext")