Justin Woo b1e23abd7f purescript: upgrade to 0.12.5 (#59589)
* purescript: 0.12.4 -> 0.12.5
https://github.com/purescript/purescript/releases/v0.12.5

* purescript: consistent pkg name and attr name
+ version must start with a number
2019-04-25 23:29:53 +02:00

61 lines
1.7 KiB
Nix

{ stdenv, fetchurl, zlib, gmp, ncurses5, lib }:
# from justinwoo/easy-purescript-nix
# https://github.com/justinwoo/easy-purescript-nix/blob/d383972c82620a712ead4033db14110497bc2c9c/purs.nix
let
dynamic-linker = stdenv.cc.bintools.dynamicLinker;
patchelf = libPath :
if stdenv.isDarwin
then ""
else
''
chmod u+w $PURS
patchelf --interpreter ${dynamic-linker} --set-rpath ${libPath} $PURS
chmod u-w $PURS
'';
in stdenv.mkDerivation rec {
pname = "purescript";
version = "0.12.5";
src =
if stdenv.isDarwin
then
fetchurl {
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/macos.tar.gz";
sha256 = "15j9lkrl15dicx37bmh0199b3qdixig7w24wvdzi20jqbacz8nkn";
}
else
fetchurl {
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/linux64.tar.gz";
sha256 = "07dva5gxq77g787krscv4dsz5088fzkvpmm9fwxw9a59jszzs7kq";
};
buildInputs = [ zlib
gmp
ncurses5 ];
libPath = lib.makeLibraryPath buildInputs;
dontStrip = true;
installPhase = ''
mkdir -p $out/bin
PURS="$out/bin/purs"
install -D -m555 -T purs $PURS
${patchelf libPath}
mkdir -p $out/etc/bash_completion.d/
$PURS --bash-completion-script $PURS > $out/etc/bash_completion.d/purs-completion.bash
'';
meta = with stdenv.lib; {
description = "A strongly-typed functional programming language that compiles to JavaScript";
homepage = http://www.purescript.org/;
license = licenses.bsd3;
maintainers = [ maintainers.justinwoo ];
platforms = [ "x86_64-linux" "x86_64-darwin" ];
};
}