Skip to content

Instantly share code, notes, and snippets.

@myguidingstar
Last active June 6, 2021 05:45
Show Gist options
  • Save myguidingstar/ed5e4b79f0daeddac6fd8cfe230726c5 to your computer and use it in GitHub Desktop.
Save myguidingstar/ed5e4b79f0daeddac6fd8cfe230726c5 to your computer and use it in GitHub Desktop.
J language Qt IDE

J language Qt IDE for NixOS

The j package in nixpkgs does not include Qt IDE. This project packages binaries from upstream.

Notes

The IDE (jqt) was written in a way that it must be place in the same directory with jconsole and other *.so files. Therefore this project has them all in a bin directory. (I tried to keep jconsole and jqt in separate packages then combine them back in a FHSUserEnv but it doesn't work).

Though jqt binaries and libraries is included, upstream tarball doesn't contain any *.ijs files, so one must download them using j package manager. You will see complaints that jqt script files are missing when you first start the IDE (jqt).

I only have nix build scripts for Linux x64 and ARM (raspi and alike) here. People using other arch should adapt the script.

Package manager

J package manager does not work out of the box in nix because of read-only file system. You must override the defaut directory paths to directories under your user's home. Here's how:

Open jqt, go to the menu Edit -> Config -> Folders. A file folders.cfg is open up. Replace its content with the one with the same name provided here.

Quit jqt. Start jconsole to install the missing script for jqt with:

install 'qtide'.

Now you can start jqt again. No more complaints. Also, the package manager included in the IDE should work now.

Enjoy!

TODO

Write a script to automate the process of setting j config's folders, so that after install the nix package, one would run jqt-init-user and have everything ready.

NB. folders.cfg
NB.
NB. each non-empty line is a pair: name path, e.g.
NB. Van /home/guest/van/source
NB.
NB. name begins with lowercase - added to SystemFolders_j_
NB. name begins with uppercase - defines UserFolders_j_
install ~user/install
system ~user/system
tools ~user/tools
addons ~user/addons
demos ~user/addons/demos
Projects ~user/projects
User ~user
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
stdenv.mkDerivation rec {
name = "qtide-${version}";
version = "1.9.2";
main = fetchurl {
url = "http://www.jsoftware.com/download/j902/install/j902_raspi64.tar.gz";
sha256 = "0xj6lzmgbd1zg9yjv2f177p4sm6myxxaw7js9fcxmh32z9ijhcpb";
};
jqt = fetchurl {
url = "https://www.jsoftware.com/download/j902/qtide/jqt-raspislim-64.tar.gz";
sha256 = "0a6f0fmd5kb8v5zll0rxj0cxi6cgpymazq84ffhwh9nbrvjdlc5w";
};
nativeBuildInputs = [
gnutar
autoPatchelfHook
qt5.wrapQtAppsHook
j
];
buildInputs = [
qt5.full
qt5.qtwebsockets
llvmPackages.openmp
(pkgs.runCommand "openmp5" {}
''
mkdir -p $out/lib
ln -s ${pkgs.llvmPackages.openmp}/lib/libomp.so $out/lib/libomp.so.5
'')
j
];
unpackPhase = ''
tar -xf $main
tar -C j902/bin -xf $jqt
'';
installPhase = ''
mv j902 $out
'';
meta = with lib; {
homepage = http://www.jsoftware.com;
description = "The J programming language
high-performance data analysis
powerful operators for exploratory programming
built-in database";
platforms = platforms.linux;
maintainers = with maintainers; [ ];
};
}
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
stdenv.mkDerivation rec {
name = "qtide-${version}";
version = "1.9.2";
main = fetchurl {
url = "http://www.jsoftware.com/download/j902/install/j902_linux64.tar.gz";
sha256 = "1wxwddapkff01fcz2jidy63pv30hbrn2hijwlx5y9a84hbfp4lgi";
};
jqt = fetchurl {
url = "https://www.jsoftware.com/download/j902/qtide/jqt-slim-x64.tar.gz";
sha256 = "11y064sbgcvrlhfdmg4r5vpxmfs9v4siy4vhs0lqxdghzin54pc0";
};
nativeBuildInputs = [
gnutar
autoPatchelfHook
qt5.wrapQtAppsHook
j
];
buildInputs = [
qt5.full
qt5.qtwebsockets
j
];
unpackPhase = ''
tar -xf $main
tar -C j902/bin -xf $jqt
'';
installPhase = ''
mv j902 $out
'';
meta = with lib; {
homepage = http://www.jsoftware.com;
description = "The J programming language
high-performance data analysis
powerful operators for exploratory programming
built-in database";
platforms = platforms.linux;
maintainers = with maintainers; [ ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment