pyre: simplify build phases

This commit is contained in:
Jörg Thalheim 2018-12-03 08:19:28 +00:00
parent 92cba3aa0c
commit 3d444cfd8e
No known key found for this signature in database
GPG Key ID: CA4106B8D7CC79FA

View File

@ -44,32 +44,29 @@ let
# python36Packages.python36Full # TODO # python36Packages.python36Full # TODO
]; ];
buildPhase = '' preBuild = ''
# build requires HOME to be set # build requires HOME to be set
export HOME=. export HOME=$TMPDIR
# "external" because https://github.com/facebook/pyre-check/pull/8/files # "external" because https://github.com/facebook/pyre-check/pull/8/files
sed "s/%VERSION%/external/" dune.in > dune sed "s/%VERSION%/external/" dune.in > dune
cp ${versionFile} ./scripts/generate-version-number.sh ln -sf ${versionFile} ./scripts/generate-version-number.sh
mkdir $(pwd)/build mkdir $(pwd)/build
export OCAMLFIND_DESTDIR=$(pwd)/build export OCAMLFIND_DESTDIR=$(pwd)/build
export OCAMLPATH=$OCAMLPATH:$(pwd)/build export OCAMLPATH=$OCAMLPATH:$(pwd)/build
make release
''; '';
checkPhase = '' buildFlags = [ "release" ];
make test
doCheck = true;
# ./scripts/run-python-tests.sh # TODO: once typeshed and python bits are added # ./scripts/run-python-tests.sh # TODO: once typeshed and python bits are added
'';
# Note that we're not installing the typeshed yet. # Note that we're not installing the typeshed yet.
# Improvement for a future version. # Improvement for a future version.
installPhase = '' installPhase = ''
mkdir -p $out/bin install -D ./_build/default/main.exe $out/bin/pyre.bin
cp ./_build/default/main.exe $out/bin/pyre.bin
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {