From a2de8dea0c56da39737865dde1d3b935d6af5047 Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Fri, 9 Apr 2021 12:20:55 +0530 Subject: [PATCH] pkg(pony-0.39.0): Add pony-lang 0.39.0 (#194) * pkg(pony-0.39.0): Add pony-lang 0.39.0 * pkg(pony-0.39.0): Use `git submodule` to install llvm and get the source through cloning. * pkg(pony-0.39.0): Reset to 0.39.0 commit and cd into `ponyc` * pkg(pony-0.39.0): User proper installation instructions, like specified in the installation guide * pkg(pony-0.39.0): Setup compile script. * pkg(pony-0.39.0): Properly delete the build dir. * pkg(pony-0.39.0): Get rid of author key in metdata * pkg(pony-0.39.0): `CD` into `ponyc` right before cloning. * pkg(ponyc-0.39.0): Move `cd` to the correct palce. --- packages/ponylang/0.39.0/build.sh | 27 ++++++++++++++++++++++++++ packages/ponylang/0.39.0/compile | 4 ++++ packages/ponylang/0.39.0/environment | 4 ++++ packages/ponylang/0.39.0/metadata.json | 5 +++++ packages/ponylang/0.39.0/run | 6 ++++++ packages/ponylang/0.39.0/test.pony | 3 +++ 6 files changed, 49 insertions(+) create mode 100755 packages/ponylang/0.39.0/build.sh create mode 100644 packages/ponylang/0.39.0/compile create mode 100644 packages/ponylang/0.39.0/environment create mode 100644 packages/ponylang/0.39.0/metadata.json create mode 100644 packages/ponylang/0.39.0/run create mode 100644 packages/ponylang/0.39.0/test.pony diff --git a/packages/ponylang/0.39.0/build.sh b/packages/ponylang/0.39.0/build.sh new file mode 100755 index 0000000..ec93a10 --- /dev/null +++ b/packages/ponylang/0.39.0/build.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +PREFIX=$(realpath $(dirname $0)) + +# get sources - only get the latest copy of the relevant files +git clone -q https://github.com/ponylang/ponyc.git ponyc + +cd ponyc + +# release commit for 0.39.0 +git reset --hard 85d897b978c5082a1f3264a3a9ad479446d73984 + +# updates all submodules recursively along their tracking branches +# i.e. https://github.com/ponylang/ponyc/blob/main/.gitmodules +git submodule update --recursive --init + +# Build the vendored LLVM libraries that are included in the `lib/llvm/src`. +make libs build_flags="-j$(nproc)" +# Configure the CMake build directory. +make configure +# Will build pony and put it in `build/release`. +make build +# Install pony into `$PREFIX`. +make prefix="$PREFIX" install + +cd .. +rm -rf ponyc diff --git a/packages/ponylang/0.39.0/compile b/packages/ponylang/0.39.0/compile new file mode 100644 index 0000000..a412613 --- /dev/null +++ b/packages/ponylang/0.39.0/compile @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Compile pony file(s) +ponyc -b out \ No newline at end of file diff --git a/packages/ponylang/0.39.0/environment b/packages/ponylang/0.39.0/environment new file mode 100644 index 0000000..c6ab089 --- /dev/null +++ b/packages/ponylang/0.39.0/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/ponylang/0.39.0/metadata.json b/packages/ponylang/0.39.0/metadata.json new file mode 100644 index 0000000..5856c39 --- /dev/null +++ b/packages/ponylang/0.39.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "ponylang", + "version": "0.39.0", + "aliases": ["pony", "ponyc"] +} diff --git a/packages/ponylang/0.39.0/run b/packages/ponylang/0.39.0/run new file mode 100644 index 0000000..8ac647b --- /dev/null +++ b/packages/ponylang/0.39.0/run @@ -0,0 +1,6 @@ +#!/bin/bash + +# removes the first arg from $@, which is always the filename +shift +# runs the executable with whatever args are left in $@ +./out "$@" \ No newline at end of file diff --git a/packages/ponylang/0.39.0/test.pony b/packages/ponylang/0.39.0/test.pony new file mode 100644 index 0000000..556516a --- /dev/null +++ b/packages/ponylang/0.39.0/test.pony @@ -0,0 +1,3 @@ +actor Main + new create(env: Env) => + env.out.print("OK")