From 9e5ac13cf344e4075ee2636988259beeb3268992 Mon Sep 17 00:00:00 2001 From: Nugraha Date: Sat, 3 Feb 2024 04:07:23 +0700 Subject: [PATCH] feat: support ocaml 2.1.5 --- rce/packages/ocaml/config.toml | 20 ++++++++++++++++++++ rce/packages/ocaml/install.sh | 27 +++++++++++++++++++++++++++ rce/packages/ocaml/test.ml | 1 + 3 files changed, 48 insertions(+) create mode 100644 rce/packages/ocaml/config.toml create mode 100644 rce/packages/ocaml/install.sh create mode 100644 rce/packages/ocaml/test.ml diff --git a/rce/packages/ocaml/config.toml b/rce/packages/ocaml/config.toml new file mode 100644 index 0000000..ba55a91 --- /dev/null +++ b/rce/packages/ocaml/config.toml @@ -0,0 +1,20 @@ +language = "OCaml" +version = "2.1.5" +compiled = true +extension = "ml" +# opam env --switch=default +environment = [ + "PATH=/opt/ocaml/2.1.5/default/bin", + "MANPATH=/opt/ocaml/2.1.5/default/man", + "OCAML_TOPLEVEL_PATH=/opt/ocaml/2.1.5/default/lib/toplevel", + "CAML_LD_LIBRARY_PATH=/opt/ocaml/2.1.5/default/lib/stublibs:/opt/ocaml/2.1.5/default/lib/ocaml/stublibs:/opt/ocaml/2.1.5/default/lib/ocaml", + "OPAM_SWITCH_PREFIX=/opt/ocaml/2.1.5/default", +] +build_command = [ "ocamlc", "-o", "code", "{file}" ] +run_command = [ "./code" ] +test_file = "test.ml" +aliases = [ "ocaml", "oc", "ml" ] +should_limit_memory = false +memory_limit = 0 +process_limit = 4096 +allowed_entrypoints = -1 diff --git a/rce/packages/ocaml/install.sh b/rce/packages/ocaml/install.sh new file mode 100644 index 0000000..b39df2a --- /dev/null +++ b/rce/packages/ocaml/install.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e + +VERSION="2.1.5" +export OPAMROOT=/opt/ocaml/${VERSION} + +mkdir -p /opt/ocaml/${VERSION} +cd /opt/ocaml/${VERSION} +echo "PWD: $PWD" + +echo "Bootstrapping opam" + +curl -L -o install-core.sh https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh +bash ./install-core.sh --version ${VERSION} <