2015-03-24 12:56:36 +00:00
|
|
|
{ stdenv, fetchurl, readline }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "j-${version}";
|
|
|
|
version = "701_b";
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.jsoftware.com/download/j${version}_source.tar.gz";
|
|
|
|
sha256 = "1gmjlpxcd647x690c4dxnf8h6ays8ndir6cib70h3zfnkrc34cys";
|
2011-03-17 15:36:38 +00:00
|
|
|
};
|
2015-03-24 12:56:36 +00:00
|
|
|
buildInputs = [ readline ];
|
|
|
|
bits = if stdenv.is64bit then "64" else "32";
|
2011-03-17 15:36:38 +00:00
|
|
|
|
2016-06-18 14:18:06 +01:00
|
|
|
doCheck = true;
|
2016-06-18 13:29:09 +01:00
|
|
|
|
2016-06-18 14:18:06 +01:00
|
|
|
buildPhase = ''
|
2014-12-10 21:43:42 +00:00
|
|
|
sed -i bin/jconfig -e '
|
|
|
|
s@bits=32@bits=${bits}@g;
|
|
|
|
s@readline=0@readline=1@;
|
|
|
|
s@LIBREADLINE=""@LIBREADLINE=" -lreadline "@;
|
|
|
|
s@-W1,soname,libj.so@-Wl,-soname,libj.so@
|
|
|
|
'
|
2011-03-17 15:36:38 +00:00
|
|
|
sed -i bin/build_libj -e 's@>& make.txt@ 2>\&1 | tee make.txt@'
|
|
|
|
|
2016-06-18 13:29:09 +01:00
|
|
|
sed -i f2.c -e 's/_isnan(\*wv)/_isnan(y)/'
|
|
|
|
|
2011-03-17 15:36:38 +00:00
|
|
|
touch *.c *.h
|
2014-12-10 21:43:42 +00:00
|
|
|
sh -o errexit bin/build_jconsole
|
2016-06-18 13:29:09 +01:00
|
|
|
[ -e j/bin/jconsole ]
|
2014-12-10 21:43:42 +00:00
|
|
|
sh -o errexit bin/build_libj
|
2016-06-18 13:29:09 +01:00
|
|
|
[ -e j/bin/libj.so ]
|
2014-12-10 21:43:42 +00:00
|
|
|
sh -o errexit bin/build_defs
|
2016-06-18 13:29:09 +01:00
|
|
|
[ -e defs/hostdefs.ijs ] && [ -e defs/netdefs.ijs ]
|
2014-12-10 21:43:42 +00:00
|
|
|
sh -o errexit bin/build_tsdll
|
2016-06-18 13:29:09 +01:00
|
|
|
[ -x libtsdll.so ]
|
2011-03-17 15:36:38 +00:00
|
|
|
|
2015-03-24 12:56:36 +00:00
|
|
|
sed -i j/bin/profile.ijs -e "
|
|
|
|
s@userx=[.] *'.j'@userx=. '/.j'@;
|
2011-03-17 15:36:38 +00:00
|
|
|
s@bin,'/profilex.ijs'@user,'/profilex.ijs'@ ;
|
2016-06-18 13:29:09 +01:00
|
|
|
/install=./ainstall=. install,'/share/j'
|
2015-03-24 12:56:36 +00:00
|
|
|
"
|
|
|
|
'';
|
2011-03-17 15:36:38 +00:00
|
|
|
|
2016-06-18 14:18:06 +01:00
|
|
|
checkPhase = ''
|
|
|
|
echo 'i. 5' | j/bin/jconsole | fgrep "0 1 2 3 4"
|
|
|
|
'';
|
|
|
|
|
2015-03-24 12:56:36 +00:00
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out"
|
2011-03-17 15:36:38 +00:00
|
|
|
cp -r j/bin "$out/bin"
|
|
|
|
rm "$out/bin/profilex_template.ijs"
|
2015-03-24 12:56:36 +00:00
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/share/j"
|
2011-03-17 15:36:38 +00:00
|
|
|
|
|
|
|
cp -r docs j/addons j/system "$out/share/j"
|
2015-03-24 12:56:36 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2011-03-17 15:36:38 +00:00
|
|
|
description = "J programming language, an ASCII-based APL successor";
|
2015-03-24 12:56:36 +00:00
|
|
|
maintainers = with maintainers; [ raskin ];
|
2016-06-18 13:40:09 +01:00
|
|
|
platforms = platforms.linux;
|
2015-03-24 12:56:36 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
homepage = http://jsoftware.com/;
|
2011-03-17 15:36:38 +00:00
|
|
|
};
|
2015-03-24 12:56:36 +00:00
|
|
|
}
|