summary refs log tree commit diff
path: root/pkgs/development/tools/glslviewer/default.nix
blob: 7a28f86562f6b1f6155db012d831a05b5b5e260b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ stdenv, fetchFromGitHub, glfw, pkgconfig, libXrandr, libXdamage
, libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi
, libX11, libGLU, Cocoa
}:

stdenv.mkDerivation rec {
  name = "glslviewer-${version}";
  version = "1.2";

  src = fetchFromGitHub {
    owner = "patriciogonzalezvivo";
    repo = "glslViewer";
    rev = version;
    sha256 = "05ya821l2pd58anyx21mgmlm2bv78rz8cnbvqw4d9pfhq40z9psw";
  };

  # Makefile has /usr/local/bin hard-coded for 'make install'
  preConfigure = ''
    substituteInPlace Makefile \
        --replace '/usr/local' "$out" \
        --replace '/usr/bin/clang++' 'clang++'
  '';

  preInstall = ''
    mkdir -p $out/bin
  '';

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [
    glfw libGLU glfw libXrandr libXdamage
    libXext libXrender libXinerama libXcursor libXxf86vm
    libXi libX11
  ] ++ stdenv.lib.optional stdenv.isDarwin Cocoa;

  meta = with stdenv.lib; {
    description = "Live GLSL coding renderer";
    homepage = http://patriciogonzalezvivo.com/2015/glslViewer/;
    license = licenses.bsd3;
    platforms = platforms.linux ++ platforms.darwin;
    maintainers = [ maintainers.hodapp ];
  };
}