2015-10-25 10:08:02 +00:00
|
|
|
{stdenv, glibc, fetchFromGitHub, llvm, makeWrapper, openssl, pcre2 }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ponyc-0.2.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CausalityLtd";
|
|
|
|
repo = "ponyc";
|
|
|
|
rev = "0.2.1";
|
|
|
|
sha256 = "1wmvqrj9v2kjqha9fcs10vfnhdxhc3rf67wpn36ldhs1hq0k25jy";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ llvm makeWrapper ];
|
|
|
|
|
|
|
|
makeFlags = [ "config=release" ];
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
|
|
|
|
|
|
|
patchPhase = ''
|
2016-01-24 07:29:16 +00:00
|
|
|
sed 's|/usr/lib/x86_64-linux-gnu/|${glibc.out}/lib/|g' -i src/libponyc/codegen/genexe.c
|
2016-04-30 21:56:43 +01:00
|
|
|
sed 's|/lib/x86_64-linux-gnu/|${stdenv.cc.cc.lib}/lib/|g' -i src/libponyc/codegen/genexe.c
|
2015-10-25 10:08:02 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export LLVM_CONFIG=${llvm}/bin/llvm-config
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
2016-01-24 07:30:05 +00:00
|
|
|
export LIBRARY_PATH="$out/lib:${openssl.out}/lib:${pcre2}/lib"
|
2015-10-25 10:08:02 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
make config=release prefix=$out install
|
|
|
|
mv $out/bin/ponyc $out/bin/ponyc.wrapped
|
|
|
|
makeWrapper $out/bin/ponyc.wrapped $out/bin/ponyc \
|
|
|
|
--prefix LIBRARY_PATH : "$out/lib" \
|
2016-01-24 07:30:05 +00:00
|
|
|
--prefix LIBRARY_PATH : "${openssl.out}/lib" \
|
2015-10-25 10:08:02 +00:00
|
|
|
--prefix LIBRARY_PATH : "${pcre2}/lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Pony is an Object-oriented, actor-model, capabilities-secure, high performance programming language";
|
|
|
|
homepage = http://www.ponylang.org;
|
|
|
|
license = stdenv.lib.licenses.bsd2;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.doublec ];
|
|
|
|
};
|
|
|
|
}
|