ocaml for nix

This commit is contained in:
Dan Vargas 2022-02-06 21:41:18 -07:00
parent e7c5b557f9
commit f94ba284df
8 changed files with 36 additions and 35 deletions

View file

@ -1,17 +0,0 @@
#!/bin/bash
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
curl -L "https://github.com/ocaml/ocaml/archive/4.12.0.tar.gz" -o ocaml.tar.gz
tar xzf ocaml.tar.gz --strip-components=1
rm ocaml.tar.gz
./configure --prefix="$PREFIX"
make -j$(nproc)
make install -j$(nproc)
cd ..
rm -rf build

View file

@ -1,5 +0,0 @@
#!/bin/bash
rename 's/$/\.ml/' "$@" # Add .ml extension
ocamlc -o out *.ml

View file

@ -1,3 +0,0 @@
#!/bin/bash
export PATH=$PWD/bin:$PATH

View file

@ -1,5 +0,0 @@
{
"language": "ocaml",
"version": "4.12.0",
"aliases": ["ocaml", "ml"]
}

View file

@ -1,4 +0,0 @@
#!/bin/bash
shift
./out "$@"

View file

@ -1 +0,0 @@
print_string "OK\n";