Compile TRX using Zig CC #2227
-
Hi! I would be really grateful if someone (I'm thinking of Absolutelynothinghere for example :) ) could share with us the exact procedure and dependencies that can be used to compile TRX using Zig CC on Linux. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
I started writing the detailed steps, but this may take me some time. I'll try finishing this week and when I do I'll reply here. :) |
Beta Was this translation helpful? Give feedback.
-
So here's how to build TRX (tr1) using Zig CC on Linux for GLIBC 2.7+, such that the compiled game works on as many distros as possible. The procedure outlined here uses a chroot jail as the build environment since Step 1 - Creating the chroot: This script creates a chroot jail from scratch. You may edit the first few lines of the script to suit your needs. Some files will be downloaded automatically, if you would like to download them yourself you can get a list of URLs by running this command: cat mkjail.sh | grep "http" | sed -e 's/.*"\(.*\)"$/\1/' Note that this script calls the Script outline:
If the script finished successfully you'll find a file named Step 2 - Building TRX: This script is executed inside the chroot jail to build TRX and its dependencies. To enter the chroot jail execute the aforementioned This script also downloads some files, but it does so while inside the chroot jail and that may require some configuration. For convenience you may use the command from Step 1 on this script and download all the needed files beforehand. Script outline:
The compiled game will be placed in |
Beta Was this translation helpful? Give feedback.
-
Hi absolutelynothinghere! You're a genius! I was able to successfully run your 1st bash script using Linux Mint 20.3 Mate (Inside a Qemu-KVM virtual machine :)) And no luck with sudo: I guess sudo has not been installed in the chroot... |
Beta Was this translation helpful? Give feedback.
-
@Toumlab When you are inside the chroot jail, you are acting as the root user so there is no sudo. To execute the second script while inside the chroot, simply run The path |
Beta Was this translation helpful? Give feedback.
-
Thanks again for your help! |
Beta Was this translation helpful? Give feedback.
@Toumlab When you are inside the chroot jail, you are acting as the root user so there is no sudo. To execute the second script while inside the chroot, simply run
sh /tmp/trx.sh
The path
/tmp/myroot/
on your machine is translated to/
inside the chroot jail, so/tmp/myroot/tmp
becomes just/tmp
... I hope this is clear, let me know if you encounter any problems.