]> gitweb.factorcode.org Git - factor.git/blob - shell.nix
Added UTExportedTypeDeclarations to Info.plist
[factor.git] / shell.nix
1 { pkgs ? import <nixpkgs> {} }:
2 with pkgs;
3 let
4   mkClangShell = mkShell.override { stdenv = clangStdenv; };
5   runtimeLibs = with xorg; [
6     glib
7     pango cairo
8     gtk2-x11
9     gdk_pixbuf
10     gnome2.gtkglext
11     pcre
12     mesa_glu
13     freealut
14     openssl
15     udis86 # available since NixOS 19.09
16     openal
17   ];
18   runtimeLibPath = lib.makeLibraryPath runtimeLibs;
19 in
20 (mkClangShell {
21   name = "factor-shell-env";
22   LD_LIBRARY_PATH = "/run/opengl-driver/lib:${runtimeLibPath}" ;
23   buildInputs = runtimeLibs ++ [
24     # for building factor
25     git
26     curl
27     makeWrapper
28   ];
29   shellHook = ''
30     wrapFactor () {
31     [ -n "$1" ] || { printf "Usage: wrapFactor <factor-root>" ; return; }
32     local root="$(realpath $1)"
33     local binary="''${root}/factor"
34     wrapProgram "$binary" --prefix LD_LIBRARY_PATH : ${runtimeLibPath} \
35       --argv0 factor
36     ln -sf "''${root}/factor.image" "''${root}/.factor-wrapped.image"
37     }
38   '';
39 })