<commit_before>{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
  mkClangShell = mkShell.override { stdenv = clangStdenv; };
  runtimeLibs = with xorg; [
    glib
    pango cairo
    gtk2-x11
    gdk_pixbuf
    gnome2.gtkglext
    pcre
    mesa_glu
    freealut
    openssl
    udis86 # available since NixOS 19.09
    openal
  ];
  runtimeLibPath = lib.makeLibraryPath runtimeLibs;
in
(mkClangShell {
  name = "factor-shell-env";
  LD_LIBRARY_PATH = "/run/opengl-driver/lib:${runtimeLibPath}" ;
  buildInputs = runtimeLibs ++ [
    # for building factor
    git
    curl
    makeWrapper
  ];
  shellHook = ''
    wrapFactor () {
    [ -n "$1" ] || { printf "Usage: wrapFactor <factor-root>" ; return; }
    local root="$(realpath $1)"
    local binary="''${root}/factor"
    wrapProgram "$binary" --prefix LD_LIBRARY_PATH : ${runtimeLibPath} \
      --argv0 factor<commit_msg>shell.nix: Add more runtime dependencies for nixos wrapper<commit_after>{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
  mkClangShell = mkShell.override { stdenv = clangStdenv; };
  runtimeLibs = with xorg; [
    glib
    pango cairo
    gtk2-x11
    gdk_pixbuf
    gnome2.gtkglext
    pcre
    mesa_glu
    freealut
    openssl
    udis86 # available since NixOS 19.09
    openal
    libogg
    libvorbis
    zlib
  ];
  runtimeLibPath = lib.makeLibraryPath runtimeLibs;
in
(mkClangShell {
  name = "factor-shell-env";
  LD_LIBRARY_PATH = "/run/opengl-driver/lib:${runtimeLibPath}" ;
  buildInputs = runtimeLibs ++ [
    # for building factor
    git
    curl
    makeWrapper
  ];
  shellHook = ''
    wrapFactor () {
    [ -n "$1" ] || { printf "Usage: wrapFactor <factor-root>" ; return; }
    local root="$(realpath $1)"
    local binary="''${root}/factor"
    wrapProgram "$binary" --prefix LD_LIBRARY_PATH : ${runtimeLibPath} \
      --argv0 factor
{'fraction_non_alphanumeric': 0.12137780207763806, 'fraction_numerical': 0.014215418261344996, 'mean_word_length': 2.893617021276596, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4682161', 'n_tokens_mistral': 683, 'n_tokens_neox': 650, 'n_words': 145}