nixpkgs/pkgs/development/interpreters/j/default.nix
R. RyanTM 2061eefc38 j: 806 -> 808
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.

This update was made based on information from https://repology.org/metapackage/j/versions.

These checks were done:

- built on NixOS
- ran ‘/nix/store/s4j1rrnwdrrqdaiyqci4c0cqy3azlnl2-j-808/bin/jconsole -h’ got 0 exit code
- ran ‘/nix/store/s4j1rrnwdrrqdaiyqci4c0cqy3azlnl2-j-808/bin/jconsole --help’ got 0 exit code
- ran ‘/nix/store/s4j1rrnwdrrqdaiyqci4c0cqy3azlnl2-j-808/bin/jconsole help’ got 0 exit code
- found 808 with grep in /nix/store/s4j1rrnwdrrqdaiyqci4c0cqy3azlnl2-j-808
- directory tree listing: https://gist.github.com/3c6f38056c15de42a7496ff1f576064e
2018-04-20 04:42:42 -07:00

86 lines
2 KiB
Nix

{ stdenv, fetchFromGitHub, readline, libedit }:
stdenv.mkDerivation rec {
name = "j-${version}";
version = "808";
jtype = "release";
src = fetchFromGitHub {
owner = "jsoftware";
repo = "jsource";
rev = "j${version}-${jtype}";
sha256 = "1sshm04p3yznlhfp6vyc7g8qxw95y67vhnh92cmz3lfy69n2q6bf";
};
buildInputs = [ readline libedit ];
bits = if stdenv.is64bit then "64" else "32";
platform =
/*if stdenv.isRaspberryPi then "raspberry" else*/
if stdenv.isLinux then "linux" else
if stdenv.isDarwin then "darwin" else
"unknown";
doCheck = true;
buildPhase = ''
export SOURCE_DIR=$(pwd)
export HOME=$TMPDIR
export JBIN=$HOME/j${bits}/bin
export JLIB=$SOURCE_DIR/jlibrary
mkdir -p $JBIN
cd make
patchShebangs .
sed -i jvars.sh -e '
s@~/gitdev/jsource@$SOURCE_DIR@;
s@~/jbld@$HOME@;
s@linux@${platform}@;
'
sed -i $JLIB/bin/profile.ijs -e "s@'/usr/share/j/.*'@'$out/share/j'@;"
# For future versions, watch
# https://github.com/jsoftware/jsource/pull/4
cp ./jvars.sh $HOME
echo '
#define jversion "${version}"
#define jplatform "${platform}"
#define jtype "${jtype}" // release,beta,...
#define jlicense "GPL3"
#define jbuilder "unknown" // website or email
' > ../jsrc/jversion.h
./build_jconsole.sh j${bits}
./build_libj.sh j${bits}
'';
checkPhase = ''
echo 'i. 5' | $JBIN/jconsole | fgrep "0 1 2 3 4"
# Now run the real tests
cd $SOURCE_DIR/test
# for f in *.ijs
# do
# echo $f
# $JBIN/jconsole < $f
# done
'';
installPhase = ''
mkdir -p "$out"
cp -r $JBIN "$out/bin"
mkdir -p "$out/share/j"
cp -r $JLIB/{addons,system} "$out/share/j"
cp -r $JLIB/bin "$out"
'';
meta = with stdenv.lib; {
description = "J programming language, an ASCII-based APL successor";
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
license = licenses.gpl3Plus;
homepage = http://jsoftware.com/;
};
}