Skip to content

Commit

Permalink
Update building/usage instructions
Browse files Browse the repository at this point in the history
`README.md` § Getting Started
  • Loading branch information
ParadoxV5 committed Feb 23, 2024
1 parent a25aef2 commit 2c4aee5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 64 deletions.
58 changes: 46 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,51 @@
> so thank you early adopters for beïng prepared to encounter and report segfaults and core dumps 😅.

## Getting Started

1. As betaware, only Windows and [RubyInstaller2](https://rubyinstaller.org) __without Devkit__ is tested currently.
It also needs [MinGW](https://www.mingw-w64.org) in the `PATH`. Things will go unexpected with the MSYS2 Devkit.
* Support for Devkit and Linux are planned, but not for Windows going through WSL
(but Linux support means yes for Godot Engine and Ruby both contained in WSL).

2. I might publish this project to RubyGems in the future.
For now, download/clone this repo to a consistent place (i.e., not the Downloads folder) and run:
```sh
gem install mingw-make
gem install rake rake-compiler json
rake
rake clean # optional, delete leftovers
```
If you don’t have [symlink permissions][],
consider admin elevation for the `rake` line so the script symlinks Ruby DLLs rather than duplicating them.

3. Copy-paste or symlink `generated/godot_rb.gdextension` in your Godot Project
(Unlike nearly all GDExtensions, this one uses absolute paths so multiple projects can share the same install.)

4. Have fun with [_real_ singletons](https://ruby-doc.org/current/syntax/modules_and_classes_rdoc.html#label-Singleton+Classes)! 💎
(No ideas on exporting projects currently…)

<details>
<summary><h4>A couple of reminders for Godot.rb development</h4></summary>

* The [`Rakefile`](Rakefile) is for building, not setting up…

* `bundle install` fails on RubyInstaller no-Devkit because of the `Gemfile` app `steep`’s transitive dependency `ffi`.
Gem insists to use the platform-independent version of the `ffi` gem, which doesn’t know about
`bin/ruby_builtin_dlls/libffi-8.dll` and must compile `libffi` from scratch with `libffi` own `Makefile`.
I’m unable to work around this problem one way or another (`#help-wanted`).

* RubyInstaller Ruby utilizes the new Universal C Runtime, but Godot Engine still uses the old MS VC++ Runtime,
for they support (on a best-effort basis) the minority who refuse to upgrade their outdated Windows versions.
See [godotengine/godot-proposals#9111][] regarding the situations. Fortunately, while mixing runtimes is unsupported,
the only known issue is that Ruby cannot print to console (only `Godot#print` and etc. can).

</details>

[symlink permissions]: https://learn.microsoft.com/windows/security/threat-protection/security-policy-settings/create-symbolic-links
[godotengine/godot-proposals#9111]: https://github.com/godotengine/godot-proposals/discussions/9111


## Features

### ☑️️ Current
Expand All @@ -29,26 +74,15 @@
[TBA]


## Appendix Docs – [`docs/`](docs/)

* [`Building.md`](docs/dev/Building.md)
*


## License

### [`include/godot/`](include/godot/)

Copyright (c) 2014-present Godot Engine contributors. https://godotengine.org/license/

### Bundled 3rd-party libraries in [`build/`](build/)

#### `libruby`” – [Ruby](https://www.ruby-lang.org) (“CRuby”)
Distributing in compliance with [its custom terms](https://github.com/ruby/ruby/blob/HEAD/COPYING#L25-L30)

### The rest of this project

Copyright 2023 ParadoxV5
Copyright 2024 ParadoxV5

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
52 changes: 0 additions & 52 deletions docs/Building.md

This file was deleted.

5 changes: 5 additions & 0 deletions lib/godot_rb.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
raise NotImplementedError, <<~MSG
Godot.rb loads from Godot Engine, not Ruby.
Refer to `README.md` § Getting Started on how to add Ruby to your Godot project.
Also check out https://github.com/godotengine/godot/pull/72883 on what running Godot Engine from Ruby might look like.
MSG

0 comments on commit 2c4aee5

Please sign in to comment.