forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 4
Added support AuroraOS in Godot 3.6 with Mono #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Thefolgore
wants to merge
5
commits into
savegame:3.6-auroraos
Choose a base branch
from
Thefolgore:3.6-auroraos
base: 3.6-auroraos
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,15 +59,15 @@ def copy_file(src_dir, dst_dir, src_name, dst_name=""): | |
|
|
||
|
|
||
| def is_desktop(platform): | ||
| return platform in ["windows", "osx", "x11", "server", "uwp", "haiku"] | ||
| return platform in ["windows", "osx", "x11", "server", "uwp", "haiku", "auroraos"] | ||
|
|
||
|
|
||
| def is_unix_like(platform): | ||
| return platform in ["osx", "x11", "server", "android", "haiku", "iphone"] | ||
| return platform in ["osx", "x11", "server", "android", "haiku", "iphone", "auroraos"] | ||
|
|
||
|
|
||
| def module_supports_tools_on(platform): | ||
| return platform not in ["android", "javascript", "iphone"] | ||
| return platform not in ["android", "javascript", "iphone", "auroraos"] | ||
|
|
||
|
|
||
| def find_wasm_src_dir(mono_root): | ||
|
|
@@ -83,6 +83,7 @@ def find_wasm_src_dir(mono_root): | |
|
|
||
| def configure(env, env_mono): | ||
| bits = env["bits"] | ||
| is_auroraos = env["platform"] == "auroraos" | ||
| is_android = env["platform"] == "android" | ||
| is_javascript = env["platform"] == "javascript" | ||
| is_ios = env["platform"] == "iphone" | ||
|
|
@@ -291,7 +292,7 @@ def copy_mono_lib(libname_wo_ext): | |
| copy_mono_lib("libmono-icall-table") | ||
| copy_mono_lib("libmono-ilgen") | ||
| else: | ||
| assert is_desktop(env["platform"]) or is_android or is_javascript | ||
| assert is_desktop(env["platform"]) or is_android or is_javascript or is_auroraos | ||
| env.Append(LINKFLAGS=["-Wl,-whole-archive", mono_lib_file, "-Wl,-no-whole-archive"]) | ||
|
|
||
| if is_javascript: | ||
|
|
@@ -568,7 +569,22 @@ def copy_if_exists(src, dst): | |
| "libMonoSupportW", | ||
| ] | ||
| ] | ||
|
|
||
| #Эти изменения необходимо проверить | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does it mean? |
||
| elif platform == "auroraos": | ||
| lib_file_names = [ | ||
| lib_name + ".so" | ||
| for lib_name in [ | ||
| "libmonosgen-2.0", | ||
| "libmono-btls-shared", | ||
| "libmono-ee-interp", | ||
| "libmono-native", | ||
| "libMonoPosixHelper", | ||
| "libmono-profiler-aot", | ||
| "libmono-profiler-coverage", | ||
| "libmono-profiler-log", | ||
| "libMonoSupportW", | ||
| ] | ||
| ] | ||
| for lib_file_name in lib_file_names: | ||
| copy_if_exists(os.path.join(src_mono_lib_dir, lib_file_name), target_mono_lib_dir) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,215 @@ | ||
| # Build the engine and export templates for AuroraOS with Mono support | ||
|
|
||
| First of all, download the source code of the engine to the Aurora working directory and assemble the engine and editor from the source code. This instruction used the Godot 3.6 version ported by sashikknox and slightly modified by me for use with mono. | ||
|
|
||
| ## Installing dependencies on the desktop | ||
|
|
||
| **[Official instructions and list of dependencies](https://docs .godotengine.org/ru/3.x/development/compiling/index.html).** | ||
|
|
||
| The official documentation also describes in more detail how to build the engine for the main Desktop platforms with Mono. Below is a short instruction for Linux | ||
|
|
||
| ## Downloading the engine sources and assembling them | ||
|
|
||
| My path for executing the `git clone` command is: `~/Aurora/src/` | ||
|
|
||
| ``` | ||
| git clone https://gitflic.ru/project/folgore/godot.git | ||
| cd godot | ||
| scons p=x11 tools=yes module_mono_enabled=yes mono_glue=no | ||
| bin/godot.x11.tools.64.mono --generate-mono-glue modules/mono/glue | ||
| scons p=x11 target=release_debug tools=yes module_mono_enabled=yes | ||
| strip bin/godot.x11.opt.tools.64.mono | ||
| ``` | ||
|
|
||
| **Be sure to make a backup copy of the virtual machine before further manipulations, if you doubt your actions and my instructions.** | ||
|
|
||
| ## Installing dependencies on the Aurora build engine | ||
|
|
||
| P.S. The build was made under AuroraOS-4.0.2.303, so the targets in the instructions are `AuroraOS-4.0.2.303-base-i486` and `AuroraOS-4.0.2.303-base-armv7hl`, use your names for other targets. | ||
|
|
||
| ### **i486** | ||
|
|
||
| Preparing the build engine for compiling godot export templates and working with mono on the emulator | ||
| We launch the terminal from the Aurora working directory. I have this `~/Aurora/` | ||
|
|
||
| ``` | ||
| sfdk engine exec sb2 -t AuroraOS-4.0.2.303-base-i486 -m sdk-install -R zypper --non-interactive install git autoconf libtool make gettext zlib gcc gdb gcc-c++ openssl-devel bzip2-devel xz-devel nano scons mesa-llvmpipe-libGLESv1-devel alsa-lib-devel pulseaudio-devel SDL2-devel SDL2_image-devel SDL2_net-devel SDL2_sound-devel SDL2_ttf-devel wayland-devel wayland-egl-devel wayland-protocols-devel openssl | ||
| ``` | ||
|
|
||
| ### Mono Build | ||
|
|
||
| Download the mono sources to the Aurora working directory from the official website or from github (I tested the latest version from the Mono website **[12/6/11999](https://download.mono-project.com/sources/mono/mono-6.12.0.199.tar.xz ))** | ||
| *For an example. My path to the source archive is: `~/Aurora/src/mono/`* | ||
| `` | ||
| tar -xvf ~/Aurora/src/mono/mono-12/6/11999.tar.xz -C ~/Aurora/src/mono/ | ||
| `` | ||
| Open the console from the mono source folder and go into the build engine and the emulator target | ||
|
|
||
| ``` | ||
| sfdk engine exec | ||
| sb2 -t AuroraOS-4.0.2.303-base-i486 -m sdk-install -R | ||
| ``` | ||
|
|
||
| Mono is built for the emulator and x86 devices using the following commands | ||
|
|
||
| ``` | ||
| ./configure --prefix=/home/mersdk/mono_x86 | ||
| make | ||
| make install | ||
| make clean | ||
| ``` | ||
| *Specify the prefix for installation in a specific folder. Since Mono is assembled in this manual for all SDK 4.02.303 targets, it is necessary that different files for different architectures get along with each other* | ||
|
|
||
| Creating a script for exporting global parameters: | ||
|
|
||
| ``` | ||
| nano ~/.mono_x86 | ||
| ``` | ||
|
|
||
| Script Content: | ||
|
|
||
| ``` | ||
| #!/bin/bash | ||
|
|
||
| #Path to prefix with mono for i486 | ||
| MONO_PREFIX=/home/mersdk/mono_x86 | ||
|
|
||
| export DYLD_FALLBACK_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_FALLBACK_PATH | ||
| export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH | ||
| export C_INCLUDE_PATH=$MONO_PREFIX/include | ||
| export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal | ||
| export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig | ||
| export PATH=$MONO_PREFIX/bin:$PATH | ||
| ``` | ||
|
|
||
| Exporting variables | ||
|
|
||
| ``` | ||
| source ~/.mono_x86 | ||
| ``` | ||
|
|
||
| We are synchronizing certificates so that nuget can be used in future projects, for example. | ||
|
|
||
| ``` | ||
| cert-sync /etc/ssl/certs/ca-bundle.crt | ||
| ``` | ||
|
|
||
| We write the exit command twice to exit the target console and the build engine. | ||
|
|
||
| ``` | ||
| exit | ||
| exit | ||
| ``` | ||
|
|
||
| Go to the Godot source folder to compile the export templates. | ||
|
|
||
| ``` | ||
| cd ~/Aurora/src/godot | ||
| ``` | ||
|
|
||
| *If it is necessary to encrypt .pck scripts, then it is necessary to act according to [instructions](https://docs .godotengine.org/ru/3.x/development/compiling/compiling_with_script_encryption_key.html ) posted on the Godot website* | ||
|
|
||
| In the Godot source folder, run the commands to build the release and debug template (the second one, if necessary) | ||
|
|
||
| ### Building a release export template | ||
|
|
||
| ``` | ||
| sfdk engine exec sb2 -t AuroraOS-4.0.2.303-base-i486 scons -j`nproc` arch=x86 platform=auroraos tools=no bits=32 target=release module_mono_enabled=yes mono_prefix="/home/mersdk/mono_x86/" mono_static=yes | ||
| ``` | ||
|
|
||
| ### Building the debug export template | ||
|
|
||
| ``` | ||
| sfdk engine exec sb2 -t AuroraOS-4.0.2.303-base-i486 scons -j`nproc` arch=x86 platform=auroraos tools=no bits=32 target=debug module_mono_enabled=yes mono_prefix="/home/mersdk/mono_x86/" mono_static=yes | ||
| ``` | ||
|
|
||
| `module_mono_enabled=yes` activates the ability to use mono and the C# language to write scripts. | ||
| We pay special attention to `mono_prefix`, since the path must match the previously specified path when compiling Mono. | ||
| `mono_static=yes` is required, otherwise libraries such as `libmonosgen-2.0.so ` it will be necessary to somehow upload the project to the device, bypassing the validator. | ||
|
|
||
| After compilation, the file `godot.auroraos.opt.x86.mono` and the folder `data.mono.auroraos` will appear in the `bin' folder located in the downloaded Godot sources.32.release` (if you specified `target=debug`, then the file and folder will have the corresponding entry in the name). | ||
| We specify this file in the export settings when exporting the project. If you move the templates, be sure to copy the corresponding folder (indicated above), it contains the necessary libraries, which will be included in the project when exporting. | ||
|
|
||
| ### Feature of Mono compilation under ARM | ||
| Installing the necessary dependencies for armv7hl | ||
|
|
||
| ``` | ||
| sfdk engine exec sb2 -t AuroraOS-4.0.2.303-base-armv7hl -m sdk-install -R zypper --non-interactive install git autoconf libtool make gettext zlib gcc gdb gcc-c++ openssl-devel bzip2-devel xz-devel nano scons mesa-llvmpipe-libGLESv1-devel alsa-lib-devel pulseaudio-devel SDL2-devel SDL2_image-devel SDL2_net-devel SDL2_sound-devel SDL2_ttf-devel wayland-devel wayland-egl-devel wayland-protocols-devel openssl | ||
| ``` | ||
| Go to the mono source folder | ||
|
|
||
| ``` | ||
| cd ~/Aurora/src/mono/mono-6.12.0.199 | ||
| ``` | ||
| Launching the assembly engine terminal from the catalog | ||
|
|
||
| ``` | ||
| sfdk engine exec | ||
| sb2 -t AuroraOS-4.0.2.303-base-armv7hl | ||
| `` | ||
| ### Mono Build | ||
| `` | ||
| ./configure --prefix=/home/mersdk/mono_arm --disable-mcs-build | ||
| make | ||
| make install | ||
| make clean | ||
| ``` | ||
| Here we have specified a different path for the prefix, different from the previous one for the emulator and x86, and we also make sure to write `--disable-mcs-build` | ||
|
|
||
| Creating a script for exporting global parameters | ||
|
|
||
| ``` | ||
| nano ~/.mono_arm | ||
| ``` | ||
|
|
||
| File contents: | ||
| `` | ||
| #!/bin/bash | ||
|
|
||
| #Path to prefix with mono for arm | ||
| MONO_PREFIX=/home/mersdk/mono_arm | ||
|
|
||
| export DYLD_FALLBACK_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_FALLBACK_PATH | ||
| export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH | ||
| export C_INCLUDE_PATH=$MONO_PREFIX/include | ||
| export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal | ||
| export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig | ||
| export PATH=$MONO_PREFIX/bin:$PATH | ||
| ``` | ||
|
|
||
| **Before compiling the sources for arm, I recommend turning off the assembly engine, and running it again and exporting global variables for this platform, so that the mono_x86 and mono_arm variables do not mix.** | ||
|
|
||
| ``` | ||
| sfdk engine exec | ||
| sb2 -t AuroraOS-4.0.2.303-base-armv7hl -m sdk-install -R | ||
| source /home/mersdk/.mono_arm | ||
| exit | ||
| exit | ||
| ``` | ||
|
|
||
| *`/home/mersdk/` - the VM's home directory* | ||
|
|
||
| ### Creating export templates | ||
|
|
||
| go to the Godot source folder | ||
|
|
||
| ``` | ||
| cd ~/Aurora/src/godot | ||
| ``` | ||
|
|
||
| ### Build a release 32bit export template | ||
|
|
||
| `` | ||
| sfdk engine exec sb2 -t AuroraOS-4.0.2.303-base-armv7hl scons -j'nproc` arch=arm platform=auroraos tools=no bits=32 target=release module_mono_enabled=yes mono_prefix="/home/mersdk/mono_arm/" mono_static=yes | ||
| `` | ||
| ### Export template build debug 32bit | ||
|
|
||
| ``` | ||
| sfdk engine exec sb2 -t AuroraOS-4.0.2.303-base-armv7hl scons -j`nproc` arch=arm platform=auroraos tools=no bits=32 target=release module_mono_enabled=yes mono_prefix="/home/mersdk/mono_arm/" mono_static=yes | ||
| ``` | ||
|
|
||
| *The export template for arm will take much longer to create…* | ||
|
|
||
| The other export templates are compiled in the same way. | ||
|
|
||
| Instructions for using export templates from Sashikknox to Godot can be found [here](https://boosty.to/sashikknox/posts/bad1c63b-c453-4933-a34c-ee7c22bd6e44 ?share=post_link) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like its no need here, you already add
is_auroraos