@sean-bennett112 Looks like GR depends on a few Qt libraries, which you will need to add to the extraLibs list.
You should be able to do nix-locate -1 -w foo.so.4 to find which nix package provides the shared library. For a bit more context see the relevant section in the Nixos wiki.
As you can see, itās expecting an interpreter at /lib64/ld-linux-x86-64.so.2 which does not exist on NixOS. Iāve confirmed that manually patching the binary(after running Pkg.add("GR"))via the below command does resolve the issue.
For GR specifically, you can see in build.jl that we can pass in an environment variable GRDIR to use a pre-existing copy of gksqt. From a cursory glance through nixpkgs, it looks like GR framework isnāt packaged yet. Thatās a solvable problem, though.
However Iām not sure if there exists a more general solution for when Julia packages download pre-built binaries. Maybe this is something the move towards BinaryProvider will help address?
In any case, thanks for pointing me in the right direction!
If someone else eventually needs to patch the gksqt binary. Here is how you do it semi-automatically within a nix expression:
let
libPath = lib.makeLibraryPath [
qt4
gcc9
stdenv.cc.cc.lib
];
in
pkgs.stdenv.mkDerivation {
name = "sandbox-julia";
buildInputs = with pkgs; [
julia
];
shellHook = ''
# Make sure the GR package is installed in the current project
julia -e 'using Pkg; Pkg.activate("./"); Pkg.add("GR")'
# Patch the GKS binary for GR
patchelf \
--set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 \
--set-rpath "${libPath}" \
/home/user/.julia/packages/GR/cRdXQ/deps/gr/bin/gksqt
'';
}