Merge pull request #6965 from joachifm/reimplement-j
j: re-implement using mkDerivation
This commit is contained in:
commit
7c8410b196
1 changed files with 25 additions and 59 deletions
|
@ -1,42 +1,16 @@
|
|||
x@{builderDefsPackage
|
||||
, readline
|
||||
, ...}:
|
||||
builderDefsPackage
|
||||
(a :
|
||||
let
|
||||
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
||||
[];
|
||||
{ stdenv, fetchurl, readline }:
|
||||
|
||||
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;
|
||||
stdenv.mkDerivation rec {
|
||||
name = "j-${version}";
|
||||
version = "701_b";
|
||||
src = fetchurl {
|
||||
url = "http://www.jsoftware.com/download/j${version}_source.tar.gz";
|
||||
sha256 = "1gmjlpxcd647x690c4dxnf8h6ays8ndir6cib70h3zfnkrc34cys";
|
||||
};
|
||||
buildInputs = [ readline ];
|
||||
bits = if stdenv.is64bit then "64" else "32";
|
||||
|
||||
inherit (sourceInfo) name version;
|
||||
inherit buildInputs;
|
||||
|
||||
/* doConfigure should be removed if not needed */
|
||||
phaseNames = ["doUnpack" "doBuildJ" "doDeploy"];
|
||||
|
||||
bits = if a.stdenv.is64bit then
|
||||
"64"
|
||||
else if a.stdenv.isi686 then
|
||||
"32"
|
||||
else
|
||||
builtins.trace "assuming ${a.stdenv.system} is 32 bits" "32";
|
||||
|
||||
doBuildJ = a.fullDepEntry ''
|
||||
buildPhase = ''
|
||||
sed -i bin/jconfig -e '
|
||||
s@bits=32@bits=${bits}@g;
|
||||
s@readline=0@readline=1@;
|
||||
|
@ -51,36 +25,28 @@ rec {
|
|||
sh -o errexit bin/build_defs
|
||||
sh -o errexit bin/build_tsdll
|
||||
|
||||
sed -i j/bin/profile.ijs -e "s@userx=[.] *'.j'@userx=. '/.j'@;
|
||||
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 ''
|
||||
installPhase = ''
|
||||
mkdir -p "$out"
|
||||
cp -r j/bin "$out/bin"
|
||||
rm "$out/bin/profilex_template.ijs"
|
||||
|
||||
|
||||
mkdir -p "$out/share/j"
|
||||
|
||||
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;
|
||||
unix;
|
||||
license = a.lib.licenses.gpl3Plus;
|
||||
};
|
||||
passthru = {
|
||||
updateInfo = {
|
||||
downloadPage = "http://jsoftware.com/source.htm";
|
||||
};
|
||||
};
|
||||
}) x
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "J programming language, an ASCII-based APL successor";
|
||||
maintainers = with maintainers; [ raskin ];
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl3Plus;
|
||||
homepage = http://jsoftware.com/;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue