2011-03-17 15:36:38 +00:00
|
|
|
x@{builderDefsPackage
|
|
|
|
, readline
|
|
|
|
, ...}:
|
|
|
|
builderDefsPackage
|
|
|
|
(a :
|
|
|
|
let
|
|
|
|
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
|
|
|
[];
|
|
|
|
|
|
|
|
buildInputs = map (n: builtins.getAttr n x)
|
|
|
|
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
|
|
|
|
sourceInfo = rec {
|
|
|
|
baseName="j";
|
|
|
|
version="701_b";
|
|
|
|
name="${baseName}-${version}";
|
|
|
|
url="http://www.jsoftware.com/download/${baseName}${version}_source.tar.gz";
|
|
|
|
hash="1gmjlpxcd647x690c4dxnf8h6ays8ndir6cib70h3zfnkrc34cys";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
src = a.fetchurl {
|
|
|
|
url = sourceInfo.url;
|
|
|
|
sha256 = sourceInfo.hash;
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit (sourceInfo) name version;
|
|
|
|
inherit buildInputs;
|
|
|
|
|
|
|
|
/* doConfigure should be removed if not needed */
|
|
|
|
phaseNames = ["doUnpack" "doBuildJ" "doDeploy"];
|
|
|
|
|
2014-10-20 18:52:19 +01:00
|
|
|
bits = if a.stdenv.is64bit then
|
2011-03-17 15:36:38 +00:00
|
|
|
"64"
|
2014-10-20 18:52:19 +01:00
|
|
|
else if a.stdenv.isi686 then
|
|
|
|
"32"
|
|
|
|
else
|
|
|
|
builtins.trace "assuming ${a.stdenv.system} is 32 bits" "32";
|
2011-03-17 15:36:38 +00:00
|
|
|
|
|
|
|
doBuildJ = a.fullDepEntry ''
|
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@'
|
|
|
|
|
|
|
|
touch *.c *.h
|
2014-12-10 21:43:42 +00:00
|
|
|
sh -o errexit bin/build_jconsole
|
|
|
|
sh -o errexit bin/build_libj
|
|
|
|
sh -o errexit bin/build_defs
|
|
|
|
sh -o errexit bin/build_tsdll
|
2011-03-17 15:36:38 +00:00
|
|
|
|
|
|
|
sed -i j/bin/profile.ijs -e "s@userx=[.] *'.j'@userx=. '/.j'@;
|
|
|
|
s@bin,'/profilex.ijs'@user,'/profilex.ijs'@ ;
|
|
|
|
/install=./ainstall=. install,'/share/j'
|
|
|
|
"
|
|
|
|
'' ["doUnpack" "addInputs" "minInit"];
|
|
|
|
|
|
|
|
doDeploy = a.fullDepEntry ''
|
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"
|
|
|
|
|
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"
|
|
|
|
'' ["doUnpack" "doBuildJ" "minInit" "defEnsureDir"];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "J programming language, an ASCII-based APL successor";
|
|
|
|
maintainers = with a.lib.maintainers;
|
|
|
|
[
|
|
|
|
raskin
|
|
|
|
];
|
|
|
|
platforms = with a.lib.platforms;
|
2014-10-20 18:52:19 +01:00
|
|
|
unix;
|
2011-03-17 15:36:38 +00:00
|
|
|
license = a.lib.licenses.gpl3Plus;
|
|
|
|
};
|
|
|
|
passthru = {
|
|
|
|
updateInfo = {
|
|
|
|
downloadPage = "http://jsoftware.com/source.htm";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}) x
|
|
|
|
|