Skip to content

Commit

Permalink
Add NO_PATCH option to flake.nix [noci]
Browse files Browse the repository at this point in the history
  • Loading branch information
toasterofbread committed Aug 3, 2024
1 parent 0d080e4 commit 1c7b48b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 3 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c7b48b

Please sign in to comment.