From de856185e389ef3412c092ef9181cbd7c9795e7a Mon Sep 17 00:00:00 2001 From: toasterofbread Date: Sat, 3 Aug 2024 09:45:30 +0100 Subject: [PATCH] Add NO_PATCH option to flake.nix [noci] --- README.md | 4 ++++ flake.nix | 4 +++- gradle.properties | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2190cf5..a9d871c 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,7 @@ Short for spmp-server This library isn't intended to be used outside of [SpMp](https://github.com/toasterofbread/spmp), but if you want to, go ahead. Available on Maven Central: https://central.sonatype.com/artifact/dev.toastbits/spms + +## Options + +To skip patching outputted binaries when building in the Nix environment, set the environment variable `NO_PATCH` to 1. diff --git a/flake.nix b/flake.nix index 5941b97..3e9ea6d 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,9 @@ export PATH="$KONAN_DATA_DIR/bin:$PATH" PATCH_KOTLIN_BINARY_SCRIPT="patchelf --set-interpreter \$(cat \$NIX_CC/nix-support/dynamic-linker) --set-rpath ${custom_pkgs.kotlin-native-toolchain-env}/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/sysroot/lib64 \$1" - echo "$PATCH_KOTLIN_BINARY_SCRIPT" > $KONAN_DATA_DIR/bin/${kotlin_binary_patch_command} + echo '[ "''${NO_PATCH:-0}" -eq 1 ] && exit 1' > $KONAN_DATA_DIR/bin/${kotlin_binary_patch_command} + echo "$PATCH_KOTLIN_BINARY_SCRIPT" >> $KONAN_DATA_DIR/bin/${kotlin_binary_patch_command} + chmod +x $KONAN_DATA_DIR/bin/${kotlin_binary_patch_command} chmod -R u+w $KONAN_DATA_DIR diff --git a/gradle.properties b/gradle.properties index d33166c..31b082f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -project.version=0.4.0-beta1 +project.version=0.4.0-beta2 kotlin.incremental.native=true org.gradle.jvmargs=-Xmx4g -Xms1g