From 6aa9c258a5125dae66bdb0407ecfa05f4e7827c3 Mon Sep 17 00:00:00 2001 From: Oleg Montak Date: Fri, 8 Nov 2019 19:57:33 +0300 Subject: [PATCH] swift5: dockerfile --- .travis.yml | 2 ++ README.md | 14 +++++++++++++- swift5/Dockerfile | 44 ++++++++++++++++++++++++++++++++++++++++++++ swift5/run | 1 - 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 swift5/Dockerfile diff --git a/.travis.yml b/.travis.yml index b371bd52..81e8822b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,6 +97,8 @@ matrix: - {env: IMPL=swift3 NO_DOCKER=1, os: osx, osx_image: xcode8} - {env: IMPL=swift4, services: [docker]} - {env: IMPL=swift4 NO_DOCKER=1, os: osx, osx_image: xcode10} + - {env: IMPL=swift5, services: [docker]} + - {env: IMPL=swift5 NO_DOCKER=1, os: osx, osx_image: xcode11} - {env: IMPL=tcl, services: [docker]} - {env: IMPL=ts, services: [docker]} - {env: IMPL=vala, services: [docker]} diff --git a/README.md b/README.md index 6c7657ea..22dccf8c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ **1. Mal is a Clojure inspired Lisp interpreter** -**2. Mal is implemented in 79 languages (81 different implementations and 102 runtime modes)** +**2. Mal is implemented in 79 languages (82 different implementations and 102 runtime modes)** | Language | Creator | | -------- | ------- | @@ -82,6 +82,7 @@ | [Swift 2](#swift) | [Keith Rollin](https://github.com/keith-rollin) | | [Swift 3](#swift-3) | [Joel Martin](https://github.com/kanaka) | | [Swift 4](#swift-4) | [陆遥](https://github.com/LispLY) | +| [Swift 5](#swift-5) | [Oleg Montak](https://github.com/MontakOleg) | | [Tcl](#tcl-86) | [Dov Murik](https://github.com/dubek) | | [TypeScript](#typescript) | [Masahiro Wakame](https://github.com/vvakame) | | [Vala](#vala) | [Simon Tatham](https://github.com/sgtatham) | @@ -1018,6 +1019,17 @@ make ./stepX_YYY ``` +### Swift 5 + +The Swift 5 implementation of mal requires the Swift 5.0 compiler. It +has been tested with Swift 5.1.1 release. + +``` +cd swift5 +make +./stepX_YYY +``` + ### Tcl 8.6 The Tcl implementation of mal requires Tcl 8.6 to run. For readline line diff --git a/swift5/Dockerfile b/swift5/Dockerfile new file mode 100644 index 00000000..b2f2ef26 --- /dev/null +++ b/swift5/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:xenial +MAINTAINER Joel Martin + +########################################################## +# General requirements for testing or common across many +# implementations +########################################################## + +RUN apt-get -y update + +# Required for running tests +RUN apt-get -y install make python + +# Some typical implementation and test requirements +RUN apt-get -y install curl libreadline-dev libedit-dev + +RUN mkdir -p /mal +WORKDIR /mal + +########################################################## +# Specific implementation requirements +########################################################## + +# Swift +RUN apt-get -y install clang-3.6 cmake pkg-config \ + git ninja-build uuid-dev libicu-dev icu-devtools \ + libbsd-dev libedit-dev libxml2-dev libsqlite3-dev \ + swig libpython-dev libncurses5-dev + +# TODO: better way to do this? +RUN ln -sf /usr/lib/llvm-3.6/bin/clang++ /usr/bin/clang++ +RUN ln -sf /usr/lib/llvm-3.6/bin/clang /usr/bin/clang + +ENV SWIFT_PREFIX swift-5.1.1-RELEASE +ENV SWIFT_RELEASE ${SWIFT_PREFIX}-ubuntu16.04 + +RUN cd /opt && \ + curl -O https://swift.org/builds/swift-4.2.3-release/ubuntu1604/${SWIFT_PREFIX}/${SWIFT_RELEASE}.tar.gz && \ + tar xvzf ${SWIFT_RELEASE}.tar.gz && \ + rm ${SWIFT_RELEASE}.tar.gz + +ENV PATH /opt/${SWIFT_RELEASE}/usr/bin/:$PATH + + diff --git a/swift5/run b/swift5/run index e77aef2c..df55362c 100755 --- a/swift5/run +++ b/swift5/run @@ -1,4 +1,3 @@ #!/bin/bash swift run ${STEP:-stepA_mal} "${@}" -#exec $(dirname $0)/.build/debug/${STEP:-stepA_mal} "${@}"