From 4aacdee4e191d08809fb5f9ad308947fd3d2edd1 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 17 Mar 2011 15:36:38 +0000 Subject: [PATCH] Adding J language svn path=/nixpkgs/trunk/; revision=26398 --- pkgs/development/interpreters/j/default.nix | 81 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 83 insertions(+) create mode 100644 pkgs/development/interpreters/j/default.nix diff --git a/pkgs/development/interpreters/j/default.nix b/pkgs/development/interpreters/j/default.nix new file mode 100644 index 00000000000..3be0e8aa117 --- /dev/null +++ b/pkgs/development/interpreters/j/default.nix @@ -0,0 +1,81 @@ +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"]; + + bits = if a.stdenv.system == "i686-linux" then + "32" + else if a.stdenv.system == "x86_64-linux" then + "64" + else + throw "Oops, unknown system: ${a.stdenv.system}"; + + doBuildJ = a.fullDepEntry '' + sed -i bin/jconfig -e 's@bits=32@bits=${bits}@g; s@readline=0@readline=1@; s@LIBREADLINE=""@LIBREADLINE=" -lreadline "@' + sed -i bin/build_libj -e 's@>& make.txt@ 2>\&1 | tee make.txt@' + + touch *.c *.h + sh bin/build_jconsole + sh bin/build_libj + sh bin/build_defs + sh bin/build_tsdll + + 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 '' + ensureDir "$out" + cp -r j/bin "$out/bin" + rm "$out/bin/profilex_template.ijs" + + ensureDir "$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; + linux; + license = a.lib.licenses.gpl3Plus; + }; + passthru = { + updateInfo = { + downloadPage = "http://jsoftware.com/source.htm"; + }; + }; +}) x + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0325c2000d9..d59cbb19a23 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2219,6 +2219,8 @@ let freeglut e2fsprogs libsamplerate pcre libevent libedit; }; + j = callPackage ../development/interpreters/j {}; + kaffe = callPackage ../development/interpreters/kaffe { }; lua4 = callPackage ../development/interpreters/lua-4 { };