mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 19:28:49 -04:00
Add run_release script (#152)
* Add run_release script * Update README to use the run_release scripts
This commit is contained in:
parent
d2a6fc3c42
commit
8aaa9f585c
1
.zig-version
Normal file
1
.zig-version
Normal file
@ -0,0 +1 @@
|
|||||||
|
0.12.0-dev.983+78f2ae7f2
|
@ -31,8 +31,7 @@ Otherwise you can
|
|||||||
### Compile Cubyz from source
|
### Compile Cubyz from source
|
||||||
1. Install git
|
1. Install git
|
||||||
2. Clone this repository `git clone https://github.com/pixelguys/Cubyz`
|
2. Clone this repository `git clone https://github.com/pixelguys/Cubyz`
|
||||||
3. Run `run.sh` (Linux) or `run.bat` (Windows)
|
3. Run `run_release.sh` (Linux) or `run_release.bat` (Windows)
|
||||||
4. If the game is too slow, run it in release: `run.sh -Doptimize=ReleaseFast` (Linux) or `run.bar -Doptimize=ReleaseFast` (Windows)
|
|
||||||
#### Note for Linux Users:
|
#### Note for Linux Users:
|
||||||
I also had to install a few `-dev` packages for the compilation to work:
|
I also had to install a few `-dev` packages for the compilation to work:
|
||||||
```
|
```
|
||||||
|
3
run.bat
3
run.bat
@ -1,6 +1,7 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
set version=zig-windows-x86_64-0.12.0-dev.983+78f2ae7f2
|
set /p baseVersion=<".zig-version"
|
||||||
|
set version=zig-windows-x86_64-%baseVersion%
|
||||||
|
|
||||||
if not exist compiler mkdir compiler
|
if not exist compiler mkdir compiler
|
||||||
if not exist compiler\version.txt copy NUL compiler\version.txt >NUL
|
if not exist compiler\version.txt copy NUL compiler\version.txt >NUL
|
||||||
|
17
run.sh
17
run.sh
@ -1,21 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
version=zig-linux-x86_64-0.12.0-dev.983+78f2ae7f2
|
BASE_VERSION=$(< .zig-version)
|
||||||
|
VERSION=zig-linux-x86_64-$BASE_VERSION
|
||||||
|
|
||||||
mkdir -p compiler/zig
|
mkdir -p compiler/zig
|
||||||
touch compiler/version.txt
|
touch compiler/version.txt
|
||||||
if [[ $(< compiler/version.txt) != "$version" ]]; then
|
|
||||||
|
CURRENT_VERSION=$(< compiler/version.txt)
|
||||||
|
|
||||||
|
if [[ "$CURRENT_VERSION" != "$VERSION" ]]; then
|
||||||
echo "Deleting old zig installation..."
|
echo "Deleting old zig installation..."
|
||||||
rm -r compiler/zig
|
rm -r compiler/zig
|
||||||
mkdir compiler/zig
|
mkdir compiler/zig
|
||||||
echo "Downloading $version..."
|
echo "Downloading $VERSION..."
|
||||||
wget -O compiler/archive.tar.xz https://ziglang.org/builds/$version.tar.xz
|
wget -O compiler/archive.tar.xz https://ziglang.org/builds/"$VERSION".tar.xz
|
||||||
echo "Extracting tar file..."
|
echo "Extracting tar file..."
|
||||||
tar --xz -xf compiler/archive.tar.xz --directory compiler/zig --strip-components 1
|
tar --xz -xf compiler/archive.tar.xz --directory compiler/zig --strip-components 1
|
||||||
echo "Done."
|
echo "Done."
|
||||||
rm compiler/archive.tar.xz
|
rm compiler/archive.tar.xz
|
||||||
rm compiler/version.txt
|
echo "$VERSION" > compiler/version.txt
|
||||||
printf "$version" >> compiler/version.txt
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./compiler/zig/zig build run $@
|
./compiler/zig/zig build run "$@"
|
3
run_release.bat
Normal file
3
run_release.bat
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
.\run.bat -Doptimize=ReleaseFast %*
|
3
run_release.sh
Executable file
3
run_release.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
./run.sh -Doptimize=ReleaseFast "$@"
|
Loading…
x
Reference in New Issue
Block a user