commit
ae265ec922
@ -1,94 +0,0 @@ |
||||
{ lib, stdenv, fetchFromGitHub, fetchurl, python2, makeWrapper, pkg-config, gcc, |
||||
pypy, libffi, libedit, libuv, boost, zlib, |
||||
variant ? "jit", buildWithPypy ? false }: |
||||
|
||||
let |
||||
commit-count = "1364"; |
||||
common-flags = "--thread --gcrootfinder=shadowstack --continuation"; |
||||
variants = { |
||||
jit = { flags = "--opt=jit"; target = "target.py"; }; |
||||
jit-preload = { flags = "--opt=jit"; target = "target_preload.py"; }; |
||||
no-jit = { flags = ""; target = "target.py"; }; |
||||
no-jit-preload = { flags = ""; target = "target_preload.py"; }; |
||||
}; |
||||
pixie-src = fetchFromGitHub { |
||||
owner = "pixie-lang"; |
||||
repo = "pixie"; |
||||
rev = "5eb0ccbe8b0087d3a5f2d0bbbc6998d624d3cd62"; |
||||
sha256 = "sha256-dQ8ncH0IqU42WYxwBgjH6QQfvMIo7RZpv81UAUsPw10="; |
||||
}; |
||||
pypy-tag = "91db1a9"; |
||||
pypy-src = fetchurl { |
||||
name = "pypy-src-${pypy-tag}"; |
||||
url = "https://bitbucket.org/pypy/pypy/get/${pypy-tag}.tar.bz2"; |
||||
sha256 = "0ylbqvhbcp5m09l15i2q2h3a0vjd055x2r37cq71lkhgmmaxrwbq"; |
||||
}; |
||||
libs = [ libffi libedit libuv boost.dev boost.out zlib ]; |
||||
include-path = lib.concatStringsSep ":" |
||||
(map (p: "${p}/include") libs); |
||||
library-path = lib.concatStringsSep ":" |
||||
(map (p: "${p}/lib") libs); |
||||
bin-path = lib.concatStringsSep ":" |
||||
(map (p: "${p}/bin") [ gcc ]); |
||||
build = {flags, target}: stdenv.mkDerivation rec { |
||||
pname = "pixie"; |
||||
version = "0-r${commit-count}-${variant}"; |
||||
nativeBuildInputs = [ makeWrapper pkg-config ]; |
||||
buildInputs = libs; |
||||
PYTHON = if buildWithPypy |
||||
then "${pypy}/pypy-c/pypy-c" |
||||
else python2.interpreter; |
||||
unpackPhase = '' |
||||
cp -R ${pixie-src} pixie-src |
||||
mkdir pypy-src |
||||
(cd pypy-src |
||||
tar --strip-components=1 -xjf ${pypy-src}) |
||||
chmod -R +w pypy-src pixie-src |
||||
''; |
||||
patchPhase = '' |
||||
(cd pixie-src |
||||
patch -p1 < ${./load_paths.patch} |
||||
libraryPaths='["${libuv}" "${libedit}" "${libffi.dev}" "${boost.dev}" "${boost.out}" "${zlib.dev}"]' |
||||
export libraryPaths |
||||
substituteAllInPlace ./pixie/ffi-infer.pxi) |
||||
''; |
||||
buildPhase = ''( |
||||
PYTHONPATH="`pwd`/pypy-src:$PYTHONPATH"; |
||||
RPYTHON="`pwd`/pypy-src/rpython/bin/rpython"; |
||||
cd pixie-src |
||||
$PYTHON $RPYTHON ${common-flags} ${target} |
||||
find pixie -name "*.pxi" -exec ./pixie-vm -c {} \; |
||||
)''; |
||||
LD_LIBRARY_PATH = library-path; |
||||
C_INCLUDE_PATH = include-path; |
||||
LIBRARY_PATH = library-path; |
||||
PATH = bin-path; |
||||
installPhase = '' |
||||
mkdir -p $out/share $out/bin |
||||
cp pixie-src/pixie-vm $out/share/pixie-vm |
||||
cp -R pixie-src/pixie $out/share/pixie |
||||
makeWrapper $out/share/pixie-vm $out/bin/pixie \ |
||||
--prefix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH} \ |
||||
--prefix C_INCLUDE_PATH : ${C_INCLUDE_PATH} \ |
||||
--prefix LIBRARY_PATH : ${LIBRARY_PATH} \ |
||||
--prefix PATH : ${PATH} |
||||
''; |
||||
doCheck = true; |
||||
checkPhase = '' |
||||
RES=$(./pixie-src/pixie-vm -e "(print :ok)") |
||||
if [ "$RES" != ":ok" ]; then |
||||
echo "ERROR Unexpected output: '$RES'" |
||||
return 1 |
||||
else |
||||
echo "$RES" |
||||
fi |
||||
''; |
||||
meta = { |
||||
description = "A clojure-like lisp, built with the pypy vm toolkit"; |
||||
homepage = "https://github.com/pixie-lang/pixie"; |
||||
license = lib.licenses.lgpl3; |
||||
platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"]; |
||||
maintainers = with lib.maintainers; [ bendlas ]; |
||||
}; |
||||
}; |
||||
in build (builtins.getAttr variant variants) |
@ -1,46 +0,0 @@ |
||||
{ lib, stdenv, fetchFromGitHub |
||||
, pixie, rlwrap |
||||
}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "dust"; |
||||
version = "0-91"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "pixie-lang"; |
||||
repo = "dust"; |
||||
rev = "efe469661e749a71e86858fd006f61464810575a"; |
||||
sha256 = "09n57b6haxwask9m8vimv42ikczf7lgfc7m9izjrcqgs0padvfzc"; |
||||
}; |
||||
|
||||
buildInputs = [ pixie ]; |
||||
|
||||
patches = [ ./make-paths-configurable.patch ]; |
||||
|
||||
configurePhase = '' |
||||
pixiePath="${pixie}/bin/pixie" \ |
||||
basePath="$out/share/dust" \ |
||||
rlwrapPath="${rlwrap}/bin/rlwrap" \ |
||||
substituteAll dust.in dust |
||||
chmod +x dust |
||||
''; |
||||
|
||||
# FIXME: AOT for dust |
||||
# buildPhase = '' |
||||
# find . -name "*.pxi" -exec pixie-vm -c {} \; |
||||
# ''; |
||||
|
||||
installPhase = '' |
||||
mkdir -p $out/bin $out/share/dust |
||||
cp -a src/ run.pxi $out/share/dust |
||||
mv dust $out/bin/dust |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "Provides tooling around pixie, e.g. a nicer repl, running tests and fetching dependencies"; |
||||
homepage = src.meta.homepage; |
||||
maintainers = with maintainers; [ ]; |
||||
license = licenses.lgpl3; |
||||
platforms = platforms.unix; |
||||
}; |
||||
} |
@ -1,25 +0,0 @@ |
||||
diff --git a/pixie/ffi-infer.pxi b/pixie/ffi-infer.pxi
|
||||
index 9f13ac7..74301c2 100644
|
||||
--- a/pixie/ffi-infer.pxi
|
||||
+++ b/pixie/ffi-infer.pxi
|
||||
@@ -1,15 +1,12 @@
|
||||
(ns pixie.ffi-infer
|
||||
(:require [pixie.io-blocking :as io]))
|
||||
|
||||
+(defn -add-library-path [p]
|
||||
+ (swap! load-paths conj (str p "/include"))
|
||||
+ (swap! load-paths conj (str p "/lib")))
|
||||
|
||||
-(defn -add-rel-path [rel]
|
||||
- (swap! load-paths conj (str (first @load-paths) "/" rel)))
|
||||
-
|
||||
-(-add-rel-path "lib")
|
||||
-(-add-rel-path "include")
|
||||
-(-add-rel-path "../lib")
|
||||
-(-add-rel-path "../include")
|
||||
-
|
||||
+(doseq [lp @libraryPaths@]
|
||||
+ (-add-library-path lp))
|
||||
|
||||
(def *config* nil)
|
||||
(set-dynamic! (var *config*))
|
@ -1,119 +0,0 @@ |
||||
From 0cbb82e606610d36e52c70d888995fbbf9b0d7c8 Mon Sep 17 00:00:00 2001
|
||||
From: Herwig Hochleitner <herwig@bendlas.net>
|
||||
Date: Sun, 28 Feb 2016 16:34:14 +0100
|
||||
Subject: [PATCH] make paths configurable
|
||||
|
||||
---
|
||||
dust | 52 ----------------------------------------------------
|
||||
dust.in | 43 +++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 43 insertions(+), 52 deletions(-)
|
||||
delete mode 100755 dust
|
||||
create mode 100755 dust.in
|
||||
|
||||
diff --git a/dust b/dust
|
||||
deleted file mode 100755
|
||||
index ffced9b..0000000
|
||||
--- a/dust
|
||||
+++ /dev/null
|
||||
@@ -1,52 +0,0 @@
|
||||
-#!/usr/bin/env bash
|
||||
-
|
||||
-base_path=$0
|
||||
-if [ -L "$base_path" ]; then
|
||||
- base_path=`readlink $base_path`
|
||||
-fi
|
||||
-base_path=`dirname $base_path`
|
||||
-
|
||||
-pixie_path=`which pixie-vm`
|
||||
-if [ -z "$pixie_path" ]; then
|
||||
- echo "Error: 'pixie-vm' must be on your PATH"
|
||||
- exit 1
|
||||
-fi
|
||||
-
|
||||
-function set_load_path() {
|
||||
- load_path=""
|
||||
- if ([ -f "project.edn" ] || [ -f "project.pxi" ]) && [ -f ".load-path" ]; then
|
||||
- load_path="`cat .load-path`"
|
||||
- fi
|
||||
-}
|
||||
-
|
||||
-if [ ! -f "project.edn" ] && [ -f "project.pxi" ]; then
|
||||
- echo "Warning: 'project.pxi' is deprecated, please use 'project.edn'."
|
||||
- echo "To start you can run the following command:"
|
||||
- echo " pixie-vm -l $base_path/src -e '(require dust.project :as p) (p/load-project!) (prn (dissoc @p/*project* :path))'"
|
||||
- echo
|
||||
-fi
|
||||
-
|
||||
-set_load_path
|
||||
-run_dust="$pixie_path -l $base_path/src $load_path $base_path/run.pxi"
|
||||
-
|
||||
-case $1 in
|
||||
- ""|"repl")
|
||||
- rlwrap_cmd=""
|
||||
- if [ -n "`which rlwrap`" ]; then
|
||||
- rlwrap_cmd="rlwrap -aignored -n"
|
||||
- fi
|
||||
- $rlwrap_cmd $pixie_path $load_path
|
||||
- ;;
|
||||
- "run")
|
||||
- shift
|
||||
- file=$1
|
||||
- shift
|
||||
- $pixie_path $load_path $file $@
|
||||
- ;;
|
||||
- -h|--help)
|
||||
- $run_dust help
|
||||
- ;;
|
||||
- *)
|
||||
- $run_dust $@
|
||||
- ;;
|
||||
-esac
|
||||
diff --git a/dust.in b/dust.in
|
||||
new file mode 100755
|
||||
index 0000000..44a7fbd
|
||||
--- /dev/null
|
||||
+++ b/dust.in
|
||||
@@ -0,0 +1,40 @@
|
||||
+#!/usr/bin/env bash
|
||||
+
|
||||
+base_path=@basePath@
|
||||
+pixie_path=@pixiePath@
|
||||
+rlwrap_cmd=@rlwrapPath@
|
||||
+
|
||||
+function set_load_path() {
|
||||
+ load_path=""
|
||||
+ if ([ -f "project.edn" ] || [ -f "project.pxi" ]) && [ -f ".load-path" ]; then
|
||||
+ load_path="`cat .load-path`"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+if [ ! -f "project.edn" ] && [ -f "project.pxi" ]; then
|
||||
+ echo "Warning: 'project.pxi' is deprecated, please use 'project.edn'."
|
||||
+ echo "To start you can run the following command:"
|
||||
+ echo " pixie-vm -l $base_path/src -e '(require dust.project :as p) (p/load-project!) (prn (dissoc @p/*project* :path))'"
|
||||
+ echo
|
||||
+fi
|
||||
+
|
||||
+set_load_path
|
||||
+run_dust="$pixie_path -l $base_path/src $load_path $base_path/run.pxi"
|
||||
+
|
||||
+case $1 in
|
||||
+ ""|"repl")
|
||||
+ $rlwrap_cmd -aignored -n $pixie_path $load_path
|
||||
+ ;;
|
||||
+ "run")
|
||||
+ shift
|
||||
+ file=$1
|
||||
+ shift
|
||||
+ $pixie_path $load_path $file $@
|
||||
+ ;;
|
||||
+ -h|--help)
|
||||
+ $run_dust help
|
||||
+ ;;
|
||||
+ *)
|
||||
+ $run_dust $@
|
||||
+ ;;
|
||||
+esac
|
||||
--
|
||||
2.7.1
|
||||
|
Loading…
Reference in new issue