Try to create a shell with Xlib headers:

$ nix-shell -p xorg.libX11

On Thu, Mar 19, 2015 at 2:01 AM, Paul Dufresne <dufres...@gmail.com> wrote:

> Well, I am mostly user-level in NixOS.
> I modify my /etc/nixos/configuration.nix then #nixos-rebuild -switch
>
> I am learning GO.
> I have been able to get ncurses to work in go.
>
> I was now trying with SDL:
> [guest@nixos:~]$ go get -v
> github.com/veandco/go-sdl2/sdl{,_mixer,_image,_ttf}
> github.com/veandco/go-sdl2/sdl
> # github.com/veandco/go-sdl2/sdl
> In file included from go/src/github.com/veandco/go-sdl2/sdl/syswm.go:9:0:
>
> /nix/store/0lryp5ww28x21l74mmh42gnv6xdp45bw-SDL2-2.0.3/include/SDL2/SDL_syswm.h:70:22:
> fatal error: X11/Xlib.h: No such file or directory
>  #include <X11/Xlib.h>
>                       ^
> compilation terminated.
>
> [guest@nixos:~]$
>
> Well, I can vaguely understand I should build this, with a nix
> expression giving me go and Xlib as a "dependency".
> But, although I did read about nix expressions, I never really wrote any.
>
> In my configuration.nix I have:
>    environment.systemPackages = with pkgs; [
>      wget
>      firefoxWrapper
>      wineUnstable
>      winetricks
>      go
>      xlibs.libX11
>      SDL2
>      SDL2_gfx
>      SDL2_image
>      SDL2_mixer
>      SDL2_net
>      dmd
>      mercurial
>      git
>      pkgconfig
>      gcc
>      ...
>
> [guest@nixos:~]$ ls -l $GOPATH
> total 12
> drwxr-xr-x 2 guest users 4096 Mar 17 23:46 bin
> drwxr-xr-x 3 guest users 4096 Mar 17 23:26 pkg
> drwxr-xr-x 4 guest users 4096 Mar 17 23:19 src
>
> [guest@nixos:~]$ echo $GOPATH
> /home/guest/go
>
> [guest@nixos:~]$
>
> Don't know if there is some package I can add to my
> environment.systemPackages... or if I need some sophisticated nix
> expression.
> _______________________________________________
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to