X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=shell.nix;h=f9d896259e7b7edee0424f0a3a917aaf54234bee;hp=b9d4a136b0a5de7de38a88be1e78bbe29c878359;hb=1bf4194271bc619cbeaeda2f60bf11081a95282f;hpb=655f54af19915225a44ceba874538167515cd110 diff --git a/shell.nix b/shell.nix index b9d4a136b0..f9d896259e 100644 --- a/shell.nix +++ b/shell.nix @@ -9,17 +9,21 @@ let gdk_pixbuf gnome2.gtkglext pcre - mesa_glu + libGL + libGLU freealut openssl udis86 # available since NixOS 19.09 openal + libogg + libvorbis + zlib ]; - runtimeLibPath = lib.makeLibraryPath runtimeLibs; + runtimeLibPath = "/run/opengl-driver/lib:" + lib.makeLibraryPath runtimeLibs; in (mkClangShell { name = "factor-shell-env"; - LD_LIBRARY_PATH = "/run/opengl-driver/lib:${runtimeLibPath}" ; + LD_LIBRARY_PATH = runtimeLibPath ; buildInputs = runtimeLibs ++ [ # for building factor git @@ -27,11 +31,22 @@ in makeWrapper ]; shellHook = '' + # Set Gdk pixbuf loaders file to the one from the build dependencies here + unset GDK_PIXBUF_MODULE_FILE + # Defined in gdk-pixbuf setup hook + findGdkPixbufLoaders "${pkgs.librsvg}" + wrapFactor () { [ -n "$1" ] || { printf "Usage: wrapFactor " ; return; } local root="$(realpath $1)" local binary="''${root}/factor" + local wrapped="''${root}/.factor-wrapped" + # Remove the wrapped binary if a new VM has been compiled + ${lib.getBin file}/bin/file "$binary" |grep ELF >/dev/null && rm -f "$wrapped" + # Restore the factor binary if it was already wrapped + [ -e "$wrapped" ] && { mv "$wrapped" "$binary" ; } wrapProgram "$binary" --prefix LD_LIBRARY_PATH : ${runtimeLibPath} \ + --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \ --argv0 factor ln -sf "''${root}/factor.image" "''${root}/.factor-wrapped.image" }