Skip to content

Commit

Permalink
ci: Add setup for php and ocaml in dev container (#2825)
Browse files Browse the repository at this point in the history
* ci: Add setup for php and ocaml

Signed-off-by: Xuanwo <[email protected]>

* pilish

Signed-off-by: Xuanwo <[email protected]>

* polish

Signed-off-by: GitHub <[email protected]>

---------

Signed-off-by: Xuanwo <[email protected]>
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
Xuanwo authored Aug 9, 2023
1 parent ee34c9e commit 90fc206
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions .devcontainer/post_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

set -e

# Make sure trustdb has been created.
sudo gpg --list-keys || true

# Update apt repo
sudo apt update

Expand All @@ -35,24 +38,30 @@ corepack prepare yarn@stable --activate
# Setup for java binding
sudo apt install -y default-jdk
echo "export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")" | sudo tee /etc/profile.d/java_home.sh
sudo ln -s /usr/lib/jvm/default-java /usr/lib/jvm/default
sudo ln -s /usr/lib/jvm/default-java /usr/lib/jvm/default || true

# Setup for C binding
sudo apt install -y libgtest-dev cmake
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp lib/*.a /usr/lib
sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a
sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a

# Setup for Zig binding
sudo apt install -y wget
wget -q https://github.com/marler8997/zigup/releases/download/v2022_08_25/zigup.ubuntu-latest-x86_64.zip
unzip zigup.ubuntu-latest-x86_64.zip -d /usr/bin
chmod +x /usr/bin/zigup
zigup master #TODO: replace to 0.11.0 (stable)
wget -q https://github.com/marler8997/zigup/releases/download/v2023_07_27/zigup.ubuntu-latest-x86_64.zip
sudo unzip -o zigup.ubuntu-latest-x86_64.zip -d /usr/bin
sudo chmod +x /usr/bin/zigup
sudo zigup 0.11.0

# Setup for Haskell binding
sudo apt install -y ghc cabal-install
cabal update
cabal update

# Setup for PHP binding
sudo apt install software-properties-common
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
sudo apt update -y
sudo apt install -y php8.2 php8.2-dev

# Setup for OCaml binding
sudo apt install -y opam
opam init --auto-setup --yes
opam install -y dune ounit2 ocamlformat

0 comments on commit 90fc206

Please sign in to comment.