Skip to content

Commit

Permalink
TG 1.2.0 + Make patching less dumb (#6)
Browse files Browse the repository at this point in the history
* New patching logic - Based on tags

* Readme tweak

* 1.2.0

* 515 Compat
  • Loading branch information
AffectedArc07 committed Oct 30, 2022
1 parent 5c23ad0 commit 4b928e8
Show file tree
Hide file tree
Showing 9 changed files with 212 additions and 112 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
paradise-rust-g
paradise-rust-g
tg-rust-g
6 changes: 3 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This repository holds ParadiseSS13 modifications of [rust-g](https://github.com/tgstation/rust-g) libraries from /tg/station.

This works by keeping an up-to-date copy of /tg/station's code, and a folder of Paradise patches to be applied. This reduces our need for major reworks to code, as we can just use patches to achieve what we need without cluttering the main tree.
This works by keeping a folder of Paradise patches to be applied, and applies it to a specific version tag of tg's rust-g. This reduces our need for major reworks to code, as we can just use patches to achieve what we need without cluttering the main tree.

## License

The license for RUST-G itself can be found inside the `tg-rust-g` directory. Code for the Paradise modifications falls under the same license.
The license for RUST-G itself can be found on tg's repo. Code for the Paradise modifications falls under the same license.

## How to (Compiling)

Expand All @@ -16,7 +16,7 @@ The license for RUST-G itself can be found inside the `tg-rust-g` directory. Cod
- To build on windows, run `cargo build --release --all-features --target=i686-pc-windows-msvc`. This will generate a 32-bit `.dll` file that is compatible with BYOND.
- To build on linux, run `cargo build --release --all-features --target=i686-unknown-linux-gnu`. This will generate a 32-bit `.so` file that is compatible with BYOND.

If you are still stuck, check `tg-rust-g/README.md` for more detailed instructions.
If you are still stuck, check tg's README. for more detailed instructions.

## How to (Developing)

Expand Down
15 changes: 13 additions & 2 deletions apply_patches.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
#!/bin/sh

PS1="$"
basedir=`pwd`
echo "Rebuilding projects.... "
tg_tag="1.2.0"

echo "Checking for TG rust-g repo.."
if [ ! -d "./tg-rust-g" ]
then
echo "TG rust-g does not exist locally. Cloning..."
git clone https://github.com/tgstation/rust-g.git tg-rust-g
fi

echo "Setting up project... "

cd "$basedir/tg-rust-g"
git reset --hard $tg_tag

apply_patch() {
what=$1
Expand Down
34 changes: 19 additions & 15 deletions paradise-rust-g-patches/0001-Paradise-Version-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
From ab1d942ac45e1b14ffaa13c79e2a44e5c2d2f54c Mon Sep 17 00:00:00 2001
From 124eccba73fa986f9d9ceffa7a8a69bd97eae218 Mon Sep 17 00:00:00 2001
From: AffectedArc07 <[email protected]>
Date: Wed, 13 Oct 2021 22:04:30 +0100
Subject: [PATCH] Paradise Version Changes


diff --git a/Cargo.lock b/Cargo.lock
index cd4001f..85313cc 100644
index ab158a2..f77d99f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1544,7 +1544,7 @@ dependencies = [
@@ -1999,7 +1999,7 @@ dependencies = [

[[package]]
name = "rust-g"
-version = "0.6.0"
+version = "0.6.0-P"
-version = "1.2.0"
+version = "1.2.0-P"
dependencies = [
"aho-corasick",
"base64 0.13.0",
"base64",
diff --git a/Cargo.toml b/Cargo.toml
index 1cbe8f5..68a7029 100644
index 121c252..b2166a7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,11 +1,11 @@
@@ -1,15 +1,15 @@
[package]
name = "rust-g"
edition = "2018"
-version = "0.6.0"
+version = "0.6.0-P"
authors = ["Bjorn Neergaard <[email protected]>"]
edition = "2021"
-version = "1.2.0"
+version = "1.2.0-P"
authors = [
"Bjorn Neergaard <[email protected]>",
"Tad Hardesty <[email protected]>",
"rust-g maintainer team",
]
-repository = "https://github.com/tgstation/rust-g"
+repository = "https://github.com/ParadiseSS13/rust-g"
license-file = "LICENSE"
license = "MIT"
-description = "Offloaded task library for the /tg/ Space Station 13 codebase"
+description = "Offloaded task library for the ParadiseSS13 Space Station 13 codebase"
+description = "Offloaded task library for the ParadiseSS13 Space Station 13 codebase - Adapted from tgstation/rust-g"

[lib]
crate-type = ["cdylib"]
--
2.33.0.windows.2
2.35.2.windows.1

13 changes: 7 additions & 6 deletions paradise-rust-g-patches/0002-Paradise-Logging-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
From 4a5eab77486dd2bccac8eb7e345cb9490db124e8 Mon Sep 17 00:00:00 2001
From a7d7ad5361239e00852692abc39c8404383290e4 Mon Sep 17 00:00:00 2001
From: AffectedArc07 <[email protected]>
Date: Wed, 13 Oct 2021 22:04:37 +0100
Subject: [PATCH] Paradise Logging Changes


diff --git a/dmsrc/log.dm b/dmsrc/log.dm
index d0380a5..f3be525 100644
index 1faadc8..bbc8fe6 100644
--- a/dmsrc/log.dm
+++ b/dmsrc/log.dm
@@ -1,2 +1,2 @@
-#define rustg_log_write(fname, text, format) call(RUST_G, "log_write")(fname, text, format)
+#define rustg_log_write(fname, text) call(RUST_G, "log_write")(fname, text)
/proc/rustg_log_close_all() return call(RUST_G, "log_close_all")()
-#define rustg_log_write(fname, text, format) RUSTG_CALL(RUST_G, "log_write")(fname, text, format)
-/proc/rustg_log_close_all() return RUSTG_CALL(RUST_G, "log_close_all")()
+#define rustg_log_write(fname, text) RUSTG_CALL(RUST_G, "log_write")(fname, text)
+/proc/rustg_log_close_all() return RUSTG_CALL(RUST_G, "log_close_all")()
diff --git a/src/log.rs b/src/log.rs
index 9bd019b..6722353 100644
--- a/src/log.rs
Expand Down Expand Up @@ -51,5 +52,5 @@ index 9bd019b..6722353 100644

Ok(())
--
2.33.0.windows.2
2.35.2.windows.1

Loading

0 comments on commit 4b928e8

Please sign in to comment.