aboutsummaryrefslogtreecommitdiffstats
path: root/sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sh/test-template.sh27
-rw-r--r--shell.nix52
2 files changed, 79 insertions, 0 deletions
diff --git a/sh/test-template.sh b/sh/test-template.sh
new file mode 100644
index 0000000..b20040e
--- /dev/null
+++ b/sh/test-template.sh
@@ -0,0 +1,27 @@
+GAME=my-awesome-game
+GODOT_VER=3.2
+template_directory=$PWD
+git branch
+tree -a "${template_directory}"
+rustup component add clippy rustfmt
+cargo install cargo-generate --features vendored-openssl
+if [ ! -f /tmp/godot.zip ]; then
+ wget "https://downloads.tuxfamily.org/godotengine/$GODOT_VER/Godot_v${GODOT_VER}-stable_linux_headless.64.zip" -O /tmp/godot.zip
+fi
+if [ ! -d /tmp/godot_bin ]; then
+ unzip /tmp/godot.zip -d /tmp/godot_bin
+fi
+export PATH=$PATH:/tmp/godot_bin/
+cd /tmp || exit 1
+rm -rf ${GAME}
+cargo generate --git "${template_directory}" --name "${GAME}" --branch "${TRAVIS_BRANCH}"
+cd "${GAME}" || exit 1
+cargo fmt --all -- --check
+cargo clippy --all --all-features -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented
+make build-x86_64-unknown-linux-gnu-debug
+tree -a lib/
+"Godot_v${GODOT_VER}-stable_linux_headless.64" --path godot/ &
+run_pid=$!
+echo ${run_pid}
+sleep 5
+kill -9 ${run_pid}
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..3bee8ce
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,52 @@
+with import <nixpkgs> {
+ config.android_sdk.accept_license = true;
+};
+
+stdenv.mkDerivation {
+ name = "code-with-your-friends2022";
+ nativeBuildInputs = [
+ cacert
+ emacs
+ godot
+ jdk
+ nix
+ openssl
+ pkgconfig
+ sccache
+ ];
+ buildInputs = [
+ alsaLib
+ clang
+ glibc_multi
+ libGL
+ libpulseaudio
+ xorg.libX11
+ xorg.libXcursor
+ xorg.libXi
+ xorg.libXinerama
+ xorg.libXrandr
+ xorg.libXrender
+ zlib
+ ];
+ shellHook = ''
+ export PATH=$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin:$PATH
+ '';
+
+ # Set Environment Variables
+ EDITOR = "emacs";
+ LD_LIBRARY_PATH = builtins.concatStringsSep ":" [
+ "${alsaLib}/lib/"
+ "${libGL}/lib/"
+ "${libpulseaudio}/lib/"
+ "${xorg.libX11}/lib/"
+ "${xorg.libXcursor}/lib/"
+ "${xorg.libXi}/lib/"
+ "${xorg.libXinerama}/lib/"
+ "${xorg.libXrandr}/lib/"
+ "${xorg.libXrender}/lib/"
+ "${zlib}/lib/"
+ ];
+ LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
+ RUST_BACKTRACE = 1;
+ RUSTC_WRAPPER = "${sccache}/bin/sccache";
+}