fix(crystal)

better shim
This commit is contained in:
Jacob Heider 2023-10-23 12:51:52 -04:00
parent 7369033225
commit 6d90ced542
No known key found for this signature in database
GPG key ID: 51E3FD0EE62677B6
2 changed files with 13 additions and 4 deletions

View file

@ -32,7 +32,6 @@ dependencies:
runtime:
env:
CRYSTAL_PATH: ${{prefix}}/lib:$CRYSTAL_PATH
CRYSTAL_LIBRARY_PATH: $LD_LIBRARY_PATH
build:
dependencies:
@ -77,6 +76,5 @@ test:
- cp $FIXTURE test.cr
- crystal build -o test test.cr
- test "$(./test)" = "{{version}}"
# FIXME: this should work, but because it compiles with LLVM, it needs the
# @rpath set somehow.
# - test "$(crystal eval 'puts {{Crystal::VERSION}}')" = "{{version}}"
- test "$(crystal eval 'puts {{Crystal::VERSION}}')" = "{{version}}"
- test "$(cat $FIXTURE | crystal eval)" = "{{version}}"

View file

@ -5,5 +5,16 @@ shift
case "$cmd" in
build) crystal.bin "$cmd" --link-flags "${CRYSTAL_LINK_FLAGS:-}" "$@";;
eval)
TEMP=$(mktemp)
if test $# -gt 0; then
echo "$@" > "$TEMP"
else
# stdin.... hm
cat > "$TEMP"
fi
crystal.bin run --link-flags "${CRYSTAL_LINK_FLAGS:-}" "$TEMP"
rm "$TEMP"
;;
*) crystal.bin "$cmd" "$@";;
esac